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

Legend:
Removed from v.1.1.4.7  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.22