/[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.4 by cheisey, Thu Dec 19 13:44:51 2002 UTC revision 1.25 by dimitri, Mon Feb 21 05:32:55 2005 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 34  c     changed: Virginie Thierry, vthierr Line 35  c     changed: Virginie Thierry, vthierr
35  c              - added new obcs parameters (for each boundaries)  c              - added new obcs parameters (for each boundaries)
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
 c  
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     mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002
40    c
41  c     ==================================================================  c     ==================================================================
42  c     SUBROUTINE exf_readparms  c     SUBROUTINE exf_readparms
43  c     ==================================================================  c     ==================================================================
# Line 46  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 58  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,
74       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,
75         &     evapstartdate1,     evapstartdate2,    evapperiod,
76       &   precipstartdate1,   precipstartdate2,  precipperiod,       &   precipstartdate1,   precipstartdate2,  precipperiod,
77       &   runoffstartdate1,   runoffstartdate2,  runoffperiod,       &   runoffstartdate1,   runoffstartdate2,  runoffperiod,
78       &  ustressstartdate1,  ustressstartdate2, ustressperiod,       &  ustressstartdate1,  ustressstartdate2, ustressperiod,
# Line 81  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 88  c     Surface flux data. Line 90  c     Surface flux data.
90       &apressurestartdate1,apressurestartdate2,apressureperiod,       &apressurestartdate1,apressurestartdate2,apressureperiod,
91       &          hfluxfile,          atempfile,       aqhfile,       &          hfluxfile,          atempfile,       aqhfile,
92       &          sfluxfile,         precipfile,    runofffile,       &          sfluxfile,         precipfile,    runofffile,
93       &        ustressfile,        vstressfile,       &        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,  twoDigitYear,  useExfCheckRange,
99       &     scal_apressure,           scal_prc,       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
190          evapstartdate2   = 0
191          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 168  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          = ' '
271        atempfile          = ' '        atempfile          = ' '
272        aqhfile            = ' '        aqhfile            = ' '
273          evapfile           = ' '
274        precipfile         = ' '        precipfile         = ' '
275        sfluxfile          = ' '        sfluxfile          = ' '
276        runofffile         = ' '        runofffile         = ' '
# Line 185  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           precipstartdate(i)   = 0        precipstartdate    = 0.
293           sfluxstartdate(i)    = 0        sfluxstartdate     = 0.
294           runoffstartdate(i)   = 0        runoffstartdate    = 0.
295           ustressstartdate(i)  = 0        ustressstartdate   = 0.
296           vstressstartdate(i)  = 0        vstressstartdate   = 0.
297           uwindstartdate(i)    = 0        uwindstartdate     = 0.
298           vwindstartdate(i)    = 0        vwindstartdate     = 0.
299           swfluxstartdate(i)   = 0        swfluxstartdate    = 0.
300           lwfluxstartdate(i)   = 0        lwfluxstartdate    = 0.
301           obcsNstartdate(i)    = 0        swdownstartdate    = 0.
302           obcsSstartdate(i)    = 0        lwdownstartdate    = 0.
303           obcsEstartdate(i)    = 0        obcsNstartdate     = 0.
304           obcsWstartdate(i)    = 0        obcsSstartdate     = 0.
305           apressurestartdate(i)= 0        obcsEstartdate     = 0.
306        enddo        obcsWstartdate     = 0.
307          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        twoDigitYear         = .FALSE.
314        scal_hfl       =  1. _d 0        useExfCheckRange     = .TRUE.
315        scal_ust       =  1. _d 0  
316        scal_vst       =  1. _d 0  c     Input scaling factors.
317        scal_swf       =  1. _d 0        exf_inscal_hflux     =  1. _d 0
318        scal_sst       =  1. _d 0        exf_inscal_sflux     =  1. _d 0
319        scal_sss       =  1. _d 0        exf_inscal_ustress   =  1. _d 0
320        scal_apressure =  1. _d 0        exf_inscal_vstress   =  1. _d 0
321  #if (defined (ALLOW_BULKFORMULAE) && defined (ALLOW_ATM_TEMP))        exf_inscal_uwind     =  1. _d 0
322        scal_prc       =  1. _d 0        exf_inscal_vwind     =  1. _d 0
323  #else        exf_inscal_swflux    =  1. _d 0
324        scal_sfl       =  1. _d 0            exf_inscal_lwflux    =  1. _d 0
325  #endif        exf_inscal_precip    =  1. _d 0
326          exf_inscal_sst       =  1. _d 0
327          exf_inscal_sss       =  1. _d 0
328          exf_inscal_atemp     =  1. _d 0
329          exf_offset_atemp     =  0. _d 0
330          exf_inscal_aqh       =  1. _d 0
331          exf_inscal_evap      =  1. _d 0
332          exf_inscal_apressure =  1. _d 0
333          exf_inscal_runoff    =  1. _d 0
334          exf_inscal_swdown    =  1. _d 0
335          exf_inscal_lwdown    =  1. _d 0
336    
337    c     Output scaling factors.
338          exf_outscal_hflux    =  1. _d 0
339          exf_outscal_sflux    =  1. _d 0
340          exf_outscal_ustress  =  1. _d 0
341          exf_outscal_vstress  =  1. _d 0
342          exf_outscal_swflux   =  1. _d 0
343          exf_outscal_sst      =  1. _d 0
344          exf_outscal_sss      =  1. _d 0
345          exf_outscal_apressure=  1. _d 0
346    
347    #ifdef USE_EXF_INTERPOLATION
348          ustress_lon0   = thetaMin
349          uwind_lon0     = thetaMin
350          vstress_lon0   = thetaMin + delX(1) / 2
351          hflux_lon0     = thetaMin + delX(1) / 2
352          sflux_lon0     = thetaMin + delX(1) / 2
353          swflux_lon0    = thetaMin + delX(1) / 2
354          runoff_lon0    = thetaMin + delX(1) / 2
355          atemp_lon0     = thetaMin + delX(1) / 2
356          aqh_lon0       = thetaMin + delX(1) / 2
357          evap_lon0      = thetaMin + delX(1) / 2
358          precip_lon0    = thetaMin + delX(1) / 2
359          vwind_lon0     = thetaMin + delX(1) / 2
360          lwflux_lon0    = thetaMin + delX(1) / 2
361          swdown_lon0    = thetaMin + delX(1) / 2
362          lwdown_lon0    = thetaMin + delX(1) / 2
363          apressure_lon0 = thetaMin + delX(1) / 2
364          vstress_lat0   = phimin
365          vwind_lat0     = phimin
366          ustress_lat0   = phimin   + delY(1) / 2
367          hflux_lat0     = phimin   + delY(1) / 2
368          sflux_lat0     = phimin   + delY(1) / 2
369          runoff_lat0    = phimin   + delY(1) / 2
370          swflux_lat0    = phimin   + delY(1) / 2
371          atemp_lat0     = phimin   + delY(1) / 2
372          aqh_lat0       = phimin   + delY(1) / 2
373          evap_lat0      = phimin   + delY(1) / 2
374          precip_lat0    = phimin   + delY(1) / 2
375          uwind_lat0     = phimin   + delY(1) / 2
376          lwflux_lat0    = phimin   + delY(1) / 2
377          swdown_lat0    = phimin   + delY(1) / 2
378          lwdown_lat0    = phimin   + delY(1) / 2
379          apressure_lat0 = phimin   + delY(1) / 2
380          ustress_nlon   = Nx
381          ustress_nlat   = Ny
382          vstress_nlon   = Nx
383          vstress_nlat   = Ny
384          hflux_nlon     = Nx
385          hflux_nlat     = Ny
386          sflux_nlon     = Nx
387          sflux_nlat     = Ny
388          swflux_nlon    = Nx
389          swflux_nlat    = Ny
390          runoff_nlon    = Nx
391          runoff_nlat    = Ny
392          atemp_nlon     = Nx
393          atemp_nlat     = Ny
394          aqh_nlon       = Nx
395          aqh_nlat       = Ny
396          evap_nlon      = Nx
397          evap_nlat      = Ny
398          precip_nlon    = Nx
399          precip_nlat    = Ny
400          uwind_nlon     = Nx
401          uwind_nlat     = Ny
402          vwind_nlon     = Nx
403          vwind_nlat     = Ny
404          lwflux_nlon    = Nx
405          lwflux_nlat    = Ny
406          swdown_nlon    = Nx
407          swdown_nlat    = Ny
408          lwdown_nlon    = Nx
409          lwdown_nlat    = Ny
410          apressure_nlon = Nx
411          apressure_nlat = Ny
412          Ustress_lon_inc   = delX(1)
413          vstress_lon_inc   = delX(1)
414          hflux_lon_inc     = delX(1)
415          sflux_lon_inc     = delX(1)
416          swflux_lon_inc    = delX(1)
417          runoff_lon_inc    = delX(1)
418          atemp_lon_inc     = delX(1)
419          aqh_lon_inc       = delX(1)
420          evap_lon_inc      = delX(1)
421          precip_lon_inc    = delX(1)
422          uwind_lon_inc     = delX(1)
423          vwind_lon_inc     = delX(1)
424          lwflux_lon_inc    = delX(1)
425          swdown_lon_inc    = delX(1)
426          lwdown_lon_inc    = delX(1)
427          apressure_lon_inc = delX(1)
428          DO i=1,MAX_LAT_INC
429             IF (i.LT.Ny) THEN
430                vstress_lat_inc(i)   =  delY(i)
431                vwind_lat_inc(i)     =  delY(i)
432                ustress_lat_inc(i)   = (delY(i) + delY(i)) / 2.
433                hflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.
434                sflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.
435                swflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.
436                runoff_lat_inc(i)    = (delY(i) + delY(i)) / 2.
437                atemp_lat_inc(i)     = (delY(i) + delY(i)) / 2.
438                aqh_lat_inc(i)       = (delY(i) + delY(i)) / 2.
439                evap_lat_inc(i)      = (delY(i) + delY(i)) / 2.
440                precip_lat_inc(i)    = (delY(i) + delY(i)) / 2.
441                uwind_lat_inc(i)     = (delY(i) + delY(i)) / 2.
442                lwflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.
443                swdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
444                lwdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
445                apressure_lat_inc(i) = (delY(i) + delY(i)) / 2.
446             ELSE
447                ustress_lat_inc(i)   = 0.
448                vstress_lat_inc(i)   = 0.
449                hflux_lat_inc(i)     = 0.
450                sflux_lat_inc(i)     = 0.
451                swflux_lat_inc(i)    = 0.
452                runoff_lat_inc(i)    = 0.
453                atemp_lat_inc(i)     = 0.
454                aqh_lat_inc(i)       = 0.
455                evap_lat_inc(i)      = 0.
456                precip_lat_inc(i)    = 0.
457                uwind_lat_inc(i)     = 0.
458                vwind_lat_inc(i)     = 0.
459                lwflux_lat_inc(i)    = 0.
460                swdown_lat_inc(i)    = 0.
461                lwdown_lat_inc(i)    = 0.
462                apressure_lat_inc(i) = 0.
463             ENDIF
464          ENDDO
465    #endif /* USE_EXF_INTERPOLATION */
466    
467  c     Check for the availability of the right calendar version.  c     Check for the availability of the right calendar version.
468        if ( calendarversion .ne. usescalendarversion ) then        if ( calendarversion .ne. usescalendarversion ) then
# Line 244  c     Next, read the forcing data file. Line 482  c     Next, read the forcing data file.
482        read(  scrunit1, nml = exf_nml )        read(  scrunit1, nml = exf_nml )
483        close( scrunit1 )        close( scrunit1 )
484    
485          call exf_check( mythid )
486    
487  c     Complete the start date specifications for the forcing  c     Complete the start date specifications for the forcing
488  c     fields to get a complete calendar date array.  c     fields to get a complete calendar date array.
489    
490  c     check for consistency  #ifdef ALLOW_ATM_WIND
491          if ( uwindfile .NE. ' ' ) then
492        if (.NOT.           call cal_FullDate  ( uwindstartdate1    ,      uwindstartdate2,
493       &     (exf_iprec .EQ. 32 .OR. exf_iprec .EQ. 64)       &        date_array                        ,mythid )
494       &     ) then           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
495           stop 'stop in exf_readparms: value of exf_iprec not allowed'           call cal_ToSeconds ( difftime,    uwindstartdate     ,mythid )
496        else if (.NOT.           uwindstartdate     = modelstart   + uwindstartdate
497       &        (exf_yftype .EQ. 'RS' .OR.        endif
498       &        exf_yftype .EQ. 'RL')        if ( vwindfile .NE. ' ' ) then
499       &        ) then           call cal_FullDate  ( vwindstartdate1    ,      vwindstartdate2,
500           stop 'stop in exf_readparms: value of exf_yftype not allowed'       &        date_array                        ,mythid )
501        end if           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
502             call cal_ToSeconds ( difftime,    vwindstartdate     ,mythid )
503  #ifdef ALLOW_RUNOFF           vwindstartdate     = modelstart   + vwindstartdate
504        call cal_FullDate(  runoffstartdate1,  runoffstartdate2,        endif
505       &                    runoffstartdate,            mythid )  #else
506          if ( ustressfile .NE. ' ' ) then
507             call cal_FullDate  ( ustressstartdate1  ,    ustressstartdate2,
508         &        date_array                        ,mythid )
509             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
510             call cal_ToSeconds ( difftime,  ustressstartdate     ,mythid )
511             ustressstartdate   = modelstart + ustressstartdate
512          endif
513          if ( vstressfile .NE. ' ' ) then
514             call cal_FullDate  ( vstressstartdate1  ,    vstressstartdate2,
515         &        date_array                        ,mythid )
516             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
517             call cal_ToSeconds ( difftime,  vstressstartdate     ,mythid )
518             vstressstartdate   = modelstart + vstressstartdate
519          endif
520  #endif  #endif
521    
 #ifdef ALLOW_BULKFORMULAE  
   
522  #ifdef ALLOW_ATM_TEMP  #ifdef ALLOW_ATM_TEMP
523        call cal_FullDate(   atempstartdate1,   atempstartdate2,        if ( atempfile .NE. ' ' ) then
524       &                     atempstartdate,            mythid )           call cal_FullDate  ( atempstartdate1    ,      atempstartdate2,
525        call cal_FullDate(     aqhstartdate1,     aqhstartdate2,       &        date_array                        ,mythid )
526       &                       aqhstartdate,            mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
527        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,           call cal_ToSeconds ( difftime,    atempstartdate     ,mythid )
528       &                    swfluxstartdate,            mythid )           atempstartdate     = modelstart   + atempstartdate
529        call cal_FullDate(  lwfluxstartdate1,  lwfluxstartdate2,        endif
530       &                    lwfluxstartdate,            mythid )        if ( aqhfile .NE. ' ' ) then
531        call cal_FullDate(  precipstartdate1,  precipstartdate2,           call cal_FullDate  ( aqhstartdate1      ,        aqhstartdate2,
532       &                    precipstartdate,            mythid )       &        date_array                        ,mythid )
533             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
534             call cal_ToSeconds ( difftime,      aqhstartdate     ,mythid )
535             aqhstartdate       = modelstart     + aqhstartdate
536          endif
537          if ( lwfluxfile .NE. ' ' ) then
538             call cal_FullDate  ( lwfluxstartdate1   ,     lwfluxstartdate2,
539         &        date_array                        ,mythid )
540             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
541             call cal_ToSeconds ( difftime,   lwfluxstartdate     ,mythid )
542             lwfluxstartdate    = modelstart  + lwfluxstartdate
543          endif
544          if ( precipfile .NE. ' ' ) then
545             call cal_FullDate  ( precipstartdate1   ,     precipstartdate2,
546         &        date_array                        ,mythid )
547             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
548             call cal_ToSeconds ( difftime,   precipstartdate     ,mythid )
549             precipstartdate    = modelstart  + precipstartdate
550          endif
551  #else  #else
552        call cal_FullDate(   hfluxstartdate1,   hfluxstartdate2,        if ( hfluxfile .NE. ' ' ) then
553       &                     hfluxstartdate,            mythid )           call cal_FullDate  ( hfluxstartdate1    ,      hfluxstartdate2,
554        call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,       &        date_array                        ,mythid )
555       &                     sfluxstartdate,           mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
556  #ifdef ALLOW_KPP           call cal_ToSeconds ( difftime,    hfluxstartdate     ,mythid )
557        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,           hfluxstartdate     = modelstart   + hfluxstartdate
558       &                    swfluxstartdate,            mythid )        endif
559          if ( sfluxfile .NE. ' ' ) then
560             call cal_FullDate  ( sfluxstartdate1    ,      sfluxstartdate2,
561         &        date_array                        ,mythid )
562             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
563             call cal_ToSeconds ( difftime,    sfluxstartdate     ,mythid )
564             sfluxstartdate     = modelstart   + sfluxstartdate
565          endif
566  #endif  #endif
567    
568    #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
569          if ( swfluxfile .NE. ' ' ) then
570             call cal_FullDate  ( swfluxstartdate1   ,     swfluxstartdate2,
571         &        date_array                        ,mythid )
572             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
573             call cal_ToSeconds ( difftime,   swfluxstartdate     ,mythid )
574             swfluxstartdate    = modelstart  + swfluxstartdate
575          endif
576  #endif  #endif
577    
578  #ifdef ALLOW_ATM_WIND  #ifdef EXF_READ_EVAP
579        call cal_FullDate(   uwindstartdate1,   uwindstartdate2,        if ( evapfile .NE. ' ' ) then
580       &                     uwindstartdate,            mythid )           call cal_FullDate  ( evapstartdate1     ,       evapstartdate2,
581        call cal_FullDate(   vwindstartdate1,   vwindstartdate2,       &        date_array                        ,mythid )
582       &                     vwindstartdate,            mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
583  #else           call cal_ToSeconds ( difftime,     evapstartdate     ,mythid )
584        call cal_FullDate( ustressstartdate1, ustressstartdate2,           evapstartdate      = modelstart    + evapstartdate
585       &                   ustressstartdate,            mythid )        endif
       call cal_FullDate( vstressstartdate1, vstressstartdate2,  
      &                   vstressstartdate,            mythid )  
586  #endif  #endif
587    
588  #else  #ifdef ALLOW_RUNOFF
589        call cal_FullDate(   hfluxstartdate1,  hfluxstartdate2,        if ( runofffile .NE. ' ' .AND. runoffperiod .NE. 0. ) then
590       &                     hfluxstartdate,           mythid )           call cal_FullDate  ( runoffstartdate1   ,     runoffstartdate2,
591        call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,       &        date_array                        ,mythid )
592       &                     sfluxstartdate,           mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
593        call cal_FullDate( ustressstartdate1, ustressstartdate2,           call cal_ToSeconds ( difftime,   runoffstartdate     ,mythid )
594       &                   ustressstartdate,            mythid )           runoffstartdate    = modelstart  + runoffstartdate
595        call cal_FullDate( vstressstartdate1, vstressstartdate2,        endif
596       &                   vstressstartdate,            mythid )  #endif
597  #ifdef ALLOW_KPP  
598        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,  #ifdef ALLOW_DOWNWARD_RADIATION
599       &                    swfluxstartdate,            mythid )        if ( swdownfile .NE. ' ' ) then
600             call cal_FullDate  ( swdownstartdate1   ,     swdownstartdate2,
601         &        date_array                        ,mythid )
602             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
603             call cal_ToSeconds ( difftime,   swdownstartdate     ,mythid )
604             swdownstartdate    = modelstart  + swdownstartdate
605          endif
606          if ( lwdownfile .NE. ' ' ) then
607             call cal_FullDate  ( lwdownstartdate1   ,     lwdownstartdate2,
608         &        date_array                        ,mythid )
609             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
610             call cal_ToSeconds ( difftime,   lwdownstartdate     ,mythid )
611             lwdownstartdate    = modelstart  + lwdownstartdate
612          endif
613  #endif  #endif
614    
615    #ifdef ATMOSPHERIC_LOADING
616          if ( apressurefile .NE. ' ' ) then
617             call cal_FullDate  ( apressurestartdate1,  apressurestartdate2,
618         &        date_array                        ,mythid )
619             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
620             call cal_ToSeconds ( difftime,  apressurestartdate   ,mythid )
621             apressurestartdate = modelstart + apressurestartdate
622          endif
623  #endif  #endif
624    
625  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
626  #ifdef ALLOW_OBCS_NORTH  #ifdef ALLOW_OBCS_NORTH
627        call cal_FullDate(  obcsNstartdate1,  obcsNstartdate2,        if ( obcsNperiod .NE. 0 ) then
628       &                    obcsNstartdate,           mythid )           call cal_FullDate  ( obcsNstartdate1    ,      obcsNstartdate2,
629         &        date_array                        ,mythid )
630             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
631             call cal_ToSeconds ( difftime,   obcsNstartdate      ,mythid )
632             obcsNstartdate     = modelstart + obcsNstartdate
633          endif
634  #endif  #endif
635  #ifdef ALLOW_OBCS_SOUTH  #ifdef ALLOW_OBCS_SOUTH
636        call cal_FullDate(  obcsSstartdate1,  obcsSstartdate2,        if ( obcsSperiod .NE. 0 ) then
637       &                    obcsSstartdate,           mythid )           call cal_FullDate  ( obcsSstartdate1    ,      obcsSstartdate2,
638         &        date_array                        ,mythid )
639             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
640             call cal_ToSeconds ( difftime,   obcsSstartdate      ,mythid )
641             obcsSstartdate     = modelstart + obcsSstartdate
642          endif
643  #endif  #endif
644  #ifdef ALLOW_OBCS_EAST  #ifdef ALLOW_OBCS_EAST
645        call cal_FullDate(  obcsEstartdate1,  obcsEstartdate2,        if ( obcsEperiod .NE. 0 ) then
646       &                    obcsEstartdate,           mythid )           call cal_FullDate  ( obcsEstartdate1    ,      obcsEstartdate2,
647         &        date_array                        ,mythid )
648             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
649             call cal_ToSeconds ( difftime,   obcsEstartdate      ,mythid )
650             obcsEstartdate     = modelstart + obcsEstartdate
651          endif
652  #endif  #endif
653  #ifdef ALLOW_OBCS_WEST  #ifdef ALLOW_OBCS_WEST
654        call cal_FullDate(  obcsWstartdate1,  obcsWstartdate2,        if ( obcsNperiod .NE. 0 ) then
655       &                    obcsWstartdate,           mythid )           call cal_FullDate  ( obcsWstartdate1    ,      obcsWstartdate2,
656  #endif       &        date_array                        ,mythid )
657  #endif           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
658             call cal_ToSeconds ( difftime,  obcsWstartdate       ,mythid )
659  #ifdef ATMOSPHERIC_LOADING           obcsWstartdate     = modelstart + obcsWstartdate
660        call cal_FullDate(   apressurestartdate1, apressurestartdate2,        endif
      &                     apressurestartdate,          mythid )  
661  #endif  #endif
662    #endif /* ALLOW_OBCS */
663    
664        _END_MASTER( mythid )        _END_MASTER( mythid )
665    
# Line 349  c     check for consistency Line 668  c     check for consistency
668  c--   Summarize the External forcing's setup.  c--   Summarize the External forcing's setup.
669        call exf_summary( mythid )        call exf_summary( mythid )
670    
   
671  c--   set climatology parameters  c--   set climatology parameters
672        call exf_clim_readparms( mythid )        call exf_clim_readparms( mythid )
673    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.22