1 |
C $Header: /u/gcmpack/MITgcm/pkg/offline/offline_readparms.F,v 1.7 2010/03/30 14:56:30 dfer Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "OFFLINE_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE OFFLINE_READPARMS( myThid ) |
7 |
C *==========================================================* |
8 |
C | SUBROUTINE OFFLINE_READPARMS |
9 |
C | o Routine to initialize OFFLINE variables and constants. |
10 |
C *==========================================================* |
11 |
C | Initialize OFFLINE parameters, read in data.off |
12 |
C *==========================================================* |
13 |
IMPLICIT NONE |
14 |
|
15 |
C === Global variables === |
16 |
#include "SIZE.h" |
17 |
#include "EEPARAMS.h" |
18 |
#include "PARAMS.h" |
19 |
c#include "GRID.h" |
20 |
#ifdef ALLOW_OFFLINE |
21 |
#include "OFFLINE.h" |
22 |
#endif |
23 |
|
24 |
C === Routine arguments === |
25 |
INTEGER myThid |
26 |
|
27 |
#ifdef ALLOW_OFFLINE |
28 |
C-- Bulk Formula parameter |
29 |
NAMELIST /OFFLINE_PARM01/ |
30 |
& UvelFile, VvelFile, WvelFile, ThetFile, |
31 |
& SaltFile, ConvFile, GMwxFile, GMwyFile, |
32 |
& GMwzFile, HfluxFile, SfluxFile, |
33 |
& KPP_DiffSFile, KPP_ghatKFile, ICEFile, |
34 |
& KPP_ghatFile |
35 |
|
36 |
NAMELIST /OFFLINE_PARM02/ |
37 |
& offlineIter0, offlineOffsetIter, |
38 |
& deltaToffline, offlineForcingPeriod, |
39 |
& offlineForcingCycle, offlineLoadPrec |
40 |
|
41 |
C === Local variables === |
42 |
C msgBuf :: Informational/error message buffer |
43 |
C iUnit :: Work variable for IO unit number |
44 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
45 |
INTEGER iUnit |
46 |
C Retired main data.offline file parameters |
47 |
CHARACTER*(MAX_LEN_FNAM) KPP_ghatFile |
48 |
|
49 |
_BEGIN_MASTER(myThid) |
50 |
|
51 |
WRITE(msgBuf,'(A)') ' OFFLINE_READPARMS: opening data.off' |
52 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
53 |
& SQUEEZE_RIGHT, myThid ) |
54 |
|
55 |
|
56 |
CALL OPEN_COPY_DATA_FILE( |
57 |
I 'data.off', 'OFFLINE_READPARMS', |
58 |
O iUnit, |
59 |
I myThid ) |
60 |
|
61 |
C-- Default values for params in OFFLINE_PARM01 : |
62 |
UvelFile=' ' |
63 |
VvelFile=' ' |
64 |
WvelFile=' ' |
65 |
ThetFile=' ' |
66 |
SaltFile=' ' |
67 |
ConvFile=' ' |
68 |
GMwxFile=' ' |
69 |
GMwyFile=' ' |
70 |
GMwzFile=' ' |
71 |
HFluxFile=' ' |
72 |
SFluxFile=' ' |
73 |
KPP_DiffSFile=' ' |
74 |
KPP_ghatKFile=' ' |
75 |
KPP_ghatFile='KPP_ghatFile has been replaced by KPP_ghatKFile' |
76 |
ICEFile=' ' |
77 |
|
78 |
C-- Read parameters from open data file |
79 |
READ(UNIT=iUnit,NML=OFFLINE_PARM01) |
80 |
|
81 |
IF ( KPP_ghatFile .NE. |
82 |
& 'KPP_ghatFile has been replaced by KPP_ghatKFile' ) THEN |
83 |
c nRetired = nRetired+1 |
84 |
WRITE(msgBuf,'(A,A)') 'S/R OFFLINE_READPARMS: "KPP_ghatFile"', |
85 |
& ' is no longer allowed in file "data.off"' |
86 |
CALL PRINT_ERROR( msgBuf, myThid ) |
87 |
WRITE(msgBuf,'(A,A)') 'S/R OFFLINE_READPARMS: read instead ', |
88 |
& 'the product ghat*diffKz from file "KPP_ghatKFile"' |
89 |
CALL PRINT_ERROR( msgBuf, myThid ) |
90 |
STOP 'ABNORMAL END: S/R OFFLINE_READPARMS' |
91 |
ENDIF |
92 |
|
93 |
C-- Default values for params in OFFLINE_PARM02 : |
94 |
deltaToffline=deltaTclock |
95 |
offlineIter0=nIter0 !initial offline field timestep |
96 |
offlineOffsetIter=0 !offset |
97 |
offlineForcingPeriod=2592000. |
98 |
offlineForcingCycle=31104000. |
99 |
offlineLoadPrec=readBinaryPrec |
100 |
|
101 |
C-- Read parameters from open data file |
102 |
READ(UNIT=iUnit,NML=OFFLINE_PARM02) |
103 |
|
104 |
WRITE(msgBuf,'(A)') |
105 |
& ' OFFLINE_READPARMS: finished reading data.off' |
106 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
107 |
& SQUEEZE_RIGHT, myThid ) |
108 |
|
109 |
C-- Close the open data file |
110 |
CLOSE(iUnit) |
111 |
_END_MASTER(myThid) |
112 |
|
113 |
C-- Everyone else must wait for the parameters to be loaded |
114 |
_BARRIER |
115 |
|
116 |
#endif /* ALLOW_OFFLINE */ |
117 |
|
118 |
RETURN |
119 |
END |