/[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.31 by mlosch, Tue May 30 22:47:40 2006 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)
65          integer iUnit
66    
67  c     == external ==        character*(max_len_mbuf) msgbuf
   
       integer  ilnblnk  
       external ilnblnk  
68    
69  c     == end of interface ==  c     == end of interface ==
70    
71  c     Surface flux data.  c     Surface flux data.
72        namelist /exf_nml/        namelist /exf_nml/
73       &    repeatPeriod,       &      windstressmax,       repeatPeriod,
74         &         exf_albedo,  
75         &   ocean_emissivity,     ice_emissivity, snow_emissivity,
76       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,
77       &    atempstartdate1,    atempstartdate2,   atempperiod,       &    atempstartdate1,    atempstartdate2,   atempperiod,
78       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,
79       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,
80         &     evapstartdate1,     evapstartdate2,    evapperiod,
81       &   precipstartdate1,   precipstartdate2,  precipperiod,       &   precipstartdate1,   precipstartdate2,  precipperiod,
82         & snowprecipstartdate1, snowprecipstartdate2, snowprecipperiod,
83       &   runoffstartdate1,   runoffstartdate2,  runoffperiod,       &   runoffstartdate1,   runoffstartdate2,  runoffperiod,
84       &  ustressstartdate1,  ustressstartdate2, ustressperiod,       &  ustressstartdate1,  ustressstartdate2, ustressperiod,
85       &  vstressstartdate1,  vstressstartdate2, vstressperiod,       &  vstressstartdate1,  vstressstartdate2, vstressperiod,
86       &    uwindstartdate1,    uwindstartdate2,   uwindperiod,       &    uwindstartdate1,    uwindstartdate2,   uwindperiod,
87       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,
88         &   wspeedstartdate1,   wspeedstartdate2,  wspeedperiod,
89       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,
90       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,
91         &   swdownstartdate1,   swdownstartdate2,  swdownperiod,
92         &   lwdownstartdate1,   lwdownstartdate2,  lwdownperiod,
93       &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,       &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,
94       &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,       &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,
95       &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,       &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,
# Line 88  c     Surface flux data. Line 97  c     Surface flux data.
97       &apressurestartdate1,apressurestartdate2,apressureperiod,       &apressurestartdate1,apressurestartdate2,apressureperiod,
98       &          hfluxfile,          atempfile,       aqhfile,       &          hfluxfile,          atempfile,       aqhfile,
99       &          sfluxfile,         precipfile,    runofffile,       &          sfluxfile,         precipfile,    runofffile,
100       &        ustressfile,        vstressfile,       &        ustressfile,        vstressfile,      evapfile,
101       &          uwindfile,          vwindfile,       &     snowprecipfile,
102         &          uwindfile,          vwindfile,    wspeedfile,
103       &         swfluxfile,         lwfluxfile, apressurefile,       &         swfluxfile,         lwfluxfile, apressurefile,
104       &          exf_iprec,         exf_yftype,       &         swdownfile,         lwdownfile,
105       &           scal_hfl,           scal_ust,       scal_vst,       &          exf_iprec,  exf_yftype,
106       &           scal_swf,           scal_sst,       scal_sss,       & useExfYearlyFields,  twoDigitYear,         useExfCheckRange,
107       &     scal_apressure,           scal_prc,       scal_sfl       &   exf_inscal_hflux,  exf_inscal_sflux,      exf_inscal_evap,
108         & exf_inscal_ustress,  exf_inscal_vstress,
109         &   exf_inscal_uwind,  exf_inscal_vwind,    exf_inscal_wspeed,
110         &   exf_inscal_atemp,  exf_offset_atemp,       exf_inscal_aqh,
111         &     exf_inscal_sst,  exf_inscal_sss,
112         &  exf_inscal_swflux,  exf_inscal_lwflux,   exf_inscal_precip,
113         &  exf_inscal_runoff,  exf_inscal_apressure, exf_inscal_snowprecip,
114         &  exf_inscal_swdown,  exf_inscal_lwdown,
115         &  exf_outscal_hflux,  exf_outscal_ustress, exf_outscal_vstress,
116         & exf_outscal_swflux,  exf_outscal_sst,     exf_outscal_sss,
117         &  exf_outscal_sflux,  exf_outscal_apressure,
118         &         hfluxconst,   atempconst,            aqhconst,
119         &         sfluxconst,    evapconst,
120         &        precipconst,   snowprecipconst,
121         &        runoffconst, ustressconst,        vstressconst,
122         &         uwindconst,   vwindconst,         wspeedconst,
123         &        swfluxconst,  lwfluxconst,
124         &        swdownconst,  lwdownconst,
125         &         apressureconst,
126         &     hflux_exfremo_intercept, hflux_exfremo_slope,
127         &     atemp_exfremo_intercept, atemp_exfremo_slope,
128         &     aqh_exfremo_intercept, aqh_exfremo_slope,
129         &     sflux_exfremo_intercept, sflux_exfremo_slope,
130         &     evap_exfremo_intercept, evap_exfremo_slope,
131         &     precip_exfremo_intercept, precip_exfremo_slope,
132         &     snowprecip_exfremo_intercept, snowprecip_exfremo_slope,
133         &     runoff_exfremo_intercept, runoff_exfremo_slope,
134         &     ustress_exfremo_intercept, ustress_exfremo_slope,
135         &     vstress_exfremo_intercept, vstress_exfremo_slope,
136         &     uwind_exfremo_intercept, uwind_exfremo_slope,
137         &     vwind_exfremo_intercept, vwind_exfremo_slope,
138         &     wspeed_exfremo_intercept, wspeed_exfremo_slope,
139         &     swflux_exfremo_intercept, swflux_exfremo_slope,
140         &     lwflux_exfremo_intercept, lwflux_exfremo_slope,
141         &     swdown_exfremo_intercept, swdown_exfremo_slope,
142         &     lwdown_exfremo_intercept, lwdown_exfremo_slope,
143         &     apressure_exfremo_intercept, apressure_exfremo_slope
144    #ifdef USE_EXF_INTERPOLATION
145         & ,ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,
146         & ustress_nlon, ustress_nlat,
147         & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,
148         & vstress_nlon, vstress_nlat,
149         & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,
150         & hflux_nlon, hflux_nlat,
151         & sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc,
152         & sflux_nlon, sflux_nlat,
153         & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,
154         & swflux_nlon, swflux_nlat,
155         & runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc,
156         & runoff_nlon, runoff_nlat,
157         & atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc,
158         & atemp_nlon, atemp_nlat,
159         & aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc,
160         & aqh_nlon, aqh_nlat,
161         & evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc,
162         & evap_nlon, evap_nlat,
163         & precip_lon0, precip_lon_inc,
164         & precip_lat0, precip_lat_inc,
165         & precip_nlon, precip_nlat,
166         & snowprecip_lon0, snowprecip_lon_inc,
167         & snowprecip_lat0, snowprecip_lat_inc,
168         & snowprecip_nlon, snowprecip_nlat,
169         & uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc,
170         & uwind_nlon, uwind_nlat,
171         & vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc,
172         & vwind_nlon, vwind_nlat,
173         & wspeed_lon0, wspeed_lon_inc, wspeed_lat0, wspeed_lat_inc,
174         & wspeed_nlon, wspeed_nlat,
175         & lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc,
176         & lwflux_nlon, lwflux_nlat,
177         & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,
178         & swdown_nlon, swdown_nlat,
179         & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
180         & lwdown_nlon, lwdown_nlat,
181         & apressure_lon0,apressure_lon_inc,apressure_nlon,
182         & apressure_lat0,apressure_lat_inc,apressure_nlat
183    #endif
184    
185        _BEGIN_MASTER(mythid)        _BEGIN_MASTER(mythid)
186    
187  c     Set default values.  c     Set default values.
188    
189          year2sec           = 365.*86400.
190    
191  c     Calendar data.  c     Calendar data.
192        hfluxstartdate1    = 0        hfluxstartdate1    = 0
193        hfluxstartdate2    = 0        hfluxstartdate2    = 0
194        hfluxperiod        = 0.0 _d 0        hfluxperiod        = 0.0 _d 0
195          hfluxconst         = 0.0 _d 0
196          hflux_exfremo_intercept = 0.0 _d 0
197          hflux_exfremo_slope = 0.0 _d 0
198    
199        atempstartdate1    = 0        atempstartdate1    = 0
200        atempstartdate2    = 0        atempstartdate2    = 0
201        atempperiod        = 0.0 _d 0        atempperiod        = 0.0 _d 0
202          atempconst         = celsius2K
203          atemp_exfremo_intercept = 0.0 _d 0
204          atemp_exfremo_slope = 0.0 _d 0
205    
206        aqhstartdate1      = 0        aqhstartdate1      = 0
207        aqhstartdate2      = 0        aqhstartdate2      = 0
208        aqhperiod          = 0.0 _d 0        aqhperiod          = 0.0 _d 0
209          aqhconst           = 0.0 _d 0
210          aqh_exfremo_intercept = 0.0 _d 0
211          aqh_exfremo_slope = 0.0 _d 0
212    
213        sfluxstartdate1    = 0        sfluxstartdate1    = 0
214        sfluxstartdate2    = 0        sfluxstartdate2    = 0
215        sfluxperiod        = 0.0 _d 0        sfluxperiod        = 0.0 _d 0
216          sfluxconst         = 0.0 _d 0
217          sflux_exfremo_intercept = 0.0 _d 0
218          sflux_exfremo_slope = 0.0 _d 0
219    
220          evapstartdate1   = 0
221          evapstartdate2   = 0
222          evapperiod       = 0.0 _d 0
223          evapconst        = 0.0 _d 0
224          evap_exfremo_intercept = 0.0 _d 0
225          evap_exfremo_slope = 0.0 _d 0
226    
227        precipstartdate1   = 0        precipstartdate1   = 0
228        precipstartdate2   = 0        precipstartdate2   = 0
229        precipperiod       = 0.0 _d 0        precipperiod       = 0.0 _d 0
230          precipconst        = 0.0 _d 0
231          precip_exfremo_intercept = 0.0 _d 0
232          precip_exfremo_slope = 0.0 _d 0
233    
234          snowprecipstartdate1   = 0
235          snowprecipstartdate2   = 0
236          snowprecipperiod       = 0.0 _d 0
237          snowprecipconst        = 0.0 _d 0
238          snowprecip_exfremo_intercept = 0.0 _d 0
239          snowprecip_exfremo_slope = 0.0 _d 0
240    
241        runoffstartdate1   = 0        runoffstartdate1   = 0
242        runoffstartdate2   = 0        runoffstartdate2   = 0
243        runoffperiod       = 0.0 _d 0        runoffperiod       = 0.0 _d 0
244          runoffconst        = 0.0 _d 0
245          runoff_exfremo_intercept = 0.0 _d 0
246          runoff_exfremo_slope = 0.0 _d 0
247    
248        ustressstartdate1  = 0        ustressstartdate1  = 0
249        ustressstartdate2  = 0        ustressstartdate2  = 0
250        ustressperiod      = 0.0 _d 0        ustressperiod      = 0.0 _d 0
251          ustressconst       = 0.0 _d 0
252          ustress_exfremo_intercept = 0.0 _d 0
253          ustress_exfremo_slope = 0.0 _d 0
254    
255        vstressstartdate1  = 0        vstressstartdate1  = 0
256        vstressstartdate2  = 0        vstressstartdate2  = 0
257        vstressperiod      = 0.0 _d 0        vstressperiod      = 0.0 _d 0
258          vstressconst       = 0.0 _d 0
259          vstress_exfremo_intercept = 0.0 _d 0
260          vstress_exfremo_slope = 0.0 _d 0
261    
262        uwindstartdate1    = 0        uwindstartdate1    = 0
263        uwindstartdate2    = 0        uwindstartdate2    = 0
264        uwindperiod        = 0.0 _d 0        uwindperiod        = 0.0 _d 0
265          uwindconst         = 0.0 _d 0
266          uwind_exfremo_intercept = 0.0 _d 0
267          uwind_exfremo_slope = 0.0 _d 0
268    
269        vwindstartdate1    = 0        vwindstartdate1    = 0
270        vwindstartdate2    = 0        vwindstartdate2    = 0
271        vwindperiod        = 0.0 _d 0        vwindperiod        = 0.0 _d 0
272          vwindconst         = 0.0 _d 0
273          vwind_exfremo_intercept = 0.0 _d 0
274          vwind_exfremo_slope = 0.0 _d 0
275    
276          wspeedstartdate1    = 0
277          wspeedstartdate2    = 0
278          wspeedperiod        = 0.0 _d 0
279          wspeedconst         = 0.0 _d 0
280          wspeed_exfremo_intercept = 0.0 _d 0
281          wspeed_exfremo_slope = 0.0 _d 0
282    
283        swfluxstartdate1   = 0        swfluxstartdate1   = 0
284        swfluxstartdate2   = 0        swfluxstartdate2   = 0
285        swfluxperiod       = 0.0 _d 0        swfluxperiod       = 0.0 _d 0
286          swfluxconst        = 0.0 _d 0
287          swflux_exfremo_intercept = 0.0 _d 0
288          swflux_exfremo_slope = 0.0 _d 0
289    
290        lwfluxstartdate1   = 0        lwfluxstartdate1   = 0
291        lwfluxstartdate2   = 0        lwfluxstartdate2   = 0
292        lwfluxperiod       = 0.0 _d 0        lwfluxperiod       = 0.0 _d 0
293          lwfluxconst        = 0.0 _d 0
294          lwflux_exfremo_intercept = 0.0 _d 0
295          lwflux_exfremo_slope = 0.0 _d 0
296    
297          swdownstartdate1   = 0
298          swdownstartdate2   = 0
299          swdownperiod       = 0.0 _d 0
300          swdownconst        = 0.0 _d 0
301          swdown_exfremo_intercept = 0.0 _d 0
302          swdown_exfremo_slope = 0.0 _d 0
303    
304          lwdownstartdate1   = 0
305          lwdownstartdate2   = 0
306          lwdownperiod       = 0.0 _d 0
307          lwdownconst        = 0.0 _d 0
308          lwdown_exfremo_intercept = 0.0 _d 0
309          lwdown_exfremo_slope = 0.0 _d 0
310    
311          apressurestartdate1    = 0
312          apressurestartdate2    = 0
313          apressureperiod        = 0.0 _d 0
314          apressureconst         = 0.0 _d 0
315          apressure_exfremo_intercept = 0.0 _d 0
316          apressure_exfremo_slope = 0.0 _d 0
317    
318        obcsNstartdate1    = 0        obcsNstartdate1    = 0
319        obcsNstartdate2    = 0        obcsNstartdate2    = 0
# Line 165  c     Calendar data. Line 331  c     Calendar data.
331        obcsWstartdate2    = 0        obcsWstartdate2    = 0
332        obcsWperiod        = 0.0 _d 0        obcsWperiod        = 0.0 _d 0
333    
334        apressurestartdate1    = 0        repeatPeriod       = 0.0 _d 0
335        apressurestartdate2    = 0        exf_albedo         = 0.1 _d 0
336        apressureperiod        = 0.0 _d 0        windstressmax      = 2.0 _d 0
337    c--   this default is chosen to be backward compatible with
338        repeatPeriod           = 0.0 _d 0  c--   an earlier setting of 5.5 = ocean_emissivity*stefanBoltzmann
339          ocean_emissivity   = 5.50D-8/5.670D-8
340          ice_emissivity     = 0.98 _d 0
341          snow_emissivity    = 0.98 _d 0
342    
343  c     Data files.  c     Data files.
344        hfluxfile          = ' '        hfluxfile          = ' '
345        atempfile          = ' '        atempfile          = ' '
346        aqhfile            = ' '        aqhfile            = ' '
347          evapfile           = ' '
348        precipfile         = ' '        precipfile         = ' '
349          snowprecipfile     = ' '
350        sfluxfile          = ' '        sfluxfile          = ' '
351        runofffile         = ' '        runofffile         = ' '
352        ustressfile        = ' '        ustressfile        = ' '
353        vstressfile        = ' '        vstressfile        = ' '
354        uwindfile          = ' '        uwindfile          = ' '
355        vwindfile          = ' '        vwindfile          = ' '
356          wspeedfile         = ' '
357        swfluxfile         = ' '        swfluxfile         = ' '
358        lwfluxfile         = ' '        lwfluxfile         = ' '
359          swdownfile         = ' '
360          lwdownfile         = ' '
361        apressurefile      = ' '        apressurefile      = ' '
362    
363  c     Initialise the date arrays.  c     Start dates.
364        do i = 1,4        hfluxstartdate     = 0.
365           hfluxstartdate(i)    = 0        atempstartdate     = 0.
366           atempstartdate(i)    = 0        aqhstartdate       = 0.
367           aqhstartdate(i)      = 0        evapstartdate      = 0.
368           precipstartdate(i)   = 0        precipstartdate    = 0.
369           sfluxstartdate(i)    = 0        snowprecipstartdate = 0.
370           runoffstartdate(i)   = 0        sfluxstartdate     = 0.
371           ustressstartdate(i)  = 0        runoffstartdate    = 0.
372           vstressstartdate(i)  = 0        ustressstartdate   = 0.
373           uwindstartdate(i)    = 0        vstressstartdate   = 0.
374           vwindstartdate(i)    = 0        uwindstartdate     = 0.
375           swfluxstartdate(i)   = 0        vwindstartdate     = 0.
376           lwfluxstartdate(i)   = 0        wspeedstartdate    = 0.
377           obcsNstartdate(i)    = 0        swfluxstartdate    = 0.
378           obcsSstartdate(i)    = 0        lwfluxstartdate    = 0.
379           obcsEstartdate(i)    = 0        swdownstartdate    = 0.
380           obcsWstartdate(i)    = 0        lwdownstartdate    = 0.
381           apressurestartdate(i)= 0        obcsNstartdate     = 0.
382        enddo        obcsSstartdate     = 0.
383          obcsEstartdate     = 0.
384          obcsWstartdate     = 0.
385          apressurestartdate = 0.
386    
387  c     Initialise file type and field precision  c     Initialise file type and field precision
388        exf_iprec       = 32        exf_iprec            = 32
389        exf_yftype      = 'RL'        exf_yftype           = 'RL'
390          useExfYearlyFields   = .FALSE.
391  c     scaling between exf units and MITgcm units        twoDigitYear         = .FALSE.
392        scal_hfl       =  1. _d 0        useExfCheckRange     = .TRUE.
393        scal_ust       =  1. _d 0  
394        scal_vst       =  1. _d 0  c     Input scaling factors.
395        scal_swf       =  1. _d 0        exf_inscal_hflux     =  1. _d 0
396        scal_sst       =  1. _d 0        exf_inscal_sflux     =  1. _d 0
397        scal_sss       =  1. _d 0        exf_inscal_ustress   =  1. _d 0
398        scal_apressure =  1. _d 0        exf_inscal_vstress   =  1. _d 0
399  #if (defined (ALLOW_BULKFORMULAE) && defined (ALLOW_ATM_TEMP))        exf_inscal_uwind     =  1. _d 0
400        scal_prc       =  1. _d 0        exf_inscal_vwind     =  1. _d 0
401  #else        exf_inscal_wspeed    =  1. _d 0
402        scal_sfl       =  1. _d 0            exf_inscal_swflux    =  1. _d 0
403  #endif        exf_inscal_lwflux    =  1. _d 0
404          exf_inscal_precip    =  1. _d 0
405          exf_inscal_snowprecip =  1. _d 0
406          exf_inscal_sst       =  1. _d 0
407          exf_inscal_sss       =  1. _d 0
408          exf_inscal_atemp     =  1. _d 0
409          exf_offset_atemp     =  0. _d 0
410          exf_inscal_aqh       =  1. _d 0
411          exf_inscal_evap      =  1. _d 0
412          exf_inscal_apressure =  1. _d 0
413          exf_inscal_runoff    =  1. _d 0
414          exf_inscal_swdown    =  1. _d 0
415          exf_inscal_lwdown    =  1. _d 0
416    
417    c     Output scaling factors.
418          exf_outscal_hflux    =  1. _d 0
419          exf_outscal_sflux    =  1. _d 0
420          exf_outscal_ustress  =  1. _d 0
421          exf_outscal_vstress  =  1. _d 0
422          exf_outscal_swflux   =  1. _d 0
423          exf_outscal_sst      =  1. _d 0
424          exf_outscal_sss      =  1. _d 0
425          exf_outscal_apressure=  1. _d 0
426    
427    #ifdef USE_EXF_INTERPOLATION
428          ustress_lon0   = thetaMin
429          uwind_lon0     = thetaMin
430          vstress_lon0   = thetaMin + delX(1) / 2
431          hflux_lon0     = thetaMin + delX(1) / 2
432          sflux_lon0     = thetaMin + delX(1) / 2
433          swflux_lon0    = thetaMin + delX(1) / 2
434          runoff_lon0    = thetaMin + delX(1) / 2
435          atemp_lon0     = thetaMin + delX(1) / 2
436          aqh_lon0       = thetaMin + delX(1) / 2
437          evap_lon0      = thetaMin + delX(1) / 2
438          precip_lon0    = thetaMin + delX(1) / 2
439          snowprecip_lon0 = thetaMin + delX(1) / 2
440          vwind_lon0     = thetaMin + delX(1) / 2
441          wspeed_lon0    = thetaMin + delX(1) / 2
442          lwflux_lon0    = thetaMin + delX(1) / 2
443          swdown_lon0    = thetaMin + delX(1) / 2
444          lwdown_lon0    = thetaMin + delX(1) / 2
445          apressure_lon0 = thetaMin + delX(1) / 2
446          vstress_lat0   = phimin
447          vwind_lat0     = phimin
448          wspeed_lat0    = phimin
449          ustress_lat0   = phimin   + delY(1) / 2
450          hflux_lat0     = phimin   + delY(1) / 2
451          sflux_lat0     = phimin   + delY(1) / 2
452          runoff_lat0    = phimin   + delY(1) / 2
453          swflux_lat0    = phimin   + delY(1) / 2
454          atemp_lat0     = phimin   + delY(1) / 2
455          aqh_lat0       = phimin   + delY(1) / 2
456          evap_lat0      = phimin   + delY(1) / 2
457          precip_lat0    = phimin   + delY(1) / 2
458          snowprecip_lat0 = phimin   + delY(1) / 2
459          uwind_lat0     = phimin   + delY(1) / 2
460          lwflux_lat0    = phimin   + delY(1) / 2
461          swdown_lat0    = phimin   + delY(1) / 2
462          lwdown_lat0    = phimin   + delY(1) / 2
463          apressure_lat0 = phimin   + delY(1) / 2
464          ustress_nlon   = Nx
465          ustress_nlat   = Ny
466          vstress_nlon   = Nx
467          vstress_nlat   = Ny
468          hflux_nlon     = Nx
469          hflux_nlat     = Ny
470          sflux_nlon     = Nx
471          sflux_nlat     = Ny
472          swflux_nlon    = Nx
473          swflux_nlat    = Ny
474          runoff_nlon    = Nx
475          runoff_nlat    = Ny
476          atemp_nlon     = Nx
477          atemp_nlat     = Ny
478          aqh_nlon       = Nx
479          aqh_nlat       = Ny
480          evap_nlon      = Nx
481          evap_nlat      = Ny
482          precip_nlon    = Nx
483          snowprecip_nlon = Nx
484          precip_nlat    = Ny
485          snowprecip_nlat = Ny
486          uwind_nlon     = Nx
487          uwind_nlat     = Ny
488          vwind_nlon     = Nx
489          vwind_nlat     = Ny
490          wspeed_nlon    = Nx
491          wspeed_nlat    = Ny
492          lwflux_nlon    = Nx
493          lwflux_nlat    = Ny
494          swdown_nlon    = Nx
495          swdown_nlat    = Ny
496          lwdown_nlon    = Nx
497          lwdown_nlat    = Ny
498          apressure_nlon = Nx
499          apressure_nlat = Ny
500          Ustress_lon_inc   = delX(1)
501          vstress_lon_inc   = delX(1)
502          hflux_lon_inc     = delX(1)
503          sflux_lon_inc     = delX(1)
504          swflux_lon_inc    = delX(1)
505          runoff_lon_inc    = delX(1)
506          atemp_lon_inc     = delX(1)
507          aqh_lon_inc       = delX(1)
508          evap_lon_inc      = delX(1)
509          precip_lon_inc    = delX(1)
510          snowprecip_lon_inc = delX(1)
511          uwind_lon_inc     = delX(1)
512          vwind_lon_inc     = delX(1)
513          wspeed_lon_inc    = delX(1)
514          lwflux_lon_inc    = delX(1)
515          swdown_lon_inc    = delX(1)
516          lwdown_lon_inc    = delX(1)
517          apressure_lon_inc = delX(1)
518          DO i=1,MAX_LAT_INC
519             IF (i.LT.Ny) THEN
520                vstress_lat_inc(i)   =  delY(i)
521                vwind_lat_inc(i)     =  delY(i)
522                wspeed_lat_inc(i)    =  delY(i)
523                ustress_lat_inc(i)   = (delY(i) + delY(i)) / 2.
524                hflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.
525                sflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.
526                swflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.
527                runoff_lat_inc(i)    = (delY(i) + delY(i)) / 2.
528                atemp_lat_inc(i)     = (delY(i) + delY(i)) / 2.
529                aqh_lat_inc(i)       = (delY(i) + delY(i)) / 2.
530                evap_lat_inc(i)      = (delY(i) + delY(i)) / 2.
531                precip_lat_inc(i)    = (delY(i) + delY(i)) / 2.
532                snowprecip_lat_inc(i) = (delY(i) + delY(i)) / 2.
533                uwind_lat_inc(i)     = (delY(i) + delY(i)) / 2.
534                lwflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.
535                swdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
536                lwdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
537                apressure_lat_inc(i) = (delY(i) + delY(i)) / 2.
538             ELSE
539                ustress_lat_inc(i)   = 0.
540                vstress_lat_inc(i)   = 0.
541                hflux_lat_inc(i)     = 0.
542                sflux_lat_inc(i)     = 0.
543                swflux_lat_inc(i)    = 0.
544                runoff_lat_inc(i)    = 0.
545                atemp_lat_inc(i)     = 0.
546                aqh_lat_inc(i)       = 0.
547                evap_lat_inc(i)      = 0.
548                precip_lat_inc(i)    = 0.
549                snowprecip_lat_inc(i) = 0.
550                uwind_lat_inc(i)     = 0.
551                vwind_lat_inc(i)     = 0.
552                wspeed_lat_inc(i)    = 0.
553                lwflux_lat_inc(i)    = 0.
554                swdown_lat_inc(i)    = 0.
555                lwdown_lat_inc(i)    = 0.
556                apressure_lat_inc(i) = 0.
557             ENDIF
558          ENDDO
559    #endif /* USE_EXF_INTERPOLATION */
560    
561  c     Check for the availability of the right calendar version.  c     Check for the availability of the right calendar version.
562        if ( calendarversion .ne. usescalendarversion ) then        if ( calendarversion .ne. usescalendarversion ) then
# Line 237  c     Check for the availability of the Line 569  c     Check for the availability of the
569        endif        endif
570    
571  c     Next, read the forcing data file.  c     Next, read the forcing data file.
572        call nml_filter( 'data.exf', scrunit1, myThid )          WRITE(msgBuf,'(A)') 'EXF_READPARMS: opening data.exf'
573        if (scrunit1 .eq. 0) then          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
574           stop 'exf_readparms: reading namelist failed'       &                    SQUEEZE_RIGHT , 1)
       end if  
       read(  scrunit1, nml = exf_nml )  
       close( scrunit1 )  
575    
576  c     Complete the start date specifications for the forcing          CALL OPEN_COPY_DATA_FILE(
577  c     fields to get a complete calendar date array.       I                          'data.exf', 'EXF_READPARMS',
578         O                          iUnit,
579         I                          myThid )
580    
581  c     check for consistency        READ(  iUnit, nml = exf_nml )
582    
583        if (.NOT.        WRITE(msgBuf,'(A)')
584       &     (exf_iprec .EQ. 32 .OR. exf_iprec .EQ. 64)       &     'EXF_READPARMS: finished reading data.exf'
585       &     ) then        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
586           stop 'stop in exf_readparms: value of exf_iprec not allowed'       &                SQUEEZE_RIGHT , 1)
       else if (.NOT.  
      &        (exf_yftype .EQ. 'RS' .OR.  
      &        exf_yftype .EQ. 'RL')  
      &        ) then  
          stop 'stop in exf_readparms: value of exf_yftype not allowed'  
       end if  
587    
588  #ifdef ALLOW_RUNOFF        CLOSE( iUnit )
589        call cal_FullDate(  runoffstartdate1,  runoffstartdate2,  
590       &                    runoffstartdate,            mythid )        call exf_check( mythid )
 #endif  
591    
592  #ifdef ALLOW_BULKFORMULAE  c     Complete the start date specifications for the forcing
593    c     fields to get a complete calendar date array.
594    
595    #ifdef ALLOW_ATM_WIND
596          if ( uwindfile .NE. ' ' ) then
597             call cal_FullDate  ( uwindstartdate1    ,      uwindstartdate2,
598         &        date_array                        ,mythid )
599             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
600             call cal_ToSeconds ( difftime,    uwindstartdate     ,mythid )
601             uwindstartdate     = modelstart   + uwindstartdate
602          endif
603          if ( vwindfile .NE. ' ' ) then
604             call cal_FullDate  ( vwindstartdate1    ,      vwindstartdate2,
605         &        date_array                        ,mythid )
606             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
607             call cal_ToSeconds ( difftime,    vwindstartdate     ,mythid )
608             vwindstartdate     = modelstart   + vwindstartdate
609          endif
610          if ( wspeedfile .NE. ' ' ) then
611             call cal_FullDate  ( wspeedstartdate1, wspeedstartdate2,
612         &        date_array                        ,mythid )
613             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
614             call cal_ToSeconds ( difftime,    wspeedstartdate     ,mythid )
615             wspeedstartdate     = modelstart   + wspeedstartdate
616          endif
617    #else
618          if ( ustressfile .NE. ' ' ) then
619             call cal_FullDate  ( ustressstartdate1  ,    ustressstartdate2,
620         &        date_array                        ,mythid )
621             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
622             call cal_ToSeconds ( difftime,  ustressstartdate     ,mythid )
623             ustressstartdate   = modelstart + ustressstartdate
624          endif
625          if ( vstressfile .NE. ' ' ) then
626             call cal_FullDate  ( vstressstartdate1  ,    vstressstartdate2,
627         &        date_array                        ,mythid )
628             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
629             call cal_ToSeconds ( difftime,  vstressstartdate     ,mythid )
630             vstressstartdate   = modelstart + vstressstartdate
631          endif
632    #endif
633    
634  #ifdef ALLOW_ATM_TEMP  #ifdef ALLOW_ATM_TEMP
635        call cal_FullDate(   atempstartdate1,   atempstartdate2,        if ( atempfile .NE. ' ' ) then
636       &                     atempstartdate,            mythid )           call cal_FullDate  ( atempstartdate1    ,      atempstartdate2,
637        call cal_FullDate(     aqhstartdate1,     aqhstartdate2,       &        date_array                        ,mythid )
638       &                       aqhstartdate,            mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
639        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,           call cal_ToSeconds ( difftime,    atempstartdate     ,mythid )
640       &                    swfluxstartdate,            mythid )           atempstartdate     = modelstart   + atempstartdate
641        call cal_FullDate(  lwfluxstartdate1,  lwfluxstartdate2,        endif
642       &                    lwfluxstartdate,            mythid )        if ( aqhfile .NE. ' ' ) then
643        call cal_FullDate(  precipstartdate1,  precipstartdate2,           call cal_FullDate  ( aqhstartdate1      ,        aqhstartdate2,
644       &                    precipstartdate,            mythid )       &        date_array                        ,mythid )
645             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
646             call cal_ToSeconds ( difftime,      aqhstartdate     ,mythid )
647             aqhstartdate       = modelstart     + aqhstartdate
648          endif
649          if ( lwfluxfile .NE. ' ' ) then
650             call cal_FullDate  ( lwfluxstartdate1   ,     lwfluxstartdate2,
651         &        date_array                        ,mythid )
652             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
653             call cal_ToSeconds ( difftime,   lwfluxstartdate     ,mythid )
654             lwfluxstartdate    = modelstart  + lwfluxstartdate
655          endif
656          if ( precipfile .NE. ' ' ) then
657             call cal_FullDate  ( precipstartdate1   ,     precipstartdate2,
658         &        date_array                        ,mythid )
659             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
660             call cal_ToSeconds ( difftime,   precipstartdate     ,mythid )
661             precipstartdate    = modelstart  + precipstartdate
662          endif
663          if ( snowprecipfile .NE. ' ' ) then
664             call cal_FullDate( snowprecipstartdate1, snowprecipstartdate2,
665         &        date_array                        ,mythid )
666             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
667             call cal_ToSeconds ( difftime, snowprecipstartdate, mythid )
668             snowprecipstartdate    = modelstart  + snowprecipstartdate
669          endif
670  #else  #else
671        call cal_FullDate(   hfluxstartdate1,   hfluxstartdate2,        if ( hfluxfile .NE. ' ' ) then
672       &                     hfluxstartdate,            mythid )           call cal_FullDate  ( hfluxstartdate1    ,      hfluxstartdate2,
673        call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,       &        date_array                        ,mythid )
674       &                     sfluxstartdate,           mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
675  #ifdef ALLOW_KPP           call cal_ToSeconds ( difftime,    hfluxstartdate     ,mythid )
676        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,           hfluxstartdate     = modelstart   + hfluxstartdate
677       &                    swfluxstartdate,            mythid )        endif
678          if ( sfluxfile .NE. ' ' ) then
679             call cal_FullDate  ( sfluxstartdate1    ,      sfluxstartdate2,
680         &        date_array                        ,mythid )
681             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
682             call cal_ToSeconds ( difftime,    sfluxstartdate     ,mythid )
683             sfluxstartdate     = modelstart   + sfluxstartdate
684          endif
685  #endif  #endif
686    
687    #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
688          if ( swfluxfile .NE. ' ' ) then
689             call cal_FullDate  ( swfluxstartdate1   ,     swfluxstartdate2,
690         &        date_array                        ,mythid )
691             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
692             call cal_ToSeconds ( difftime,   swfluxstartdate     ,mythid )
693             swfluxstartdate    = modelstart  + swfluxstartdate
694          endif
695  #endif  #endif
696    
697  #ifdef ALLOW_ATM_WIND  #ifdef EXF_READ_EVAP
698        call cal_FullDate(   uwindstartdate1,   uwindstartdate2,        if ( evapfile .NE. ' ' ) then
699       &                     uwindstartdate,            mythid )           call cal_FullDate  ( evapstartdate1     ,       evapstartdate2,
700        call cal_FullDate(   vwindstartdate1,   vwindstartdate2,       &        date_array                        ,mythid )
701       &                     vwindstartdate,            mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
702  #else           call cal_ToSeconds ( difftime,     evapstartdate     ,mythid )
703        call cal_FullDate( ustressstartdate1, ustressstartdate2,           evapstartdate      = modelstart    + evapstartdate
704       &                   ustressstartdate,            mythid )        endif
       call cal_FullDate( vstressstartdate1, vstressstartdate2,  
      &                   vstressstartdate,            mythid )  
705  #endif  #endif
706    
707  #else  #ifdef ALLOW_RUNOFF
708        call cal_FullDate(   hfluxstartdate1,  hfluxstartdate2,        if ( runofffile .NE. ' ' .AND. runoffperiod .NE. 0. ) then
709       &                     hfluxstartdate,           mythid )           call cal_FullDate  ( runoffstartdate1   ,     runoffstartdate2,
710        call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,       &        date_array                        ,mythid )
711       &                     sfluxstartdate,           mythid )           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
712        call cal_FullDate( ustressstartdate1, ustressstartdate2,           call cal_ToSeconds ( difftime,   runoffstartdate     ,mythid )
713       &                   ustressstartdate,            mythid )           runoffstartdate    = modelstart  + runoffstartdate
714        call cal_FullDate( vstressstartdate1, vstressstartdate2,        endif
      &                   vstressstartdate,            mythid )  
 #ifdef ALLOW_KPP  
       call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,  
      &                    swfluxstartdate,            mythid )  
715  #endif  #endif
716    
717    #ifdef ALLOW_DOWNWARD_RADIATION
718          if ( swdownfile .NE. ' ' ) then
719             call cal_FullDate  ( swdownstartdate1   ,     swdownstartdate2,
720         &        date_array                        ,mythid )
721             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
722             call cal_ToSeconds ( difftime,   swdownstartdate     ,mythid )
723             swdownstartdate    = modelstart  + swdownstartdate
724          endif
725          if ( lwdownfile .NE. ' ' ) then
726             call cal_FullDate  ( lwdownstartdate1   ,     lwdownstartdate2,
727         &        date_array                        ,mythid )
728             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
729             call cal_ToSeconds ( difftime,   lwdownstartdate     ,mythid )
730             lwdownstartdate    = modelstart  + lwdownstartdate
731          endif
732    #endif
733    
734    #ifdef ATMOSPHERIC_LOADING
735          if ( apressurefile .NE. ' ' ) then
736             call cal_FullDate  ( apressurestartdate1,  apressurestartdate2,
737         &        date_array                        ,mythid )
738             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
739             call cal_ToSeconds ( difftime,  apressurestartdate   ,mythid )
740             apressurestartdate = modelstart + apressurestartdate
741          endif
742  #endif  #endif
743    
744  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
745  #ifdef ALLOW_OBCS_NORTH  #ifdef ALLOW_OBCS_NORTH
746        call cal_FullDate(  obcsNstartdate1,  obcsNstartdate2,        if ( obcsNperiod .NE. 0 ) then
747       &                    obcsNstartdate,           mythid )           call cal_FullDate  ( obcsNstartdate1    ,      obcsNstartdate2,
748         &        date_array                        ,mythid )
749             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
750             call cal_ToSeconds ( difftime,   obcsNstartdate      ,mythid )
751             obcsNstartdate     = modelstart + obcsNstartdate
752          endif
753  #endif  #endif
754  #ifdef ALLOW_OBCS_SOUTH  #ifdef ALLOW_OBCS_SOUTH
755        call cal_FullDate(  obcsSstartdate1,  obcsSstartdate2,        if ( obcsSperiod .NE. 0 ) then
756       &                    obcsSstartdate,           mythid )           call cal_FullDate  ( obcsSstartdate1    ,      obcsSstartdate2,
757         &        date_array                        ,mythid )
758             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
759             call cal_ToSeconds ( difftime,   obcsSstartdate      ,mythid )
760             obcsSstartdate     = modelstart + obcsSstartdate
761          endif
762  #endif  #endif
763  #ifdef ALLOW_OBCS_EAST  #ifdef ALLOW_OBCS_EAST
764        call cal_FullDate(  obcsEstartdate1,  obcsEstartdate2,        if ( obcsEperiod .NE. 0 ) then
765       &                    obcsEstartdate,           mythid )           call cal_FullDate  ( obcsEstartdate1    ,      obcsEstartdate2,
766         &        date_array                        ,mythid )
767             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
768             call cal_ToSeconds ( difftime,   obcsEstartdate      ,mythid )
769             obcsEstartdate     = modelstart + obcsEstartdate
770          endif
771  #endif  #endif
772  #ifdef ALLOW_OBCS_WEST  #ifdef ALLOW_OBCS_WEST
773        call cal_FullDate(  obcsWstartdate1,  obcsWstartdate2,        if ( obcsNperiod .NE. 0 ) then
774       &                    obcsWstartdate,           mythid )           call cal_FullDate  ( obcsWstartdate1    ,      obcsWstartdate2,
775  #endif       &        date_array                        ,mythid )
776  #endif           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
777             call cal_ToSeconds ( difftime,  obcsWstartdate       ,mythid )
778  #ifdef ATMOSPHERIC_LOADING           obcsWstartdate     = modelstart + obcsWstartdate
779        call cal_FullDate(   apressurestartdate1, apressurestartdate2,        endif
      &                     apressurestartdate,          mythid )  
780  #endif  #endif
781    #endif /* ALLOW_OBCS */
782    
783        _END_MASTER( mythid )        _END_MASTER( mythid )
784    
# Line 349  c     check for consistency Line 787  c     check for consistency
787  c--   Summarize the External forcing's setup.  c--   Summarize the External forcing's setup.
788        call exf_summary( mythid )        call exf_summary( mythid )
789    
   
790  c--   set climatology parameters  c--   set climatology parameters
791        call exf_clim_readparms( mythid )        call exf_clim_readparms( mythid )
792    

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

  ViewVC Help
Powered by ViewVC 1.1.22