1 |
C $Header: /u/gcmpack/MITgcm_contrib/eh3/regrid/regrid/regrid_readparms.F,v 1.2 2006/08/10 21:50:00 edhill Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "REGRID_OPTIONS.h" |
5 |
|
6 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
7 |
CBOP 0 |
8 |
C !ROUTINE: REGRID_READPARMS |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE REGRID_READPARMS( myThid ) |
12 |
|
13 |
C !DESCRIPTION: |
14 |
C Initialize REGRID variables and constants. |
15 |
|
16 |
C !USES: |
17 |
IMPLICIT NONE |
18 |
#include "SIZE.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "PARAMS.h" |
21 |
#include "GRID.h" |
22 |
#include "REGRID_SIZE.h" |
23 |
#include "REGRID.h" |
24 |
|
25 |
C !INPUT PARAMETERS: |
26 |
INTEGER myThid |
27 |
CEOP |
28 |
|
29 |
#ifdef ALLOW_REGRID |
30 |
|
31 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
32 |
CHARACTER*(MAX_LEN_FNAM) blank |
33 |
INTEGER iUnit, i |
34 |
|
35 |
NAMELIST /REGRID_PARM01/ |
36 |
& regrid_MNC, regrid_MDSIO, |
37 |
& regrid_ngrids, regrid_fbname_in, |
38 |
& regrid_nout |
39 |
|
40 |
_BEGIN_MASTER(myThid) |
41 |
|
42 |
DO i = 1,MAX_LEN_FNAM |
43 |
blank(i:i) = ' ' |
44 |
ENDDO |
45 |
|
46 |
C Default values for REGRID |
47 |
REGRID_MNC = useMNC |
48 |
REGRID_MDSIO = .FALSE. |
49 |
regrid_ngrids = 0 |
50 |
DO i = 1,REGRID_NGRID_MAX |
51 |
REGRID_fbname_in(i)(1:MAX_LEN_FNAM) = blank(1:MAX_LEN_FNAM) |
52 |
REGRID_fbname_out(i)(1:MAX_LEN_FNAM) = blank(1:MAX_LEN_FNAM) |
53 |
regrid_nout(i) = 0 |
54 |
ENDDO |
55 |
|
56 |
WRITE(msgBuf,'(A)') 'REGRID_READPARMS: opening data.regrid' |
57 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
58 |
& SQUEEZE_RIGHT , 1) |
59 |
CALL OPEN_COPY_DATA_FILE( |
60 |
I 'data.regrid', 'REGRID_READPARMS', |
61 |
O iUnit, |
62 |
I myThid ) |
63 |
|
64 |
C Read parameters from open data file |
65 |
READ(UNIT=iUnit,NML=REGRID_PARM01) |
66 |
WRITE(msgBuf,'(A)') |
67 |
& 'REGRID_READPARMS: finished reading data.regrid' |
68 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
69 |
& SQUEEZE_RIGHT , 1) |
70 |
C Close the open data file |
71 |
CLOSE(iUnit) |
72 |
|
73 |
C Make sure that we locally honor the global MNC on/off flag |
74 |
REGRID_MNC = REGRID_MNC .AND. useMNC |
75 |
#ifndef ALLOW_MNC |
76 |
C Fix to avoid running without getting any output: |
77 |
REGRID_MNC = .FALSE. |
78 |
#endif |
79 |
REGRID_MDSIO = (.NOT. REGRID_MNC) .OR. outputTypesInclusive |
80 |
|
81 |
_END_MASTER(myThid) |
82 |
|
83 |
C-- Everyone else must wait for the parameters to be loaded |
84 |
_BARRIER |
85 |
|
86 |
#endif /* ALLOW_REGRID */ |
87 |
|
88 |
RETURN |
89 |
END |