1 |
gforget |
1.69 |
C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_init.F,v 1.68 2015/10/29 17:03:38 gforget Exp $ |
2 |
heimbach |
1.14 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
jmc |
1.49 |
#include "CTRL_OPTIONS.h" |
5 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
6 |
|
|
# include "EXF_OPTIONS.h" |
7 |
|
|
#endif |
8 |
heimbach |
1.1 |
|
9 |
jmc |
1.43 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
10 |
|
|
|
11 |
gforget |
1.55 |
subroutine ctrl_init( myThid ) |
12 |
heimbach |
1.1 |
|
13 |
|
|
c ================================================================== |
14 |
heimbach |
1.5 |
c SUBROUTINE ctrl_init |
15 |
heimbach |
1.1 |
c ================================================================== |
16 |
|
|
c |
17 |
jmc |
1.49 |
c o The vector of control variables is defined here. |
18 |
heimbach |
1.11 |
c |
19 |
heimbach |
1.1 |
c ================================================================== |
20 |
heimbach |
1.5 |
c SUBROUTINE ctrl_init |
21 |
heimbach |
1.1 |
c ================================================================== |
22 |
|
|
|
23 |
|
|
implicit none |
24 |
|
|
|
25 |
|
|
c == global variables == |
26 |
|
|
|
27 |
|
|
#include "EEPARAMS.h" |
28 |
|
|
#include "SIZE.h" |
29 |
|
|
#include "PARAMS.h" |
30 |
|
|
#include "GRID.h" |
31 |
gforget |
1.58 |
#ifdef ALLOW_CTRL |
32 |
|
|
# include "CTRL_SIZE.h" |
33 |
|
|
# include "ctrl.h" |
34 |
|
|
# include "CTRL_GENARR.h" |
35 |
|
|
# include "CTRL_OBCS.h" |
36 |
|
|
# include "optim.h" |
37 |
|
|
#endif |
38 |
|
|
#ifdef ALLOW_CAL |
39 |
|
|
# include "cal.h" |
40 |
|
|
#endif |
41 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
42 |
|
|
# include "EXF_PARAM.h" |
43 |
|
|
#endif |
44 |
heimbach |
1.33 |
#ifdef ALLOW_DIC_CONTROL |
45 |
|
|
# include "DIC_CTRL.h" |
46 |
|
|
#endif |
47 |
heimbach |
1.5 |
|
48 |
heimbach |
1.1 |
c == routine arguments == |
49 |
|
|
|
50 |
gforget |
1.55 |
integer myThid |
51 |
heimbach |
1.1 |
|
52 |
|
|
c == local variables == |
53 |
|
|
|
54 |
heimbach |
1.21 |
integer bi,bj |
55 |
gforget |
1.65 |
integer i,j,k |
56 |
heimbach |
1.21 |
integer itlo,ithi |
57 |
|
|
integer jtlo,jthi |
58 |
|
|
integer jmin,jmax |
59 |
|
|
integer imin,imax |
60 |
|
|
|
61 |
heimbach |
1.11 |
integer ivar |
62 |
heimbach |
1.1 |
integer startrec |
63 |
|
|
integer endrec |
64 |
heimbach |
1.11 |
integer diffrec |
65 |
heimbach |
1.46 |
integer iarr |
66 |
heimbach |
1.5 |
|
67 |
gforget |
1.65 |
_RL dummy |
68 |
|
|
_RL loctmp3d (1-olx:snx+olx,1-oly:sny+oly,Nr,nsx,nsy) |
69 |
|
|
|
70 |
mmazloff |
1.38 |
#ifdef ALLOW_OBCS_CONTROL_MODES |
71 |
gforget |
1.66 |
INTEGER length_of_rec,dUnit |
72 |
mmazloff |
1.38 |
INTEGER MDS_RECLEN |
73 |
|
|
EXTERNAL MDS_RECLEN |
74 |
|
|
#endif |
75 |
|
|
|
76 |
gforget |
1.60 |
#ifdef ALLOW_GENTIM2D_CONTROL |
77 |
|
|
CHARACTER*(MAX_LEN_FNAM) fnamegen |
78 |
gforget |
1.62 |
INTEGER ilgen, k2, diffrecFull, endrecFull |
79 |
gforget |
1.60 |
#endif |
80 |
|
|
|
81 |
heimbach |
1.1 |
c == external == |
82 |
|
|
|
83 |
|
|
integer ilnblnk |
84 |
|
|
external ilnblnk |
85 |
|
|
|
86 |
|
|
c == end of interface == |
87 |
|
|
|
88 |
gforget |
1.55 |
jtlo = mybylo(myThid) |
89 |
|
|
jthi = mybyhi(myThid) |
90 |
|
|
itlo = mybxlo(myThid) |
91 |
|
|
ithi = mybxhi(myThid) |
92 |
heimbach |
1.21 |
jmin = 1-oly |
93 |
|
|
jmax = sny+oly |
94 |
|
|
imin = 1-olx |
95 |
|
|
imax = snx+olx |
96 |
|
|
|
97 |
heimbach |
1.1 |
c-- Set default values. |
98 |
heimbach |
1.11 |
do ivar = 1,maxcvars |
99 |
mlosch |
1.36 |
ncvarindex(ivar) = -1 |
100 |
|
|
ncvarrecs(ivar) = 0 |
101 |
|
|
ncvarxmax(ivar) = 0 |
102 |
|
|
ncvarymax(ivar) = 0 |
103 |
|
|
ncvarnrmax(ivar) = 0 |
104 |
|
|
ncvargrd(ivar) = '?' |
105 |
heimbach |
1.11 |
enddo |
106 |
heimbach |
1.1 |
|
107 |
gforget |
1.65 |
c Set unit weight to 1 |
108 |
|
|
c |
109 |
|
|
|
110 |
|
|
do bj=1,nSy |
111 |
|
|
do bi=1,nSx |
112 |
|
|
do k=1,Nr |
113 |
|
|
wunit(k,bi,bj) = 1. _d 0 |
114 |
|
|
do j=1-oly,sNy+oly |
115 |
|
|
do i=1-olx,sNx+olx |
116 |
|
|
loctmp3d(i,j,k,bi,bj) = 1. _d 0 |
117 |
|
|
enddo |
118 |
|
|
enddo |
119 |
|
|
enddo |
120 |
|
|
enddo |
121 |
|
|
enddo |
122 |
|
|
|
123 |
gforget |
1.69 |
#ifdef ALLOW_AUTODIFF |
124 |
gforget |
1.65 |
call active_write_xyz( 'wunit', loctmp3d, 1, 0, mythid, dummy) |
125 |
gforget |
1.69 |
#else |
126 |
|
|
CALL WRITE_REC_XYZ_RL( 'wunit', loctmp3d, 1, 1, myThid ) |
127 |
|
|
#endif |
128 |
gforget |
1.65 |
|
129 |
heimbach |
1.1 |
_BARRIER |
130 |
|
|
|
131 |
gforget |
1.59 |
#ifdef ECCO_CTRL_DEPRECATED |
132 |
|
|
|
133 |
heimbach |
1.1 |
c-- ===================== |
134 |
|
|
c-- Initial state fields. |
135 |
|
|
c-- ===================== |
136 |
|
|
|
137 |
heimbach |
1.5 |
cph( |
138 |
|
|
cph index 7-10 reserved for atmos. state, |
139 |
|
|
cph index 11-14 reserved for open boundaries, |
140 |
|
|
cph index 15-16 reserved for mixing coeff. |
141 |
heimbach |
1.18 |
cph index 17 reserved for passive tracer TR1 |
142 |
heimbach |
1.5 |
cph index 18,19 reserved for sst, sss |
143 |
|
|
cph index 20 for hFacC |
144 |
heimbach |
1.6 |
cph index 21-22 for efluxy, efluxp |
145 |
heimbach |
1.17 |
cph index 23 for bottom drag |
146 |
|
|
cph index 24 |
147 |
|
|
cph index 25-26 for edtaux, edtauy |
148 |
|
|
cph index 27-29 for uvel0, vvel0, etan0 |
149 |
heimbach |
1.32 |
cph index 30-31 for generic 2d, 3d field |
150 |
heimbach |
1.18 |
cph index 32 reserved for precip (atmos. state) |
151 |
|
|
cph index 33 reserved for swflux (atmos. state) |
152 |
heimbach |
1.19 |
cph index 34 reserved for swdown (atmos. state) |
153 |
heimbach |
1.24 |
cph 35 lwflux |
154 |
|
|
cph 36 lwdown |
155 |
|
|
cph 37 evap |
156 |
|
|
cph 38 snowprecip |
157 |
|
|
cph 39 apressure |
158 |
|
|
cph 40 runoff |
159 |
heimbach |
1.26 |
cph 41 seaice SIAREA |
160 |
|
|
cph 42 seaice SIHEFF |
161 |
|
|
cph 43 seaice SIHSNOW |
162 |
mlosch |
1.39 |
cph 44 gmredi kapredi |
163 |
|
|
cph 45 shelfice shifwflx |
164 |
heimbach |
1.45 |
cph 47-52 mean atmos. state |
165 |
heimbach |
1.5 |
cph) |
166 |
|
|
|
167 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
168 |
heimbach |
1.6 |
c-- |
169 |
heimbach |
1.1 |
#ifdef ALLOW_THETA0_CONTROL |
170 |
heimbach |
1.5 |
c-- Initial state temperature contribution. |
171 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
172 |
|
|
& xx_theta_file, 1, 101, 1, 1, 1, |
173 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
174 |
heimbach |
1.1 |
#endif /* ALLOW_THETA0_CONTROL */ |
175 |
|
|
|
176 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
177 |
heimbach |
1.6 |
c-- |
178 |
heimbach |
1.1 |
#ifdef ALLOW_SALT0_CONTROL |
179 |
heimbach |
1.5 |
c-- Initial state salinity contribution. |
180 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
181 |
heimbach |
1.11 |
& xx_salt_file, 2, 102, 1, 1, 1, |
182 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
183 |
heimbach |
1.1 |
#endif /* ALLOW_SALT0_CONTROL */ |
184 |
|
|
|
185 |
heimbach |
1.5 |
c-- =========================== |
186 |
|
|
c-- Surface flux contributions. |
187 |
|
|
c-- =========================== |
188 |
|
|
|
189 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
190 |
heimbach |
1.6 |
c-- |
191 |
heimbach |
1.5 |
#if (defined (ALLOW_HFLUX_CONTROL)) |
192 |
|
|
c-- Heat flux. |
193 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_hflux_file, |
194 |
jmc |
1.40 |
I xx_hfluxstartdate1, xx_hfluxstartdate2, xx_hfluxperiod, 1, |
195 |
mlosch |
1.36 |
O xx_hfluxstartdate, diffrec, startrec, endrec, |
196 |
gforget |
1.55 |
I myThid ) |
197 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
198 |
mlosch |
1.36 |
& xx_hflux_file, 3, 103, diffrec, startrec, endrec, |
199 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
200 |
heimbach |
1.5 |
|
201 |
|
|
#elif (defined (ALLOW_ATEMP_CONTROL)) |
202 |
|
|
c-- Atmos. temperature |
203 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_atemp_file, |
204 |
mlosch |
1.36 |
I xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, 1, |
205 |
|
|
O xx_atempstartdate, diffrec, startrec, endrec, |
206 |
gforget |
1.55 |
I myThid ) |
207 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
208 |
mlosch |
1.36 |
& xx_atemp_file, 7, 107, diffrec, startrec, endrec, |
209 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
210 |
jmc |
1.40 |
|
211 |
heimbach |
1.5 |
#elif (defined (ALLOW_HFLUX0_CONTROL)) |
212 |
|
|
c-- initial forcing only |
213 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
214 |
|
|
& xx_hflux_file, 3, 103, 1, 1, 1, |
215 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
216 |
heimbach |
1.1 |
|
217 |
heimbach |
1.5 |
#endif /* ALLOW_HFLUX_CONTROL */ |
218 |
|
|
|
219 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
220 |
heimbach |
1.6 |
c-- |
221 |
heimbach |
1.5 |
#if (defined (ALLOW_SFLUX_CONTROL)) |
222 |
|
|
c-- Salt flux. |
223 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_sflux_file, |
224 |
mlosch |
1.36 |
I xx_sfluxstartdate1, xx_sfluxstartdate2, xx_sfluxperiod, 1, |
225 |
|
|
O xx_sfluxstartdate, diffrec, startrec, endrec, |
226 |
gforget |
1.55 |
I myThid ) |
227 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
228 |
mlosch |
1.36 |
& xx_sflux_file, 4, 104, diffrec, startrec, endrec, |
229 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
230 |
jmc |
1.40 |
|
231 |
heimbach |
1.5 |
#elif (defined (ALLOW_AQH_CONTROL)) |
232 |
|
|
c-- Atmos. humidity |
233 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_aqh_file, |
234 |
mlosch |
1.36 |
I xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod, 1, |
235 |
|
|
O xx_aqhstartdate, diffrec, startrec, endrec, |
236 |
gforget |
1.55 |
I myThid ) |
237 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
238 |
mlosch |
1.36 |
& xx_aqh_file, 8, 108, diffrec, startrec, endrec, |
239 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
240 |
heimbach |
1.5 |
|
241 |
|
|
#elif (defined (ALLOW_SFLUX0_CONTROL)) |
242 |
|
|
c-- initial forcing only |
243 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
244 |
|
|
& xx_sflux_file, 4, 104, 1, 1, 1, |
245 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
246 |
heimbach |
1.1 |
|
247 |
heimbach |
1.5 |
#endif /* ALLOW_SFLUX_CONTROL */ |
248 |
|
|
|
249 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
250 |
heimbach |
1.6 |
c-- |
251 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
252 |
|
|
IF ( .NOT.useAtmWind ) THEN |
253 |
|
|
#endif |
254 |
heimbach |
1.5 |
#if (defined (ALLOW_USTRESS_CONTROL)) |
255 |
|
|
c-- Zonal wind stress. |
256 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_tauu_file, |
257 |
mlosch |
1.36 |
I xx_tauustartdate1, xx_tauustartdate2, xx_tauuperiod, 1, |
258 |
|
|
O xx_tauustartdate, diffrec, startrec, endrec, |
259 |
gforget |
1.55 |
I myThid ) |
260 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
261 |
mlosch |
1.36 |
& xx_tauu_file, 5, 105, diffrec, startrec, endrec, |
262 |
gforget |
1.34 |
#ifndef ALLOW_ROTATE_UV_CONTROLS |
263 |
gforget |
1.55 |
& snx, sny, 1, 'w', 'xy', myThid ) |
264 |
gforget |
1.34 |
#else |
265 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
266 |
gforget |
1.34 |
#endif |
267 |
heimbach |
1.5 |
|
268 |
gforget |
1.50 |
#elif (defined (ALLOW_TAUU0_CONTROL)) |
269 |
|
|
c-- initial forcing only |
270 |
|
|
call ctrl_init_ctrlvar ( |
271 |
|
|
& xx_tauu_file, 5, 105, 1, 1, 1, |
272 |
gforget |
1.55 |
& snx, sny, 1, 'w', 'xy', myThid ) |
273 |
gforget |
1.50 |
|
274 |
|
|
#endif /* ALLOW_USTRESS_CONTROL */ |
275 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
276 |
|
|
ENDIF |
277 |
|
|
#endif |
278 |
gforget |
1.50 |
|
279 |
|
|
#if (defined (ALLOW_UWIND_CONTROL)) |
280 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
281 |
|
|
IF ( useAtmWind ) THEN |
282 |
|
|
#endif |
283 |
heimbach |
1.5 |
c-- Zonal wind speed. |
284 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_uwind_file, |
285 |
mlosch |
1.36 |
I xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, 1, |
286 |
|
|
O xx_uwindstartdate, diffrec, startrec, endrec, |
287 |
gforget |
1.55 |
I myThid ) |
288 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
289 |
mlosch |
1.36 |
& xx_uwind_file, 9, 109, diffrec, startrec, endrec, |
290 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
291 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
292 |
|
|
ENDIF |
293 |
|
|
#endif |
294 |
gforget |
1.50 |
#endif /* ALLOW_UWIND_CONTROL */ |
295 |
heimbach |
1.5 |
|
296 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
297 |
heimbach |
1.6 |
c-- |
298 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
299 |
|
|
IF ( .NOT.useAtmWind ) THEN |
300 |
|
|
#endif |
301 |
heimbach |
1.5 |
#if (defined (ALLOW_VSTRESS_CONTROL)) |
302 |
|
|
c-- Meridional wind stress. |
303 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_tauv_file, |
304 |
mlosch |
1.36 |
I xx_tauvstartdate1, xx_tauvstartdate2, xx_tauvperiod, 1, |
305 |
|
|
O xx_tauvstartdate, diffrec, startrec, endrec, |
306 |
gforget |
1.55 |
I myThid ) |
307 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
308 |
mlosch |
1.36 |
& xx_tauv_file, 6, 106, diffrec, startrec, endrec, |
309 |
gforget |
1.34 |
#ifndef ALLOW_ROTATE_UV_CONTROLS |
310 |
gforget |
1.55 |
& snx, sny, 1, 's', 'xy', myThid ) |
311 |
jmc |
1.40 |
#else |
312 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
313 |
gforget |
1.34 |
#endif |
314 |
heimbach |
1.5 |
|
315 |
gforget |
1.50 |
#elif (defined (ALLOW_TAUV0_CONTROL)) |
316 |
|
|
c-- initial forcing only |
317 |
|
|
call ctrl_init_ctrlvar ( |
318 |
|
|
& xx_tauv_file, 6, 106, 1, 1, 1, |
319 |
gforget |
1.55 |
& snx, sny, 1, 's', 'xy', myThid ) |
320 |
gforget |
1.50 |
|
321 |
|
|
#endif /* ALLOW_VSTRESS_CONTROL */ |
322 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
323 |
|
|
ENDIF |
324 |
|
|
#endif |
325 |
gforget |
1.50 |
|
326 |
|
|
#if (defined (ALLOW_VWIND_CONTROL)) |
327 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
328 |
|
|
IF ( useAtmWind ) THEN |
329 |
|
|
#endif |
330 |
heimbach |
1.5 |
c-- Meridional wind speed. |
331 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_vwind_file, |
332 |
mlosch |
1.36 |
I xx_vwindstartdate1, xx_vwindstartdate2, xx_vwindperiod, 1, |
333 |
|
|
O xx_vwindstartdate, diffrec, startrec, endrec, |
334 |
gforget |
1.55 |
I myThid ) |
335 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
336 |
mlosch |
1.36 |
& xx_vwind_file, 10, 110, diffrec, startrec, endrec, |
337 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
338 |
gforget |
1.51 |
#ifdef ALLOW_EXF |
339 |
|
|
ENDIF |
340 |
|
|
#endif |
341 |
gforget |
1.50 |
#endif /* ALLOW_VWIND_CONTROL */ |
342 |
heimbach |
1.5 |
|
343 |
gforget |
1.59 |
#endif /* ECCO_CTRL_DEPRECATED */ |
344 |
|
|
|
345 |
heimbach |
1.11 |
c-- =========================== |
346 |
|
|
c-- Open boundary contributions. |
347 |
|
|
c-- =========================== |
348 |
|
|
|
349 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
350 |
heimbach |
1.6 |
c-- |
351 |
heimbach |
1.5 |
#ifdef ALLOW_OBCSN_CONTROL |
352 |
|
|
c-- Northern obc. |
353 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_obcsn_file, |
354 |
mlosch |
1.36 |
I xx_obcsnstartdate1, xx_obcsnstartdate2, xx_obcsnperiod, 4, |
355 |
|
|
O xx_obcsnstartdate, diffrec, startrec, endrec, |
356 |
gforget |
1.55 |
I myThid ) |
357 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
358 |
mlosch |
1.36 |
& xx_obcsn_file, 11, 111, diffrec, startrec, endrec, |
359 |
gforget |
1.55 |
& snx, 1, nr, 'm', 'xz', myThid ) |
360 |
heimbach |
1.5 |
#endif /* ALLOW_OBCSN_CONTROL */ |
361 |
|
|
|
362 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
363 |
heimbach |
1.11 |
c-- |
364 |
heimbach |
1.5 |
#ifdef ALLOW_OBCSS_CONTROL |
365 |
|
|
c-- Southern obc. |
366 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_obcss_file, |
367 |
mlosch |
1.36 |
I xx_obcssstartdate1, xx_obcssstartdate2, xx_obcssperiod, 4, |
368 |
|
|
O xx_obcssstartdate, diffrec, startrec, endrec, |
369 |
gforget |
1.55 |
I myThid ) |
370 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
371 |
mlosch |
1.36 |
& xx_obcss_file, 12, 112, diffrec, startrec, endrec, |
372 |
gforget |
1.55 |
& snx, 1, nr, 'm', 'xz', myThid ) |
373 |
heimbach |
1.5 |
#endif /* ALLOW_OBCSS_CONTROL */ |
374 |
|
|
|
375 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
376 |
heimbach |
1.6 |
c-- |
377 |
heimbach |
1.5 |
#ifdef ALLOW_OBCSW_CONTROL |
378 |
|
|
c-- Western obc. |
379 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_obcsw_file, |
380 |
mlosch |
1.36 |
I xx_obcswstartdate1, xx_obcswstartdate2, xx_obcswperiod, 4, |
381 |
|
|
O xx_obcswstartdate, diffrec, startrec, endrec, |
382 |
gforget |
1.55 |
I myThid ) |
383 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
384 |
mlosch |
1.36 |
& xx_obcsw_file, 13, 113, diffrec, startrec, endrec, |
385 |
gforget |
1.55 |
& 1, sny, nr, 'm', 'yz', myThid ) |
386 |
heimbach |
1.11 |
#endif /* ALLOW_OBCSW_CONTROL */ |
387 |
heimbach |
1.5 |
|
388 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
389 |
heimbach |
1.6 |
c-- |
390 |
heimbach |
1.5 |
#ifdef ALLOW_OBCSE_CONTROL |
391 |
|
|
c-- Eastern obc. |
392 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_obcse_file, |
393 |
mlosch |
1.36 |
I xx_obcsestartdate1, xx_obcsestartdate2, xx_obcseperiod, 4, |
394 |
|
|
O xx_obcsestartdate, diffrec, startrec, endrec, |
395 |
gforget |
1.55 |
I myThid ) |
396 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
397 |
mlosch |
1.36 |
& xx_obcse_file, 14, 114, diffrec, startrec, endrec, |
398 |
gforget |
1.55 |
& 1, sny, nr, 'm', 'yz', myThid ) |
399 |
heimbach |
1.5 |
#endif /* ALLOW_OBCSE_CONTROL */ |
400 |
heimbach |
1.2 |
|
401 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
402 |
heimbach |
1.6 |
c-- |
403 |
mmazloff |
1.38 |
#ifdef ALLOW_OBCS_CONTROL_MODES |
404 |
|
|
cih Get matrices for reconstruction from barotropic-barclinic modes |
405 |
|
|
CMM To use modes now hardcoded with ECCO_CPPOPTION. Would be good to have |
406 |
|
|
c run-time option and also define filename=baro_invmodes.bin |
407 |
|
|
CALL MDSFINDUNIT( dUnit, myThid ) |
408 |
|
|
length_of_rec = MDS_RECLEN( 64, NR*NR, myThid ) |
409 |
|
|
open(dUnit, file='baro_invmodes.bin', status='old', |
410 |
|
|
& access='direct', recl=length_of_rec ) |
411 |
|
|
do j = 1,Nr |
412 |
|
|
read(dUnit,rec=j) ((modesv(k,i,j), k=1,Nr), i=1,Nr) |
413 |
|
|
end do |
414 |
|
|
CLOSE( dUnit ) |
415 |
|
|
CMM double precision modesv is size [NR,NR,NR] |
416 |
jmc |
1.40 |
c dim one is z-space |
417 |
|
|
c dim two is mode space |
418 |
mmazloff |
1.38 |
c dim three is the total depth for which this set of modes applies |
419 |
|
|
c so for example modesv(:,2,nr) will be the second mode |
420 |
|
|
c in z-space for the full model depth |
421 |
jmc |
1.40 |
c The modes are to be orthogonal when weighted by dz. |
422 |
mmazloff |
1.38 |
c i.e. if f_i(z) = mode i, sum_j(f_i(z_j)*f_j(z_j)*dz_j = delta_ij |
423 |
|
|
c first mode should also be constant in depth...barotropic |
424 |
jmc |
1.40 |
c For a matlab code example how to construct the orthonormal modes, |
425 |
mmazloff |
1.38 |
c which are ideally the solution of planetary vertical mode equation |
426 |
jmc |
1.40 |
c using model mean dRho/dz, see |
427 |
mmazloff |
1.38 |
c MITgcm/verification/obcs_ctrl/input/gendata.m |
428 |
|
|
c This code is compatible with partial cells |
429 |
|
|
#endif |
430 |
|
|
|
431 |
gforget |
1.59 |
#ifdef ECCO_CTRL_DEPRECATED |
432 |
|
|
|
433 |
mmazloff |
1.38 |
c---------------------------------------------------------------------- |
434 |
|
|
c-- |
435 |
heimbach |
1.3 |
#ifdef ALLOW_DIFFKR_CONTROL |
436 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
437 |
mlosch |
1.36 |
& xx_diffkr_file, 15, 115, 1, 1, 1, |
438 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
439 |
heimbach |
1.3 |
#endif /* ALLOW_DIFFKR_CONTROL */ |
440 |
|
|
|
441 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
442 |
heimbach |
1.6 |
c-- |
443 |
heimbach |
1.3 |
#ifdef ALLOW_KAPGM_CONTROL |
444 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
445 |
mlosch |
1.36 |
& xx_kapgm_file, 16, 116, 1, 1, 1, |
446 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
447 |
heimbach |
1.3 |
#endif /* ALLOW_KAPGM_CONTROL */ |
448 |
|
|
|
449 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
450 |
heimbach |
1.6 |
c-- |
451 |
heimbach |
1.18 |
#ifdef ALLOW_TR10_CONTROL |
452 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
453 |
mlosch |
1.36 |
& xx_tr1_file, 17, 117, 1, 1, 1, |
454 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
455 |
heimbach |
1.18 |
#endif /* ALLOW_TR10_CONTROL */ |
456 |
heimbach |
1.2 |
|
457 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
458 |
heimbach |
1.6 |
c-- |
459 |
heimbach |
1.20 |
#if (defined (ALLOW_SST_CONTROL)) |
460 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_sst_file, |
461 |
mlosch |
1.36 |
I xx_sststartdate1, xx_sststartdate2, xx_sstperiod, 1, |
462 |
|
|
O xx_sststartdate, diffrec, startrec, endrec, |
463 |
gforget |
1.55 |
I myThid ) |
464 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
465 |
mlosch |
1.36 |
& xx_sst_file, 18, 118, diffrec, startrec, endrec, |
466 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
467 |
heimbach |
1.20 |
|
468 |
|
|
#elif (defined (ALLOW_SST0_CONTROL)) |
469 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
470 |
mlosch |
1.36 |
& xx_sst_file, 18, 118, 1, 1, 1, |
471 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
472 |
heimbach |
1.20 |
|
473 |
|
|
#endif /* ALLOW_SST_CONTROL */ |
474 |
heimbach |
1.6 |
|
475 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
476 |
heimbach |
1.6 |
c-- |
477 |
heimbach |
1.20 |
#if (defined (ALLOW_SSS_CONTROL)) |
478 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_sss_file, |
479 |
mlosch |
1.36 |
I xx_sssstartdate1, xx_sssstartdate2, xx_sssperiod, 1, |
480 |
|
|
O xx_sssstartdate, diffrec, startrec, endrec, |
481 |
gforget |
1.55 |
I myThid ) |
482 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
483 |
mlosch |
1.36 |
& xx_sss_file, 19, 119, diffrec, startrec, endrec, |
484 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
485 |
heimbach |
1.20 |
|
486 |
|
|
#elif (defined (ALLOW_SSS0_CONTROL)) |
487 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
488 |
mlosch |
1.36 |
& xx_sss_file, 19, 119, 1, 1, 1, |
489 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
490 |
jmc |
1.40 |
|
491 |
heimbach |
1.6 |
#endif /* ALLOW_SSS0_CONTROL */ |
492 |
|
|
|
493 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
494 |
heimbach |
1.6 |
c-- |
495 |
heimbach |
1.23 |
#ifdef ALLOW_DEPTH_CONTROL |
496 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
497 |
heimbach |
1.23 |
& xx_depth_file, 20, 120, 1, 1, 1, |
498 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
499 |
heimbach |
1.23 |
#endif /* ALLOW_DEPTH_CONTROL */ |
500 |
heimbach |
1.6 |
|
501 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
502 |
heimbach |
1.6 |
c-- |
503 |
heimbach |
1.5 |
#ifdef ALLOW_EFLUXY0_CONTROL |
504 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
505 |
heimbach |
1.11 |
& xx_efluxy_file, 21, 121, 1, 1, 1, |
506 |
gforget |
1.55 |
& snx, sny, nr, 's', '3d', myThid ) |
507 |
heimbach |
1.5 |
#endif /* ALLOW_EFLUXY0_CONTROL */ |
508 |
|
|
|
509 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
510 |
heimbach |
1.6 |
c-- |
511 |
heimbach |
1.5 |
#ifdef ALLOW_EFLUXP0_CONTROL |
512 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
513 |
heimbach |
1.11 |
& xx_efluxp_file, 22, 122, 1, 1, 1, |
514 |
gforget |
1.55 |
& snx, sny, nr, 'v', '3d', myThid ) |
515 |
heimbach |
1.5 |
#endif /* ALLOW_EFLUXP0_CONTROL */ |
516 |
heimbach |
1.6 |
|
517 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
518 |
heimbach |
1.6 |
c-- |
519 |
heimbach |
1.48 |
#ifdef ALLOW_BOTTOMDRAG_CONTROL_NONGENERIC |
520 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
521 |
heimbach |
1.11 |
& xx_bottomdrag_file, 23, 123, 1, 1, 1, |
522 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
523 |
heimbach |
1.6 |
#endif /* ALLOW_BOTTOMDRAG_CONTROL */ |
524 |
|
|
|
525 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
526 |
heimbach |
1.15 |
c-- |
527 |
dfer |
1.28 |
#ifdef ALLOW_HFLUXM_CONTROL |
528 |
|
|
call ctrl_init_ctrlvar ( |
529 |
|
|
& xx_hfluxm_file, 24, 124, 1, 1, 1, |
530 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
531 |
dfer |
1.28 |
#endif /* ALLOW_HFLUXM_CONTROL */ |
532 |
|
|
|
533 |
|
|
c---------------------------------------------------------------------- |
534 |
|
|
c-- |
535 |
gforget |
1.30 |
#ifdef ALLOW_EDDYPSI_CONTROL |
536 |
heimbach |
1.15 |
call ctrl_init_ctrlvar ( |
537 |
|
|
& xx_edtaux_file, 25, 125, 1, 1, 1, |
538 |
gforget |
1.55 |
& snx, sny, nr, 'w', '3d', myThid ) |
539 |
heimbach |
1.15 |
|
540 |
|
|
call ctrl_init_ctrlvar ( |
541 |
|
|
& xx_edtauy_file, 26, 126, 1, 1, 1, |
542 |
gforget |
1.55 |
& snx, sny, nr, 's', '3d', myThid ) |
543 |
gforget |
1.30 |
#endif /* ALLOW_EDDYPSI_CONTROL */ |
544 |
heimbach |
1.15 |
|
545 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
546 |
|
|
c-- |
547 |
|
|
#ifdef ALLOW_UVEL0_CONTROL |
548 |
|
|
call ctrl_init_ctrlvar ( |
549 |
|
|
& xx_uvel_file, 27, 127, 1, 1, 1, |
550 |
gforget |
1.55 |
& snx, sny, nr, 'w', '3d', myThid ) |
551 |
heimbach |
1.16 |
#endif /* ALLOW_UVEL0_CONTROL */ |
552 |
|
|
|
553 |
|
|
c---------------------------------------------------------------------- |
554 |
|
|
c-- |
555 |
|
|
#ifdef ALLOW_VVEL0_CONTROL |
556 |
|
|
call ctrl_init_ctrlvar ( |
557 |
|
|
& xx_vvel_file, 28, 128, 1, 1, 1, |
558 |
gforget |
1.55 |
& snx, sny, nr, 's', '3d', myThid ) |
559 |
heimbach |
1.16 |
#endif /* ALLOW_VVEL0_CONTROL */ |
560 |
|
|
|
561 |
|
|
c---------------------------------------------------------------------- |
562 |
|
|
c-- |
563 |
|
|
#ifdef ALLOW_ETAN0_CONTROL |
564 |
|
|
call ctrl_init_ctrlvar ( |
565 |
|
|
& xx_etan_file, 29, 129, 1, 1, 1, |
566 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
567 |
heimbach |
1.16 |
#endif /* ALLOW_VVEL0_CONTROL */ |
568 |
|
|
|
569 |
|
|
c---------------------------------------------------------------------- |
570 |
|
|
c-- |
571 |
heimbach |
1.32 |
#ifdef ALLOW_GEN2D_CONTROL |
572 |
heimbach |
1.16 |
call ctrl_init_ctrlvar ( |
573 |
heimbach |
1.32 |
& xx_gen2d_file, 30, 130, 1, 1, 1, |
574 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
575 |
heimbach |
1.32 |
#endif /* ALLOW_GEN2D_CONTROL */ |
576 |
heimbach |
1.16 |
|
577 |
|
|
c---------------------------------------------------------------------- |
578 |
|
|
c-- |
579 |
heimbach |
1.32 |
#ifdef ALLOW_GEN3D_CONTROL |
580 |
heimbach |
1.16 |
call ctrl_init_ctrlvar ( |
581 |
heimbach |
1.32 |
& xx_gen3d_file, 31, 131, 1, 1, 1, |
582 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
583 |
heimbach |
1.32 |
#endif /* ALLOW_GEN3D_CONTROL */ |
584 |
heimbach |
1.16 |
|
585 |
|
|
c---------------------------------------------------------------------- |
586 |
heimbach |
1.17 |
c-- |
587 |
heimbach |
1.18 |
#ifdef ALLOW_PRECIP_CONTROL |
588 |
|
|
c-- Atmos. precipitation |
589 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_precip_file, |
590 |
mlosch |
1.36 |
I xx_precipstartdate1, xx_precipstartdate2, xx_precipperiod,1, |
591 |
|
|
O xx_precipstartdate, diffrec, startrec, endrec, |
592 |
gforget |
1.55 |
I myThid ) |
593 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
594 |
mlosch |
1.36 |
& xx_precip_file, 32, 132, diffrec, startrec, endrec, |
595 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
596 |
heimbach |
1.18 |
|
597 |
|
|
#endif /* ALLOW_PRECIP_CONTROL */ |
598 |
|
|
|
599 |
|
|
c---------------------------------------------------------------------- |
600 |
|
|
c-- |
601 |
|
|
#ifdef ALLOW_SWFLUX_CONTROL |
602 |
|
|
c-- Atmos. swflux |
603 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_swflux_file, |
604 |
mlosch |
1.36 |
I xx_swfluxstartdate1, xx_swfluxstartdate2, xx_swfluxperiod, 1, |
605 |
|
|
O xx_swfluxstartdate, diffrec, startrec, endrec, |
606 |
gforget |
1.55 |
I myThid ) |
607 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
608 |
mlosch |
1.36 |
& xx_swflux_file, 33, 133, diffrec, startrec, endrec, |
609 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
610 |
heimbach |
1.18 |
|
611 |
|
|
#endif /* ALLOW_SWFLUX_CONTROL */ |
612 |
heimbach |
1.17 |
|
613 |
|
|
c---------------------------------------------------------------------- |
614 |
heimbach |
1.19 |
c-- |
615 |
|
|
#ifdef ALLOW_SWDOWN_CONTROL |
616 |
|
|
c-- Atmos. swdown |
617 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_swdown_file, |
618 |
mlosch |
1.36 |
I xx_swdownstartdate1, xx_swdownstartdate2, xx_swdownperiod, 1, |
619 |
|
|
O xx_swdownstartdate, diffrec, startrec, endrec, |
620 |
gforget |
1.55 |
I myThid ) |
621 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
622 |
mlosch |
1.36 |
& xx_swdown_file, 34, 134, diffrec, startrec, endrec, |
623 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
624 |
heimbach |
1.19 |
|
625 |
|
|
#endif /* ALLOW_SWDOWN_CONTROL */ |
626 |
|
|
|
627 |
|
|
c---------------------------------------------------------------------- |
628 |
heimbach |
1.24 |
c-- |
629 |
|
|
#ifdef ALLOW_LWFLUX_CONTROL |
630 |
|
|
c-- Atmos. lwflux |
631 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_lwflux_file, |
632 |
mlosch |
1.36 |
I xx_lwfluxstartdate1, xx_lwfluxstartdate2, xx_lwfluxperiod, 1, |
633 |
|
|
O xx_lwfluxstartdate, diffrec, startrec, endrec, |
634 |
gforget |
1.55 |
I myThid ) |
635 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
636 |
mlosch |
1.36 |
& xx_lwflux_file, 35, 135, diffrec, startrec, endrec, |
637 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
638 |
heimbach |
1.24 |
|
639 |
|
|
#endif /* ALLOW_LWFLUX_CONTROL */ |
640 |
|
|
|
641 |
|
|
c---------------------------------------------------------------------- |
642 |
|
|
c-- |
643 |
|
|
#ifdef ALLOW_LWDOWN_CONTROL |
644 |
|
|
c-- Atmos. lwdown |
645 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_lwdown_file, |
646 |
mlosch |
1.36 |
I xx_lwdownstartdate1, xx_lwdownstartdate2, xx_lwdownperiod, 1, |
647 |
|
|
O xx_lwdownstartdate, diffrec, startrec, endrec, |
648 |
gforget |
1.55 |
I myThid ) |
649 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
650 |
mlosch |
1.36 |
& xx_lwdown_file, 36, 136, diffrec, startrec, endrec, |
651 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
652 |
heimbach |
1.24 |
|
653 |
|
|
#endif /* ALLOW_LWDOWN_CONTROL */ |
654 |
|
|
|
655 |
|
|
c---------------------------------------------------------------------- |
656 |
|
|
c-- |
657 |
|
|
#ifdef ALLOW_EVAP_CONTROL |
658 |
|
|
c-- Atmos. evap |
659 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_evap_file, |
660 |
mlosch |
1.36 |
I xx_evapstartdate1, xx_evapstartdate2, xx_evapperiod, 1, |
661 |
|
|
O xx_evapstartdate, diffrec, startrec, endrec, |
662 |
gforget |
1.55 |
I myThid ) |
663 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
664 |
mlosch |
1.36 |
& xx_evap_file, 37, 137, diffrec, startrec, endrec, |
665 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
666 |
heimbach |
1.24 |
|
667 |
|
|
#endif /* ALLOW_EVAP_CONTROL */ |
668 |
|
|
|
669 |
|
|
c---------------------------------------------------------------------- |
670 |
|
|
c-- |
671 |
|
|
#ifdef ALLOW_SNOWPRECIP_CONTROL |
672 |
|
|
c-- Atmos. snowprecip |
673 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_snowprecip_file, |
674 |
jmc |
1.40 |
I xx_snowprecipstartdate1, xx_snowprecipstartdate2, |
675 |
mlosch |
1.36 |
I xx_snowprecipperiod, 1, |
676 |
|
|
O xx_snowprecipstartdate, diffrec, startrec, endrec, |
677 |
gforget |
1.55 |
I myThid ) |
678 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
679 |
mlosch |
1.36 |
& xx_snowprecip_file, 38, 138, diffrec, startrec, endrec, |
680 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
681 |
heimbach |
1.24 |
|
682 |
|
|
#endif /* ALLOW_SNOWPRECIP_CONTROL */ |
683 |
|
|
|
684 |
|
|
c---------------------------------------------------------------------- |
685 |
|
|
c-- |
686 |
|
|
#ifdef ALLOW_APRESSURE_CONTROL |
687 |
|
|
c-- Atmos. apressure |
688 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_apressure_file, |
689 |
jmc |
1.40 |
I xx_apressurestartdate1, xx_apressurestartdate2, |
690 |
mlosch |
1.36 |
I xx_apressureperiod, 1, |
691 |
|
|
O xx_apressurestartdate, diffrec, startrec, endrec, |
692 |
gforget |
1.55 |
I myThid ) |
693 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
694 |
mlosch |
1.36 |
& xx_apressure_file, 39, 139, diffrec, startrec, endrec, |
695 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
696 |
heimbach |
1.24 |
|
697 |
|
|
#endif /* ALLOW_APRESSURE_CONTROL */ |
698 |
|
|
|
699 |
|
|
c---------------------------------------------------------------------- |
700 |
|
|
c-- |
701 |
|
|
#ifdef ALLOW_RUNOFF_CONTROL |
702 |
|
|
c-- Atmos. runoff |
703 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_runoff_file, |
704 |
mlosch |
1.36 |
I xx_runoffstartdate1, xx_runoffstartdate2, xx_runoffperiod, 1, |
705 |
|
|
O xx_runoffstartdate, diffrec, startrec, endrec, |
706 |
gforget |
1.55 |
I myThid ) |
707 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
708 |
mlosch |
1.36 |
& xx_runoff_file, 40, 140, diffrec, startrec, endrec, |
709 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
710 |
heimbach |
1.24 |
#endif /* ALLOW_RUNOFF_CONTROL */ |
711 |
|
|
|
712 |
|
|
c---------------------------------------------------------------------- |
713 |
heimbach |
1.26 |
c-- |
714 |
|
|
#ifdef ALLOW_SIAREA_CONTROL |
715 |
mlosch |
1.36 |
C-- so far there are no xx_siareastartdate1, etc., so we need to fudge it. |
716 |
mlosch |
1.44 |
CML call ctrl_init_rec ( xx_siarea_file, |
717 |
mlosch |
1.36 |
CML I xx_siareastartdate1, xx_siareastartdate2, xx_siareaperiod, 1, |
718 |
|
|
CML O xx_siareastartdate, diffrec, startrec, endrec, |
719 |
gforget |
1.55 |
CML I myThid ) |
720 |
mlosch |
1.36 |
startrec = 1 |
721 |
|
|
endrec = 1 |
722 |
|
|
diffrec = endrec - startrec + 1 |
723 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
724 |
mlosch |
1.36 |
& xx_siarea_file, 41, 141, diffrec, startrec, endrec, |
725 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
726 |
heimbach |
1.26 |
#endif /* ALLOW_siarea_CONTROL */ |
727 |
|
|
|
728 |
|
|
c---------------------------------------------------------------------- |
729 |
|
|
c-- |
730 |
|
|
#ifdef ALLOW_SIHEFF_CONTROL |
731 |
mlosch |
1.36 |
C-- so far there are no xx_siheffstartdate1, etc., so we need to fudge it. |
732 |
mlosch |
1.44 |
CML call ctrl_init_rec ( xx_siheff_file, |
733 |
mlosch |
1.36 |
CML I xx_siheffstartdate1, xx_siheffstartdate2, xx_siheffperiod, 1, |
734 |
|
|
CML O xx_siheffstartdate, diffrec, startrec, endrec, |
735 |
gforget |
1.55 |
CML I myThid ) |
736 |
mlosch |
1.36 |
startrec = 1 |
737 |
|
|
endrec = 1 |
738 |
|
|
diffrec = endrec - startrec + 1 |
739 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
740 |
mlosch |
1.36 |
& xx_siheff_file, 42, 142, diffrec, startrec, endrec, |
741 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
742 |
heimbach |
1.26 |
#endif /* ALLOW_siheff_CONTROL */ |
743 |
|
|
|
744 |
|
|
c---------------------------------------------------------------------- |
745 |
|
|
c-- |
746 |
|
|
#ifdef ALLOW_SIHSNOW_CONTROL |
747 |
mlosch |
1.36 |
C-- so far there are no xx_sihsnowstartdate1, etc., so we need to fudge it. |
748 |
mlosch |
1.44 |
CML call ctrl_init_rec ( xx_sihsnow_file, |
749 |
mlosch |
1.36 |
CML I xx_sihsnowstartdate1, xx_sihsnowstartdate2, xx_sihsnowperiod, 1, |
750 |
|
|
CML O xx_sihsnowstartdate, diffrec, startrec, endrec, |
751 |
gforget |
1.55 |
CML I myThid ) |
752 |
mlosch |
1.36 |
startrec = 1 |
753 |
|
|
endrec = 1 |
754 |
|
|
diffrec = endrec - startrec + 1 |
755 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
756 |
mlosch |
1.36 |
& xx_sihsnow_file, 43, 143, diffrec, startrec, endrec, |
757 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
758 |
heimbach |
1.26 |
#endif /* ALLOW_sihsnow_CONTROL */ |
759 |
|
|
|
760 |
gforget |
1.29 |
|
761 |
|
|
c---------------------------------------------------------------------- |
762 |
|
|
c-- |
763 |
|
|
#ifdef ALLOW_KAPREDI_CONTROL |
764 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
765 |
mlosch |
1.36 |
& xx_kapredi_file, 44, 144, 1, 1, 1, |
766 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
767 |
gforget |
1.29 |
#endif /* ALLOW_KAPREDI_CONTROL */ |
768 |
|
|
|
769 |
heimbach |
1.26 |
c---------------------------------------------------------------------- |
770 |
heimbach |
1.16 |
c---------------------------------------------------------------------- |
771 |
heimbach |
1.21 |
|
772 |
mlosch |
1.39 |
#ifdef ALLOW_SHIFWFLX_CONTROL |
773 |
|
|
c-- freshwater flux underneath ice-shelves |
774 |
mlosch |
1.44 |
call ctrl_init_rec ( xx_shifwflx_file, |
775 |
mlosch |
1.39 |
I xx_shifwflxstartdate1, xx_shifwflxstartdate2, |
776 |
|
|
I xx_shifwflxperiod, 1, |
777 |
|
|
O xx_shifwflxstartdate, diffrec, startrec, endrec, |
778 |
gforget |
1.55 |
I myThid ) |
779 |
jmc |
1.40 |
call ctrl_init_ctrlvar ( |
780 |
mlosch |
1.39 |
& xx_shifwflx_file, 45, 145, diffrec, startrec, endrec, |
781 |
gforget |
1.55 |
& snx, sny, 1, 'i', 'xy', myThid ) |
782 |
mlosch |
1.39 |
#endif /* ALLOW_SHIFWFLX_CONTROL */ |
783 |
|
|
|
784 |
|
|
c---------------------------------------------------------------------- |
785 |
heimbach |
1.45 |
c-- |
786 |
|
|
#ifdef ALLOW_ATM_MEAN_CONTROL |
787 |
|
|
# ifdef ALLOW_ATEMP_CONTROL |
788 |
|
|
call ctrl_init_ctrlvar ( |
789 |
|
|
& xx_atemp_mean_file, 47, 147, 1, 1, 1, |
790 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
791 |
heimbach |
1.45 |
# endif |
792 |
|
|
# ifdef ALLOW_AQH_CONTROL |
793 |
|
|
call ctrl_init_ctrlvar ( |
794 |
|
|
& xx_aqh_mean_file, 48, 148, 1, 1, 1, |
795 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
796 |
heimbach |
1.45 |
# endif |
797 |
|
|
# ifdef ALLOW_UWIND_CONTROL |
798 |
|
|
call ctrl_init_ctrlvar ( |
799 |
|
|
& xx_uwind_mean_file, 49, 149, 1, 1, 1, |
800 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
801 |
heimbach |
1.45 |
# endif |
802 |
|
|
# ifdef ALLOW_VWIND_CONTROL |
803 |
|
|
call ctrl_init_ctrlvar ( |
804 |
|
|
& xx_vwind_mean_file, 50, 150, 1, 1, 1, |
805 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
806 |
heimbach |
1.45 |
# endif |
807 |
|
|
# ifdef ALLOW_PRECIP_CONTROL |
808 |
|
|
call ctrl_init_ctrlvar ( |
809 |
|
|
& xx_precip_mean_file,51, 151, 1, 1, 1, |
810 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
811 |
heimbach |
1.45 |
# endif |
812 |
|
|
# ifdef ALLOW_SWDOWN_CONTROL |
813 |
|
|
call ctrl_init_ctrlvar ( |
814 |
|
|
& xx_swdown_mean_file,52, 152, 1, 1, 1, |
815 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
816 |
heimbach |
1.45 |
# endif |
817 |
|
|
#endif /* ALLOW_ATM_MEAN_CONTROL */ |
818 |
|
|
|
819 |
gforget |
1.59 |
#endif /* ECCO_CTRL_DEPRECATED */ |
820 |
|
|
|
821 |
heimbach |
1.45 |
c---------------------------------------------------------------------- |
822 |
heimbach |
1.46 |
c-- |
823 |
|
|
#ifdef ALLOW_GENARR2D_CONTROL |
824 |
|
|
do iarr = 1, maxCtrlArr2D |
825 |
gforget |
1.63 |
#ifndef ALLOW_OPENAD |
826 |
|
|
if (xx_genarr2d_weight(iarr).NE.' ') |
827 |
|
|
& call ctrl_init_ctrlvar ( |
828 |
|
|
#else |
829 |
heimbach |
1.46 |
call ctrl_init_ctrlvar ( |
830 |
gforget |
1.63 |
#endif |
831 |
jmc |
1.49 |
& xx_genarr2d_file(iarr)(1:MAX_LEN_FNAM), |
832 |
heimbach |
1.46 |
& 100+iarr, 200+iarr, 1, 1, 1, |
833 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
834 |
gforget |
1.63 |
|
835 |
heimbach |
1.46 |
enddo |
836 |
|
|
#endif /* ALLOW_GENARR2D_CONTROL */ |
837 |
|
|
|
838 |
|
|
c---------------------------------------------------------------------- |
839 |
|
|
c-- |
840 |
|
|
#ifdef ALLOW_GENARR3D_CONTROL |
841 |
|
|
do iarr = 1, maxCtrlArr3D |
842 |
gforget |
1.63 |
#ifndef ALLOW_OPENAD |
843 |
|
|
if (xx_genarr3d_weight(iarr).NE.' ') |
844 |
|
|
& call ctrl_init_ctrlvar ( |
845 |
|
|
#else |
846 |
heimbach |
1.46 |
call ctrl_init_ctrlvar ( |
847 |
gforget |
1.63 |
#endif |
848 |
jmc |
1.49 |
& xx_genarr3d_file(iarr)(1:MAX_LEN_FNAM), |
849 |
heimbach |
1.46 |
& 200+iarr, 300+iarr, 1, 1, 1, |
850 |
gforget |
1.55 |
& snx, sny, nr, 'c', '3d', myThid ) |
851 |
heimbach |
1.46 |
enddo |
852 |
|
|
#endif /* ALLOW_GENARR3D_CONTROL */ |
853 |
|
|
|
854 |
|
|
c---------------------------------------------------------------------- |
855 |
heimbach |
1.52 |
c-- |
856 |
|
|
#ifdef ALLOW_GENTIM2D_CONTROL |
857 |
|
|
do iarr = 1, maxCtrlTim2D |
858 |
gforget |
1.53 |
|
859 |
gforget |
1.58 |
#ifdef ALLOW_CAL |
860 |
|
|
if (xx_gentim2d_startdate1(iarr).EQ.0) then |
861 |
|
|
xx_gentim2d_startdate1(iarr)=startdate_1 |
862 |
|
|
xx_gentim2d_startdate2(iarr)=startdate_2 |
863 |
|
|
endif |
864 |
|
|
#endif |
865 |
|
|
|
866 |
heimbach |
1.52 |
call ctrl_init_rec ( xx_gentim2d_file(iarr)(1:MAX_LEN_FNAM), |
867 |
|
|
I xx_gentim2d_startdate1(iarr), |
868 |
|
|
I xx_gentim2d_startdate2(iarr), |
869 |
|
|
I xx_gentim2d_period(iarr), |
870 |
|
|
I 1, |
871 |
|
|
O xx_gentim2d_startdate(1,iarr), |
872 |
|
|
O diffrec, startrec, endrec, |
873 |
gforget |
1.55 |
I myThid ) |
874 |
heimbach |
1.52 |
C |
875 |
gforget |
1.62 |
|
876 |
gforget |
1.63 |
#ifndef ALLOW_OPENAD |
877 |
|
|
if (xx_gentim2d_weight(iarr).NE.' ') then |
878 |
|
|
#endif |
879 |
gforget |
1.67 |
do k2 = 1, maxCtrlProc |
880 |
|
|
if (xx_gentim2d_preproc(k2,iarr).EQ.'replicate') |
881 |
|
|
& xx_gentim2d_preproc(k2,iarr)='docycle' |
882 |
|
|
if (xx_gentim2d_preproc(k2,iarr).EQ.'doglomean') |
883 |
|
|
& xx_gentim2d_glosum(iarr) = .TRUE. |
884 |
|
|
if (xx_gentim2d_preproc(k2,iarr).EQ.'documul') |
885 |
|
|
& xx_gentim2d_cumsum(iarr) = .TRUE. |
886 |
|
|
enddo |
887 |
|
|
C |
888 |
gforget |
1.62 |
diffrecFull=diffrec |
889 |
|
|
endrecFull=endrec |
890 |
gforget |
1.61 |
do k2 = 1, maxCtrlProc |
891 |
gforget |
1.67 |
if (xx_gentim2d_preproc(k2,iarr).EQ.'docycle') then |
892 |
gforget |
1.61 |
if (xx_gentim2d_preproc_i(k2,iarr).NE.0) then |
893 |
gforget |
1.62 |
diffrec=min(diffrec,xx_gentim2d_preproc_i(k2,iarr)) |
894 |
gforget |
1.61 |
endrec=min(endrec,xx_gentim2d_preproc_i(k2,iarr)) |
895 |
|
|
endif |
896 |
|
|
endif |
897 |
|
|
enddo |
898 |
|
|
C |
899 |
gforget |
1.62 |
ilgen=ilnblnk( xx_gentim2d_file(iarr) ) |
900 |
|
|
write(fnamegen(1:MAX_LEN_FNAM),'(2a)') |
901 |
|
|
& xx_gentim2d_file(iarr)(1:ilgen),'.effective' |
902 |
heimbach |
1.52 |
call ctrl_init_ctrlvar ( |
903 |
gforget |
1.62 |
& fnamegen(1:MAX_LEN_FNAM), |
904 |
heimbach |
1.52 |
& 300+iarr, 400+iarr, |
905 |
gforget |
1.62 |
& diffrecFull, startrec, endrecFull, |
906 |
gforget |
1.55 |
& snx, sny, 1, 'c', 'xy', myThid ) |
907 |
gforget |
1.60 |
C |
908 |
gforget |
1.64 |
ilgen=ilnblnk( xx_gentim2d_file(iarr) ) |
909 |
|
|
write(fnamegen(1:MAX_LEN_FNAM),'(2a)') |
910 |
|
|
& xx_gentim2d_file(iarr)(1:ilgen),'.tmp' |
911 |
|
|
call ctrl_init_ctrlvar ( |
912 |
|
|
& fnamegen(1:MAX_LEN_FNAM), |
913 |
|
|
& 300+iarr, 400+iarr, |
914 |
|
|
& diffrecFull, startrec, endrecFull, |
915 |
|
|
& snx, sny, 1, 'c', 'xy', myThid ) |
916 |
|
|
C |
917 |
gforget |
1.60 |
call ctrl_init_ctrlvar ( |
918 |
gforget |
1.62 |
& xx_gentim2d_file(iarr)(1:MAX_LEN_FNAM), |
919 |
gforget |
1.60 |
& 300+iarr, 400+iarr, |
920 |
|
|
& diffrec, startrec, endrec, |
921 |
|
|
& snx, sny, 1, 'c', 'xy', myThid ) |
922 |
|
|
C |
923 |
gforget |
1.63 |
#ifndef ALLOW_OPENAD |
924 |
|
|
endif |
925 |
|
|
#endif |
926 |
|
|
C |
927 |
heimbach |
1.52 |
enddo |
928 |
|
|
#endif /* ALLOW_GENTIM2D_CONTROL */ |
929 |
|
|
|
930 |
|
|
c---------------------------------------------------------------------- |
931 |
mlosch |
1.39 |
c---------------------------------------------------------------------- |
932 |
|
|
|
933 |
gforget |
1.65 |
call ctrl_init_wet( myThid ) |
934 |
|
|
|
935 |
|
|
c---------------------------------------------------------------------- |
936 |
|
|
c---------------------------------------------------------------------- |
937 |
|
|
|
938 |
heimbach |
1.33 |
#ifdef ALLOW_DIC_CONTROL |
939 |
mlosch |
1.36 |
do i = 1, dic_n_control |
940 |
|
|
xx_dic(i) = 0. _d 0 |
941 |
|
|
enddo |
942 |
heimbach |
1.33 |
#endif |
943 |
|
|
|
944 |
|
|
c---------------------------------------------------------------------- |
945 |
|
|
c---------------------------------------------------------------------- |
946 |
|
|
|
947 |
heimbach |
1.21 |
do bj = jtlo,jthi |
948 |
mlosch |
1.36 |
do bi = itlo,ithi |
949 |
|
|
do j = jmin,jmax |
950 |
|
|
do i = imin,imax |
951 |
|
|
wareaunit (i,j,bi,bj) = 1.0 |
952 |
heimbach |
1.21 |
#ifndef ALLOW_ECCO |
953 |
mlosch |
1.36 |
whflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
954 |
|
|
wsflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
955 |
|
|
wtauu (i,j,bi,bj) = maskW(i,j,1,bi,bj) |
956 |
|
|
wtauv (i,j,bi,bj) = maskS(i,j,1,bi,bj) |
957 |
|
|
watemp (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
958 |
|
|
waqh (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
959 |
|
|
wprecip (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
960 |
|
|
wswflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
961 |
|
|
wswdown (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
962 |
|
|
wuwind (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
963 |
|
|
wvwind (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
964 |
|
|
wlwflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
965 |
|
|
wlwdown (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
966 |
|
|
wevap (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
967 |
|
|
wsnowprecip(i,j,bi,bj) = maskC(i,j,1,bi,bj) |
968 |
|
|
wapressure(i,j,bi,bj) = maskC(i,j,1,bi,bj) |
969 |
|
|
wrunoff (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
970 |
|
|
wsst (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
971 |
|
|
wsss (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
972 |
heimbach |
1.21 |
#endif |
973 |
mlosch |
1.36 |
enddo |
974 |
heimbach |
1.21 |
enddo |
975 |
mlosch |
1.36 |
enddo |
976 |
heimbach |
1.21 |
enddo |
977 |
jmc |
1.40 |
|
978 |
gforget |
1.55 |
_BARRIER |
979 |
|
|
|
980 |
|
|
c-- Summarize the cost function setup. |
981 |
|
|
_BEGIN_MASTER( myThid ) |
982 |
|
|
call ctrl_summary( myThid ) |
983 |
|
|
_END_MASTER( myThid ) |
984 |
|
|
|
985 |
heimbach |
1.1 |
return |
986 |
|
|
end |