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

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.22