1 |
|
C |
2 |
C $Header$ |
C $Header$ |
3 |
|
C $Name$ |
4 |
|
|
5 |
|
#include "AD_CONFIG.h" |
6 |
#include "CTRL_CPPOPTIONS.h" |
#include "CTRL_CPPOPTIONS.h" |
7 |
|
|
8 |
|
|
34 |
#ifdef ALLOW_OBCS_CONTROL |
#ifdef ALLOW_OBCS_CONTROL |
35 |
# include "OBCS.h" |
# include "OBCS.h" |
36 |
#endif |
#endif |
|
#ifdef ALLOW_ECCO_OPTIMIZATION |
|
|
# include "optim.h" |
|
|
#endif |
|
37 |
|
|
38 |
c == routine arguments == |
c == routine arguments == |
39 |
|
|
45 |
integer i,j,k |
integer i,j,k |
46 |
integer ntmp |
integer ntmp |
47 |
integer ivarindex |
integer ivarindex |
48 |
|
integer iUnit |
49 |
integer iobcs |
integer iobcs |
50 |
integer il |
integer il |
51 |
integer errio |
integer errio |
84 |
& xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, |
& xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, |
85 |
& xx_aqh_file, |
& xx_aqh_file, |
86 |
& xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod, |
& 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, |
& xx_uwind_file, |
94 |
& xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, |
& xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, |
95 |
& xx_vwind_file, |
& xx_vwind_file, |
110 |
& xx_hfacc_file, |
& xx_hfacc_file, |
111 |
& xx_efluxy_file, |
& xx_efluxy_file, |
112 |
& xx_efluxp_file, |
& xx_efluxp_file, |
113 |
& xx_bottomdrag_file |
& xx_bottomdrag_file, |
114 |
|
& xx_edtaux_file, |
115 |
|
& xx_edtauy_file, |
116 |
|
& xx_uvel_file, |
117 |
|
& xx_vvel_file, |
118 |
|
& xx_etan_file, |
119 |
|
& doInitXX, |
120 |
|
& doPackDiag, |
121 |
|
& doZscaleUnpack, |
122 |
|
& doZscalePack |
123 |
|
|
124 |
|
|
125 |
namelist /ctrl_packnames/ |
namelist /ctrl_packnames/ |
126 |
& yadmark, yctrlid, |
& yadmark, yctrlid, yctrlposunpack, yctrlpospack, |
127 |
& ctrlname, costname, scalname, maskname, metaname |
& ctrlname, costname, scalname, maskname, metaname |
128 |
|
|
129 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
130 |
|
|
131 |
c-- Set default values. |
c-- Set default values. |
132 |
xx_theta_file = ' ' |
doInitXX = .TRUE. |
133 |
xx_salt_file = ' ' |
#ifdef ALLOW_ADMTLM |
134 |
|
doAdmTlm = .TRUE. |
135 |
|
#else |
136 |
|
doAdmTlm = .FALSE. |
137 |
|
#endif |
138 |
|
doPackDiag = .FALSE. |
139 |
|
doZscaleUnpack = .FALSE. |
140 |
|
doZscalePack = .FALSE. |
141 |
|
|
142 |
|
xx_theta_file = 'xx_theta' |
143 |
|
xx_salt_file = 'xx_salt' |
144 |
xx_hfluxstartdate1 = 0 |
xx_hfluxstartdate1 = 0 |
145 |
xx_hfluxstartdate2 = 0 |
xx_hfluxstartdate2 = 0 |
146 |
xx_hfluxperiod = 0. _d 0 |
xx_hfluxperiod = 0. _d 0 |
147 |
xx_hflux_file = ' ' |
xx_hflux_file = 'xx_hfl' |
148 |
xx_sfluxstartdate1 = 0 |
xx_sfluxstartdate1 = 0 |
149 |
xx_sfluxstartdate2 = 0 |
xx_sfluxstartdate2 = 0 |
150 |
xx_sfluxperiod = 0. _d 0 |
xx_sfluxperiod = 0. _d 0 |
151 |
xx_sflux_file = ' ' |
xx_sflux_file = 'xx_sfl' |
152 |
xx_tauustartdate1 = 0 |
xx_tauustartdate1 = 0 |
153 |
xx_tauustartdate2 = 0 |
xx_tauustartdate2 = 0 |
154 |
xx_tauuperiod = 0. _d 0 |
xx_tauuperiod = 0. _d 0 |
155 |
xx_tauu_file = ' ' |
xx_tauu_file = 'xx_tauu' |
156 |
xx_tauvstartdate1 = 0 |
xx_tauvstartdate1 = 0 |
157 |
xx_tauvstartdate2 = 0 |
xx_tauvstartdate2 = 0 |
158 |
xx_tauvperiod = 0. _d 0 |
xx_tauvperiod = 0. _d 0 |
159 |
xx_tauv_file = ' ' |
xx_tauv_file = 'xx_tauv' |
160 |
xx_atempstartdate1 = 0 |
xx_atempstartdate1 = 0 |
161 |
xx_atempstartdate2 = 0 |
xx_atempstartdate2 = 0 |
162 |
xx_atempperiod = 0. _d 0 |
xx_atempperiod = 0. _d 0 |
163 |
xx_atemp_file = ' ' |
xx_atemp_file = 'xx_atemp' |
164 |
xx_aqhstartdate1 = 0 |
xx_aqhstartdate1 = 0 |
165 |
xx_aqhstartdate2 = 0 |
xx_aqhstartdate2 = 0 |
166 |
xx_aqhperiod = 0. _d 0 |
xx_aqhperiod = 0. _d 0 |
167 |
xx_aqh_file = ' ' |
xx_aqh_file = 'xx_aqh' |
168 |
|
xx_precipstartdate1 = 0 |
169 |
|
xx_precipstartdate2 = 0 |
170 |
|
xx_precipperiod = 0. _d 0 |
171 |
|
xx_precip_file = 'xx_precip' |
172 |
|
xx_swfluxstartdate1 = 0 |
173 |
|
xx_swfluxstartdate2 = 0 |
174 |
|
xx_swfluxperiod = 0. _d 0 |
175 |
|
xx_swflux_file = 'xx_swflux' |
176 |
|
xx_swdownstartdate1 = 0 |
177 |
|
xx_swdownstartdate2 = 0 |
178 |
|
xx_swdownperiod = 0. _d 0 |
179 |
|
xx_swdown_file = 'xx_swdown' |
180 |
xx_uwindstartdate1 = 0 |
xx_uwindstartdate1 = 0 |
181 |
xx_uwindstartdate2 = 0 |
xx_uwindstartdate2 = 0 |
182 |
xx_uwindperiod = 0. _d 0 |
xx_uwindperiod = 0. _d 0 |
183 |
xx_uwind_file = ' ' |
xx_uwind_file = 'xx_uwind' |
184 |
xx_vwindstartdate1 = 0 |
xx_vwindstartdate1 = 0 |
185 |
xx_vwindstartdate2 = 0 |
xx_vwindstartdate2 = 0 |
186 |
xx_vwindperiod = 0. _d 0 |
xx_vwindperiod = 0. _d 0 |
187 |
xx_vwind_file = ' ' |
xx_vwind_file = 'xx_vwind' |
188 |
xx_obcsnstartdate1 = 0 |
xx_obcsnstartdate1 = 0 |
189 |
xx_obcsnstartdate2 = 0 |
xx_obcsnstartdate2 = 0 |
190 |
xx_obcsnperiod = 0. _d 0 |
xx_obcsnperiod = 0. _d 0 |
191 |
xx_obcsn_file = ' ' |
xx_obcsn_file = 'xx_obcsn' |
192 |
xx_obcssstartdate1 = 0 |
xx_obcssstartdate1 = 0 |
193 |
xx_obcssstartdate2 = 0 |
xx_obcssstartdate2 = 0 |
194 |
xx_obcssperiod = 0. _d 0 |
xx_obcssperiod = 0. _d 0 |
195 |
xx_obcss_file = ' ' |
xx_obcss_file = 'xx_obcss' |
196 |
xx_obcswstartdate1 = 0 |
xx_obcswstartdate1 = 0 |
197 |
xx_obcswstartdate2 = 0 |
xx_obcswstartdate2 = 0 |
198 |
xx_obcswperiod = 0. _d 0 |
xx_obcswperiod = 0. _d 0 |
199 |
xx_obcsw_file = ' ' |
xx_obcsw_file = 'xx_obcsw' |
200 |
xx_obcsestartdate1 = 0 |
xx_obcsestartdate1 = 0 |
201 |
xx_obcsestartdate2 = 0 |
xx_obcsestartdate2 = 0 |
202 |
xx_obcseperiod = 0. _d 0 |
xx_obcseperiod = 0. _d 0 |
203 |
xx_obcse_file = ' ' |
xx_obcse_file = 'xx_obcse' |
204 |
xx_diffkr_file = ' ' |
xx_diffkr_file = 'xx_diffkr' |
205 |
xx_kapgm_file = ' ' |
xx_kapgm_file = 'xx_kapgm' |
206 |
xx_tr1_file = ' ' |
xx_tr1_file = 'xx_ptr' |
207 |
xx_sst_file = ' ' |
xx_sst_file = 'xx_sst' |
208 |
xx_sss_file = ' ' |
xx_sss_file = 'xx_sss' |
209 |
xx_hfacc_file = ' ' |
xx_hfacc_file = 'xx_hfacc' |
210 |
xx_efluxy_file = ' ' |
xx_efluxy_file = 'xx_efluxy' |
211 |
xx_efluxp_file = ' ' |
xx_efluxp_file = 'xx_efluxp' |
212 |
xx_bottomdrag_file = ' ' |
xx_bottomdrag_file = 'xx_bottomdrag' |
213 |
|
xx_edtaux_file = 'xx_edtaux' |
214 |
|
xx_edtauy_file = 'xx_edtauy' |
215 |
|
xx_uvel_file = 'xx_uvel' |
216 |
|
xx_vvel_file = 'xx_vvel' |
217 |
|
xx_etan_file = 'xx_etan' |
218 |
|
|
219 |
#ifndef ALLOW_TANGENTLINEAR_RUN |
#ifdef ALLOW_TANGENTLINEAR_RUN |
220 |
yadmark = 'ad' |
yadprefix = 'g_' |
|
#else |
|
221 |
yadmark = 'g_' |
yadmark = 'g_' |
222 |
|
#else |
223 |
|
yadprefix = 'ad' |
224 |
|
yadmark = 'ad' |
225 |
#endif |
#endif |
226 |
yctrlid = 'MIT_CE_000' |
yctrlid = 'MIT_CE_000' |
227 |
|
yctrlposunpack = '.opt' |
228 |
|
yctrlpospack = '.opt' |
229 |
ctrlname = ' ' |
ctrlname = ' ' |
230 |
costname = ' ' |
costname = ' ' |
231 |
scalname = ' ' |
scalname = ' ' |
232 |
maskname = ' ' |
maskname = ' ' |
233 |
metaname = ' ' |
metaname = ' ' |
234 |
|
|
235 |
c-- Check versions. |
c-- Next, read the cost data file. |
236 |
|
WRITE(msgBuf,'(A)') 'CTRL_READPARMS: opening data.ctrl' |
237 |
open(unit=scrunit1,status='scratch') |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
238 |
|
& SQUEEZE_RIGHT , 1) |
239 |
|
|
240 |
|
CALL OPEN_COPY_DATA_FILE( |
241 |
|
I 'data.ctrl', 'CTRL_READPARMS', |
242 |
|
O iUnit, |
243 |
|
I myThid ) |
244 |
|
|
245 |
|
READ(unit = iUnit, nml = ctrl_nml) |
246 |
|
READ(unit = iUnit, nml = ctrl_packnames) |
247 |
|
|
248 |
|
WRITE(msgBuf,'(A)') |
249 |
|
& 'CTRL_READPARMS: finished reading data.ctrl' |
250 |
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
251 |
|
& SQUEEZE_RIGHT , 1) |
252 |
|
|
253 |
c-- Next, read the ecco data file. |
CLOSE( iUnit ) |
|
open(unit = modeldataunit,file = 'data.ctrl', |
|
|
& status = 'old', iostat = errio) |
|
|
if ( errio .lt. 0 ) then |
|
|
stop ' stopped in ctrl_readparms' |
|
|
endif |
|
|
|
|
|
do while ( .true. ) |
|
|
read(modeldataunit, fmt='(a)', end=1001) record |
|
|
il = max(ilnblnk(record),1) |
|
|
if ( record(1:1) .ne. commentcharacter ) |
|
|
& write(unit=scrunit1, fmt='(a)') record(:il) |
|
|
enddo |
|
|
1001 continue |
|
|
close( modeldataunit ) |
|
|
|
|
|
rewind( scrunit1 ) |
|
|
read(unit = scrunit1, nml = ctrl_nml) |
|
|
read(unit = scrunit1, nml = ctrl_packnames) |
|
|
close( scrunit1 ) |
|
254 |
|
|
255 |
_END_MASTER( myThid ) |
_END_MASTER( myThid ) |
256 |
|
|