1 |
c $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "EXF_CPPOPTIONS.h" |
#include "EXF_OPTIONS.h" |
5 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
6 |
# include "OBCS_OPTIONS.h" |
# include "OBCS_OPTIONS.h" |
7 |
#endif |
#endif |
15 |
c o This routine initialises the package that calculates external |
c o This routine initialises the package that calculates external |
16 |
c forcing fields for a given timestep of the MITgcmUV. Parameters |
c forcing fields for a given timestep of the MITgcmUV. Parameters |
17 |
c for this package are set in "data.externalforcing". Some additional |
c for this package are set in "data.externalforcing". Some additional |
18 |
c precompiler switches have to be specified in "EXF_CPPOPTIONS.h". |
c precompiler switches have to be specified in "EXF_OPTIONS.h". |
19 |
c |
c |
20 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
21 |
c |
c |
60 |
c == local variables == |
c == local variables == |
61 |
|
|
62 |
integer i |
integer i |
63 |
|
integer date_array(4), difftime(4) |
64 |
|
|
65 |
c == external == |
c == external == |
66 |
|
|
99 |
& swfluxfile, lwfluxfile, apressurefile, |
& swfluxfile, lwfluxfile, apressurefile, |
100 |
& swdownfile, lwdownfile, |
& swdownfile, lwdownfile, |
101 |
& exf_iprec, exf_yftype, |
& exf_iprec, exf_yftype, |
102 |
& exf_inscal_hfl, exf_inscal_ust, exf_inscal_vst, |
& exf_inscal_hflux, exf_inscal_sflux, |
103 |
& exf_inscal_swf, exf_inscal_sst, exf_inscal_sss, |
& exf_inscal_ustress, exf_inscal_vstress, |
104 |
& exf_inscal_sfl, exf_inscal_runoff,exf_inscal_apressure, |
& exf_inscal_uwind, exf_inscal_vwind, |
105 |
& exf_outscal_hfl, exf_outscal_ust,exf_outscal_vst, |
& exf_inscal_evap, exf_inscal_atemp, exf_inscal_aqh, |
106 |
& exf_outscal_swf, exf_outscal_sst,exf_outscal_sss, |
& exf_inscal_sst, exf_inscal_sss, |
107 |
& exf_outscal_sfl, exf_outscal_apressure, |
& exf_inscal_swflux, exf_inscal_lwflux, exf_inscal_precip, |
108 |
|
& exf_inscal_runoff, exf_inscal_apressure, |
109 |
|
& exf_inscal_swdown, exf_inscal_lwdown, |
110 |
|
& exf_outscal_hflux, exf_outscal_ustress, exf_outscal_vstress, |
111 |
|
& exf_outscal_swflux, exf_outscal_sst,exf_outscal_sss, |
112 |
|
& exf_outscal_sflux, exf_outscal_apressure, |
113 |
& hfluxconst, |
& hfluxconst, |
114 |
& atempconst, |
& atempconst, |
115 |
& aqhconst, |
& aqhconst, |
125 |
& lwfluxconst, |
& lwfluxconst, |
126 |
& swdownconst, |
& swdownconst, |
127 |
& lwdownconst, |
& lwdownconst, |
128 |
& apressureconst, |
& apressureconst |
129 |
& EXFwindOnBgrid |
#ifdef USE_EXF_INTERPOLATION |
130 |
|
& ,ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc, |
131 |
|
& ustress_nlon, ustress_nlat, |
132 |
|
& vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc, |
133 |
|
& vstress_nlon, vstress_nlat, |
134 |
|
& hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc, |
135 |
|
& hflux_nlon, hflux_nlat, |
136 |
|
& sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc, |
137 |
|
& sflux_nlon, sflux_nlat, |
138 |
|
& swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc, |
139 |
|
& swflux_nlon, swflux_nlat, |
140 |
|
& runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc, |
141 |
|
& runoff_nlon, runoff_nlat, |
142 |
|
& atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc, |
143 |
|
& atemp_nlon, atemp_nlat, |
144 |
|
& aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc, |
145 |
|
& aqh_nlon, aqh_nlat, |
146 |
|
& evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc, |
147 |
|
& evap_nlon, evap_nlat, |
148 |
|
& precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc, |
149 |
|
& precip_nlon, precip_nlat, |
150 |
|
& uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc, |
151 |
|
& uwind_nlon, uwind_nlat, |
152 |
|
& vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc, |
153 |
|
& vwind_nlon, vwind_nlat, |
154 |
|
& lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc, |
155 |
|
& lwflux_nlon, lwflux_nlat, |
156 |
|
& swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc, |
157 |
|
& swdown_nlon, swdown_nlat, |
158 |
|
& lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc, |
159 |
|
& lwdown_nlon, lwdown_nlat, |
160 |
|
& apressure_lon0,apressure_lon_inc, |
161 |
|
& apressure_lat0,apressure_lat_inc, |
162 |
|
& apressure_nlon,apressure_nlat |
163 |
|
#endif |
164 |
|
|
165 |
_BEGIN_MASTER(mythid) |
_BEGIN_MASTER(mythid) |
166 |
|
|
283 |
lwdownfile = ' ' |
lwdownfile = ' ' |
284 |
apressurefile = ' ' |
apressurefile = ' ' |
285 |
|
|
286 |
c Initialise the date arrays. |
c Start dates. |
287 |
do i = 1,4 |
hfluxstartdate = 0 |
288 |
hfluxstartdate(i) = 0 |
atempstartdate = 0 |
289 |
atempstartdate(i) = 0 |
aqhstartdate = 0 |
290 |
aqhstartdate(i) = 0 |
evapstartdate = 0 |
291 |
evapstartdate(i) = 0 |
precipstartdate = 0 |
292 |
precipstartdate(i) = 0 |
sfluxstartdate = 0 |
293 |
sfluxstartdate(i) = 0 |
runoffstartdate = 0 |
294 |
runoffstartdate(i) = 0 |
ustressstartdate = 0 |
295 |
ustressstartdate(i) = 0 |
vstressstartdate = 0 |
296 |
vstressstartdate(i) = 0 |
uwindstartdate = 0 |
297 |
uwindstartdate(i) = 0 |
vwindstartdate = 0 |
298 |
vwindstartdate(i) = 0 |
swfluxstartdate = 0 |
299 |
swfluxstartdate(i) = 0 |
lwfluxstartdate = 0 |
300 |
lwfluxstartdate(i) = 0 |
swdownstartdate = 0 |
301 |
swdownstartdate(i) = 0 |
lwdownstartdate = 0 |
302 |
lwdownstartdate(i) = 0 |
obcsNstartdate = 0 |
303 |
obcsNstartdate(i) = 0 |
obcsSstartdate = 0 |
304 |
obcsSstartdate(i) = 0 |
obcsEstartdate = 0 |
305 |
obcsEstartdate(i) = 0 |
obcsWstartdate = 0 |
306 |
obcsWstartdate(i) = 0 |
apressurestartdate = 0 |
|
apressurestartdate(i)= 0 |
|
|
enddo |
|
307 |
|
|
308 |
c Initialise file type and field precision |
c Initialise file type and field precision |
309 |
exf_iprec = 32 |
exf_iprec = 32 |
310 |
exf_yftype = 'RL' |
exf_yftype = 'RL' |
311 |
|
|
312 |
c Input scaling factors. |
c Input scaling factors. |
313 |
exf_inscal_hfl = 1. _d 0 |
exf_inscal_hflux = 1. _d 0 |
314 |
exf_inscal_ust = 1. _d 0 |
exf_inscal_sflux = 1. _d 0 |
315 |
exf_inscal_vst = 1. _d 0 |
exf_inscal_ustress = 1. _d 0 |
316 |
exf_inscal_swf = 1. _d 0 |
exf_inscal_vstress = 1. _d 0 |
317 |
|
exf_inscal_uwind = 1. _d 0 |
318 |
|
exf_inscal_vwind = 1. _d 0 |
319 |
|
exf_inscal_swflux = 1. _d 0 |
320 |
|
exf_inscal_lwflux = 1. _d 0 |
321 |
|
exf_inscal_precip = 1. _d 0 |
322 |
exf_inscal_sst = 1. _d 0 |
exf_inscal_sst = 1. _d 0 |
323 |
exf_inscal_sss = 1. _d 0 |
exf_inscal_sss = 1. _d 0 |
324 |
|
exf_inscal_atemp = 1. _d 0 |
325 |
|
exf_inscal_aqh = 1. _d 0 |
326 |
|
exf_inscal_evap = 1. _d 0 |
327 |
exf_inscal_apressure = 1. _d 0 |
exf_inscal_apressure = 1. _d 0 |
|
exf_inscal_sfl = 1. _d 0 |
|
328 |
cds convert runoff from m/yr to m/s and change sign. |
cds convert runoff from m/yr to m/s and change sign. |
329 |
exf_inscal_runoff = -1.0/(86400.*365.0) |
exf_inscal_runoff = -1.0/(86400.*365.0) |
330 |
|
exf_inscal_swdown = 1. _d 0 |
331 |
|
exf_inscal_lwdown = 1. _d 0 |
332 |
|
|
333 |
c Output scaling factors. |
c Output scaling factors. |
334 |
exf_outscal_hfl = 1. _d 0 |
exf_outscal_hflux = 1. _d 0 |
335 |
exf_outscal_ust = 1. _d 0 |
exf_outscal_sflux = 1. _d 0 |
336 |
exf_outscal_vst = 1. _d 0 |
exf_outscal_ustress = 1. _d 0 |
337 |
exf_outscal_swf = 1. _d 0 |
exf_outscal_vstress = 1. _d 0 |
338 |
|
exf_outscal_swflux = 1. _d 0 |
339 |
exf_outscal_sst = 1. _d 0 |
exf_outscal_sst = 1. _d 0 |
340 |
exf_outscal_sss = 1. _d 0 |
exf_outscal_sss = 1. _d 0 |
341 |
exf_outscal_apressure= 1. _d 0 |
exf_outscal_apressure= 1. _d 0 |
|
exf_outscal_sfl = 1. _d 0 |
|
|
c |
|
|
EXFwindOnBgrid = .FALSE. |
|
342 |
|
|
343 |
c Check for the availability of the right calendar version. |
c Check for the availability of the right calendar version. |
344 |
if ( calendarversion .ne. usescalendarversion ) then |
if ( calendarversion .ne. usescalendarversion ) then |
375 |
end if |
end if |
376 |
|
|
377 |
#ifdef ALLOW_ATM_WIND |
#ifdef ALLOW_ATM_WIND |
378 |
call cal_FullDate( uwindstartdate1, uwindstartdate2, |
call cal_FullDate ( uwindstartdate1 , uwindstartdate2, |
379 |
& uwindstartdate , mythid ) |
& date_array ,mythid ) |
380 |
call cal_FullDate( vwindstartdate1, vwindstartdate2, |
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
381 |
& vwindstartdate , mythid ) |
call cal_ToSeconds ( difftime, uwindstartdate ,mythid ) |
382 |
|
uwindstartdate = modelstart + uwindstartdate |
383 |
|
call cal_FullDate ( vwindstartdate1 , vwindstartdate2, |
384 |
|
& date_array ,mythid ) |
385 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
386 |
|
call cal_ToSeconds ( difftime, vwindstartdate ,mythid ) |
387 |
|
vwindstartdate = modelstart + vwindstartdate |
388 |
#else |
#else |
389 |
call cal_FullDate( ustressstartdate1, ustressstartdate2, |
call cal_FullDate ( ustressstartdate1 , ustressstartdate2, |
390 |
& ustressstartdate , mythid ) |
& date_array ,mythid ) |
391 |
call cal_FullDate( vstressstartdate1, vstressstartdate2, |
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
392 |
& vstressstartdate , mythid ) |
call cal_ToSeconds ( difftime, ustressstartdate ,mythid ) |
393 |
|
ustressstartdate = modelstart + ustressstartdate |
394 |
|
call cal_FullDate ( vstressstartdate1 , vstressstartdate2, |
395 |
|
& date_array ,mythid ) |
396 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
397 |
|
call cal_ToSeconds ( difftime, vstressstartdate ,mythid ) |
398 |
|
vstressstartdate = modelstart + vstressstartdate |
399 |
#endif |
#endif |
400 |
|
|
401 |
#ifdef ALLOW_ATM_TEMP |
#ifdef ALLOW_ATM_TEMP |
402 |
call cal_FullDate( atempstartdate1, atempstartdate2, |
call cal_FullDate ( atempstartdate1 , atempstartdate2, |
403 |
& atempstartdate , mythid ) |
& date_array ,mythid ) |
404 |
call cal_FullDate( aqhstartdate1, aqhstartdate2, |
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
405 |
& aqhstartdate , mythid ) |
call cal_ToSeconds ( difftime, atempstartdate ,mythid ) |
406 |
call cal_FullDate( lwfluxstartdate1, lwfluxstartdate2, |
atempstartdate = modelstart + atempstartdate |
407 |
& lwfluxstartdate , mythid ) |
call cal_FullDate ( aqhstartdate1 , aqhstartdate2, |
408 |
call cal_FullDate( precipstartdate1, precipstartdate2, |
& date_array ,mythid ) |
409 |
& precipstartdate , mythid ) |
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
410 |
|
call cal_ToSeconds ( difftime, aqhstartdate ,mythid ) |
411 |
|
aqhstartdate = modelstart + aqhstartdate |
412 |
|
call cal_FullDate ( lwfluxstartdate1 , lwfluxstartdate2, |
413 |
|
& date_array ,mythid ) |
414 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
415 |
|
call cal_ToSeconds ( difftime, lwfluxstartdate ,mythid ) |
416 |
|
lwfluxstartdate = modelstart + lwfluxstartdate |
417 |
|
call cal_FullDate ( precipstartdate1 , precipstartdate2, |
418 |
|
& date_array ,mythid ) |
419 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
420 |
|
call cal_ToSeconds ( difftime, precipstartdate ,mythid ) |
421 |
|
precipstartdate = modelstart + precipstartdate |
422 |
#else |
#else |
423 |
call cal_FullDate( hfluxstartdate1, hfluxstartdate2, |
call cal_FullDate ( hfluxstartdate1 , hfluxstartdate2, |
424 |
& hfluxstartdate , mythid ) |
& date_array ,mythid ) |
425 |
call cal_FullDate( sfluxstartdate1, sfluxstartdate2, |
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
426 |
& sfluxstartdate , mythid ) |
call cal_ToSeconds ( difftime, hfluxstartdate ,mythid ) |
427 |
|
hfluxstartdate = modelstart + hfluxstartdate |
428 |
|
call cal_FullDate ( sfluxstartdate1 , sfluxstartdate2, |
429 |
|
& date_array ,mythid ) |
430 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
431 |
|
call cal_ToSeconds ( difftime, sfluxstartdate ,mythid ) |
432 |
|
sfluxstartdate = modelstart + sfluxstartdate |
433 |
#endif |
#endif |
434 |
|
|
435 |
#if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING) |
#if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING) |
436 |
call cal_FullDate( swfluxstartdate1, swfluxstartdate2, |
call cal_FullDate ( swfluxstartdate1 , swfluxstartdate2, |
437 |
& swfluxstartdate , mythid ) |
& date_array ,mythid ) |
438 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
439 |
|
call cal_ToSeconds ( difftime, swfluxstartdate ,mythid ) |
440 |
|
swfluxstartdate = modelstart + swfluxstartdate |
441 |
#endif |
#endif |
442 |
|
|
443 |
#ifdef EXF_READ_EVAP |
#ifdef EXF_READ_EVAP |
444 |
call cal_FullDate( evapstartdate1, evapstartdate2, |
call cal_FullDate ( evapstartdate1 , evapstartdate2, |
445 |
& evapstartdate , mythid ) |
& date_array ,mythid ) |
446 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
447 |
|
call cal_ToSeconds ( difftime, evapstartdate ,mythid ) |
448 |
|
evapstartdate = modelstart + evapstartdate |
449 |
#endif |
#endif |
450 |
|
|
451 |
#ifdef ALLOW_RUNOFF |
#ifdef ALLOW_RUNOFF |
452 |
call cal_FullDate( runoffstartdate1, runoffstartdate2, |
call cal_FullDate ( runoffstartdate1 , runoffstartdate2, |
453 |
& runoffstartdate , mythid ) |
& date_array ,mythid ) |
454 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
455 |
|
call cal_ToSeconds ( difftime, runoffstartdate ,mythid ) |
456 |
|
runoffstartdate = modelstart + runoffstartdate |
457 |
#endif |
#endif |
458 |
|
|
459 |
#ifdef ALLOW_DOWNWARD_RADIATION |
#ifdef ALLOW_DOWNWARD_RADIATION |
460 |
call cal_FullDate( swdownstartdate1, swdownstartdate2, |
call cal_FullDate ( swdownstartdate1 , swdownstartdate2, |
461 |
& swdownstartdate , mythid ) |
& date_array ,mythid ) |
462 |
call cal_FullDate( lwdownstartdate1, lwdownstartdate2, |
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
463 |
& lwdownstartdate , mythid ) |
call cal_ToSeconds ( difftime, swdownstartdate ,mythid ) |
464 |
|
swdownstartdate = modelstart + swdownstartdate |
465 |
|
call cal_FullDate ( lwdownstartdate1 , lwdownstartdate2, |
466 |
|
& date_array ,mythid ) |
467 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
468 |
|
call cal_ToSeconds ( difftime, lwdownstartdate ,mythid ) |
469 |
|
lwdownstartdate = modelstart + lwdownstartdate |
470 |
#endif |
#endif |
471 |
|
|
472 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
473 |
#ifdef ALLOW_OBCS_NORTH |
#ifdef ALLOW_OBCS_NORTH |
474 |
call cal_FullDate( obcsNstartdate1, obcsNstartdate2, |
call cal_FullDate ( obcsNstartdate1 , obcsNstartdate2, |
475 |
& obcsNstartdate , mythid ) |
& date_array ,mythid ) |
476 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
477 |
|
call cal_ToSeconds ( difftime, obcsNstartdate ,mythid ) |
478 |
|
obcsNstartdate = modelstart + obcsNstartdate |
479 |
#endif |
#endif |
480 |
#ifdef ALLOW_OBCS_SOUTH |
#ifdef ALLOW_OBCS_SOUTH |
481 |
call cal_FullDate( obcsSstartdate1, obcsSstartdate2, |
call cal_FullDate ( obcsSstartdate1 , obcsSstartdate2, |
482 |
& obcsSstartdate , mythid ) |
& date_array ,mythid ) |
483 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
484 |
|
call cal_ToSeconds ( difftime, obcsSstartdate ,mythid ) |
485 |
|
obcsSstartdate = modelstart + obcsSstartdate |
486 |
#endif |
#endif |
487 |
#ifdef ALLOW_OBCS_EAST |
#ifdef ALLOW_OBCS_EAST |
488 |
call cal_FullDate( obcsEstartdate1, obcsEstartdate2, |
call cal_FullDate ( obcsEstartdate1 , obcsEstartdate2, |
489 |
& obcsEstartdate , mythid ) |
& date_array ,mythid ) |
490 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
491 |
|
call cal_ToSeconds ( difftime, obcsEstartdate ,mythid ) |
492 |
|
obcsEstartdate = modelstart + obcsEstartdate |
493 |
#endif |
#endif |
494 |
#ifdef ALLOW_OBCS_WEST |
#ifdef ALLOW_OBCS_WEST |
495 |
call cal_FullDate( obcsWstartdate1, obcsWstartdate2, |
call cal_FullDate ( obcsWstartdate1 , obcsWstartdate2, |
496 |
& obcsWstartdate , mythid ) |
& date_array ,mythid ) |
497 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
498 |
|
call cal_ToSeconds ( difftime, obcsWstartdate ,mythid ) |
499 |
|
obcsWstartdate = modelstart + obcsWstartdate |
500 |
#endif |
#endif |
501 |
#endif /* ALLOW_OBCS */ |
#endif /* ALLOW_OBCS */ |
502 |
|
|
503 |
#ifdef ATMOSPHERIC_LOADING |
#ifdef ATMOSPHERIC_LOADING |
504 |
call cal_FullDate(apressurestartdate1,apressurestartdate2, |
call cal_FullDate ( apressurestartdate1, apressurestartdate2, |
505 |
& apressurestartdate , mythid ) |
& date_array ,mythid ) |
506 |
|
call cal_TimePassed( modelstartdate,date_array,difftime,mythid ) |
507 |
|
call cal_ToSeconds ( difftime, apressurestartdate ,mythid ) |
508 |
|
apressurestartdate = modelstart + apressurestartdate |
509 |
#endif |
#endif |
510 |
|
|
511 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |