1 |
C $Header$ |
C $Header$ |
2 |
|
|
3 |
#include "CPP_OPTIONS.h" |
#include "COST_CPPOPTIONS.h" |
4 |
|
|
5 |
|
subroutine ecco_readparms( mythid ) |
|
subroutine ecco_readparms( |
|
|
I mythid |
|
|
& ) |
|
6 |
|
|
7 |
c ================================================================== |
c ================================================================== |
8 |
c SUBROUTINE ecco_readparms |
c SUBROUTINE ecco_readparms |
9 |
c ================================================================== |
c ================================================================== |
10 |
c |
c |
11 |
c o Initialize the ECCO release of the MITgcmUV. |
c o This routine initialises the package cost. |
12 |
c |
c started: Ralf Giering 18-Jan-2001 |
|
c started: Christian Eckert eckert@mit.edu 29-Feb-1999 |
|
|
c |
|
|
c - Introduced to create a package for the MITgcmUV. |
|
|
c |
|
|
c changed: Christian Eckert eckert@mit.edu |
|
13 |
c |
c |
14 |
c ================================================================== |
c ================================================================== |
15 |
c SUBROUTINE ecco_readparms |
c SUBROUTINE ecco_readparms |
19 |
|
|
20 |
c == global variables == |
c == global variables == |
21 |
|
|
|
#include "SIZE.h" |
|
22 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
23 |
|
#include "SIZE.h" |
24 |
|
#include "GRID.h" |
25 |
#include "PARAMS.h" |
#include "PARAMS.h" |
26 |
#include "ecco.h" |
|
27 |
|
#include "ecco_cost.h" |
28 |
|
|
29 |
c == routine arguments == |
c == routine arguments == |
30 |
|
|
32 |
|
|
33 |
c == local variables == |
c == local variables == |
34 |
|
|
|
integer errio |
|
|
integer il |
|
|
|
|
|
character*(max_len_prec) record |
|
|
|
|
|
c == external == |
|
|
|
|
|
integer ilnblnk |
|
|
external ilnblnk |
|
|
|
|
35 |
c == end of interface == |
c == end of interface == |
36 |
|
|
37 |
c-- ECCO parameters. |
c-- Read the namelist input. |
38 |
namelist /ECCO_PARMS/ |
namelist /ecco_cost_nml/ |
39 |
& expId |
& data_errfile, |
40 |
|
& tbarfile, sbarfile, psbarfile, |
41 |
_BEGIN_MASTER( myThid ) |
& ubarfile, vbarfile, wbarfile, |
42 |
open( unit=scrunit1, status='scratch' ) |
& tauxbarfile, tauybarfile, |
43 |
|
& hfluxbarfile, sfluxbarfile, |
44 |
c-- Next, read the ECCO data file. |
& using_topex, |
45 |
open( unit = modeldataunit, |
& topexstartdate1, topexstartdate2, |
46 |
& file = 'data.ecco', |
& topexperiod, topexfile, topexmeanfile, |
47 |
& status = 'old', |
& using_ers, |
48 |
& iostat = errio) |
& ersstartdate1, ersstartdate2, |
49 |
|
& ersperiod, ersfile, |
50 |
if ( errio .lt. 0 ) then |
& scatstartdate1, scatstartdate2, |
51 |
stop ' stopped in ecco_readparms.' |
& scatperiod, scatxdatfile, scatydatfile, |
52 |
endif |
& scatx_errfile, scaty_errfile, |
53 |
|
& ssh_errfile, |
54 |
do while ( .true. ) |
& tmistartdate1, tmistartdate2, tmidatfile, |
55 |
read(modeldataunit, fmt='(a)', end=1001) record |
& sststartdate1, sststartdate2, sstdatfile, |
56 |
il = max(ilnblnk(record),1) |
& sssstartdate1, sssstartdate2, sssdatfile, |
57 |
if ( record(1:1) .ne. commentcharacter ) |
& tdatfile, sdatfile, |
58 |
& write(unit=scrunit1, fmt='(a)') record(:il) |
& ctdtfile, ctdsfile, |
59 |
enddo |
& ctdtclimfile, ctdsclimfile, |
60 |
1001 continue |
& xbtfile, |
61 |
close( modeldataunit ) |
& argotstartdate1, argotstartdate2, argotfile, |
62 |
|
& argosstartdate1, argosstartdate2, argosfile, |
63 |
rewind( scrunit1 ) |
& udriftfile, vdriftfile, |
64 |
read ( unit = scrunit1, nml = ecco_parms) |
& udrifterrfile, vdrifterrfile, |
65 |
close ( scrunit1 ) |
& curmtrufile,curmtrvfile, |
66 |
|
& salterrfile, temperrfile, velerrfile, |
67 |
c-------------------------------- ECCO -------------------------------- |
& hflux_errfile, sflux_errfile, |
68 |
|
& tauu_errfile, tauv_errfile, |
69 |
#ifdef INCLUDE_ECCO_PACKAGE |
& atemp_errfile, aqh_errfile, |
70 |
C-- Initialise the ECCO State Estimation package. |
& uwind_errfile, vwind_errfile, |
71 |
|
& geoid_errfile, geoid_covariancefile, |
72 |
#ifdef ALLOW_CALENDAR |
& mult_hflux, mult_sflux, mult_tauu, mult_tauv, |
73 |
C-- Initialise the calendar package. |
& mult_atemp, mult_aqh, mult_uwind, mult_vwind, |
74 |
#ifdef ALLOW_CAL_NENDITER |
& mult_hmean, mult_h, mult_temp, mult_salt, |
75 |
CALL cal_Init( |
& mult_tmi, mult_sst, mult_sss, |
76 |
I startTime, |
& mult_ctdt, mult_ctds, |
77 |
I endTime, |
& mult_ctdtclim, mult_ctdsclim, |
78 |
I deltaTclock, |
& mult_xbt, mult_drift, |
79 |
I nIter0, |
& mult_argot, mult_argos, |
80 |
I nEndIter, |
& mult_scatx, mult_scaty, |
81 |
I nTimeSteps, |
& mult_sdrift, mult_tdrift, mult_wdrift, |
82 |
I myThid |
& mult_temp0, mult_salt0, |
83 |
& ) |
& mult_obcsn, mult_obcss, |
84 |
#else |
& mult_obcsw, mult_obcse, mult_obcsvol, |
85 |
CALL cal_Init( |
& mult_curmtr, mult_ageos, |
86 |
I startTime, |
& mult_ice, |
87 |
I endTime, |
& mult_kapgm, mult_diffkr, |
88 |
I deltaTclock, |
& costIceStart1, costIceStart2, |
89 |
I nIter0, |
& costIceEnd1, costIceEnd2, |
90 |
I nTimeSteps, |
& cost_ice_flag, |
91 |
I myThid |
& cost_iprec, cost_yftype |
|
& ) |
|
|
#endif |
|
|
_BARRIER |
|
|
#endif |
|
|
|
|
|
C-- Custom routine to set forcing fields. |
|
|
#ifdef INCLUDE_EXTERNAL_FORCING_PACKAGE |
|
|
call exf_readparms ( mythid ) |
|
|
call exf_init( mythid ) |
|
|
#endif /* INCLUDE_EXTERNAL_FORCING_PACKAGE */ |
|
|
|
|
|
#ifdef ALLOW_ECCO_OPTIMIZATION |
|
|
c-- Initialise the optimization-related parts of the ECCO State |
|
|
c-- Estimation package. |
|
|
CALL optim_Init( myThid ) |
|
|
_BARRIER |
|
|
#else |
|
|
c-- Optimization not enabled. |
|
|
#endif |
|
|
|
|
|
#ifndef ALLOW_ECCO_FORWARD_RUN |
|
|
C-- Initialise the cost function. |
|
|
call cost_readparms( mythid ) |
|
|
call cost_init( myThid ) |
|
|
_BARRIER |
|
|
|
|
|
C-- Initialise the control vector. |
|
|
CALL ctrl_Init( myThid ) |
|
|
_BARRIER |
|
|
#else |
|
|
c not needed for forward run only |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifdef ALLOW_ECCO_GRADIENT_CHECK |
|
|
c-- Initialise the gradient check for the TAMC generated adjoint |
|
|
c-- model. |
|
|
CALL grdchk_Init( myThid ) |
|
|
_BARRIER |
|
|
#else |
|
|
c-- Gradient check not enabled. |
|
|
#endif |
|
92 |
|
|
93 |
|
_BEGIN_MASTER( myThid ) |
94 |
|
|
95 |
#ifdef ALLOW_ECCO_DIAGNOSTICS_RUN |
c-- Set default values. |
96 |
c-- Initialise the ECCO diagnostics package. |
data_errfile = ' ' |
97 |
CALL diagnos_Init( myThid ) |
tbarfile = 'tbar' |
98 |
_BARRIER |
sbarfile = 'sbar' |
99 |
#else |
psbarfile = 'psbar' |
100 |
c-- Diagnostics not enabled. |
ubarfile = 'ubar' |
101 |
|
vbarfile = 'vbar' |
102 |
|
wbarfile = 'wbar' |
103 |
|
tauxbarfile = 'tauxbar' |
104 |
|
tauybarfile = 'tauybar' |
105 |
|
hfluxbarfile = 'hfluxbar' |
106 |
|
sfluxbarfile = 'sfluxbar' |
107 |
|
using_topex = .false. |
108 |
|
topexstartdate1 = 0 |
109 |
|
topexstartdate2 = 0 |
110 |
|
topexperiod = 0. _d 0 |
111 |
|
topexfile = ' ' |
112 |
|
topexmeanfile = ' ' |
113 |
|
using_ers = .false. |
114 |
|
ersstartdate1 = 0 |
115 |
|
ersstartdate2 = 0 |
116 |
|
ersperiod = 0. _d 0 |
117 |
|
ersfile = ' ' |
118 |
|
scatstartdate1 = 0 |
119 |
|
scatstartdate2 = 0 |
120 |
|
scatperiod = 0. _d 0 |
121 |
|
scatxdatfile = ' ' |
122 |
|
scatydatfile = ' ' |
123 |
|
ssh_errfile = ' ' |
124 |
|
scatx_errfile = ' ' |
125 |
|
scaty_errfile = ' ' |
126 |
|
tmistartdate1 = 0 |
127 |
|
tmistartdate2 = 0 |
128 |
|
tmidatfile = ' ' |
129 |
|
sststartdate1 = 0 |
130 |
|
sststartdate2 = 0 |
131 |
|
sstdatfile = ' ' |
132 |
|
sssstartdate1 = 0 |
133 |
|
sssstartdate2 = 0 |
134 |
|
sssdatfile = ' ' |
135 |
|
tdatfile = ' ' |
136 |
|
sdatfile = ' ' |
137 |
|
ctdtfile = ' ' |
138 |
|
ctdsfile = ' ' |
139 |
|
ctdtclimfile = ' ' |
140 |
|
ctdsclimfile = ' ' |
141 |
|
curmtrufile = ' ' |
142 |
|
curmtrvfile = ' ' |
143 |
|
xbtfile = ' ' |
144 |
|
argotstartdate1 = 0 |
145 |
|
argotstartdate2 = 0 |
146 |
|
argotfile = ' ' |
147 |
|
argosstartdate1 = 0 |
148 |
|
argosstartdate2 = 0 |
149 |
|
argosfile = ' ' |
150 |
|
udriftfile = ' ' |
151 |
|
vdriftfile = ' ' |
152 |
|
udrifterrfile = ' ' |
153 |
|
vdrifterrfile = ' ' |
154 |
|
salterrfile = ' ' |
155 |
|
temperrfile = ' ' |
156 |
|
velerrfile = ' ' |
157 |
|
hflux_errfile = ' ' |
158 |
|
sflux_errfile = ' ' |
159 |
|
tauu_errfile = ' ' |
160 |
|
tauv_errfile = ' ' |
161 |
|
atemp_errfile = ' ' |
162 |
|
aqh_errfile = ' ' |
163 |
|
uwind_errfile = ' ' |
164 |
|
vwind_errfile = ' ' |
165 |
|
geoid_errfile = ' ' |
166 |
|
geoid_covariancefile = ' ' |
167 |
|
mult_hflux = 0. _d 0 |
168 |
|
mult_sflux = 0. _d 0 |
169 |
|
mult_tauu = 0. _d 0 |
170 |
|
mult_tauv = 0. _d 0 |
171 |
|
mult_atemp = 0. _d 0 |
172 |
|
mult_aqh = 0. _d 0 |
173 |
|
mult_uwind = 0. _d 0 |
174 |
|
mult_vwind = 0. _d 0 |
175 |
|
mult_hmean = 0. _d 0 |
176 |
|
mult_h = 0. _d 0 |
177 |
|
mult_temp = 0. _d 0 |
178 |
|
mult_salt = 0. _d 0 |
179 |
|
mult_temp0 = 0. _d 0 |
180 |
|
mult_salt0 = 0. _d 0 |
181 |
|
mult_tmi = 0. _d 0 |
182 |
|
mult_sst = 0. _d 0 |
183 |
|
mult_sss = 0. _d 0 |
184 |
|
mult_ctdt = 0. _d 0 |
185 |
|
mult_ctds = 0. _d 0 |
186 |
|
mult_ctdtclim = 0. _d 0 |
187 |
|
mult_ctdsclim = 0. _d 0 |
188 |
|
mult_xbt = 0. _d 0 |
189 |
|
mult_argot = 0. _d 0 |
190 |
|
mult_argos = 0. _d 0 |
191 |
|
mult_drift = 0. _d 0 |
192 |
|
mult_tdrift = 0. _d 0 |
193 |
|
mult_sdrift = 0. _d 0 |
194 |
|
mult_wdrift = 0. _d 0 |
195 |
|
mult_scatx = 0. _d 0 |
196 |
|
mult_scaty = 0. _d 0 |
197 |
|
mult_obcsn = 0. _d 0 |
198 |
|
mult_obcss = 0. _d 0 |
199 |
|
mult_obcsw = 0. _d 0 |
200 |
|
mult_obcse = 0. _d 0 |
201 |
|
mult_obcsvol = 0. _d 0 |
202 |
|
mult_ageos = 0. _d 0 |
203 |
|
mult_curmtr = 0. _d 0 |
204 |
|
mult_ice = 0. _d 0 |
205 |
|
mult_kapgm = 0. _d 0 |
206 |
|
mult_diffkr = 0. _d 0 |
207 |
|
costIceStart1 = 0 |
208 |
|
costIceStart2 = 0 |
209 |
|
costIceEnd1 = 0 |
210 |
|
costIceEnd2 = 0 |
211 |
|
cost_ice_flag = 1 |
212 |
|
|
213 |
|
c-- Check versions. |
214 |
|
|
215 |
|
c-- Next, read the cost data file. |
216 |
|
call nml_filter( 'data.ecco', scrunit1, myThid ) |
217 |
|
if (scrunit1 .eq. 0) then |
218 |
|
stop 'ecco_readparms: reading namelist failed' |
219 |
|
end if |
220 |
|
read( scrunit1, nml = ecco_cost_nml ) |
221 |
|
close( scrunit1 ) |
222 |
|
|
223 |
|
#ifdef ALLOW_CAL |
224 |
|
c-- Get the complete dates of the ... |
225 |
|
c-- ... SST data. |
226 |
|
call cal_FullDate( sststartdate1, sststartdate2, |
227 |
|
& sststartdate, mythid ) |
228 |
|
c-- ... TMI data. |
229 |
|
call cal_FullDate( tmistartdate1, tmistartdate2, |
230 |
|
& tmistartdate, mythid ) |
231 |
|
c-- ... SSS data. |
232 |
|
call cal_FullDate( sssstartdate1, sssstartdate2, |
233 |
|
& sssstartdate, mythid ) |
234 |
|
c-- ... T/P data. |
235 |
|
call cal_FullDate( topexstartdate1, topexstartdate2, |
236 |
|
& topexstartdate, mythid ) |
237 |
|
c-- ... ERS data. |
238 |
|
call cal_FullDate( ersstartdate1, ersstartdate2, |
239 |
|
& ersstartdate, mythid ) |
240 |
|
c-- ... SCAT data. |
241 |
|
call cal_FullDate( scatstartdate1, scatstartdate2, |
242 |
|
& scatxstartdate, mythid ) |
243 |
|
call cal_FullDate( scatstartdate1, scatstartdate2, |
244 |
|
& scatystartdate, mythid ) |
245 |
#endif |
#endif |
246 |
|
|
|
#endif /* INCLUDE_ECCO_PACKAGE */ |
|
|
|
|
|
c-------------------------------- ECCO -------------------------------- |
|
|
|
|
|
c-- Summarize the setup of the ECCO release. |
|
|
c call ecco_Summary( mythid ) |
|
247 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
248 |
|
|
|
c-- Everyone else must wait for the parameters to be loaded and |
|
|
c-- the setup to be completed. |
|
249 |
_BARRIER |
_BARRIER |
250 |
|
|
251 |
end |
end |