1 |
C |
2 |
C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_readparms.F,v 1.20 2005/12/19 23:29:25 heimbach Exp $ |
3 |
C $Name: $ |
4 |
|
5 |
#include "AD_CONFIG.h" |
6 |
#include "CTRL_CPPOPTIONS.h" |
7 |
|
8 |
|
9 |
subroutine ctrl_readparms( mythid ) |
10 |
|
11 |
c ================================================================== |
12 |
c SUBROUTINE ctrl_readparms |
13 |
c ================================================================== |
14 |
c |
15 |
c o read ctrl parameters |
16 |
c split from ctrl_init |
17 |
c |
18 |
c started: heimbach@mit.edu 12-Jun-2003 |
19 |
c |
20 |
c ================================================================== |
21 |
c SUBROUTINE ctrl_readparms |
22 |
c ================================================================== |
23 |
|
24 |
implicit none |
25 |
|
26 |
c == global variables == |
27 |
|
28 |
#include "EEPARAMS.h" |
29 |
#include "SIZE.h" |
30 |
#include "PARAMS.h" |
31 |
#include "GRID.h" |
32 |
#include "ctrl.h" |
33 |
|
34 |
#ifdef ALLOW_OBCS_CONTROL |
35 |
# include "OBCS.h" |
36 |
#endif |
37 |
|
38 |
c == routine arguments == |
39 |
|
40 |
integer mythid |
41 |
|
42 |
c == local variables == |
43 |
|
44 |
integer bi,bj |
45 |
integer i,j,k |
46 |
integer ntmp |
47 |
integer ivarindex |
48 |
integer iUnit |
49 |
integer iobcs |
50 |
integer il |
51 |
integer errio |
52 |
integer startrec |
53 |
integer endrec |
54 |
integer difftime(4) |
55 |
_RL diffsecs |
56 |
_RL dummy |
57 |
|
58 |
character*(80) ymaskobcs |
59 |
character*(max_len_prec) record |
60 |
character*(max_len_mbuf) msgbuf |
61 |
|
62 |
integer nwetc3d |
63 |
|
64 |
c == external == |
65 |
|
66 |
integer ilnblnk |
67 |
external ilnblnk |
68 |
|
69 |
c == end of interface == |
70 |
|
71 |
c-- Read the namelist input. |
72 |
namelist /ctrl_nml/ |
73 |
& xx_theta_file, |
74 |
& xx_salt_file, |
75 |
& xx_hflux_file, |
76 |
& xx_hfluxstartdate1, xx_hfluxstartdate2, xx_hfluxperiod, |
77 |
& xx_sflux_file, |
78 |
& xx_sfluxstartdate1, xx_sfluxstartdate2, xx_sfluxperiod, |
79 |
& xx_tauu_file, |
80 |
& xx_tauustartdate1, xx_tauustartdate2, xx_tauuperiod, |
81 |
& xx_tauv_file, |
82 |
& xx_tauvstartdate1, xx_tauvstartdate2, xx_tauvperiod, |
83 |
& xx_atemp_file, |
84 |
& xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, |
85 |
& xx_aqh_file, |
86 |
& xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod, |
87 |
& xx_precip_file, |
88 |
& xx_precipstartdate1, xx_precipstartdate2, xx_precipperiod, |
89 |
& xx_swflux_file, |
90 |
& xx_swfluxstartdate1, xx_swfluxstartdate2, xx_swfluxperiod, |
91 |
& xx_swdown_file, |
92 |
& xx_swdownstartdate1, xx_swdownstartdate2, xx_swdownperiod, |
93 |
& xx_uwind_file, |
94 |
& xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, |
95 |
& xx_vwind_file, |
96 |
& xx_vwindstartdate1, xx_vwindstartdate2, xx_vwindperiod, |
97 |
& xx_obcsn_file, |
98 |
& xx_obcsnstartdate1, xx_obcsnstartdate2, xx_obcsnperiod, |
99 |
& xx_obcss_file, |
100 |
& xx_obcssstartdate1, xx_obcssstartdate2, xx_obcssperiod, |
101 |
& xx_obcsw_file, |
102 |
& xx_obcswstartdate1, xx_obcswstartdate2, xx_obcswperiod, |
103 |
& xx_obcse_file, |
104 |
& xx_obcsestartdate1, xx_obcsestartdate2, xx_obcseperiod, |
105 |
& xx_diffkr_file, |
106 |
& xx_kapgm_file, |
107 |
& xx_tr1_file, |
108 |
& xx_sst_file, |
109 |
& xx_sststartdate1, xx_sststartdate2, xx_sstperiod, |
110 |
& xx_sss_file, |
111 |
& xx_sssstartdate1, xx_sssstartdate2, xx_sssperiod, |
112 |
& xx_hfacc_file, |
113 |
& xx_efluxy_file, |
114 |
& xx_efluxp_file, |
115 |
& xx_bottomdrag_file, |
116 |
& xx_edtaux_file, |
117 |
& xx_edtauy_file, |
118 |
& xx_uvel_file, |
119 |
& xx_vvel_file, |
120 |
& xx_etan_file, |
121 |
& doInitXX, |
122 |
& doPackDiag, |
123 |
& doZscaleUnpack, |
124 |
& doZscalePack, |
125 |
& doMainUnpack, |
126 |
& doMainPack, |
127 |
& doAdmtlmBypassAD |
128 |
|
129 |
namelist /ctrl_packnames/ |
130 |
& yadmark, yctrlid, yctrlposunpack, yctrlpospack, |
131 |
& ctrlname, costname, scalname, maskname, metaname |
132 |
|
133 |
_BEGIN_MASTER( myThid ) |
134 |
|
135 |
c-- Set default values. |
136 |
doInitXX = .TRUE. |
137 |
#ifdef ALLOW_ADMTLM |
138 |
doAdmTlm = .TRUE. |
139 |
#else |
140 |
doAdmTlm = .FALSE. |
141 |
#endif |
142 |
doPackDiag = .FALSE. |
143 |
doZscaleUnpack = .FALSE. |
144 |
doZscalePack = .FALSE. |
145 |
doMainUnpack = .TRUE. |
146 |
doMainPack = .TRUE. |
147 |
doAdmtlmBypassAD = .FALSE. |
148 |
|
149 |
xx_theta_file = 'xx_theta' |
150 |
xx_salt_file = 'xx_salt' |
151 |
xx_hfluxstartdate1 = 0 |
152 |
xx_hfluxstartdate2 = 0 |
153 |
xx_hfluxperiod = 0. _d 0 |
154 |
xx_hflux_file = 'xx_hfl' |
155 |
xx_sfluxstartdate1 = 0 |
156 |
xx_sfluxstartdate2 = 0 |
157 |
xx_sfluxperiod = 0. _d 0 |
158 |
xx_sflux_file = 'xx_sfl' |
159 |
xx_tauustartdate1 = 0 |
160 |
xx_tauustartdate2 = 0 |
161 |
xx_tauuperiod = 0. _d 0 |
162 |
xx_tauu_file = 'xx_tauu' |
163 |
xx_tauvstartdate1 = 0 |
164 |
xx_tauvstartdate2 = 0 |
165 |
xx_tauvperiod = 0. _d 0 |
166 |
xx_tauv_file = 'xx_tauv' |
167 |
xx_atempstartdate1 = 0 |
168 |
xx_atempstartdate2 = 0 |
169 |
xx_atempperiod = 0. _d 0 |
170 |
xx_atemp_file = 'xx_atemp' |
171 |
xx_aqhstartdate1 = 0 |
172 |
xx_aqhstartdate2 = 0 |
173 |
xx_aqhperiod = 0. _d 0 |
174 |
xx_aqh_file = 'xx_aqh' |
175 |
xx_precipstartdate1 = 0 |
176 |
xx_precipstartdate2 = 0 |
177 |
xx_precipperiod = 0. _d 0 |
178 |
xx_precip_file = 'xx_precip' |
179 |
xx_swfluxstartdate1 = 0 |
180 |
xx_swfluxstartdate2 = 0 |
181 |
xx_swfluxperiod = 0. _d 0 |
182 |
xx_swflux_file = 'xx_swflux' |
183 |
xx_swdownstartdate1 = 0 |
184 |
xx_swdownstartdate2 = 0 |
185 |
xx_swdownperiod = 0. _d 0 |
186 |
xx_swdown_file = 'xx_swdown' |
187 |
xx_uwindstartdate1 = 0 |
188 |
xx_uwindstartdate2 = 0 |
189 |
xx_uwindperiod = 0. _d 0 |
190 |
xx_uwind_file = 'xx_uwind' |
191 |
xx_vwindstartdate1 = 0 |
192 |
xx_vwindstartdate2 = 0 |
193 |
xx_vwindperiod = 0. _d 0 |
194 |
xx_vwind_file = 'xx_vwind' |
195 |
xx_obcsnstartdate1 = 0 |
196 |
xx_obcsnstartdate2 = 0 |
197 |
xx_obcsnperiod = 0. _d 0 |
198 |
xx_obcsn_file = 'xx_obcsn' |
199 |
xx_obcssstartdate1 = 0 |
200 |
xx_obcssstartdate2 = 0 |
201 |
xx_obcssperiod = 0. _d 0 |
202 |
xx_obcss_file = 'xx_obcss' |
203 |
xx_obcswstartdate1 = 0 |
204 |
xx_obcswstartdate2 = 0 |
205 |
xx_obcswperiod = 0. _d 0 |
206 |
xx_obcsw_file = 'xx_obcsw' |
207 |
xx_obcsestartdate1 = 0 |
208 |
xx_obcsestartdate2 = 0 |
209 |
xx_obcseperiod = 0. _d 0 |
210 |
xx_obcse_file = 'xx_obcse' |
211 |
xx_diffkr_file = 'xx_diffkr' |
212 |
xx_kapgm_file = 'xx_kapgm' |
213 |
xx_tr1_file = 'xx_ptr' |
214 |
xx_sststartdate1 = 0 |
215 |
xx_sststartdate2 = 0 |
216 |
xx_sstperiod = 0. _d 0 |
217 |
xx_sst_file = 'xx_sst' |
218 |
xx_sssstartdate1 = 0 |
219 |
xx_sssstartdate2 = 0 |
220 |
xx_sssperiod = 0. _d 0 |
221 |
xx_sss_file = 'xx_sss' |
222 |
xx_hfacc_file = 'xx_hfacc' |
223 |
xx_efluxy_file = 'xx_efluxy' |
224 |
xx_efluxp_file = 'xx_efluxp' |
225 |
xx_bottomdrag_file = 'xx_bottomdrag' |
226 |
xx_edtaux_file = 'xx_edtaux' |
227 |
xx_edtauy_file = 'xx_edtauy' |
228 |
xx_uvel_file = 'xx_uvel' |
229 |
xx_vvel_file = 'xx_vvel' |
230 |
xx_etan_file = 'xx_etan' |
231 |
|
232 |
#ifdef ALLOW_TANGENTLINEAR_RUN |
233 |
yadprefix = 'g_' |
234 |
yadmark = 'g_' |
235 |
#else |
236 |
yadprefix = 'ad' |
237 |
yadmark = 'ad' |
238 |
#endif |
239 |
yctrlid = 'MIT_CE_000' |
240 |
yctrlposunpack = '.opt' |
241 |
yctrlpospack = '.opt' |
242 |
ctrlname = ' ' |
243 |
costname = ' ' |
244 |
scalname = ' ' |
245 |
maskname = ' ' |
246 |
metaname = ' ' |
247 |
|
248 |
c-- Next, read the cost data file. |
249 |
WRITE(msgBuf,'(A)') 'CTRL_READPARMS: opening data.ctrl' |
250 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
251 |
& SQUEEZE_RIGHT , 1) |
252 |
|
253 |
CALL OPEN_COPY_DATA_FILE( |
254 |
I 'data.ctrl', 'CTRL_READPARMS', |
255 |
O iUnit, |
256 |
I myThid ) |
257 |
|
258 |
READ(unit = iUnit, nml = ctrl_nml) |
259 |
READ(unit = iUnit, nml = ctrl_packnames) |
260 |
|
261 |
WRITE(msgBuf,'(A)') |
262 |
& 'CTRL_READPARMS: finished reading data.ctrl' |
263 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
264 |
& SQUEEZE_RIGHT , 1) |
265 |
|
266 |
CLOSE( iUnit ) |
267 |
|
268 |
_END_MASTER( myThid ) |
269 |
|
270 |
_BARRIER |
271 |
|
272 |
return |
273 |
end |
274 |
|