/[MITgcm]/MITgcm/pkg/ctrl/ctrl_init.F
ViewVC logotype

Annotation of /MITgcm/pkg/ctrl/ctrl_init.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.68 - (hide annotations) (download)
Thu Oct 29 17:03:38 2015 UTC (8 years, 7 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65r, checkpoint65q
Changes since 1.67: +1 -5 lines
- finish deprecating ctrlSmoothCorrel2d/3d

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

  ViewVC Help
Powered by ViewVC 1.1.22