/[MITgcm]/MITgcm/pkg/exf/exf_readparms.F
ViewVC logotype

Diff of /MITgcm/pkg/exf/exf_readparms.F

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

revision 1.5 by dimitri, Sat Dec 28 10:11:11 2002 UTC revision 1.22 by heimbach, Mon Nov 22 20:47:34 2004 UTC
# Line 1  Line 1 
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
# Line 14  c Line 15  c
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
# Line 35  c              - added new obcs paramete Line 36  c              - added new obcs paramete
36  c     included runoff D. Stammer, Nov. 25, 2001  c     included runoff D. Stammer, Nov. 25, 2001
37  c     included pressure forcing. heimbach@mit.edu 05-Nov-2002  c     included pressure forcing. heimbach@mit.edu 05-Nov-2002
38  c     added "repeatPeriod" for cycling of forcing datasets 19-Dec-2002  c     added "repeatPeriod" for cycling of forcing datasets 19-Dec-2002
39  c     added option EXF_READ_EVAP. menemenlis@jpl.nasa.gov 20-Dec-2002  c     mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002
40  c  c
41  c     ==================================================================  c     ==================================================================
42  c     SUBROUTINE exf_readparms  c     SUBROUTINE exf_readparms
# Line 47  c     == global variables == Line 48  c     == global variables ==
48    
49  #include "EEPARAMS.h"  #include "EEPARAMS.h"
50  #include "SIZE.h"  #include "SIZE.h"
51    #include "PARAMS.h"
52  #include "cal.h"  #include "cal.h"
53  #include "exf.h"  #include "exf.h"
54  #include "exf_param.h"  #include "exf_param.h"
# Line 59  c     == routine arguments == Line 61  c     == routine arguments ==
61  c     == local variables ==  c     == local variables ==
62    
63        integer i        integer i
64          integer date_array(4), difftime(4)
 c     == external ==  
   
       integer  ilnblnk  
       external ilnblnk  
65    
66  c     == end of interface ==  c     == end of interface ==
67    
68  c     Surface flux data.  c     Surface flux data.
69        namelist /exf_nml/        namelist /exf_nml/
70       &    repeatPeriod,       &      windstressmax,       repeatPeriod,    exf_albedo,
71       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,
72       &    atempstartdate1,    atempstartdate2,   atempperiod,       &    atempstartdate1,    atempstartdate2,   atempperiod,
73       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,
# Line 83  c     Surface flux data. Line 81  c     Surface flux data.
81       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,
82       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,
83       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,
84         &   swdownstartdate1,   swdownstartdate2,  swdownperiod,
85         &   lwdownstartdate1,   lwdownstartdate2,  lwdownperiod,
86       &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,       &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,
87       &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,       &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,
88       &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,       &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,
# Line 93  c     Surface flux data. Line 93  c     Surface flux data.
93       &        ustressfile,        vstressfile,      evapfile,       &        ustressfile,        vstressfile,      evapfile,
94       &          uwindfile,          vwindfile,       &          uwindfile,          vwindfile,
95       &         swfluxfile,         lwfluxfile, apressurefile,       &         swfluxfile,         lwfluxfile, apressurefile,
96       &          exf_iprec,         exf_yftype,       &         swdownfile,         lwdownfile,
97       &           scal_hfl,           scal_ust,       scal_vst,       &          exf_iprec,         exf_yftype,
98       &           scal_swf,           scal_sst,       scal_sss,       & useExfYearlyFields,   useExfCheckRange,
99       &     scal_apressure,           scal_sfl       &   exf_inscal_hflux,  exf_inscal_sflux,
100         & exf_inscal_ustress,  exf_inscal_vstress,
101         &   exf_inscal_uwind,  exf_inscal_vwind,    exf_inscal_evap,
102         &   exf_inscal_atemp,  exf_offset_atemp,    exf_inscal_aqh,
103         &     exf_inscal_sst,  exf_inscal_sss,
104         &  exf_inscal_swflux,  exf_inscal_lwflux,   exf_inscal_precip,
105         &  exf_inscal_runoff,  exf_inscal_apressure,
106         &  exf_inscal_swdown,  exf_inscal_lwdown,
107         &  exf_outscal_hflux,  exf_outscal_ustress, exf_outscal_vstress,
108         & exf_outscal_swflux,  exf_outscal_sst,     exf_outscal_sss,
109         &  exf_outscal_sflux,  exf_outscal_apressure,
110         &         hfluxconst,
111         &         atempconst,
112         &         aqhconst,
113         &         sfluxconst,
114         &         evapconst,
115         &         precipconst,
116         &         runoffconst,
117         &         ustressconst,
118         &         vstressconst,
119         &         uwindconst,
120         &         vwindconst,
121         &         swfluxconst,
122         &         lwfluxconst,
123         &         swdownconst,
124         &         lwdownconst,
125         &         apressureconst
126    #ifdef USE_EXF_INTERPOLATION
127         & ,ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,
128         & ustress_nlon, ustress_nlat,
129         & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,
130         & vstress_nlon, vstress_nlat,
131         & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,
132         & hflux_nlon, hflux_nlat,
133         & sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc,
134         & sflux_nlon, sflux_nlat,
135         & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,
136         & swflux_nlon, swflux_nlat,
137         & runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc,
138         & runoff_nlon, runoff_nlat,
139         & atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc,
140         & atemp_nlon, atemp_nlat,
141         & aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc,
142         & aqh_nlon, aqh_nlat,
143         & evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc,
144         & evap_nlon, evap_nlat,
145         & precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc,
146         & precip_nlon, precip_nlat,
147         & uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc,
148         & uwind_nlon, uwind_nlat,
149         & vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc,
150         & vwind_nlon, vwind_nlat,
151         & lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc,
152         & lwflux_nlon, lwflux_nlat,
153         & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,
154         & swdown_nlon, swdown_nlat,
155         & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
156         & lwdown_nlon, lwdown_nlat,
157         & apressure_lon0,apressure_lon_inc,
158         & apressure_lat0,apressure_lat_inc,
159         & apressure_nlon,apressure_nlat
160    #endif
161    
162        _BEGIN_MASTER(mythid)        _BEGIN_MASTER(mythid)
163    
164  c     Set default values.  c     Set default values.
165    
166          year2sec           = 365.*86400.
167    
168  c     Calendar data.  c     Calendar data.
169        hfluxstartdate1    = 0        hfluxstartdate1    = 0
170        hfluxstartdate2    = 0        hfluxstartdate2    = 0
171        hfluxperiod        = 0.0 _d 0        hfluxperiod        = 0.0 _d 0
172          hfluxconst         = 0.0 _d 0
173    
174        atempstartdate1    = 0        atempstartdate1    = 0
175        atempstartdate2    = 0        atempstartdate2    = 0
176        atempperiod        = 0.0 _d 0        atempperiod        = 0.0 _d 0
177          atempconst         = celsius2K
178    
179        aqhstartdate1      = 0        aqhstartdate1      = 0
180        aqhstartdate2      = 0        aqhstartdate2      = 0
181        aqhperiod          = 0.0 _d 0        aqhperiod          = 0.0 _d 0
182          aqhconst           = 0.0 _d 0
183    
184        sfluxstartdate1    = 0        sfluxstartdate1    = 0
185        sfluxstartdate2    = 0        sfluxstartdate2    = 0
186        sfluxperiod        = 0.0 _d 0        sfluxperiod        = 0.0 _d 0
187          sfluxconst         = 0.0 _d 0
188    
189        evapstartdate1   = 0        evapstartdate1   = 0
190        evapstartdate2   = 0        evapstartdate2   = 0
191        evapperiod       = 0.0 _d 0        evapperiod       = 0.0 _d 0
192          evapconst        = 0.0 _d 0
193    
194        precipstartdate1   = 0        precipstartdate1   = 0
195        precipstartdate2   = 0        precipstartdate2   = 0
196        precipperiod       = 0.0 _d 0        precipperiod       = 0.0 _d 0
197          precipconst        = 0.0 _d 0
198    
199        runoffstartdate1   = 0        runoffstartdate1   = 0
200        runoffstartdate2   = 0        runoffstartdate2   = 0
201        runoffperiod       = 0.0 _d 0        runoffperiod       = 0.0 _d 0
202          runoffconst        = 0.0 _d 0
203    
204        ustressstartdate1  = 0        ustressstartdate1  = 0
205        ustressstartdate2  = 0        ustressstartdate2  = 0
206        ustressperiod      = 0.0 _d 0        ustressperiod      = 0.0 _d 0
207          ustressconst       = 0.0 _d 0
208    
209        vstressstartdate1  = 0        vstressstartdate1  = 0
210        vstressstartdate2  = 0        vstressstartdate2  = 0
211        vstressperiod      = 0.0 _d 0        vstressperiod      = 0.0 _d 0
212          vstressconst       = 0.0 _d 0
213    
214        uwindstartdate1    = 0        uwindstartdate1    = 0
215        uwindstartdate2    = 0        uwindstartdate2    = 0
216        uwindperiod        = 0.0 _d 0        uwindperiod        = 0.0 _d 0
217          uwindconst         = 0.0 _d 0
218    
219        vwindstartdate1    = 0        vwindstartdate1    = 0
220        vwindstartdate2    = 0        vwindstartdate2    = 0
221        vwindperiod        = 0.0 _d 0        vwindperiod        = 0.0 _d 0
222          vwindconst         = 0.0 _d 0
223    
224        swfluxstartdate1   = 0        swfluxstartdate1   = 0
225        swfluxstartdate2   = 0        swfluxstartdate2   = 0
226        swfluxperiod       = 0.0 _d 0        swfluxperiod       = 0.0 _d 0
227          swfluxconst        = 0.0 _d 0
228    
229        lwfluxstartdate1   = 0        lwfluxstartdate1   = 0
230        lwfluxstartdate2   = 0        lwfluxstartdate2   = 0
231        lwfluxperiod       = 0.0 _d 0        lwfluxperiod       = 0.0 _d 0
232          lwfluxconst        = 0.0 _d 0
233    
234          swdownstartdate1   = 0
235          swdownstartdate2   = 0
236          swdownperiod       = 0.0 _d 0
237          swdownconst        = 0.0 _d 0
238    
239          lwdownstartdate1   = 0
240          lwdownstartdate2   = 0
241          lwdownperiod       = 0.0 _d 0
242          lwdownconst        = 0.0 _d 0
243    
244        obcsNstartdate1    = 0        obcsNstartdate1    = 0
245        obcsNstartdate2    = 0        obcsNstartdate2    = 0
# Line 174  c     Calendar data. Line 260  c     Calendar data.
260        apressurestartdate1    = 0        apressurestartdate1    = 0
261        apressurestartdate2    = 0        apressurestartdate2    = 0
262        apressureperiod        = 0.0 _d 0        apressureperiod        = 0.0 _d 0
263          apressureconst         = 0.0 _d 0
264    
265        repeatPeriod           = 0.0 _d 0        repeatPeriod           = 0.0 _d 0
266          exf_albedo             = 0.1 _d 0
267          windstressmax          = 2.0 _d 0
268    
269  c     Data files.  c     Data files.
270        hfluxfile          = ' '        hfluxfile          = ' '
# Line 191  c     Data files. Line 280  c     Data files.
280        vwindfile          = ' '        vwindfile          = ' '
281        swfluxfile         = ' '        swfluxfile         = ' '
282        lwfluxfile         = ' '        lwfluxfile         = ' '
283          swdownfile         = ' '
284          lwdownfile         = ' '
285        apressurefile      = ' '        apressurefile      = ' '
286    
287  c     Initialise the date arrays.  c     Start dates.
288        do i = 1,4        hfluxstartdate     = 0
289           hfluxstartdate(i)    = 0        atempstartdate     = 0
290           atempstartdate(i)    = 0        aqhstartdate       = 0
291           aqhstartdate(i)      = 0        evapstartdate      = 0
292           evapstartdate(i)     = 0        precipstartdate    = 0
293           precipstartdate(i)   = 0        sfluxstartdate     = 0
294           sfluxstartdate(i)    = 0        runoffstartdate    = 0
295           runoffstartdate(i)   = 0        ustressstartdate   = 0
296           ustressstartdate(i)  = 0        vstressstartdate   = 0
297           vstressstartdate(i)  = 0        uwindstartdate     = 0
298           uwindstartdate(i)    = 0        vwindstartdate     = 0
299           vwindstartdate(i)    = 0        swfluxstartdate    = 0
300           swfluxstartdate(i)   = 0        lwfluxstartdate    = 0
301           lwfluxstartdate(i)   = 0        swdownstartdate    = 0
302           obcsNstartdate(i)    = 0        lwdownstartdate    = 0
303           obcsSstartdate(i)    = 0        obcsNstartdate     = 0
304           obcsEstartdate(i)    = 0        obcsSstartdate     = 0
305           obcsWstartdate(i)    = 0        obcsEstartdate     = 0
306           apressurestartdate(i)= 0        obcsWstartdate     = 0
307        enddo        apressurestartdate = 0
308    
309  c     Initialise file type and field precision  c     Initialise file type and field precision
310        exf_iprec       = 32        exf_iprec            = 32
311        exf_yftype      = 'RL'        exf_yftype           = 'RL'
312          useExfYearlyFields   = .FALSE.
313  c     scaling between exf units and MITgcm units        useExfCheckRange     = .TRUE.
314        scal_hfl       =  1. _d 0  
315        scal_ust       =  1. _d 0  c     Input scaling factors.
316        scal_vst       =  1. _d 0        exf_inscal_hflux     =  1. _d 0
317        scal_swf       =  1. _d 0        exf_inscal_sflux     =  1. _d 0
318        scal_sst       =  1. _d 0        exf_inscal_ustress   =  1. _d 0
319        scal_sss       =  1. _d 0        exf_inscal_vstress   =  1. _d 0
320        scal_apressure =  1. _d 0        exf_inscal_uwind     =  1. _d 0
321        scal_sfl       =  1. _d 0            exf_inscal_vwind     =  1. _d 0
322          exf_inscal_swflux    =  1. _d 0
323          exf_inscal_lwflux    =  1. _d 0
324          exf_inscal_precip    =  1. _d 0
325          exf_inscal_sst       =  1. _d 0
326          exf_inscal_sss       =  1. _d 0
327          exf_inscal_atemp     =  1. _d 0
328          exf_offset_atemp     =  0. _d 0
329          exf_inscal_aqh       =  1. _d 0
330          exf_inscal_evap      =  1. _d 0
331          exf_inscal_apressure =  1. _d 0
332    cds   convert runoff from m/yr to m/s and change sign.
333    cph   do this later, in exf_init_runoff
334          exf_inscal_runoff    =  1. _d 0
335          exf_inscal_swdown    =  1. _d 0
336          exf_inscal_lwdown    =  1. _d 0
337    
338    c     Output scaling factors.
339          exf_outscal_hflux    =  1. _d 0
340          exf_outscal_sflux    =  1. _d 0
341          exf_outscal_ustress  =  1. _d 0
342          exf_outscal_vstress  =  1. _d 0
343          exf_outscal_swflux   =  1. _d 0
344          exf_outscal_sst      =  1. _d 0
345          exf_outscal_sss      =  1. _d 0
346          exf_outscal_apressure=  1. _d 0
347    
348    #ifdef USE_EXF_INTERPOLATION
349          ustress_lon0   = thetaMin
350          uwind_lon0     = thetaMin
351          vstress_lon0   = thetaMin + delX(1) / 2
352          hflux_lon0     = thetaMin + delX(1) / 2
353          sflux_lon0     = thetaMin + delX(1) / 2
354          swflux_lon0    = thetaMin + delX(1) / 2
355          runoff_lon0    = thetaMin + delX(1) / 2
356          atemp_lon0     = thetaMin + delX(1) / 2
357          aqh_lon0       = thetaMin + delX(1) / 2
358          evap_lon0      = thetaMin + delX(1) / 2
359          precip_lon0    = thetaMin + delX(1) / 2
360          vwind_lon0     = thetaMin + delX(1) / 2
361          lwflux_lon0    = thetaMin + delX(1) / 2
362          swdown_lon0    = thetaMin + delX(1) / 2
363          lwdown_lon0    = thetaMin + delX(1) / 2
364          apressure_lon0 = thetaMin + delX(1) / 2
365          vstress_lat0   = phimin
366          vwind_lat0     = phimin
367          ustress_lat0   = phimin   + delY(1) / 2
368          hflux_lat0     = phimin   + delY(1) / 2
369          sflux_lat0     = phimin   + delY(1) / 2
370          runoff_lat0    = phimin   + delY(1) / 2
371          swflux_lat0    = phimin   + delY(1) / 2
372          atemp_lat0     = phimin   + delY(1) / 2
373          aqh_lat0       = phimin   + delY(1) / 2
374          evap_lat0      = phimin   + delY(1) / 2
375          precip_lat0    = phimin   + delY(1) / 2
376          uwind_lat0     = phimin   + delY(1) / 2
377          lwflux_lat0    = phimin   + delY(1) / 2
378          swdown_lat0    = phimin   + delY(1) / 2
379          lwdown_lat0    = phimin   + delY(1) / 2
380          apressure_lat0 = phimin   + delY(1) / 2
381          ustress_nlon   = Nx
382          ustress_nlat   = Ny
383          vstress_nlon   = Nx
384          vstress_nlat   = Ny
385          hflux_nlon     = Nx
386          hflux_nlat     = Ny
387          sflux_nlon     = Nx
388          sflux_nlat     = Ny
389          swflux_nlon    = Nx
390          swflux_nlat    = Ny
391          runoff_nlon    = Nx
392          runoff_nlat    = Ny
393          atemp_nlon     = Nx
394          atemp_nlat     = Ny
395          aqh_nlon       = Nx
396          aqh_nlat       = Ny
397          evap_nlon      = Nx
398          evap_nlat      = Ny
399          precip_nlon    = Nx
400          precip_nlat    = Ny
401          uwind_nlon     = Nx
402          uwind_nlat     = Ny
403          vwind_nlon     = Nx
404          vwind_nlat     = Ny
405          lwflux_nlon    = Nx
406          lwflux_nlat    = Ny
407          swdown_nlon    = Nx
408          swdown_nlat    = Ny
409          lwdown_nlon    = Nx
410          lwdown_nlat    = Ny
411          apressure_nlon = Nx
412          apressure_nlat = Ny
413          Ustress_lon_inc   = delX(1)
414          vstress_lon_inc   = delX(1)
415          hflux_lon_inc     = delX(1)
416          sflux_lon_inc     = delX(1)
417          swflux_lon_inc    = delX(1)
418          runoff_lon_inc    = delX(1)
419          atemp_lon_inc     = delX(1)
420          aqh_lon_inc       = delX(1)
421          evap_lon_inc      = delX(1)
422          precip_lon_inc    = delX(1)
423          uwind_lon_inc     = delX(1)
424          vwind_lon_inc     = delX(1)
425          lwflux_lon_inc    = delX(1)
426          swdown_lon_inc    = delX(1)
427          lwdown_lon_inc    = delX(1)
428          apressure_lon_inc = delX(1)
429          DO i=1,MAX_LAT_INC
430             IF (i.LT.Ny) THEN
431                vstress_lat_inc(i)   =  delY(i)
432                vwind_lat_inc(i)     =  delY(i)
433                ustress_lat_inc(i)   = (delY(i) + delY(i)) / 2.
434                hflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.
435                sflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.
436                swflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.
437                runoff_lat_inc(i)    = (delY(i) + delY(i)) / 2.
438                atemp_lat_inc(i)     = (delY(i) + delY(i)) / 2.
439                aqh_lat_inc(i)       = (delY(i) + delY(i)) / 2.
440                evap_lat_inc(i)      = (delY(i) + delY(i)) / 2.
441                precip_lat_inc(i)    = (delY(i) + delY(i)) / 2.
442                uwind_lat_inc(i)     = (delY(i) + delY(i)) / 2.
443                lwflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.
444                swdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
445                lwdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
446                apressure_lat_inc(i) = (delY(i) + delY(i)) / 2.
447             ELSE
448                ustress_lat_inc(i)   = 0.
449                vstress_lat_inc(i)   = 0.
450                hflux_lat_inc(i)     = 0.
451                sflux_lat_inc(i)     = 0.
452                swflux_lat_inc(i)    = 0.
453                runoff_lat_inc(i)    = 0.
454                atemp_lat_inc(i)     = 0.
455                aqh_lat_inc(i)       = 0.
456                evap_lat_inc(i)      = 0.
457                precip_lat_inc(i)    = 0.
458                uwind_lat_inc(i)     = 0.
459                vwind_lat_inc(i)     = 0.
460                lwflux_lat_inc(i)    = 0.
461                swdown_lat_inc(i)    = 0.
462                lwdown_lat_inc(i)    = 0.
463                apressure_lat_inc(i) = 0.
464             ENDIF
465          ENDDO
466    #endif /* USE_EXF_INTERPOLATION */
467    
468  c     Check for the availability of the right calendar version.  c     Check for the availability of the right calendar version.
469        if ( calendarversion .ne. usescalendarversion ) then        if ( calendarversion .ne. usescalendarversion ) then
# Line 247  c     Next, read the forcing data file. Line 483  c     Next, read the forcing data file.
483        read(  scrunit1, nml = exf_nml )        read(  scrunit1, nml = exf_nml )
484        close( scrunit1 )        close( scrunit1 )
485    
486          call exf_check( mythid )
487    
488  c     Complete the start date specifications for the forcing  c     Complete the start date specifications for the forcing
489  c     fields to get a complete calendar date array.  c     fields to get a complete calendar date array.
490    
491  c     check for consistency  #ifdef ALLOW_ATM_WIND
492          if ( uwindfile .NE. ' ' ) then
493        if (.NOT.           call cal_FullDate  ( uwindstartdate1    ,      uwindstartdate2,
494       &     (exf_iprec .EQ. 32 .OR. exf_iprec .EQ. 64)       &        date_array                        ,mythid )
495       &     ) then           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
496           stop 'stop in exf_readparms: value of exf_iprec not allowed'           call cal_ToSeconds ( difftime,    uwindstartdate     ,mythid )
497        else if (.NOT.           uwindstartdate     = modelstart   + uwindstartdate
498       &        (exf_yftype .EQ. 'RS' .OR.        endif
499       &        exf_yftype .EQ. 'RL')        if ( vwindfile .NE. ' ' ) then
500       &        ) then           call cal_FullDate  ( vwindstartdate1    ,      vwindstartdate2,
501           stop 'stop in exf_readparms: value of exf_yftype not allowed'       &        date_array                        ,mythid )
502        end if           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
503             call cal_ToSeconds ( difftime,    vwindstartdate     ,mythid )
504  #ifdef EXF_READ_EVAP           vwindstartdate     = modelstart   + vwindstartdate
505        call cal_FullDate(  evapstartdate1,    evapstartdate2,        endif
506       &                    evapstartdate,              mythid )  #else
507  #endif EXF_READ_EVAP        if ( ustressfile .NE. ' ' ) then
508             call cal_FullDate  ( ustressstartdate1  ,    ustressstartdate2,
509  #ifdef ALLOW_RUNOFF       &        date_array                        ,mythid )
510        call cal_FullDate(  runoffstartdate1,  runoffstartdate2,           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
511       &                    runoffstartdate,            mythid )           call cal_ToSeconds ( difftime,  ustressstartdate     ,mythid )
512             ustressstartdate   = modelstart + ustressstartdate
513          endif
514          if ( vstressfile .NE. ' ' ) then
515             call cal_FullDate  ( vstressstartdate1  ,    vstressstartdate2,
516         &        date_array                        ,mythid )
517             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
518             call cal_ToSeconds ( difftime,  vstressstartdate     ,mythid )
519             vstressstartdate   = modelstart + vstressstartdate
520          endif
521  #endif  #endif
522    
 #ifdef ALLOW_BULKFORMULAE  
   
523  #ifdef ALLOW_ATM_TEMP  #ifdef ALLOW_ATM_TEMP
524        call cal_FullDate(   atempstartdate1,   atempstartdate2,        if ( atempfile .NE. ' ' ) then
525       &                     atempstartdate,            mythid )           call cal_FullDate  ( atempstartdate1    ,      atempstartdate2,
526        call cal_FullDate(     aqhstartdate1,     aqhstartdate2,       &        date_array                        ,mythid )
527       &                       aqhstartdate,            mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
528        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,           call cal_ToSeconds ( difftime,    atempstartdate     ,mythid )
529       &                    swfluxstartdate,            mythid )           atempstartdate     = modelstart   + atempstartdate
530        call cal_FullDate(  lwfluxstartdate1,  lwfluxstartdate2,        endif
531       &                    lwfluxstartdate,            mythid )        if ( aqhfile .NE. ' ' ) then
532        call cal_FullDate(  precipstartdate1,  precipstartdate2,           call cal_FullDate  ( aqhstartdate1      ,        aqhstartdate2,
533       &                    precipstartdate,            mythid )       &        date_array                        ,mythid )
534             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
535             call cal_ToSeconds ( difftime,      aqhstartdate     ,mythid )
536             aqhstartdate       = modelstart     + aqhstartdate
537          endif
538          if ( lwfluxfile .NE. ' ' ) then
539             call cal_FullDate  ( lwfluxstartdate1   ,     lwfluxstartdate2,
540         &        date_array                        ,mythid )
541             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
542             call cal_ToSeconds ( difftime,   lwfluxstartdate     ,mythid )
543             lwfluxstartdate    = modelstart  + lwfluxstartdate
544          endif
545          if ( precipfile .NE. ' ' ) then
546             call cal_FullDate  ( precipstartdate1   ,     precipstartdate2,
547         &        date_array                        ,mythid )
548             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
549             call cal_ToSeconds ( difftime,   precipstartdate     ,mythid )
550             precipstartdate    = modelstart  + precipstartdate
551          endif
552  #else  #else
553        call cal_FullDate(   hfluxstartdate1,   hfluxstartdate2,        if ( hfluxfile .NE. ' ' ) then
554       &                     hfluxstartdate,            mythid )           call cal_FullDate  ( hfluxstartdate1    ,      hfluxstartdate2,
555        call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,       &        date_array                        ,mythid )
556       &                     sfluxstartdate,           mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
557  #ifdef ALLOW_KPP           call cal_ToSeconds ( difftime,    hfluxstartdate     ,mythid )
558        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,           hfluxstartdate     = modelstart   + hfluxstartdate
559       &                    swfluxstartdate,            mythid )        endif
560          if ( sfluxfile .NE. ' ' ) then
561             call cal_FullDate  ( sfluxstartdate1    ,      sfluxstartdate2,
562         &        date_array                        ,mythid )
563             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
564             call cal_ToSeconds ( difftime,    sfluxstartdate     ,mythid )
565             sfluxstartdate     = modelstart   + sfluxstartdate
566          endif
567  #endif  #endif
568    
569    #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
570          if ( swfluxfile .NE. ' ' ) then
571             call cal_FullDate  ( swfluxstartdate1   ,     swfluxstartdate2,
572         &        date_array                        ,mythid )
573             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
574             call cal_ToSeconds ( difftime,   swfluxstartdate     ,mythid )
575             swfluxstartdate    = modelstart  + swfluxstartdate
576          endif
577  #endif  #endif
578    
579  #ifdef ALLOW_ATM_WIND  #ifdef EXF_READ_EVAP
580        call cal_FullDate(   uwindstartdate1,   uwindstartdate2,        if ( evapfile .NE. ' ' ) then
581       &                     uwindstartdate,            mythid )           call cal_FullDate  ( evapstartdate1     ,       evapstartdate2,
582        call cal_FullDate(   vwindstartdate1,   vwindstartdate2,       &        date_array                        ,mythid )
583       &                     vwindstartdate,            mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
584  #else           call cal_ToSeconds ( difftime,     evapstartdate     ,mythid )
585        call cal_FullDate( ustressstartdate1, ustressstartdate2,           evapstartdate      = modelstart    + evapstartdate
586       &                   ustressstartdate,            mythid )        endif
       call cal_FullDate( vstressstartdate1, vstressstartdate2,  
      &                   vstressstartdate,            mythid )  
587  #endif  #endif
588    
589  #else  #ifdef ALLOW_RUNOFF
590        call cal_FullDate(   hfluxstartdate1,  hfluxstartdate2,        if ( runofffile .NE. ' ' ) then
591       &                     hfluxstartdate,           mythid )           call cal_FullDate  ( runoffstartdate1   ,     runoffstartdate2,
592        call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,       &        date_array                        ,mythid )
593       &                     sfluxstartdate,           mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
594        call cal_FullDate( ustressstartdate1, ustressstartdate2,           call cal_ToSeconds ( difftime,   runoffstartdate     ,mythid )
595       &                   ustressstartdate,            mythid )           runoffstartdate    = modelstart  + runoffstartdate
596        call cal_FullDate( vstressstartdate1, vstressstartdate2,        endif
597       &                   vstressstartdate,            mythid )  #endif
598  #ifdef ALLOW_KPP  
599        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,  #ifdef ALLOW_DOWNWARD_RADIATION
600       &                    swfluxstartdate,            mythid )        if ( swdownfile .NE. ' ' ) then
601             call cal_FullDate  ( swdownstartdate1   ,     swdownstartdate2,
602         &        date_array                        ,mythid )
603             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
604             call cal_ToSeconds ( difftime,   swdownstartdate     ,mythid )
605             swdownstartdate    = modelstart  + swdownstartdate
606          endif
607          if ( lwdownfile .NE. ' ' ) then
608             call cal_FullDate  ( lwdownstartdate1   ,     lwdownstartdate2,
609         &        date_array                        ,mythid )
610             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
611             call cal_ToSeconds ( difftime,   lwdownstartdate     ,mythid )
612             lwdownstartdate    = modelstart  + lwdownstartdate
613          endif
614  #endif  #endif
615    
616    #ifdef ATMOSPHERIC_LOADING
617          if ( apressurefile .NE. ' ' ) then
618             call cal_FullDate  ( apressurestartdate1,  apressurestartdate2,
619         &        date_array                        ,mythid )
620             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
621             call cal_ToSeconds ( difftime,  apressurestartdate   ,mythid )
622             apressurestartdate = modelstart + apressurestartdate
623          endif
624  #endif  #endif
625    
626  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
627  #ifdef ALLOW_OBCS_NORTH  #ifdef ALLOW_OBCS_NORTH
628        call cal_FullDate(  obcsNstartdate1,  obcsNstartdate2,        if ( obcsNperiod .NE. 0 ) then
629       &                    obcsNstartdate,           mythid )           call cal_FullDate  ( obcsNstartdate1    ,      obcsNstartdate2,
630         &        date_array                        ,mythid )
631             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
632             call cal_ToSeconds ( difftime,   obcsNstartdate      ,mythid )
633             obcsNstartdate     = modelstart + obcsNstartdate
634          endif
635  #endif  #endif
636  #ifdef ALLOW_OBCS_SOUTH  #ifdef ALLOW_OBCS_SOUTH
637        call cal_FullDate(  obcsSstartdate1,  obcsSstartdate2,        if ( obcsSperiod .NE. 0 ) then
638       &                    obcsSstartdate,           mythid )           call cal_FullDate  ( obcsSstartdate1    ,      obcsSstartdate2,
639         &        date_array                        ,mythid )
640             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
641             call cal_ToSeconds ( difftime,   obcsSstartdate      ,mythid )
642             obcsSstartdate     = modelstart + obcsSstartdate
643          endif
644  #endif  #endif
645  #ifdef ALLOW_OBCS_EAST  #ifdef ALLOW_OBCS_EAST
646        call cal_FullDate(  obcsEstartdate1,  obcsEstartdate2,        if ( obcsEperiod .NE. 0 ) then
647       &                    obcsEstartdate,           mythid )           call cal_FullDate  ( obcsEstartdate1    ,      obcsEstartdate2,
648         &        date_array                        ,mythid )
649             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
650             call cal_ToSeconds ( difftime,   obcsEstartdate      ,mythid )
651             obcsEstartdate     = modelstart + obcsEstartdate
652          endif
653  #endif  #endif
654  #ifdef ALLOW_OBCS_WEST  #ifdef ALLOW_OBCS_WEST
655        call cal_FullDate(  obcsWstartdate1,  obcsWstartdate2,        if ( obcsNperiod .NE. 0 ) then
656       &                    obcsWstartdate,           mythid )           call cal_FullDate  ( obcsWstartdate1    ,      obcsWstartdate2,
657  #endif       &        date_array                        ,mythid )
658  #endif           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
659             call cal_ToSeconds ( difftime,  obcsWstartdate       ,mythid )
660  #ifdef ATMOSPHERIC_LOADING           obcsWstartdate     = modelstart + obcsWstartdate
661        call cal_FullDate(   apressurestartdate1, apressurestartdate2,        endif
      &                     apressurestartdate,          mythid )  
662  #endif  #endif
663    #endif /* ALLOW_OBCS */
664    
665        _END_MASTER( mythid )        _END_MASTER( mythid )
666    
# Line 357  c     check for consistency Line 669  c     check for consistency
669  c--   Summarize the External forcing's setup.  c--   Summarize the External forcing's setup.
670        call exf_summary( mythid )        call exf_summary( mythid )
671    
   
672  c--   set climatology parameters  c--   set climatology parameters
673        call exf_clim_readparms( mythid )        call exf_clim_readparms( mythid )
674    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.22