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