86 |
c == local variables == |
c == local variables == |
87 |
|
|
88 |
integer bi,bj |
integer bi,bj |
89 |
integer i,j,k |
integer i,j |
90 |
integer itlo,ithi |
integer itlo,ithi |
91 |
integer jtlo,jthi |
integer jtlo,jthi |
92 |
integer jmin,jmax |
integer jmin,jmax |
93 |
integer imin,imax |
integer imin,imax |
94 |
|
|
|
integer ntmp |
|
95 |
integer ivar |
integer ivar |
|
integer iobcs |
|
|
integer il |
|
|
integer errio |
|
96 |
integer startrec |
integer startrec |
97 |
integer endrec |
integer endrec |
98 |
integer diffrec |
integer diffrec |
|
integer difftime(4) |
|
|
_RL diffsecs |
|
|
|
|
|
character*(max_len_prec) record |
|
|
character*(max_len_mbuf) msgbuf |
|
|
character*2 whichxyz |
|
99 |
|
|
100 |
c == external == |
c == external == |
101 |
|
|
115 |
|
|
116 |
c-- Set default values. |
c-- Set default values. |
117 |
do ivar = 1,maxcvars |
do ivar = 1,maxcvars |
118 |
ncvarindex(ivar) = -1 |
ncvarindex(ivar) = -1 |
119 |
ncvarrecs(ivar) = 0 |
ncvarrecs(ivar) = 0 |
120 |
ncvarxmax(ivar) = 0 |
ncvarxmax(ivar) = 0 |
121 |
ncvarymax(ivar) = 0 |
ncvarymax(ivar) = 0 |
122 |
ncvarnrmax(ivar) = 0 |
ncvarnrmax(ivar) = 0 |
123 |
ncvargrd(ivar) = '?' |
ncvargrd(ivar) = '?' |
124 |
enddo |
enddo |
125 |
|
|
126 |
_BARRIER |
_BARRIER |
182 |
c-- |
c-- |
183 |
#if (defined (ALLOW_HFLUX_CONTROL)) |
#if (defined (ALLOW_HFLUX_CONTROL)) |
184 |
c-- Heat flux. |
c-- Heat flux. |
185 |
|
call ctrl_init_rec ( |
186 |
# ifdef ALLOW_CAL |
I xx_hfluxstartdate1, xx_hfluxstartdate2, xx_hfluxperiod, 1, |
187 |
call cal_FullDate( xx_hfluxstartdate1, xx_hfluxstartdate2, |
O xx_hfluxstartdate, diffrec, startrec, endrec, |
188 |
& xx_hfluxstartdate , mythid ) |
I mythid ) |
189 |
call cal_TimePassed( xx_hfluxstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
190 |
& difftime, mythid ) |
& xx_hflux_file, 3, 103, diffrec, startrec, endrec, |
191 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_hfluxperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_hfluxperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_hfluxperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_hflux_file, 3, 103, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
192 |
|
|
193 |
#elif (defined (ALLOW_ATEMP_CONTROL)) |
#elif (defined (ALLOW_ATEMP_CONTROL)) |
194 |
c-- Atmos. temperature |
c-- Atmos. temperature |
195 |
|
call ctrl_init_rec ( |
196 |
# ifdef ALLOW_CAL |
I xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod, 1, |
197 |
call cal_FullDate( xx_atempstartdate1, xx_atempstartdate2, |
O xx_atempstartdate, diffrec, startrec, endrec, |
198 |
& xx_atempstartdate , mythid ) |
I mythid ) |
199 |
call cal_TimePassed( xx_atempstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
200 |
& difftime, mythid ) |
& xx_atemp_file, 7, 107, diffrec, startrec, endrec, |
201 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
202 |
if ( xx_atempperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_atempperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_atempperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_atemp_file, 7, 107, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
|
|
|
203 |
#elif (defined (ALLOW_HFLUX0_CONTROL)) |
#elif (defined (ALLOW_HFLUX0_CONTROL)) |
204 |
c-- initial forcing only |
c-- initial forcing only |
205 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
206 |
& xx_hflux_file, 3, 103, 1, 1, 1, |
& xx_hflux_file, 3, 103, 1, 1, 1, |
207 |
& snx, sny, 1, 'c', 'xy', mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
208 |
|
|
209 |
#endif /* ALLOW_HFLUX_CONTROL */ |
#endif /* ALLOW_HFLUX_CONTROL */ |
210 |
|
|
212 |
c-- |
c-- |
213 |
#if (defined (ALLOW_SFLUX_CONTROL)) |
#if (defined (ALLOW_SFLUX_CONTROL)) |
214 |
c-- Salt flux. |
c-- Salt flux. |
215 |
|
call ctrl_init_rec ( |
216 |
# ifdef ALLOW_CAL |
I xx_sfluxstartdate1, xx_sfluxstartdate2, xx_sfluxperiod, 1, |
217 |
call cal_FullDate( xx_sfluxstartdate1, xx_sfluxstartdate2, |
O xx_sfluxstartdate, diffrec, startrec, endrec, |
218 |
& xx_sfluxstartdate , mythid ) |
I mythid ) |
219 |
call cal_TimePassed( xx_sfluxstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
220 |
& difftime, mythid ) |
& xx_sflux_file, 4, 104, diffrec, startrec, endrec, |
221 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_sfluxperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_sfluxperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_sfluxperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_sflux_file, 4, 104, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
222 |
|
|
223 |
#elif (defined (ALLOW_AQH_CONTROL)) |
#elif (defined (ALLOW_AQH_CONTROL)) |
224 |
c-- Atmos. humidity |
c-- Atmos. humidity |
225 |
|
call ctrl_init_rec ( |
226 |
# ifdef ALLOW_CAL |
I xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod, 1, |
227 |
call cal_FullDate( xx_aqhstartdate1, xx_aqhstartdate2, |
O xx_aqhstartdate, diffrec, startrec, endrec, |
228 |
& xx_aqhstartdate , mythid ) |
I mythid ) |
229 |
call cal_TimePassed( xx_aqhstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
230 |
& difftime, mythid ) |
& xx_aqh_file, 8, 108, diffrec, startrec, endrec, |
231 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_aqhperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_aqhperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_aqhperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_aqh_file, 8, 108, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
232 |
|
|
233 |
#elif (defined (ALLOW_SFLUX0_CONTROL)) |
#elif (defined (ALLOW_SFLUX0_CONTROL)) |
234 |
c-- initial forcing only |
c-- initial forcing only |
235 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
236 |
& xx_sflux_file, 4, 104, 1, 1, 1, |
& xx_sflux_file, 4, 104, 1, 1, 1, |
237 |
& snx, sny, 1, 'c', 'xy', mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
238 |
|
|
239 |
#endif /* ALLOW_SFLUX_CONTROL */ |
#endif /* ALLOW_SFLUX_CONTROL */ |
240 |
|
|
242 |
c-- |
c-- |
243 |
#if (defined (ALLOW_USTRESS_CONTROL)) |
#if (defined (ALLOW_USTRESS_CONTROL)) |
244 |
c-- Zonal wind stress. |
c-- Zonal wind stress. |
245 |
|
call ctrl_init_rec ( |
246 |
# ifdef ALLOW_CAL |
I xx_tauustartdate1, xx_tauustartdate2, xx_tauuperiod, 1, |
247 |
call cal_FullDate( xx_tauustartdate1, xx_tauustartdate2, |
O xx_tauustartdate, diffrec, startrec, endrec, |
248 |
& xx_tauustartdate, mythid ) |
I mythid ) |
249 |
call cal_TimePassed( xx_tauustartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
250 |
& difftime, mythid ) |
& xx_tauu_file, 5, 105, diffrec, startrec, endrec, |
|
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
|
|
if ( xx_tauuperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_tauuperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_tauuperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_tauu_file, 5, 105, diffrec, startrec, endrec, |
|
251 |
#ifndef ALLOW_ROTATE_UV_CONTROLS |
#ifndef ALLOW_ROTATE_UV_CONTROLS |
252 |
& snx, sny, 1, 'w', 'xy', mythid ) |
& snx, sny, 1, 'w', 'xy', mythid ) |
253 |
#else |
#else |
254 |
& snx, sny, 1, 'c', 'xy', mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
255 |
#endif |
#endif |
256 |
|
|
257 |
#elif (defined (ALLOW_UWIND_CONTROL)) |
#elif (defined (ALLOW_UWIND_CONTROL)) |
258 |
c-- Zonal wind speed. |
c-- Zonal wind speed. |
259 |
|
call ctrl_init_rec ( |
260 |
# ifdef ALLOW_CAL |
I xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod, 1, |
261 |
call cal_FullDate( xx_uwindstartdate1, xx_uwindstartdate2, |
O xx_uwindstartdate, diffrec, startrec, endrec, |
262 |
& xx_uwindstartdate , mythid ) |
I mythid ) |
263 |
call cal_TimePassed( xx_uwindstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
264 |
& difftime, mythid ) |
& xx_uwind_file, 9, 109, diffrec, startrec, endrec, |
265 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_uwindperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_uwindperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_uwindperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_uwind_file, 9, 109, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
266 |
|
|
267 |
#elif (defined (ALLOW_TAUU0_CONTROL)) |
#elif (defined (ALLOW_TAUU0_CONTROL)) |
268 |
c-- initial forcing only |
c-- initial forcing only |
269 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
270 |
& xx_tauu_file, 5, 105, 1, 1, 1, |
& xx_tauu_file, 5, 105, 1, 1, 1, |
271 |
& snx, sny, 1, 'w', 'xy', mythid ) |
& snx, sny, 1, 'w', 'xy', mythid ) |
272 |
|
|
273 |
#endif /* ALLOW_USTRESS_CONTROL */ |
#endif /* ALLOW_USTRESS_CONTROL */ |
274 |
|
|
276 |
c-- |
c-- |
277 |
#if (defined (ALLOW_VSTRESS_CONTROL)) |
#if (defined (ALLOW_VSTRESS_CONTROL)) |
278 |
c-- Meridional wind stress. |
c-- Meridional wind stress. |
279 |
|
call ctrl_init_rec ( |
280 |
# ifdef ALLOW_CAL |
I xx_tauvstartdate1, xx_tauvstartdate2, xx_tauvperiod, 1, |
281 |
call cal_FullDate( xx_tauvstartdate1, xx_tauvstartdate2, |
O xx_tauvstartdate, diffrec, startrec, endrec, |
282 |
& xx_tauvstartdate, mythid ) |
I mythid ) |
283 |
call cal_TimePassed( xx_tauvstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
284 |
& difftime, mythid ) |
& xx_tauv_file, 6, 106, diffrec, startrec, endrec, |
|
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
|
|
if ( xx_tauvperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_tauvperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_tauvperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_tauv_file, 6, 106, diffrec, startrec, endrec, |
|
285 |
#ifndef ALLOW_ROTATE_UV_CONTROLS |
#ifndef ALLOW_ROTATE_UV_CONTROLS |
286 |
& snx, sny, 1, 's', 'xy', mythid ) |
& snx, sny, 1, 's', 'xy', mythid ) |
287 |
#else |
#else |
288 |
& snx, sny, 1, 'c', 'xy', mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
289 |
#endif |
#endif |
290 |
|
|
291 |
#elif (defined (ALLOW_VWIND_CONTROL)) |
#elif (defined (ALLOW_VWIND_CONTROL)) |
292 |
c-- Meridional wind speed. |
c-- Meridional wind speed. |
293 |
|
call ctrl_init_rec ( |
294 |
# ifdef ALLOW_CAL |
I xx_vwindstartdate1, xx_vwindstartdate2, xx_vwindperiod, 1, |
295 |
call cal_FullDate( xx_vwindstartdate1, xx_vwindstartdate2, |
O xx_vwindstartdate, diffrec, startrec, endrec, |
296 |
& xx_vwindstartdate , mythid ) |
I mythid ) |
297 |
call cal_TimePassed( xx_vwindstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
298 |
& difftime, mythid ) |
& xx_vwind_file, 10, 110, diffrec, startrec, endrec, |
299 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_vwindperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_vwindperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_vwindperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_vwind_file, 10, 110, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
300 |
|
|
301 |
#elif (defined (ALLOW_TAUV0_CONTROL)) |
#elif (defined (ALLOW_TAUV0_CONTROL)) |
302 |
c-- initial forcing only |
c-- initial forcing only |
303 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
304 |
& xx_tauv_file, 6, 106, 1, 1, 1, |
& xx_tauv_file, 6, 106, 1, 1, 1, |
305 |
& snx, sny, 1, 's', 'xy', mythid ) |
& snx, sny, 1, 's', 'xy', mythid ) |
306 |
|
|
307 |
#endif /* ALLOW_VSTRESS_CONTROL */ |
#endif /* ALLOW_VSTRESS_CONTROL */ |
308 |
|
|
314 |
c-- |
c-- |
315 |
#ifdef ALLOW_OBCSN_CONTROL |
#ifdef ALLOW_OBCSN_CONTROL |
316 |
c-- Northern obc. |
c-- Northern obc. |
317 |
|
call ctrl_init_rec ( |
318 |
# ifdef ALLOW_CAL |
I xx_obcsnstartdate1, xx_obcsnstartdate2, xx_obcsnperiod, 4, |
319 |
call cal_FullDate( xx_obcsnstartdate1, xx_obcsnstartdate2, |
O xx_obcsnstartdate, diffrec, startrec, endrec, |
320 |
& xx_obcsnstartdate, mythid ) |
I mythid ) |
321 |
call cal_TimePassed( xx_obcsnstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
322 |
& difftime, mythid ) |
& xx_obcsn_file, 11, 111, diffrec, startrec, endrec, |
323 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, 1, nr, 'm', 'xz', mythid ) |
|
if ( xx_obcsnperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = 12*nobcs |
|
|
else |
|
|
startrec = int((modelstart - diffsecs)/xx_obcsnperiod) + 1 |
|
|
startrec = (startrec - 1)*nobcs + 1 |
|
|
endrec = int((modelend - diffsecs)/xx_obcsnperiod) + 2 |
|
|
endrec = (endrec - startrec + 1)*nobcs |
|
|
endif |
|
|
# else |
|
|
if ( xx_obcsnperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = nobcs |
|
|
else |
|
|
startrec = 1 |
|
|
endrec = (int((endTime - startTime)/xx_obcsnperiod) + 1)*nobcs |
|
|
endif |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_obcsn_file, 11, 111, diffrec, startrec, endrec, |
|
|
& snx, 1, nr, 'm', 'xz', mythid ) |
|
|
|
|
324 |
#endif /* ALLOW_OBCSN_CONTROL */ |
#endif /* ALLOW_OBCSN_CONTROL */ |
325 |
|
|
326 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
327 |
c-- |
c-- |
328 |
#ifdef ALLOW_OBCSS_CONTROL |
#ifdef ALLOW_OBCSS_CONTROL |
329 |
c-- Southern obc. |
c-- Southern obc. |
330 |
|
call ctrl_init_rec ( |
331 |
# ifdef ALLOW_CAL |
I xx_obcssstartdate1, xx_obcssstartdate2, xx_obcssperiod, 4, |
332 |
call cal_FullDate( xx_obcssstartdate1, xx_obcssstartdate2, |
O xx_obcssstartdate, diffrec, startrec, endrec, |
333 |
& xx_obcssstartdate, mythid ) |
I mythid ) |
334 |
call cal_TimePassed( xx_obcssstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
335 |
& difftime, mythid ) |
& xx_obcss_file, 12, 112, diffrec, startrec, endrec, |
336 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, 1, nr, 'm', 'xz', mythid ) |
|
if ( xx_obcssperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = 12*nobcs |
|
|
else |
|
|
startrec = int((modelstart - diffsecs)/xx_obcssperiod) + 1 |
|
|
startrec = (startrec - 1)*nobcs + 1 |
|
|
endrec = int((modelend - diffsecs)/xx_obcssperiod) + 2 |
|
|
endrec = (endrec - startrec + 1)*nobcs |
|
|
endif |
|
|
# else |
|
|
if ( xx_obcssperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = nobcs |
|
|
else |
|
|
startrec = 1 |
|
|
endrec = (int((endTime - startTime)/xx_obcssperiod) + 1)*nobcs |
|
|
endif |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_obcss_file, 12, 112, diffrec, startrec, endrec, |
|
|
& snx, 1, nr, 'm', 'xz', mythid ) |
|
|
|
|
337 |
#endif /* ALLOW_OBCSS_CONTROL */ |
#endif /* ALLOW_OBCSS_CONTROL */ |
338 |
|
|
339 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
340 |
c-- |
c-- |
341 |
#ifdef ALLOW_OBCSW_CONTROL |
#ifdef ALLOW_OBCSW_CONTROL |
342 |
c-- Western obc. |
c-- Western obc. |
343 |
|
call ctrl_init_rec ( |
344 |
# ifdef ALLOW_CAL |
I xx_obcswstartdate1, xx_obcswstartdate2, xx_obcswperiod, 4, |
345 |
call cal_FullDate( xx_obcswstartdate1, xx_obcswstartdate2, |
O xx_obcswstartdate, diffrec, startrec, endrec, |
346 |
& xx_obcswstartdate, mythid ) |
I mythid ) |
347 |
call cal_TimePassed( xx_obcswstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
348 |
& difftime, mythid ) |
& xx_obcsw_file, 13, 113, diffrec, startrec, endrec, |
349 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& 1, sny, nr, 'm', 'yz', mythid ) |
|
if ( xx_obcswperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = 12*nobcs |
|
|
else |
|
|
startrec = int((modelstart - diffsecs)/xx_obcswperiod) + 1 |
|
|
startrec = (startrec - 1)*nobcs + 1 |
|
|
endrec = int((modelend - diffsecs)/xx_obcswperiod) + 2 |
|
|
endrec = (endrec - startrec + 1)*nobcs |
|
|
endif |
|
|
# else |
|
|
if ( xx_obcswperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = nobcs |
|
|
else |
|
|
startrec = 1 |
|
|
endrec = (int((endTime - startTime)/xx_obcswperiod) + 1)*nobcs |
|
|
endif |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_obcsw_file, 13, 113, diffrec, startrec, endrec, |
|
|
& 1, sny, nr, 'm', 'yz', mythid ) |
|
|
|
|
350 |
#endif /* ALLOW_OBCSW_CONTROL */ |
#endif /* ALLOW_OBCSW_CONTROL */ |
351 |
|
|
352 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
353 |
c-- |
c-- |
354 |
#ifdef ALLOW_OBCSE_CONTROL |
#ifdef ALLOW_OBCSE_CONTROL |
355 |
c-- Eastern obc. |
c-- Eastern obc. |
356 |
|
call ctrl_init_rec ( |
357 |
# ifdef ALLOW_CAL |
I xx_obcsestartdate1, xx_obcsestartdate2, xx_obcseperiod, 4, |
358 |
call cal_FullDate( xx_obcsestartdate1, xx_obcsestartdate2, |
O xx_obcsestartdate, diffrec, startrec, endrec, |
359 |
& xx_obcsestartdate, mythid ) |
I mythid ) |
360 |
call cal_TimePassed( xx_obcsestartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
361 |
& difftime, mythid ) |
& xx_obcse_file, 14, 114, diffrec, startrec, endrec, |
362 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& 1, sny, nr, 'm', 'yz', mythid ) |
|
if ( xx_obcseperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = 12*nobcs |
|
|
else |
|
|
startrec = int((modelstart - diffsecs)/xx_obcseperiod) + 1 |
|
|
startrec = (startrec - 1)*nobcs + 1 |
|
|
endrec = int((modelend - diffsecs)/xx_obcseperiod) + 2 |
|
|
endrec = (endrec - startrec + 1)*nobcs |
|
|
endif |
|
|
# else |
|
|
if ( xx_obcseperiod .EQ. 0 ) then |
|
|
startrec = 1 |
|
|
endrec = nobcs |
|
|
else |
|
|
startrec = 1 |
|
|
endrec = (int((endTime - startTime)/xx_obcseperiod) + 1)*nobcs |
|
|
endif |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_obcse_file, 14, 114, diffrec, startrec, endrec, |
|
|
& 1, sny, nr, 'm', 'yz', mythid ) |
|
|
|
|
363 |
#endif /* ALLOW_OBCSE_CONTROL */ |
#endif /* ALLOW_OBCSE_CONTROL */ |
364 |
|
|
365 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
366 |
c-- |
c-- |
367 |
#ifdef ALLOW_DIFFKR_CONTROL |
#ifdef ALLOW_DIFFKR_CONTROL |
368 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
369 |
& xx_diffkr_file, 15, 115, 1, 1, 1, |
& xx_diffkr_file, 15, 115, 1, 1, 1, |
370 |
& snx, sny, nr, 'c', '3d', mythid ) |
& snx, sny, nr, 'c', '3d', mythid ) |
371 |
#endif /* ALLOW_DIFFKR_CONTROL */ |
#endif /* ALLOW_DIFFKR_CONTROL */ |
372 |
|
|
373 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
374 |
c-- |
c-- |
375 |
#ifdef ALLOW_KAPGM_CONTROL |
#ifdef ALLOW_KAPGM_CONTROL |
376 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
377 |
& xx_kapgm_file, 16, 116, 1, 1, 1, |
& xx_kapgm_file, 16, 116, 1, 1, 1, |
378 |
& snx, sny, nr, 'c', '3d', mythid ) |
& snx, sny, nr, 'c', '3d', mythid ) |
379 |
#endif /* ALLOW_KAPGM_CONTROL */ |
#endif /* ALLOW_KAPGM_CONTROL */ |
380 |
|
|
381 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
382 |
c-- |
c-- |
383 |
#ifdef ALLOW_TR10_CONTROL |
#ifdef ALLOW_TR10_CONTROL |
384 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
385 |
& xx_tr1_file, 17, 117, 1, 1, 1, |
& xx_tr1_file, 17, 117, 1, 1, 1, |
386 |
& snx, sny, nr, 'c', '3d', mythid ) |
& snx, sny, nr, 'c', '3d', mythid ) |
387 |
#endif /* ALLOW_TR10_CONTROL */ |
#endif /* ALLOW_TR10_CONTROL */ |
388 |
|
|
389 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
390 |
c-- |
c-- |
391 |
#if (defined (ALLOW_SST_CONTROL)) |
#if (defined (ALLOW_SST_CONTROL)) |
392 |
|
call ctrl_init_rec ( |
393 |
# ifdef ALLOW_CAL |
I xx_sststartdate1, xx_sststartdate2, xx_sstperiod, 1, |
394 |
call cal_FullDate( xx_sststartdate1, xx_sststartdate2, |
O xx_sststartdate, diffrec, startrec, endrec, |
395 |
& xx_sststartdate , mythid ) |
I mythid ) |
396 |
call cal_TimePassed( xx_sststartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
397 |
& difftime, mythid ) |
& xx_sst_file, 18, 118, diffrec, startrec, endrec, |
398 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_sstperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_sstperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_sstperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_sst_file, 18, 118, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
399 |
|
|
400 |
#elif (defined (ALLOW_SST0_CONTROL)) |
#elif (defined (ALLOW_SST0_CONTROL)) |
401 |
|
call ctrl_init_ctrlvar ( |
402 |
call ctrl_init_ctrlvar ( |
& xx_sst_file, 18, 118, 1, 1, 1, |
403 |
& xx_sst_file, 18, 118, 1, 1, 1, |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
404 |
|
|
405 |
#endif /* ALLOW_SST_CONTROL */ |
#endif /* ALLOW_SST_CONTROL */ |
406 |
|
|
407 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
408 |
c-- |
c-- |
409 |
#if (defined (ALLOW_SSS_CONTROL)) |
#if (defined (ALLOW_SSS_CONTROL)) |
410 |
|
call ctrl_init_rec ( |
411 |
# ifdef ALLOW_CAL |
I xx_sssstartdate1, xx_sssstartdate2, xx_sssperiod, 1, |
412 |
call cal_FullDate( xx_sssstartdate1, xx_sssstartdate2, |
O xx_sssstartdate, diffrec, startrec, endrec, |
413 |
& xx_sssstartdate , mythid ) |
I mythid ) |
414 |
call cal_TimePassed( xx_sssstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
415 |
& difftime, mythid ) |
& xx_sss_file, 19, 119, diffrec, startrec, endrec, |
416 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_sssperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_sssperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_sssperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_sss_file, 19, 119, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
417 |
|
|
418 |
#elif (defined (ALLOW_SSS0_CONTROL)) |
#elif (defined (ALLOW_SSS0_CONTROL)) |
419 |
|
call ctrl_init_ctrlvar ( |
420 |
call ctrl_init_ctrlvar ( |
& xx_sss_file, 19, 119, 1, 1, 1, |
421 |
& xx_sss_file, 19, 119, 1, 1, 1, |
& snx, sny, 1, 'c', 'xy', mythid ) |
422 |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
|
|
|
423 |
#endif /* ALLOW_SSS0_CONTROL */ |
#endif /* ALLOW_SSS0_CONTROL */ |
424 |
|
|
425 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
518 |
c-- |
c-- |
519 |
#ifdef ALLOW_PRECIP_CONTROL |
#ifdef ALLOW_PRECIP_CONTROL |
520 |
c-- Atmos. precipitation |
c-- Atmos. precipitation |
521 |
|
call ctrl_init_rec ( |
522 |
# ifdef ALLOW_CAL |
I xx_precipstartdate1, xx_precipstartdate2, xx_precipperiod,1, |
523 |
call cal_FullDate( xx_precipstartdate1, xx_precipstartdate2, |
O xx_precipstartdate, diffrec, startrec, endrec, |
524 |
& xx_precipstartdate , mythid ) |
I mythid ) |
525 |
call cal_TimePassed( xx_precipstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
526 |
& difftime, mythid ) |
& xx_precip_file, 32, 132, diffrec, startrec, endrec, |
527 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_precipperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_precipperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_precipperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_precip_file, 32, 132, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
528 |
|
|
529 |
#endif /* ALLOW_PRECIP_CONTROL */ |
#endif /* ALLOW_PRECIP_CONTROL */ |
530 |
|
|
532 |
c-- |
c-- |
533 |
#ifdef ALLOW_SWFLUX_CONTROL |
#ifdef ALLOW_SWFLUX_CONTROL |
534 |
c-- Atmos. swflux |
c-- Atmos. swflux |
535 |
|
call ctrl_init_rec ( |
536 |
# ifdef ALLOW_CAL |
I xx_swfluxstartdate1, xx_swfluxstartdate2, xx_swfluxperiod, 1, |
537 |
call cal_FullDate( xx_swfluxstartdate1, xx_swfluxstartdate2, |
O xx_swfluxstartdate, diffrec, startrec, endrec, |
538 |
& xx_swfluxstartdate , mythid ) |
I mythid ) |
539 |
call cal_TimePassed( xx_swfluxstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
540 |
& difftime, mythid ) |
& xx_swflux_file, 33, 133, diffrec, startrec, endrec, |
541 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_swfluxperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_swfluxperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_swfluxperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_swflux_file, 33, 133, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
542 |
|
|
543 |
#endif /* ALLOW_SWFLUX_CONTROL */ |
#endif /* ALLOW_SWFLUX_CONTROL */ |
544 |
|
|
546 |
c-- |
c-- |
547 |
#ifdef ALLOW_SWDOWN_CONTROL |
#ifdef ALLOW_SWDOWN_CONTROL |
548 |
c-- Atmos. swdown |
c-- Atmos. swdown |
549 |
|
call ctrl_init_rec ( |
550 |
# ifdef ALLOW_CAL |
I xx_swdownstartdate1, xx_swdownstartdate2, xx_swdownperiod, 1, |
551 |
call cal_FullDate( xx_swdownstartdate1, xx_swdownstartdate2, |
O xx_swdownstartdate, diffrec, startrec, endrec, |
552 |
& xx_swdownstartdate , mythid ) |
I mythid ) |
553 |
call cal_TimePassed( xx_swdownstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
554 |
& difftime, mythid ) |
& xx_swdown_file, 34, 134, diffrec, startrec, endrec, |
555 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_swdownperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_swdownperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_swdownperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_swdown_file, 34, 134, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
556 |
|
|
557 |
#endif /* ALLOW_SWDOWN_CONTROL */ |
#endif /* ALLOW_SWDOWN_CONTROL */ |
558 |
|
|
560 |
c-- |
c-- |
561 |
#ifdef ALLOW_LWFLUX_CONTROL |
#ifdef ALLOW_LWFLUX_CONTROL |
562 |
c-- Atmos. lwflux |
c-- Atmos. lwflux |
563 |
|
call ctrl_init_rec ( |
564 |
# ifdef ALLOW_CAL |
I xx_lwfluxstartdate1, xx_lwfluxstartdate2, xx_lwfluxperiod, 1, |
565 |
call cal_FullDate( xx_lwfluxstartdate1, xx_lwfluxstartdate2, |
O xx_lwfluxstartdate, diffrec, startrec, endrec, |
566 |
& xx_lwfluxstartdate , mythid ) |
I mythid ) |
567 |
call cal_TimePassed( xx_lwfluxstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
568 |
& difftime, mythid ) |
& xx_lwflux_file, 35, 135, diffrec, startrec, endrec, |
569 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_lwfluxperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_lwfluxperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_lwfluxperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_lwflux_file, 35, 135, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
570 |
|
|
571 |
#endif /* ALLOW_LWFLUX_CONTROL */ |
#endif /* ALLOW_LWFLUX_CONTROL */ |
572 |
|
|
574 |
c-- |
c-- |
575 |
#ifdef ALLOW_LWDOWN_CONTROL |
#ifdef ALLOW_LWDOWN_CONTROL |
576 |
c-- Atmos. lwdown |
c-- Atmos. lwdown |
577 |
|
call ctrl_init_rec ( |
578 |
# ifdef ALLOW_CAL |
I xx_lwdownstartdate1, xx_lwdownstartdate2, xx_lwdownperiod, 1, |
579 |
call cal_FullDate( xx_lwdownstartdate1, xx_lwdownstartdate2, |
O xx_lwdownstartdate, diffrec, startrec, endrec, |
580 |
& xx_lwdownstartdate , mythid ) |
I mythid ) |
581 |
call cal_TimePassed( xx_lwdownstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
582 |
& difftime, mythid ) |
& xx_lwdown_file, 36, 136, diffrec, startrec, endrec, |
583 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_lwdownperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_lwdownperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_lwdownperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_lwdown_file, 36, 136, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
584 |
|
|
585 |
#endif /* ALLOW_LWDOWN_CONTROL */ |
#endif /* ALLOW_LWDOWN_CONTROL */ |
586 |
|
|
588 |
c-- |
c-- |
589 |
#ifdef ALLOW_EVAP_CONTROL |
#ifdef ALLOW_EVAP_CONTROL |
590 |
c-- Atmos. evap |
c-- Atmos. evap |
591 |
|
call ctrl_init_rec ( |
592 |
# ifdef ALLOW_CAL |
I xx_evapstartdate1, xx_evapstartdate2, xx_evapperiod, 1, |
593 |
call cal_FullDate( xx_evapstartdate1, xx_evapstartdate2, |
O xx_evapstartdate, diffrec, startrec, endrec, |
594 |
& xx_evapstartdate , mythid ) |
I mythid ) |
595 |
call cal_TimePassed( xx_evapstartdate, modelstartdate, |
call ctrl_init_ctrlvar ( |
596 |
& difftime, mythid ) |
& xx_evap_file, 37, 137, diffrec, startrec, endrec, |
597 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
if ( xx_evapperiod .EQ. 0 ) then |
|
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_evapperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_evapperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_evap_file, 37, 137, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
598 |
|
|
599 |
#endif /* ALLOW_EVAP_CONTROL */ |
#endif /* ALLOW_EVAP_CONTROL */ |
600 |
|
|
602 |
c-- |
c-- |
603 |
#ifdef ALLOW_SNOWPRECIP_CONTROL |
#ifdef ALLOW_SNOWPRECIP_CONTROL |
604 |
c-- Atmos. snowprecip |
c-- Atmos. snowprecip |
605 |
|
call ctrl_init_rec ( |
606 |
# ifdef ALLOW_CAL |
I xx_snowprecipstartdate1, xx_snowprecipstartdate2, |
607 |
call cal_FullDate( xx_snowprecipstartdate1, |
I xx_snowprecipperiod, 1, |
608 |
& xx_snowprecipstartdate2, xx_snowprecipstartdate , mythid ) |
O xx_snowprecipstartdate, diffrec, startrec, endrec, |
609 |
call cal_TimePassed( xx_snowprecipstartdate, modelstartdate, |
I mythid ) |
610 |
& difftime, mythid ) |
call ctrl_init_ctrlvar ( |
611 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& xx_snowprecip_file, 38, 138, diffrec, startrec, endrec, |
612 |
if ( xx_snowprecipperiod .EQ. 0 ) then |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_snowprecipperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_snowprecipperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_snowprecip_file, 38, 138, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
613 |
|
|
614 |
#endif /* ALLOW_SNOWPRECIP_CONTROL */ |
#endif /* ALLOW_SNOWPRECIP_CONTROL */ |
615 |
|
|
617 |
c-- |
c-- |
618 |
#ifdef ALLOW_APRESSURE_CONTROL |
#ifdef ALLOW_APRESSURE_CONTROL |
619 |
c-- Atmos. apressure |
c-- Atmos. apressure |
620 |
|
call ctrl_init_rec ( |
621 |
# ifdef ALLOW_CAL |
I xx_apressurestartdate1, xx_apressurestartdate2, |
622 |
call cal_FullDate( xx_apressurestartdate1, |
I xx_apressureperiod, 1, |
623 |
& xx_apressurestartdate2, xx_apressurestartdate , mythid ) |
O xx_apressurestartdate, diffrec, startrec, endrec, |
624 |
call cal_TimePassed( xx_apressurestartdate, modelstartdate, |
I mythid ) |
625 |
& difftime, mythid ) |
call ctrl_init_ctrlvar ( |
626 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
& xx_apressure_file, 39, 139, diffrec, startrec, endrec, |
627 |
if ( xx_apressureperiod .EQ. 0 ) then |
& snx, sny, 1, 'c', 'xy', mythid ) |
|
startrec=1 |
|
|
endrec=12 |
|
|
else |
|
|
startrec = int((modelstart + startTime - diffsecs)/ |
|
|
& xx_apressureperiod) + 1 |
|
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
|
|
& xx_apressureperiod) + 2 |
|
|
endif |
|
|
# else |
|
|
startrec = 1 |
|
|
endrec = 1 |
|
|
# endif |
|
|
diffrec = endrec - startrec + 1 |
|
|
call ctrl_init_ctrlvar ( |
|
|
& xx_apressure_file, 39, 139, diffrec, startrec, endrec, |
|
|
& snx, sny, 1, 'c', 'xy', mythid ) |
|
628 |
|
|
629 |
#endif /* ALLOW_APRESSURE_CONTROL */ |
#endif /* ALLOW_APRESSURE_CONTROL */ |
630 |
|
|
632 |
c-- |
c-- |
633 |
#ifdef ALLOW_RUNOFF_CONTROL |
#ifdef ALLOW_RUNOFF_CONTROL |
634 |
c-- Atmos. runoff |
c-- Atmos. runoff |
635 |
startrec = 1 |
call ctrl_init_rec ( |
636 |
endrec = 1 |
I xx_runoffstartdate1, xx_runoffstartdate2, xx_runoffperiod, 1, |
637 |
diffrec = endrec - startrec + 1 |
O xx_runoffstartdate, diffrec, startrec, endrec, |
638 |
call ctrl_init_ctrlvar ( |
I mythid ) |
639 |
& xx_runoff_file, 40, 140, diffrec, startrec, endrec, |
call ctrl_init_ctrlvar ( |
640 |
& snx, sny, 1, 'c', 'xy', mythid ) |
& xx_runoff_file, 40, 140, diffrec, startrec, endrec, |
641 |
|
& snx, sny, 1, 'c', 'xy', mythid ) |
642 |
#endif /* ALLOW_RUNOFF_CONTROL */ |
#endif /* ALLOW_RUNOFF_CONTROL */ |
643 |
|
|
644 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
645 |
c-- |
c-- |
646 |
#ifdef ALLOW_SIAREA_CONTROL |
#ifdef ALLOW_SIAREA_CONTROL |
647 |
startrec = 1 |
C-- so far there are no xx_siareastartdate1, etc., so we need to fudge it. |
648 |
endrec = 1 |
CML call ctrl_init_rec ( |
649 |
diffrec = endrec - startrec + 1 |
CML I xx_siareastartdate1, xx_siareastartdate2, xx_siareaperiod, 1, |
650 |
call ctrl_init_ctrlvar ( |
CML O xx_siareastartdate, diffrec, startrec, endrec, |
651 |
& xx_siarea_file, 41, 141, diffrec, startrec, endrec, |
CML I mythid ) |
652 |
& snx, sny, 1, 'c', 'xy', mythid ) |
startrec = 1 |
653 |
|
endrec = 1 |
654 |
|
diffrec = endrec - startrec + 1 |
655 |
|
call ctrl_init_ctrlvar ( |
656 |
|
& xx_siarea_file, 41, 141, diffrec, startrec, endrec, |
657 |
|
& snx, sny, 1, 'c', 'xy', mythid ) |
658 |
#endif /* ALLOW_siarea_CONTROL */ |
#endif /* ALLOW_siarea_CONTROL */ |
659 |
|
|
660 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
661 |
c-- |
c-- |
662 |
#ifdef ALLOW_SIHEFF_CONTROL |
#ifdef ALLOW_SIHEFF_CONTROL |
663 |
startrec = 1 |
C-- so far there are no xx_siheffstartdate1, etc., so we need to fudge it. |
664 |
endrec = 1 |
CML call ctrl_init_rec ( |
665 |
diffrec = endrec - startrec + 1 |
CML I xx_siheffstartdate1, xx_siheffstartdate2, xx_siheffperiod, 1, |
666 |
call ctrl_init_ctrlvar ( |
CML O xx_siheffstartdate, diffrec, startrec, endrec, |
667 |
& xx_siheff_file, 42, 142, diffrec, startrec, endrec, |
CML I mythid ) |
668 |
& snx, sny, 1, 'c', 'xy', mythid ) |
startrec = 1 |
669 |
|
endrec = 1 |
670 |
|
diffrec = endrec - startrec + 1 |
671 |
|
call ctrl_init_ctrlvar ( |
672 |
|
& xx_siheff_file, 42, 142, diffrec, startrec, endrec, |
673 |
|
& snx, sny, 1, 'c', 'xy', mythid ) |
674 |
#endif /* ALLOW_siheff_CONTROL */ |
#endif /* ALLOW_siheff_CONTROL */ |
675 |
|
|
676 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
677 |
c-- |
c-- |
678 |
#ifdef ALLOW_SIHSNOW_CONTROL |
#ifdef ALLOW_SIHSNOW_CONTROL |
679 |
startrec = 1 |
C-- so far there are no xx_sihsnowstartdate1, etc., so we need to fudge it. |
680 |
endrec = 1 |
CML call ctrl_init_rec ( |
681 |
diffrec = endrec - startrec + 1 |
CML I xx_sihsnowstartdate1, xx_sihsnowstartdate2, xx_sihsnowperiod, 1, |
682 |
call ctrl_init_ctrlvar ( |
CML O xx_sihsnowstartdate, diffrec, startrec, endrec, |
683 |
& xx_sihsnow_file, 43, 143, diffrec, startrec, endrec, |
CML I mythid ) |
684 |
& snx, sny, 1, 'c', 'xy', mythid ) |
startrec = 1 |
685 |
|
endrec = 1 |
686 |
|
diffrec = endrec - startrec + 1 |
687 |
|
call ctrl_init_ctrlvar ( |
688 |
|
& xx_sihsnow_file, 43, 143, diffrec, startrec, endrec, |
689 |
|
& snx, sny, 1, 'c', 'xy', mythid ) |
690 |
#endif /* ALLOW_sihsnow_CONTROL */ |
#endif /* ALLOW_sihsnow_CONTROL */ |
691 |
|
|
692 |
|
|
693 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
694 |
c-- |
c-- |
695 |
#ifdef ALLOW_KAPREDI_CONTROL |
#ifdef ALLOW_KAPREDI_CONTROL |
696 |
call ctrl_init_ctrlvar ( |
call ctrl_init_ctrlvar ( |
697 |
& xx_kapredi_file, 44, 144, 1, 1, 1, |
& xx_kapredi_file, 44, 144, 1, 1, 1, |
698 |
& snx, sny, nr, 'c', '3d', mythid ) |
& snx, sny, nr, 'c', '3d', mythid ) |
699 |
#endif /* ALLOW_KAPREDI_CONTROL */ |
#endif /* ALLOW_KAPREDI_CONTROL */ |
700 |
|
|
701 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
702 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
703 |
|
|
704 |
call ctrl_init_wet( mythid ) |
call ctrl_init_wet( mythid ) |
705 |
|
|
706 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
707 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
708 |
|
|
709 |
#ifdef ALLOW_DIC_CONTROL |
#ifdef ALLOW_DIC_CONTROL |
710 |
do i = 1, dic_n_control |
do i = 1, dic_n_control |
711 |
xx_dic(i) = 0. _d 0 |
xx_dic(i) = 0. _d 0 |
712 |
enddo |
enddo |
713 |
#endif |
#endif |
714 |
|
|
715 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
716 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
717 |
|
|
718 |
do bj = jtlo,jthi |
do bj = jtlo,jthi |
719 |
do bi = itlo,ithi |
do bi = itlo,ithi |
720 |
do j = jmin,jmax |
do j = jmin,jmax |
721 |
do i = imin,imax |
do i = imin,imax |
722 |
wareaunit (i,j,bi,bj) = 1.0 |
wareaunit (i,j,bi,bj) = 1.0 |
723 |
#ifndef ALLOW_ECCO |
#ifndef ALLOW_ECCO |
724 |
whflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
whflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
725 |
wsflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wsflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
726 |
wtauu (i,j,bi,bj) = maskW(i,j,1,bi,bj) |
wtauu (i,j,bi,bj) = maskW(i,j,1,bi,bj) |
727 |
wtauv (i,j,bi,bj) = maskS(i,j,1,bi,bj) |
wtauv (i,j,bi,bj) = maskS(i,j,1,bi,bj) |
728 |
watemp (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
watemp (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
729 |
waqh (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
waqh (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
730 |
wprecip (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wprecip (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
731 |
wswflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wswflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
732 |
wswdown (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wswdown (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
733 |
wuwind (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wuwind (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
734 |
wvwind (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wvwind (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
735 |
wlwflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wlwflux (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
736 |
wlwdown (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wlwdown (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
737 |
wevap (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wevap (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
738 |
wsnowprecip(i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wsnowprecip(i,j,bi,bj) = maskC(i,j,1,bi,bj) |
739 |
wapressure(i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wapressure(i,j,bi,bj) = maskC(i,j,1,bi,bj) |
740 |
wrunoff (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wrunoff (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
741 |
wsst (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wsst (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
742 |
wsss (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
wsss (i,j,bi,bj) = maskC(i,j,1,bi,bj) |
743 |
#endif |
#endif |
744 |
enddo |
enddo |
|
enddo |
|
745 |
enddo |
enddo |
746 |
|
enddo |
747 |
enddo |
enddo |
748 |
|
|
749 |
return |
return |
750 |
end |
end |
751 |
|
|
752 |
|
subroutine ctrl_init_rec( |
753 |
|
I fldstartdate1, fldstartdate2, fldperiod, nfac, |
754 |
|
O fldstartdate, diffrec, startrec, endrec, |
755 |
|
I mythid ) |
756 |
|
|
757 |
|
c ================================================================== |
758 |
|
c SUBROUTINE ctrl_init_rec |
759 |
|
c ================================================================== |
760 |
|
c |
761 |
|
c helper routine to compute the first and last record of a |
762 |
|
c time dependent control variable |
763 |
|
c |
764 |
|
c Martin.Losch@awi.de, 2011-Mar-15 |
765 |
|
c |
766 |
|
c ================================================================== |
767 |
|
c SUBROUTINE ctrl_init_rec |
768 |
|
c ================================================================== |
769 |
|
|
770 |
|
implicit none |
771 |
|
|
772 |
|
c == global variables == |
773 |
|
#include "SIZE.h" |
774 |
|
#include "EEPARAMS.h" |
775 |
|
#include "PARAMS.h" |
776 |
|
#ifdef ALLOW_CAL |
777 |
|
# include "cal.h" |
778 |
|
#endif |
779 |
|
|
780 |
|
c == input variables == |
781 |
|
c fldstartdate1/2 : start time (date/time) of fld |
782 |
|
c fldperod : sampling interval of fld |
783 |
|
c nfac : factor for the case that fld is an obcs variable |
784 |
|
c in this case nfac = 4, otherwise nfac = 1 |
785 |
|
c mythid : thread ID of this instance |
786 |
|
integer fldstartdate1 |
787 |
|
integer fldstartdate2 |
788 |
|
_RL fldperiod |
789 |
|
integer nfac |
790 |
|
integer mythid |
791 |
|
|
792 |
|
c == output variables == |
793 |
|
c fldstartdate : full date from fldstartdate1 and 2 |
794 |
|
c startrec : first record of ctrl variable |
795 |
|
c startrec : last record of ctrl variable |
796 |
|
c diffrec : difference between first and last record of ctrl variable |
797 |
|
integer fldstartdate(4) |
798 |
|
integer startrec |
799 |
|
integer endrec |
800 |
|
integer diffrec |
801 |
|
|
802 |
|
c == local variables == |
803 |
|
integer i |
804 |
|
#ifdef ALLOW_CAL |
805 |
|
integer difftime(4) |
806 |
|
_RL diffsecs |
807 |
|
#endif /* ALLOW_CAL */ |
808 |
|
|
809 |
|
c initialise some output |
810 |
|
do i = 1,4 |
811 |
|
fldstartdate(i) = 0 |
812 |
|
end do |
813 |
|
startrec = 0 |
814 |
|
endrec = 0 |
815 |
|
diffrec = 0 |
816 |
|
# ifdef ALLOW_CAL |
817 |
|
call cal_FullDate( fldstartdate1, fldstartdate2, |
818 |
|
& fldstartdate , mythid ) |
819 |
|
call cal_TimePassed( fldstartdate, modelstartdate, |
820 |
|
& difftime, mythid ) |
821 |
|
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
822 |
|
if ( fldperiod .EQ. -12. ) then |
823 |
|
startrec = 1 |
824 |
|
endrec = 12*nfac |
825 |
|
elseif ( fldperiod .EQ. 0. ) then |
826 |
|
startrec = 1 |
827 |
|
endrec = 1*nfac |
828 |
|
else |
829 |
|
startrec = int((modelstart + startTime - diffsecs)/ |
830 |
|
& fldperiod) + 1 |
831 |
|
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
832 |
|
& fldperiod) + 2 |
833 |
|
if ( nfac .ne. 1 ) then |
834 |
|
c This is the case of obcs. I am not sure that this is correct, but |
835 |
|
c it seems to work in most configurations. |
836 |
|
print * , 'ml-startrec = ', startrec |
837 |
|
print * , 'ml-endrec = ', endrec |
838 |
|
endrec = (endrec - startrec + 1)*nfac |
839 |
|
startrec = (startrec - 1)*nfac + 1 |
840 |
|
print * , 'ml-startrec2 = ', startrec |
841 |
|
print * , 'ml-endrec2 = ', endrec |
842 |
|
endif |
843 |
|
endif |
844 |
|
# else /* ndef ALLOW_CAL */ |
845 |
|
if ( fldperiod .EQ. 0. ) then |
846 |
|
startrec = 1 |
847 |
|
endrec = 1*nfac |
848 |
|
else |
849 |
|
startrec = 1 |
850 |
|
endrec = (int((endTime - startTime)/fldperiod) + 1)*nfac |
851 |
|
endif |
852 |
|
#endif /* ALLOW_CAL */ |
853 |
|
diffrec = endrec - startrec + 1 |
854 |
|
|
855 |
|
return |
856 |
|
end |