1 |
C |
2 |
C $Header: /u/gcmpack/MITgcm/pkg/ctrl/ctrl_init.F,v 1.18 2005/07/28 19:51:22 heimbach Exp $ |
3 |
C $Name: $ |
4 |
|
5 |
#include "CTRL_CPPOPTIONS.h" |
6 |
|
7 |
subroutine ctrl_init( mythid ) |
8 |
|
9 |
c ================================================================== |
10 |
c SUBROUTINE ctrl_init |
11 |
c ================================================================== |
12 |
c |
13 |
c o Set parts of the vector of control variables and initialize the |
14 |
c rest to zero. |
15 |
c |
16 |
c The vector of control variables is initialized here. The |
17 |
c temperature and salinity contributions are read from file. |
18 |
c Subsequently, the latter are dimensionalized and the tile |
19 |
c edges are updated. |
20 |
c |
21 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
22 |
c |
23 |
c changed: Christian Eckert eckert@mit.edu 23-Feb-2000 |
24 |
c - Restructured the code in order to create a package |
25 |
c for the MITgcmUV. |
26 |
c |
27 |
c Patrick Heimbach heimbach@mit.edu 30-May-2000 |
28 |
c - diffsec was falsely declared. |
29 |
c |
30 |
c Patrick Heimbach heimbach@mit.edu 06-Jun-2000 |
31 |
c - Transferred some filename declarations |
32 |
c from ctrl_pack/ctrl_unpack to here |
33 |
c - Transferred mask-per-tile to here |
34 |
c - computation of control vector length here |
35 |
c |
36 |
c Patrick Heimbach heimbach@mit.edu 16-Jun-2000 |
37 |
c - Added call to ctrl_pack |
38 |
c - Alternatively: transfer writing of scale files to |
39 |
c ctrl_unpack |
40 |
c |
41 |
c Dimitris Menemenlis menemenlis@mit.edu 7-Mar-2003 |
42 |
c - To be consistent with usage in ctrl_getrec.F, |
43 |
c startrec and endrec need to be referenced to |
44 |
c model time = 0, not to startTime. |
45 |
c Also "- modelstep" -> "+ modelstep/2": |
46 |
c old: startrec = int((modelstart - diffsecs)/ |
47 |
c old: & xx_???period) + 1 |
48 |
c old: endrec = int((modelend - diffsecs - modelstep)/ |
49 |
c old: & xx_???period) + 2 |
50 |
c new: startrec = int((modelstart + startTime - diffsecs)/ |
51 |
c new: & xx_???period) + 1 |
52 |
c new: endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
53 |
c new: & xx_???period) + 2 |
54 |
c |
55 |
c heimbach@mit.edu totally restructured 28-Oct-2003 |
56 |
c |
57 |
c ================================================================== |
58 |
c SUBROUTINE ctrl_init |
59 |
c ================================================================== |
60 |
|
61 |
implicit none |
62 |
|
63 |
c == global variables == |
64 |
|
65 |
#include "EEPARAMS.h" |
66 |
#include "SIZE.h" |
67 |
#include "PARAMS.h" |
68 |
#include "GRID.h" |
69 |
#include "ctrl.h" |
70 |
#include "optim.h" |
71 |
|
72 |
#ifdef ALLOW_CAL |
73 |
# include "cal.h" |
74 |
#endif |
75 |
#ifdef ALLOW_OBCS_CONTROL |
76 |
# include "OBCS.h" |
77 |
#endif |
78 |
|
79 |
c == routine arguments == |
80 |
|
81 |
integer mythid |
82 |
|
83 |
c == local variables == |
84 |
|
85 |
integer ntmp |
86 |
integer ivar |
87 |
|
88 |
integer iobcs |
89 |
integer il |
90 |
integer errio |
91 |
integer startrec |
92 |
integer endrec |
93 |
integer diffrec |
94 |
integer difftime(4) |
95 |
_RL diffsecs |
96 |
|
97 |
character*(max_len_prec) record |
98 |
character*(max_len_mbuf) msgbuf |
99 |
character*2 whichxyz |
100 |
|
101 |
c == external == |
102 |
|
103 |
integer ilnblnk |
104 |
external ilnblnk |
105 |
|
106 |
c == end of interface == |
107 |
|
108 |
c-- Set default values. |
109 |
do ivar = 1,maxcvars |
110 |
ncvarindex(ivar) = -1 |
111 |
ncvarrecs(ivar) = 0 |
112 |
ncvarxmax(ivar) = 0 |
113 |
ncvarymax(ivar) = 0 |
114 |
ncvarnrmax(ivar) = 0 |
115 |
ncvargrd(ivar) = '?' |
116 |
enddo |
117 |
|
118 |
_BARRIER |
119 |
|
120 |
c-- ===================== |
121 |
c-- Initial state fields. |
122 |
c-- ===================== |
123 |
|
124 |
cph( |
125 |
cph index 7-10 reserved for atmos. state, |
126 |
cph index 11-14 reserved for open boundaries, |
127 |
cph index 15-16 reserved for mixing coeff. |
128 |
cph index 17 reserved for passive tracer TR1 |
129 |
cph index 18,19 reserved for sst, sss |
130 |
cph index 20 for hFacC |
131 |
cph index 21-22 for efluxy, efluxp |
132 |
cph index 23 for bottom drag |
133 |
cph index 24 |
134 |
cph index 25-26 for edtaux, edtauy |
135 |
cph index 27-29 for uvel0, vvel0, etan0 |
136 |
cph index 30-31 for relax. SST, SSS |
137 |
cph index 32 reserved for precip (atmos. state) |
138 |
cph index 33 reserved for swflux (atmos. state) |
139 |
cph index 34 reserved for swdown (atmos. state) |
140 |
cph) |
141 |
|
142 |
c---------------------------------------------------------------------- |
143 |
c-- |
144 |
#ifdef ALLOW_THETA0_CONTROL |
145 |
c-- Initial state temperature contribution. |
146 |
call ctrl_init_ctrlvar ( |
147 |
& xx_theta_file, 1, 101, 1, 1, 1, |
148 |
& snx, sny, nr, 'c', '3d', mythid ) |
149 |
#endif /* ALLOW_THETA0_CONTROL */ |
150 |
|
151 |
c---------------------------------------------------------------------- |
152 |
c-- |
153 |
#ifdef ALLOW_SALT0_CONTROL |
154 |
c-- Initial state salinity contribution. |
155 |
call ctrl_init_ctrlvar ( |
156 |
& xx_salt_file, 2, 102, 1, 1, 1, |
157 |
& snx, sny, nr, 'c', '3d', mythid ) |
158 |
#endif /* ALLOW_SALT0_CONTROL */ |
159 |
|
160 |
c-- =========================== |
161 |
c-- Surface flux contributions. |
162 |
c-- =========================== |
163 |
|
164 |
c---------------------------------------------------------------------- |
165 |
c-- |
166 |
#if (defined (ALLOW_HFLUX_CONTROL)) |
167 |
c-- Heat flux. |
168 |
|
169 |
# ifdef ALLOW_CAL |
170 |
call cal_FullDate( xx_hfluxstartdate1, xx_hfluxstartdate2, |
171 |
& xx_hfluxstartdate , mythid ) |
172 |
call cal_TimePassed( xx_hfluxstartdate, modelstartdate, |
173 |
& difftime, mythid ) |
174 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
175 |
startrec = int((modelstart + startTime - diffsecs)/ |
176 |
& xx_hfluxperiod) + 1 |
177 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
178 |
& xx_hfluxperiod) + 2 |
179 |
# else |
180 |
startrec = 1 |
181 |
endrec = 1 |
182 |
# endif |
183 |
diffrec = endrec - startrec + 1 |
184 |
call ctrl_init_ctrlvar ( |
185 |
& xx_hflux_file, 3, 103, diffrec, startrec, endrec, |
186 |
& snx, sny, 1, 'c', 'xy', mythid ) |
187 |
|
188 |
#elif (defined (ALLOW_ATEMP_CONTROL)) |
189 |
c-- Atmos. temperature |
190 |
|
191 |
# ifdef ALLOW_CAL |
192 |
call cal_FullDate( xx_atempstartdate1, xx_atempstartdate2, |
193 |
& xx_atempstartdate , mythid ) |
194 |
call cal_TimePassed( xx_atempstartdate, modelstartdate, |
195 |
& difftime, mythid ) |
196 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
197 |
startrec = int((modelstart + startTime - diffsecs)/ |
198 |
& xx_atempperiod) + 1 |
199 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
200 |
& xx_atempperiod) + 2 |
201 |
# else |
202 |
startrec = 1 |
203 |
endrec = 1 |
204 |
# endif |
205 |
diffrec = endrec - startrec + 1 |
206 |
call ctrl_init_ctrlvar ( |
207 |
& xx_atemp_file, 7, 107, diffrec, startrec, endrec, |
208 |
& snx, sny, 1, 'c', 'xy', mythid ) |
209 |
|
210 |
#elif (defined (ALLOW_HFLUX0_CONTROL)) |
211 |
c-- initial forcing only |
212 |
call ctrl_init_ctrlvar ( |
213 |
& xx_hflux_file, 3, 103, 1, 1, 1, |
214 |
& snx, sny, 1, 'c', 'xy', mythid ) |
215 |
|
216 |
#endif /* ALLOW_HFLUX_CONTROL */ |
217 |
|
218 |
c---------------------------------------------------------------------- |
219 |
c-- |
220 |
#if (defined (ALLOW_SFLUX_CONTROL)) |
221 |
c-- Salt flux. |
222 |
|
223 |
# ifdef ALLOW_CAL |
224 |
call cal_FullDate( xx_sfluxstartdate1, xx_sfluxstartdate2, |
225 |
& xx_sfluxstartdate , mythid ) |
226 |
call cal_TimePassed( xx_sfluxstartdate, modelstartdate, |
227 |
& difftime, mythid ) |
228 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
229 |
startrec = int((modelstart + startTime - diffsecs)/ |
230 |
& xx_sfluxperiod) + 1 |
231 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
232 |
& xx_sfluxperiod) + 2 |
233 |
# else |
234 |
startrec = 1 |
235 |
endrec = 1 |
236 |
# endif |
237 |
diffrec = endrec - startrec + 1 |
238 |
call ctrl_init_ctrlvar ( |
239 |
& xx_sflux_file, 4, 104, diffrec, startrec, endrec, |
240 |
& snx, sny, 1, 'c', 'xy', mythid ) |
241 |
|
242 |
#elif (defined (ALLOW_AQH_CONTROL)) |
243 |
c-- Atmos. humidity |
244 |
|
245 |
# ifdef ALLOW_CAL |
246 |
call cal_FullDate( xx_aqhstartdate1, xx_aqhstartdate2, |
247 |
& xx_aqhstartdate , mythid ) |
248 |
call cal_TimePassed( xx_aqhstartdate, modelstartdate, |
249 |
& difftime, mythid ) |
250 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
251 |
startrec = int((modelstart + startTime - diffsecs)/ |
252 |
& xx_aqhperiod) + 1 |
253 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
254 |
& xx_aqhperiod) + 2 |
255 |
# else |
256 |
startrec = 1 |
257 |
endrec = 1 |
258 |
# endif |
259 |
diffrec = endrec - startrec + 1 |
260 |
call ctrl_init_ctrlvar ( |
261 |
& xx_aqh_file, 8, 108, diffrec, startrec, endrec, |
262 |
& snx, sny, 1, 'c', 'xy', mythid ) |
263 |
|
264 |
#elif (defined (ALLOW_SFLUX0_CONTROL)) |
265 |
c-- initial forcing only |
266 |
call ctrl_init_ctrlvar ( |
267 |
& xx_sflux_file, 4, 104, 1, 1, 1, |
268 |
& snx, sny, 1, 'c', 'xy', mythid ) |
269 |
|
270 |
#endif /* ALLOW_SFLUX_CONTROL */ |
271 |
|
272 |
c---------------------------------------------------------------------- |
273 |
c-- |
274 |
#if (defined (ALLOW_USTRESS_CONTROL)) |
275 |
c-- Zonal wind stress. |
276 |
|
277 |
# ifdef ALLOW_CAL |
278 |
call cal_FullDate( xx_tauustartdate1, xx_tauustartdate2, |
279 |
& xx_tauustartdate, mythid ) |
280 |
call cal_TimePassed( xx_tauustartdate, modelstartdate, |
281 |
& difftime, mythid ) |
282 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
283 |
startrec = int((modelstart + startTime - diffsecs)/ |
284 |
& xx_tauuperiod) + 1 |
285 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
286 |
& xx_tauuperiod) + 2 |
287 |
# else |
288 |
startrec = 1 |
289 |
endrec = 1 |
290 |
# endif |
291 |
diffrec = endrec - startrec + 1 |
292 |
call ctrl_init_ctrlvar ( |
293 |
& xx_tauu_file, 5, 105, diffrec, startrec, endrec, |
294 |
& snx, sny, 1, 'w', 'xy', mythid ) |
295 |
|
296 |
#elif (defined (ALLOW_UWIND_CONTROL)) |
297 |
c-- Zonal wind speed. |
298 |
|
299 |
# ifdef ALLOW_CAL |
300 |
call cal_FullDate( xx_uwindstartdate1, xx_uwindstartdate2, |
301 |
& xx_uwindstartdate , mythid ) |
302 |
call cal_TimePassed( xx_uwindstartdate, modelstartdate, |
303 |
& difftime, mythid ) |
304 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
305 |
startrec = int((modelstart + startTime - diffsecs)/ |
306 |
& xx_uwindperiod) + 1 |
307 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
308 |
& xx_uwindperiod) + 2 |
309 |
# else |
310 |
startrec = 1 |
311 |
endrec = 1 |
312 |
# endif |
313 |
diffrec = endrec - startrec + 1 |
314 |
call ctrl_init_ctrlvar ( |
315 |
& xx_uwind_file, 9, 109, diffrec, startrec, endrec, |
316 |
& snx, sny, 1, 'c', 'xy', mythid ) |
317 |
|
318 |
#elif (defined (ALLOW_TAUU0_CONTROL)) |
319 |
c-- initial forcing only |
320 |
call ctrl_init_ctrlvar ( |
321 |
& xx_tauu_file, 5, 105, 1, 1, 1, |
322 |
& snx, sny, 1, 'w', 'xy', mythid ) |
323 |
|
324 |
#endif /* ALLOW_USTRESS_CONTROL */ |
325 |
|
326 |
c---------------------------------------------------------------------- |
327 |
c-- |
328 |
#if (defined (ALLOW_VSTRESS_CONTROL)) |
329 |
c-- Meridional wind stress. |
330 |
|
331 |
# ifdef ALLOW_CAL |
332 |
call cal_FullDate( xx_tauvstartdate1, xx_tauvstartdate2, |
333 |
& xx_tauvstartdate, mythid ) |
334 |
call cal_TimePassed( xx_tauvstartdate, modelstartdate, |
335 |
& difftime, mythid ) |
336 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
337 |
startrec = int((modelstart + startTime - diffsecs)/ |
338 |
& xx_tauvperiod) + 1 |
339 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
340 |
& xx_tauvperiod) + 2 |
341 |
# else |
342 |
startrec = 1 |
343 |
endrec = 1 |
344 |
# endif |
345 |
diffrec = endrec - startrec + 1 |
346 |
call ctrl_init_ctrlvar ( |
347 |
& xx_tauv_file, 6, 106, diffrec, startrec, endrec, |
348 |
& snx, sny, 1, 's', 'xy', mythid ) |
349 |
|
350 |
#elif (defined (ALLOW_VWIND_CONTROL)) |
351 |
c-- Meridional wind speed. |
352 |
|
353 |
# ifdef ALLOW_CAL |
354 |
call cal_FullDate( xx_vwindstartdate1, xx_vwindstartdate2, |
355 |
& xx_vwindstartdate , mythid ) |
356 |
call cal_TimePassed( xx_vwindstartdate, modelstartdate, |
357 |
& difftime, mythid ) |
358 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
359 |
startrec = int((modelstart + startTime - diffsecs)/ |
360 |
& xx_vwindperiod) + 1 |
361 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
362 |
& xx_vwindperiod) + 2 |
363 |
# else |
364 |
startrec = 1 |
365 |
endrec = 1 |
366 |
# endif |
367 |
diffrec = endrec - startrec + 1 |
368 |
call ctrl_init_ctrlvar ( |
369 |
& xx_vwind_file, 10, 110, diffrec, startrec, endrec, |
370 |
& snx, sny, 1, 'c', 'xy', mythid ) |
371 |
|
372 |
#elif (defined (ALLOW_TAUV0_CONTROL)) |
373 |
c-- initial forcing only |
374 |
diffrec = endrec - startrec + 1 |
375 |
call ctrl_init_ctrlvar ( |
376 |
& xx_tauv_file, 6, 106, 1, 1, 1, |
377 |
& snx, sny, 1, 's', 'xy', mythid ) |
378 |
|
379 |
#endif /* ALLOW_VSTRESS_CONTROL */ |
380 |
|
381 |
c-- =========================== |
382 |
c-- Open boundary contributions. |
383 |
c-- =========================== |
384 |
|
385 |
c---------------------------------------------------------------------- |
386 |
c-- |
387 |
#ifdef ALLOW_OBCSN_CONTROL |
388 |
c-- Northern obc. |
389 |
|
390 |
# ifdef ALLOW_CAL |
391 |
call cal_FullDate( xx_obcsnstartdate1, xx_obcsnstartdate2, |
392 |
& xx_obcsnstartdate, mythid ) |
393 |
call cal_TimePassed( xx_obcsnstartdate, modelstartdate, |
394 |
& difftime, mythid ) |
395 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
396 |
startrec = int((modelstart - diffsecs)/xx_obcsnperiod) + 1 |
397 |
startrec = (startrec - 1)*nobcs + 1 |
398 |
endrec = int((modelend - diffsecs)/xx_obcsnperiod) + 2 |
399 |
endrec = (endrec - startrec + 1)*nobcs |
400 |
# else |
401 |
startrec = 1 |
402 |
endrec = 1 |
403 |
# endif |
404 |
diffrec = endrec |
405 |
call ctrl_init_ctrlvar ( |
406 |
& xx_obcsn_file, 11, 111, diffrec, startrec, endrec, |
407 |
& snx, sny, nr, 'm', 'xz', mythid ) |
408 |
|
409 |
#endif /* ALLOW_OBCSN_CONTROL */ |
410 |
|
411 |
c---------------------------------------------------------------------- |
412 |
c-- |
413 |
#ifdef ALLOW_OBCSS_CONTROL |
414 |
c-- Southern obc. |
415 |
|
416 |
# ifdef ALLOW_CAL |
417 |
call cal_FullDate( xx_obcssstartdate1, xx_obcssstartdate2, |
418 |
& xx_obcssstartdate, mythid ) |
419 |
call cal_TimePassed( xx_obcssstartdate, modelstartdate, |
420 |
& difftime, mythid ) |
421 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
422 |
startrec = int((modelstart - diffsecs)/xx_obcssperiod) + 1 |
423 |
startrec = (startrec - 1)*nobcs + 1 |
424 |
endrec = int((modelend - diffsecs)/xx_obcssperiod) + 2 |
425 |
endrec = (endrec - startrec + 1)*nobcs |
426 |
# else |
427 |
startrec = 1 |
428 |
endrec = 1 |
429 |
# endif |
430 |
diffrec = endrec |
431 |
call ctrl_init_ctrlvar ( |
432 |
& xx_obcss_file, 12, 112, diffrec, startrec, endrec, |
433 |
& snx, sny, nr, 'm', 'xz', mythid ) |
434 |
|
435 |
#endif /* ALLOW_OBCSS_CONTROL */ |
436 |
|
437 |
c---------------------------------------------------------------------- |
438 |
c-- |
439 |
#ifdef ALLOW_OBCSW_CONTROL |
440 |
c-- Western obc. |
441 |
|
442 |
# ifdef ALLOW_CAL |
443 |
call cal_FullDate( xx_obcswstartdate1, xx_obcswstartdate2, |
444 |
& xx_obcswstartdate, mythid ) |
445 |
call cal_TimePassed( xx_obcswstartdate, modelstartdate, |
446 |
& difftime, mythid ) |
447 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
448 |
startrec = int((modelstart - diffsecs)/xx_obcswperiod) + 1 |
449 |
startrec = (startrec - 1)*nobcs + 1 |
450 |
endrec = int((modelend - diffsecs)/xx_obcswperiod) + 2 |
451 |
endrec = (endrec - startrec + 1)*nobcs |
452 |
# else |
453 |
startrec = 1 |
454 |
endrec = 1 |
455 |
# endif |
456 |
diffrec = endrec |
457 |
call ctrl_init_ctrlvar ( |
458 |
& xx_obcsw_file, 13, 113, diffrec, startrec, endrec, |
459 |
& snx, sny, nr, 'm', 'yz', mythid ) |
460 |
|
461 |
#endif /* ALLOW_OBCSW_CONTROL */ |
462 |
|
463 |
c---------------------------------------------------------------------- |
464 |
c-- |
465 |
#ifdef ALLOW_OBCSE_CONTROL |
466 |
c-- Eastern obc. |
467 |
|
468 |
# ifdef ALLOW_CAL |
469 |
call cal_FullDate( xx_obcsestartdate1, xx_obcsestartdate2, |
470 |
& xx_obcsestartdate, mythid ) |
471 |
call cal_TimePassed( xx_obcsestartdate, modelstartdate, |
472 |
& difftime, mythid ) |
473 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
474 |
startrec = int((modelstart - diffsecs)/xx_obcseperiod) + 1 |
475 |
startrec = (startrec - 1)*nobcs + 1 |
476 |
endrec = int((modelend - diffsecs)/xx_obcseperiod) + 2 |
477 |
endrec = (endrec - startrec + 1)*nobcs |
478 |
# else |
479 |
startrec = 1 |
480 |
endrec = 1 |
481 |
# endif |
482 |
diffrec = endrec |
483 |
call ctrl_init_ctrlvar ( |
484 |
& xx_obcse_file, 14, 114, diffrec, startrec, endrec, |
485 |
& snx, sny, nr, 'm', 'yz', mythid ) |
486 |
|
487 |
#endif /* ALLOW_OBCSE_CONTROL */ |
488 |
|
489 |
c---------------------------------------------------------------------- |
490 |
c-- |
491 |
#ifdef ALLOW_DIFFKR_CONTROL |
492 |
call ctrl_init_ctrlvar ( |
493 |
& xx_diffkr_file, 15, 115, 1, 1, 1, |
494 |
& snx, sny, nr, 'c', '3d', mythid ) |
495 |
#endif /* ALLOW_DIFFKR_CONTROL */ |
496 |
|
497 |
c---------------------------------------------------------------------- |
498 |
c-- |
499 |
#ifdef ALLOW_KAPGM_CONTROL |
500 |
call ctrl_init_ctrlvar ( |
501 |
& xx_kapgm_file, 16, 116, 1, 1, 1, |
502 |
& snx, sny, nr, 'c', '3d', mythid ) |
503 |
#endif /* ALLOW_KAPGM_CONTROL */ |
504 |
|
505 |
c---------------------------------------------------------------------- |
506 |
c-- |
507 |
#ifdef ALLOW_TR10_CONTROL |
508 |
call ctrl_init_ctrlvar ( |
509 |
& xx_tr1_file, 17, 117, 1, 1, 1, |
510 |
& snx, sny, nr, 'c', '3d', mythid ) |
511 |
#endif /* ALLOW_TR10_CONTROL */ |
512 |
|
513 |
c---------------------------------------------------------------------- |
514 |
c-- |
515 |
#ifdef ALLOW_SST0_CONTROL |
516 |
call ctrl_init_ctrlvar ( |
517 |
& xx_sst_file, 18, 118, 1, 1, 1, |
518 |
& snx, sny, 1, 'c', 'xy', mythid ) |
519 |
#endif /* ALLOW_SST0_CONTROL */ |
520 |
|
521 |
c---------------------------------------------------------------------- |
522 |
c-- |
523 |
#ifdef ALLOW_SSS0_CONTROL |
524 |
call ctrl_init_ctrlvar ( |
525 |
& xx_sss_file, 19, 119, 1, 1, 1, |
526 |
& snx, sny, 1, 'c', 'xy', mythid ) |
527 |
#endif /* ALLOW_SSS0_CONTROL */ |
528 |
|
529 |
c---------------------------------------------------------------------- |
530 |
c-- |
531 |
#ifdef ALLOW_HFACC_CONTROL |
532 |
# ifdef ALLOW_HFACC3D_CONTROL |
533 |
call ctrl_init_ctrlvar ( |
534 |
& xx_hfacc_file, 20, 120, 1, 1, 1, |
535 |
& snx, sny, nr, 'c', '3d', mythid ) |
536 |
# else |
537 |
call ctrl_init_ctrlvar ( |
538 |
& xx_hfacc_file, 20, 120, 1, 1, 1, |
539 |
& snx, sny, 1, 'c', 'xy', mythid ) |
540 |
# endif /*ALLOW_HFACC3D_CONTROL*/ |
541 |
#endif /* ALLOW_HFACC_CONTROL */ |
542 |
|
543 |
c---------------------------------------------------------------------- |
544 |
c-- |
545 |
#ifdef ALLOW_EFLUXY0_CONTROL |
546 |
call ctrl_init_ctrlvar ( |
547 |
& xx_efluxy_file, 21, 121, 1, 1, 1, |
548 |
& snx, sny, nr, 's', '3d', mythid ) |
549 |
#endif /* ALLOW_EFLUXY0_CONTROL */ |
550 |
|
551 |
c---------------------------------------------------------------------- |
552 |
c-- |
553 |
#ifdef ALLOW_EFLUXP0_CONTROL |
554 |
call ctrl_init_ctrlvar ( |
555 |
& xx_efluxp_file, 22, 122, 1, 1, 1, |
556 |
& snx, sny, nr, 'v', '3d', mythid ) |
557 |
#endif /* ALLOW_EFLUXP0_CONTROL */ |
558 |
|
559 |
c---------------------------------------------------------------------- |
560 |
c-- |
561 |
#ifdef ALLOW_BOTTOMDRAG_CONTROL |
562 |
call ctrl_init_ctrlvar ( |
563 |
& xx_bottomdrag_file, 23, 123, 1, 1, 1, |
564 |
& snx, sny, 1, 'c', 'xy', mythid ) |
565 |
#endif /* ALLOW_BOTTOMDRAG_CONTROL */ |
566 |
|
567 |
c---------------------------------------------------------------------- |
568 |
c-- |
569 |
#ifdef ALLOW_EDTAUX_CONTROL |
570 |
call ctrl_init_ctrlvar ( |
571 |
& xx_edtaux_file, 25, 125, 1, 1, 1, |
572 |
& snx, sny, nr, 'w', '3d', mythid ) |
573 |
#endif /* ALLOW_EDTAUX_CONTROL */ |
574 |
|
575 |
c---------------------------------------------------------------------- |
576 |
c-- |
577 |
#ifdef ALLOW_EDTAUY_CONTROL |
578 |
call ctrl_init_ctrlvar ( |
579 |
& xx_edtauy_file, 26, 126, 1, 1, 1, |
580 |
& snx, sny, nr, 's', '3d', mythid ) |
581 |
#endif /* ALLOW_EDTAUY_CONTROL */ |
582 |
|
583 |
c---------------------------------------------------------------------- |
584 |
c-- |
585 |
#ifdef ALLOW_UVEL0_CONTROL |
586 |
call ctrl_init_ctrlvar ( |
587 |
& xx_uvel_file, 27, 127, 1, 1, 1, |
588 |
& snx, sny, nr, 'w', '3d', mythid ) |
589 |
#endif /* ALLOW_UVEL0_CONTROL */ |
590 |
|
591 |
c---------------------------------------------------------------------- |
592 |
c-- |
593 |
#ifdef ALLOW_VVEL0_CONTROL |
594 |
call ctrl_init_ctrlvar ( |
595 |
& xx_vvel_file, 28, 128, 1, 1, 1, |
596 |
& snx, sny, nr, 's', '3d', mythid ) |
597 |
#endif /* ALLOW_VVEL0_CONTROL */ |
598 |
|
599 |
c---------------------------------------------------------------------- |
600 |
c-- |
601 |
#ifdef ALLOW_ETAN0_CONTROL |
602 |
call ctrl_init_ctrlvar ( |
603 |
& xx_etan_file, 29, 129, 1, 1, 1, |
604 |
& snx, sny, 1, 'c', 'xy', mythid ) |
605 |
#endif /* ALLOW_VVEL0_CONTROL */ |
606 |
|
607 |
c---------------------------------------------------------------------- |
608 |
c-- |
609 |
#ifdef ALLOW_RELAXSST_CONTROL |
610 |
call ctrl_init_ctrlvar ( |
611 |
& xx_relaxsst_file, 30, 130, 1, 1, 1, |
612 |
& snx, sny, 1, 'c', 'xy', mythid ) |
613 |
#endif /* ALLOW_RELAXSST_CONTROL */ |
614 |
|
615 |
c---------------------------------------------------------------------- |
616 |
c-- |
617 |
#ifdef ALLOW_RELAXSSS_CONTROL |
618 |
call ctrl_init_ctrlvar ( |
619 |
& xx_relaxsss_file, 31, 131, 1, 1, 1, |
620 |
& snx, sny, 1, 'c', 'xy', mythid ) |
621 |
#endif /* ALLOW_RELAXSSS_CONTROL */ |
622 |
|
623 |
c---------------------------------------------------------------------- |
624 |
c-- |
625 |
#ifdef ALLOW_PRECIP_CONTROL |
626 |
c-- Atmos. precipitation |
627 |
|
628 |
# ifdef ALLOW_CAL |
629 |
call cal_FullDate( xx_precipstartdate1, xx_precipstartdate2, |
630 |
& xx_precipstartdate , mythid ) |
631 |
call cal_TimePassed( xx_precipstartdate, modelstartdate, |
632 |
& difftime, mythid ) |
633 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
634 |
startrec = int((modelstart + startTime - diffsecs)/ |
635 |
& xx_precipperiod) + 1 |
636 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
637 |
& xx_precipperiod) + 2 |
638 |
# else |
639 |
startrec = 1 |
640 |
endrec = 1 |
641 |
# endif |
642 |
diffrec = endrec - startrec + 1 |
643 |
call ctrl_init_ctrlvar ( |
644 |
& xx_precip_file, 32, 132, diffrec, startrec, endrec, |
645 |
& snx, sny, 1, 'c', 'xy', mythid ) |
646 |
|
647 |
#endif /* ALLOW_PRECIP_CONTROL */ |
648 |
|
649 |
c---------------------------------------------------------------------- |
650 |
c-- |
651 |
#ifdef ALLOW_SWFLUX_CONTROL |
652 |
c-- Atmos. swflux |
653 |
|
654 |
# ifdef ALLOW_CAL |
655 |
call cal_FullDate( xx_swfluxstartdate1, xx_swfluxstartdate2, |
656 |
& xx_swfluxstartdate , mythid ) |
657 |
call cal_TimePassed( xx_swfluxstartdate, modelstartdate, |
658 |
& difftime, mythid ) |
659 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
660 |
startrec = int((modelstart + startTime - diffsecs)/ |
661 |
& xx_swfluxperiod) + 1 |
662 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
663 |
& xx_swfluxperiod) + 2 |
664 |
# else |
665 |
startrec = 1 |
666 |
endrec = 1 |
667 |
# endif |
668 |
diffrec = endrec - startrec + 1 |
669 |
call ctrl_init_ctrlvar ( |
670 |
& xx_swflux_file, 33, 133, diffrec, startrec, endrec, |
671 |
& snx, sny, 1, 'c', 'xy', mythid ) |
672 |
|
673 |
#endif /* ALLOW_SWFLUX_CONTROL */ |
674 |
|
675 |
c---------------------------------------------------------------------- |
676 |
c-- |
677 |
#ifdef ALLOW_SWDOWN_CONTROL |
678 |
c-- Atmos. swdown |
679 |
|
680 |
# ifdef ALLOW_CAL |
681 |
call cal_FullDate( xx_swdownstartdate1, xx_swdownstartdate2, |
682 |
& xx_swdownstartdate , mythid ) |
683 |
call cal_TimePassed( xx_swdownstartdate, modelstartdate, |
684 |
& difftime, mythid ) |
685 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
686 |
startrec = int((modelstart + startTime - diffsecs)/ |
687 |
& xx_swdownperiod) + 1 |
688 |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
689 |
& xx_swdownperiod) + 2 |
690 |
# else |
691 |
startrec = 1 |
692 |
endrec = 1 |
693 |
# endif |
694 |
diffrec = endrec - startrec + 1 |
695 |
call ctrl_init_ctrlvar ( |
696 |
& xx_swdown_file, 34, 134, diffrec, startrec, endrec, |
697 |
& snx, sny, 1, 'c', 'xy', mythid ) |
698 |
|
699 |
#endif /* ALLOW_SWDOWN_CONTROL */ |
700 |
|
701 |
c---------------------------------------------------------------------- |
702 |
c---------------------------------------------------------------------- |
703 |
c---------------------------------------------------------------------- |
704 |
|
705 |
call ctrl_init_wet( mythid ) |
706 |
|
707 |
return |
708 |
end |
709 |
|