/[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.1 by heimbach, Mon Apr 8 20:10:38 2002 UTC revision 1.49 by dimitri, Wed Dec 5 23:57:45 2007 UTC
# Line 1  Line 1 
1  c $Header$  C $Header$
2    C $Name$
3    
4  #include "EXF_CPPOPTIONS.h"  #include "EXF_OPTIONS.h"
5    
6          SUBROUTINE EXF_READPARMS( myThid )
       subroutine exf_readparms(  
      I                          mythid  
      &                        )  
7    
8  c     ==================================================================  c     ==================================================================
9  c     SUBROUTINE exf_readparms  c     SUBROUTINE exf_readparms
# Line 14  c Line 12  c
12  c     o This routine initialises the package that calculates external  c     o This routine initialises the package that calculates external
13  c       forcing fields for a given timestep of the MITgcmUV. Parameters  c       forcing fields for a given timestep of the MITgcmUV. Parameters
14  c       for this package are set in "data.externalforcing". Some additional  c       for this package are set in "data.externalforcing". Some additional
15  c       precompiler switches have to be specified in "EXF_CPPOPTIONS.h".  c       precompiler switches have to be specified in "EXF_OPTIONS.h".
16  c  c
17  c     started: Christian Eckert eckert@mit.edu  30-Jun-1999  c     started: Christian Eckert eckert@mit.edu  30-Jun-1999
18  c  c
# Line 32  c              Patrick Heimbach, heimbac Line 30  c              Patrick Heimbach, heimbac
30  c              - added obcs parameters  c              - added obcs parameters
31  c     changed: Virginie Thierry, vthierry@ucsd.edu 04-June-2001  c     changed: Virginie Thierry, vthierry@ucsd.edu 04-June-2001
32  c              - added new obcs parameters (for each boundaries)  c              - added new obcs parameters (for each boundaries)
33    c     included runoff D. Stammer, Nov. 25, 2001
34    c     included pressure forcing. heimbach@mit.edu 05-Nov-2002
35    c     added "repeatPeriod" for cycling of forcing datasets 19-Dec-2002
36    c     mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002
37  c  c
38  c     ==================================================================  c     ==================================================================
39  c     SUBROUTINE exf_readparms  c     SUBROUTINE exf_readparms
# Line 43  c     == global variables == Line 45  c     == global variables ==
45    
46  #include "EEPARAMS.h"  #include "EEPARAMS.h"
47  #include "SIZE.h"  #include "SIZE.h"
48  #include "cal.h"  #include "PARAMS.h"
49  #include "exf.h"  c#include "cal.h"
50  #include "exf_param.h"  #include "EXF_PARAM.h"
51  #include "exf_constants.h"  #include "EXF_CONSTANTS.h"
 #ifdef ALLOW_OBCS  
 # include "OBCS_OPTIONS.h"  
 #endif  
52    
53  c     == routine arguments ==  c     == routine arguments ==
54    
55        integer mythid        integer myThid
56    
57  c     == local variables ==  c     == local variables ==
58    
59        integer i        integer i, idummy
60          integer iUnit
61    
62  c     == external ==        character*(max_len_mbuf) msgbuf
   
       integer  ilnblnk  
       external ilnblnk  
63    
64  c     == end of interface ==  c     == end of interface ==
65    
66  c     Surface flux data.  c     Surface flux data.
67        namelist /exf_nml/        NAMELIST /EXF_NML_01/
68         &      windstressmax,       repeatPeriod,    exf_albedo,
69         &   ocean_emissivity,     ice_emissivity, snow_emissivity,
70         &          exf_iceCd,          exf_iceCe,     exf_iceCh,
71         &   exf_scal_BulkCdn,     climtempfreeze,
72         &          exf_iprec,         exf_yftype,   exf_monFreq,
73         & useExfYearlyFields,  twoDigitYear,   useExfCheckRange,
74         & useStabilityFct_overIce, readStressOnAgrid, readStressOnCgrid,
75         &    useRelativeWind,
76         & hu, ht, umin, atmrho, atmcp, cen2kel, gravity_mks,
77         & cdrag_1, cdrag_2, cdrag_3, cstanton_1, cstanton_2, cdalton,
78         & flamb, flami, zolmin, zref,
79         & cvapor_fac, cvapor_exp, cvapor_fac_ice, cvapor_exp_ice,
80         & humid_fac, gamma_blk, saltsat, psim_fac
81    
82          NAMELIST /EXF_NML_02/
83         &          hfluxfile,          atempfile,       aqhfile,
84         &          sfluxfile,         precipfile,    runofffile,
85         &        ustressfile,        vstressfile,      evapfile,
86         &     snowprecipfile,          uwindfile,     vwindfile,
87         &         wspeedfile,         swfluxfile,    lwfluxfile,
88         &      apressurefile,         swdownfile,    lwdownfile,
89         &        climsstfile,        climsssfile,      
90       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,
91       &    atempstartdate1,    atempstartdate2,   atempperiod,       &    atempstartdate1,    atempstartdate2,   atempperiod,
92       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,
93       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,
94         &     evapstartdate1,     evapstartdate2,    evapperiod,
95       &   precipstartdate1,   precipstartdate2,  precipperiod,       &   precipstartdate1,   precipstartdate2,  precipperiod,
96         & snowprecipstartdate1, snowprecipstartdate2, snowprecipperiod,
97         &   runoffstartdate1,   runoffstartdate2,  runoffperiod,
98       &  ustressstartdate1,  ustressstartdate2, ustressperiod,       &  ustressstartdate1,  ustressstartdate2, ustressperiod,
99       &  vstressstartdate1,  vstressstartdate2, vstressperiod,       &  vstressstartdate1,  vstressstartdate2, vstressperiod,
100       &    uwindstartdate1,    uwindstartdate2,   uwindperiod,       &    uwindstartdate1,    uwindstartdate2,   uwindperiod,
101       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,
102         &   wspeedstartdate1,   wspeedstartdate2,  wspeedperiod,
103       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,
104       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,
105         &   swdownstartdate1,   swdownstartdate2,  swdownperiod,
106         &   lwdownstartdate1,   lwdownstartdate2,  lwdownperiod,
107         &apressurestartdate1,apressurestartdate2,apressureperiod,
108         &  climsststartdate1,  climsststartdate2,  climsstperiod,
109         &  climsssstartdate1,  climsssstartdate2,  climsssperiod
110    
111          NAMELIST /EXF_NML_03/
112         &   exf_inscal_hflux,  exf_inscal_sflux,      exf_inscal_evap,
113         & exf_inscal_ustress,  exf_inscal_vstress,
114         &   exf_inscal_uwind,  exf_inscal_vwind,    exf_inscal_wspeed,
115         &   exf_inscal_atemp,  exf_offset_atemp,       exf_inscal_aqh,
116         &     exf_inscal_sst,  exf_inscal_sss,
117         &  exf_inscal_swflux,  exf_inscal_lwflux,   exf_inscal_precip,
118         &  exf_inscal_runoff,  exf_inscal_apressure, exf_inscal_snowprecip,
119         &  exf_inscal_swdown,  exf_inscal_lwdown,
120         & exf_inscal_climsst, exf_inscal_climsss,
121         &  exf_outscal_hflux,  exf_outscal_ustress, exf_outscal_vstress,
122         & exf_outscal_swflux,  exf_outscal_sst,     exf_outscal_sss,
123         &  exf_outscal_sflux,  exf_outscal_apressure,
124         &  hfluxconst, atempconst, aqhconst, sfluxconst, evapconst,
125         &  precipconst, snowprecipconst, runoffconst, ustressconst,
126         &  vstressconst, uwindconst, vwindconst, wspeedconst, swfluxconst,
127         &  lwfluxconst, swdownconst, lwdownconst, apressureconst,
128         &  climsstconst,   climsssconst,
129         &     hflux_exfremo_intercept, hflux_exfremo_slope,
130         &     atemp_exfremo_intercept, atemp_exfremo_slope,
131         &     aqh_exfremo_intercept, aqh_exfremo_slope,
132         &     sflux_exfremo_intercept, sflux_exfremo_slope,
133         &     evap_exfremo_intercept, evap_exfremo_slope,
134         &     precip_exfremo_intercept, precip_exfremo_slope,
135         &     snowprecip_exfremo_intercept, snowprecip_exfremo_slope,
136         &     runoff_exfremo_intercept, runoff_exfremo_slope,
137         &     ustress_exfremo_intercept, ustress_exfremo_slope,
138         &     vstress_exfremo_intercept, vstress_exfremo_slope,
139         &     uwind_exfremo_intercept, uwind_exfremo_slope,
140         &     vwind_exfremo_intercept, vwind_exfremo_slope,
141         &     wspeed_exfremo_intercept, wspeed_exfremo_slope,
142         &     swflux_exfremo_intercept, swflux_exfremo_slope,
143         &     lwflux_exfremo_intercept, lwflux_exfremo_slope,
144         &     swdown_exfremo_intercept, swdown_exfremo_slope,
145         &     lwdown_exfremo_intercept, lwdown_exfremo_slope,
146         &     apressure_exfremo_intercept, apressure_exfremo_slope,
147         &     climsst_exfremo_intercept, climsst_exfremo_slope,
148         &     climsss_exfremo_intercept, climsss_exfremo_slope
149    
150          NAMELIST /EXF_NML_04/
151         & idummy
152    #ifdef USE_EXF_INTERPOLATION
153         & , ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,
154         & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,
155         & ustress_nlon, ustress_nlat, vstress_nlon, vstress_nlat,
156         & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,
157         & sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc,
158         & hflux_nlon, hflux_nlat, sflux_nlon, sflux_nlat,
159         & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,
160         & lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc,
161         & swflux_nlon, swflux_nlat, lwflux_nlon, lwflux_nlat,
162         & atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc,
163         & atemp_nlon, atemp_nlat,
164         & aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc, aqh_nlon, aqh_nlat,
165         &evap_lon0,evap_lon_inc,evap_lat0,evap_lat_inc,evap_nlon,evap_nlat,
166         & precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc,
167         & runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc,
168         & precip_nlon, precip_nlat, runoff_nlon, runoff_nlat,
169         & snowprecip_lon0, snowprecip_lon_inc, snowprecip_nlon,
170         & snowprecip_lat0, snowprecip_lat_inc, snowprecip_nlat,
171         & uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc,
172         & vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc,
173         & uwind_nlon, uwind_nlat, vwind_nlon, vwind_nlat,
174         & wspeed_lon0, wspeed_lon_inc, wspeed_lat0, wspeed_lat_inc,
175         & wspeed_nlon, wspeed_nlat,
176         & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,
177         & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
178         & swdown_nlon, swdown_nlat, lwdown_nlon, lwdown_nlat,
179         & apressure_lon0,apressure_lon_inc,apressure_nlon,
180         & apressure_lat0,apressure_lat_inc,apressure_nlat,
181         & climsst_lon0, climsst_lon_inc, climsst_nlon,
182         & climsst_lat0, climsst_lat_inc, climsst_nlat,
183         & climsss_lon0, climsss_lon_inc, climsss_nlon,
184         & climsss_lat0, climsss_lat_inc, climsss_nlat
185    #endif
186    
187          NAMELIST /EXF_NML_OBCS/
188       &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,       &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,
189       &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,       &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,
190       &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,       &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,
191       &    obcsWstartdate1,    obcsWstartdate2,   obcsWperiod,       &    obcsWstartdate1,    obcsWstartdate2,   obcsWperiod
      &          hfluxfile,          atempfile,       aqhfile,  
      &         precipfile,          sfluxfile,   ustressfile,  
      &        vstressfile,          uwindfile,     vwindfile,  
      &         swfluxfile,         lwfluxfile,  
      &          exf_iprec,         exf_yftype  
192    
193        _BEGIN_MASTER(mythid)        _BEGIN_MASTER(mythid)
194    
195  c     Set default values.  c     Set default values.
196    
197          year2sec           = 365.*86400.
198          exf_monFreq        = monitorFreq
199          useExfCheckRange   = .TRUE.
200          readStressOnAgrid  = .FALSE.
201          readStressOnCgrid  = .FALSE.
202          useRelativeWind    = .FALSE.
203    
204    C-  default value should be set to main model parameter:
205    c     cen2kel     =  celsius2K
206    c     gravity_mks = gravity
207    c     atmcp       =  atm_Cp
208    c     humid_fac   =  atm_Rq     <- default is zero !!!
209    
210          cen2kel        =      273.150  _d 0
211          gravity_mks    =        9.81   _d 0
212          atmrho         =        1.200  _d 0
213          atmcp          =     1005.000  _d 0
214          flamb          =  2500000.000  _d 0
215          flami          =   334000.000  _d 0
216          cvapor_fac     =   640380.000  _d 0
217          cvapor_exp     =     5107.400  _d 0
218          cvapor_fac_ice = 11637800.000  _d 0
219          cvapor_exp_ice =     5897.800  _d 0
220          humid_fac      =        0.606  _d 0
221          gamma_blk      =        0.010  _d 0
222          saltsat        =        0.980  _d 0
223          cdrag_1        =        0.0027000 _d 0
224          cdrag_2        =        0.0001420 _d 0
225          cdrag_3        =        0.0000764 _d 0
226          cstanton_1     =        0.0327 _d 0
227          cstanton_2     =        0.0180 _d 0
228          cdalton        =        0.0346 _d 0
229          zolmin         =     -100.000  _d 0
230          psim_fac       =        5.000  _d 0
231          zref           =       10.000  _d 0
232          hu             =       10.000  _d 0
233          ht             =        2.000  _d 0
234          umin           =        0.5    _d 0
235          useStabilityFct_overIce = .FALSE.
236          exf_iceCd        = 1.63 _d -3
237          exf_iceCe        = 1.63 _d -3
238          exf_iceCh        = 1.63 _d -3
239          exf_albedo       = 0.1 _d 0
240    c--   this default is chosen to be backward compatible with
241    c--   an earlier setting of 5.5 = ocean_emissivity*stefanBoltzmann
242          ocean_emissivity = 5.50 _d-8 / 5.670 _d-8
243          ice_emissivity   = 0.95 _d 0
244          snow_emissivity  = 0.95 _d 0
245    
246  c     Calendar data.  c     Calendar data.
247        hfluxstartdate1    = 0        hfluxstartdate1    = 0
248        hfluxstartdate2    = 0        hfluxstartdate2    = 0
249        hfluxperiod        = 0.0 _d 0        hfluxperiod        = 0.0 _d 0
250          hfluxconst         = 0.0 _d 0
251          hflux_exfremo_intercept = 0.0 _d 0
252          hflux_exfremo_slope = 0.0 _d 0
253    
254        atempstartdate1    = 0        atempstartdate1    = 0
255        atempstartdate2    = 0        atempstartdate2    = 0
256        atempperiod        = 0.0 _d 0        atempperiod        = 0.0 _d 0
257          atempconst         = celsius2K
258          atemp_exfremo_intercept = 0.0 _d 0
259          atemp_exfremo_slope = 0.0 _d 0
260    
261        aqhstartdate1      = 0        aqhstartdate1      = 0
262        aqhstartdate2      = 0        aqhstartdate2      = 0
263        aqhperiod          = 0.0 _d 0        aqhperiod          = 0.0 _d 0
264          aqhconst           = 0.0 _d 0
265          aqh_exfremo_intercept = 0.0 _d 0
266          aqh_exfremo_slope = 0.0 _d 0
267    
268        sfluxstartdate1    = 0        sfluxstartdate1    = 0
269        sfluxstartdate2    = 0        sfluxstartdate2    = 0
270        sfluxperiod        = 0.0 _d 0        sfluxperiod        = 0.0 _d 0
271          sfluxconst         = 0.0 _d 0
272          sflux_exfremo_intercept = 0.0 _d 0
273          sflux_exfremo_slope = 0.0 _d 0
274    
275          evapstartdate1   = 0
276          evapstartdate2   = 0
277          evapperiod       = 0.0 _d 0
278          evapconst        = 0.0 _d 0
279          evap_exfremo_intercept = 0.0 _d 0
280          evap_exfremo_slope = 0.0 _d 0
281    
282        precipstartdate1   = 0        precipstartdate1   = 0
283        precipstartdate2   = 0        precipstartdate2   = 0
284        precipperiod       = 0.0 _d 0        precipperiod       = 0.0 _d 0
285          precipconst        = 0.0 _d 0
286          precip_exfremo_intercept = 0.0 _d 0
287          precip_exfremo_slope = 0.0 _d 0
288    
289          snowprecipstartdate1   = 0
290          snowprecipstartdate2   = 0
291          snowprecipperiod       = 0.0 _d 0
292          snowprecipconst        = 0.0 _d 0
293          snowprecip_exfremo_intercept = 0.0 _d 0
294          snowprecip_exfremo_slope = 0.0 _d 0
295    
296          runoffstartdate1   = 0
297          runoffstartdate2   = 0
298          runoffperiod       = 0.0 _d 0
299          runoffconst        = 0.0 _d 0
300          runoff_exfremo_intercept = 0.0 _d 0
301          runoff_exfremo_slope = 0.0 _d 0
302    
303        ustressstartdate1  = 0        ustressstartdate1  = 0
304        ustressstartdate2  = 0        ustressstartdate2  = 0
305        ustressperiod      = 0.0 _d 0        ustressperiod      = 0.0 _d 0
306          ustressconst       = 0.0 _d 0
307          ustress_exfremo_intercept = 0.0 _d 0
308          ustress_exfremo_slope = 0.0 _d 0
309    
310        vstressstartdate1  = 0        vstressstartdate1  = 0
311        vstressstartdate2  = 0        vstressstartdate2  = 0
312        vstressperiod      = 0.0 _d 0        vstressperiod      = 0.0 _d 0
313          vstressconst       = 0.0 _d 0
314          vstress_exfremo_intercept = 0.0 _d 0
315          vstress_exfremo_slope = 0.0 _d 0
316    
317        uwindstartdate1    = 0        uwindstartdate1    = 0
318        uwindstartdate2    = 0        uwindstartdate2    = 0
319        uwindperiod        = 0.0 _d 0        uwindperiod        = 0.0 _d 0
320          uwindconst         = 0.0 _d 0
321          uwind_exfremo_intercept = 0.0 _d 0
322          uwind_exfremo_slope = 0.0 _d 0
323    
324        vwindstartdate1    = 0        vwindstartdate1    = 0
325        vwindstartdate2    = 0        vwindstartdate2    = 0
326        vwindperiod        = 0.0 _d 0        vwindperiod        = 0.0 _d 0
327          vwindconst         = 0.0 _d 0
328          vwind_exfremo_intercept = 0.0 _d 0
329          vwind_exfremo_slope = 0.0 _d 0
330    
331          wspeedstartdate1    = 0
332          wspeedstartdate2    = 0
333          wspeedperiod        = 0.0 _d 0
334          wspeedconst         = 0.0 _d 0
335          wspeed_exfremo_intercept = 0.0 _d 0
336          wspeed_exfremo_slope = 0.0 _d 0
337    
338        swfluxstartdate1   = 0        swfluxstartdate1   = 0
339        swfluxstartdate2   = 0        swfluxstartdate2   = 0
340        swfluxperiod       = 0.0 _d 0        swfluxperiod       = 0.0 _d 0
341          swfluxconst        = 0.0 _d 0
342          swflux_exfremo_intercept = 0.0 _d 0
343          swflux_exfremo_slope = 0.0 _d 0
344    
345        lwfluxstartdate1   = 0        lwfluxstartdate1   = 0
346        lwfluxstartdate2   = 0        lwfluxstartdate2   = 0
347        lwfluxperiod       = 0.0 _d 0        lwfluxperiod       = 0.0 _d 0
348          lwfluxconst        = 0.0 _d 0
349          lwflux_exfremo_intercept = 0.0 _d 0
350          lwflux_exfremo_slope = 0.0 _d 0
351    
352          swdownstartdate1   = 0
353          swdownstartdate2   = 0
354          swdownperiod       = 0.0 _d 0
355          swdownconst        = 0.0 _d 0
356          swdown_exfremo_intercept = 0.0 _d 0
357          swdown_exfremo_slope = 0.0 _d 0
358    
359          lwdownstartdate1   = 0
360          lwdownstartdate2   = 0
361          lwdownperiod       = 0.0 _d 0
362          lwdownconst        = 0.0 _d 0
363          lwdown_exfremo_intercept = 0.0 _d 0
364          lwdown_exfremo_slope = 0.0 _d 0
365    
366          apressurestartdate1    = 0
367          apressurestartdate2    = 0
368          apressureperiod        = 0.0 _d 0
369          apressureconst         = 0.0 _d 0
370          apressure_exfremo_intercept = 0.0 _d 0
371          apressure_exfremo_slope = 0.0 _d 0
372    
373          climsststartdate1  = 0
374          climsststartdate2  = 0
375          climsstperiod      = 0
376          climsstconst         = 0.0 _d 0
377          climsst_exfremo_intercept = 0.0 _d 0
378          climsst_exfremo_slope = 0.0 _d 0
379    
380          climsssstartdate1  = 0
381          climsssstartdate2  = 0
382          climsssperiod      = 0
383          climsssconst         = 0.0 _d 0
384          climsss_exfremo_intercept = 0.0 _d 0
385          climsss_exfremo_slope = 0.0 _d 0
386    
387        obcsNstartdate1    = 0        obcsNstartdate1    = 0
388        obcsNstartdate2    = 0        obcsNstartdate2    = 0
# Line 154  c     Calendar data. Line 400  c     Calendar data.
400        obcsWstartdate2    = 0        obcsWstartdate2    = 0
401        obcsWperiod        = 0.0 _d 0        obcsWperiod        = 0.0 _d 0
402    
403          repeatPeriod       = 0.0 _d 0
404          windstressmax      = 2.0 _d 0
405    
406          exf_scal_BulkCdn   = 1.0  _d 0
407    
408    c     Initialise freezing temperature of sea water
409          climtempfreeze     = -1.9 _d 0
410    
411  c     Data files.  c     Data files.
412        hfluxfile          = ' '        hfluxfile          = ' '
413        atempfile          = ' '        atempfile          = ' '
414        aqhfile            = ' '        aqhfile            = ' '
415          evapfile           = ' '
416        precipfile         = ' '        precipfile         = ' '
417          snowprecipfile     = ' '
418        sfluxfile          = ' '        sfluxfile          = ' '
419          runofffile         = ' '
420        ustressfile        = ' '        ustressfile        = ' '
421        vstressfile        = ' '        vstressfile        = ' '
422        uwindfile          = ' '        uwindfile          = ' '
423        vwindfile          = ' '        vwindfile          = ' '
424          wspeedfile         = ' '
425        swfluxfile         = ' '        swfluxfile         = ' '
426        lwfluxfile         = ' '        lwfluxfile         = ' '
427          swdownfile         = ' '
428  c     Initialise the date arrays.        lwdownfile         = ' '
429        do i = 1,4        apressurefile      = ' '
430           hfluxstartdate(i)    = 0        climsstfile        = ' '
431           atempstartdate(i)    = 0        climsssfile        = ' '
432           aqhstartdate(i)      = 0  
433           precipstartdate(i)   = 0  c     Start dates.
434           sfluxstartdate(i)    = 0        hfluxstartdate     = 0.
435           ustressstartdate(i)  = 0        atempstartdate     = 0.
436           vstressstartdate(i)  = 0        aqhstartdate       = 0.
437           uwindstartdate(i)    = 0        evapstartdate      = 0.
438           vwindstartdate(i)    = 0        precipstartdate    = 0.
439           swfluxstartdate(i)   = 0        snowprecipstartdate= 0.
440           lwfluxstartdate(i)   = 0        sfluxstartdate     = 0.
441           obcsNstartdate(i)    = 0        runoffstartdate    = 0.
442           obcsSstartdate(i)    = 0        ustressstartdate   = 0.
443           obcsEstartdate(i)    = 0        vstressstartdate   = 0.
444           obcsWstartdate(i)    = 0        uwindstartdate     = 0.
445        enddo        vwindstartdate     = 0.
446          wspeedstartdate    = 0.
447          swfluxstartdate    = 0.
448          lwfluxstartdate    = 0.
449          swdownstartdate    = 0.
450          lwdownstartdate    = 0.
451          obcsNstartdate     = 0.
452          obcsSstartdate     = 0.
453          obcsEstartdate     = 0.
454          obcsWstartdate     = 0.
455          apressurestartdate = 0.
456          climsststartdate   = 0.
457          climsssstartdate   = 0.
458    
459  c     Initialise file type and field precision  c     Initialise file type and field precision
460        exf_iprec       = 32        exf_iprec            = 32
461        exf_yftype      = 'RL'        exf_yftype           = 'RL'
462          useExfYearlyFields   = .FALSE.
463  c     Check for the availability of the right calendar version.        twoDigitYear         = .FALSE.
464        if ( calendarversion .ne. usescalendarversion ) then  
465           print*,' exf_readparms: You are not using the appropriate'  c     Input scaling factors.
466           print*,'           version of the calendar package.'        exf_inscal_hflux     =  1. _d 0
467           print*        exf_inscal_sflux     =  1. _d 0
468           print*,' You are using Calendar version: ', calendarversion        exf_inscal_ustress   =  1. _d 0
469           print*,' Please use    Calendar version: ', usescalendarversion        exf_inscal_vstress   =  1. _d 0
470           stop ' stopped in exf_readparms.'        exf_inscal_uwind     =  1. _d 0
471        endif        exf_inscal_vwind     =  1. _d 0
472          exf_inscal_wspeed    =  1. _d 0
473          exf_inscal_swflux    =  1. _d 0
474          exf_inscal_lwflux    =  1. _d 0
475          exf_inscal_precip    =  1. _d 0
476          exf_inscal_snowprecip=  1. _d 0
477          exf_inscal_sst       =  1. _d 0
478          exf_inscal_sss       =  1. _d 0
479          exf_inscal_atemp     =  1. _d 0
480          exf_offset_atemp     =  0. _d 0
481          exf_inscal_aqh       =  1. _d 0
482          exf_inscal_evap      =  1. _d 0
483          exf_inscal_apressure =  1. _d 0
484          exf_inscal_runoff    =  1. _d 0
485          exf_inscal_swdown    =  1. _d 0
486          exf_inscal_lwdown    =  1. _d 0
487          exf_inscal_climsst   =  1. _d 0
488          exf_inscal_climsss   =  1. _d 0
489    
490    c     Output scaling factors.
491          exf_outscal_hflux    =  1. _d 0
492          exf_outscal_sflux    =  1. _d 0
493          exf_outscal_ustress  =  1. _d 0
494          exf_outscal_vstress  =  1. _d 0
495          exf_outscal_swflux   =  1. _d 0
496          exf_outscal_sst      =  1. _d 0
497          exf_outscal_sss      =  1. _d 0
498          exf_outscal_apressure=  1. _d 0
499    
500    #ifdef USE_EXF_INTERPOLATION
501          ustress_lon0   = thetaMin
502          uwind_lon0     = thetaMin
503          vstress_lon0   = thetaMin + delX(1)*exf_half
504          hflux_lon0     = thetaMin + delX(1)*exf_half
505          sflux_lon0     = thetaMin + delX(1)*exf_half
506          swflux_lon0    = thetaMin + delX(1)*exf_half
507          runoff_lon0    = thetaMin + delX(1)*exf_half
508          atemp_lon0     = thetaMin + delX(1)*exf_half
509          aqh_lon0       = thetaMin + delX(1)*exf_half
510          evap_lon0      = thetaMin + delX(1)*exf_half
511          precip_lon0    = thetaMin + delX(1)*exf_half
512          snowprecip_lon0= thetaMin + delX(1)*exf_half
513          vwind_lon0     = thetaMin + delX(1)*exf_half
514          wspeed_lon0    = thetaMin + delX(1)*exf_half
515          lwflux_lon0    = thetaMin + delX(1)*exf_half
516          swdown_lon0    = thetaMin + delX(1)*exf_half
517          lwdown_lon0    = thetaMin + delX(1)*exf_half
518          apressure_lon0 = thetaMin + delX(1)*exf_half
519          vstress_lat0   = phimin
520          vwind_lat0     = phimin
521          wspeed_lat0    = phimin
522          ustress_lat0   = phimin   + delY(1)*exf_half
523          hflux_lat0     = phimin   + delY(1)*exf_half
524          sflux_lat0     = phimin   + delY(1)*exf_half
525          runoff_lat0    = phimin   + delY(1)*exf_half
526          swflux_lat0    = phimin   + delY(1)*exf_half
527          atemp_lat0     = phimin   + delY(1)*exf_half
528          aqh_lat0       = phimin   + delY(1)*exf_half
529          evap_lat0      = phimin   + delY(1)*exf_half
530          precip_lat0    = phimin   + delY(1)*exf_half
531          snowprecip_lat0= phimin   + delY(1)*exf_half
532          uwind_lat0     = phimin   + delY(1)*exf_half
533          lwflux_lat0    = phimin   + delY(1)*exf_half
534          swdown_lat0    = phimin   + delY(1)*exf_half
535          lwdown_lat0    = phimin   + delY(1)*exf_half
536          apressure_lat0 = phimin   + delY(1)*exf_half
537          ustress_nlon   = Nx
538          ustress_nlat   = Ny
539          vstress_nlon   = Nx
540          vstress_nlat   = Ny
541          hflux_nlon     = Nx
542          hflux_nlat     = Ny
543          sflux_nlon     = Nx
544          sflux_nlat     = Ny
545          swflux_nlon    = Nx
546          swflux_nlat    = Ny
547          runoff_nlon    = Nx
548          runoff_nlat    = Ny
549          atemp_nlon     = Nx
550          atemp_nlat     = Ny
551          aqh_nlon       = Nx
552          aqh_nlat       = Ny
553          evap_nlon      = Nx
554          evap_nlat      = Ny
555          precip_nlon    = Nx
556          snowprecip_nlon= Nx
557          precip_nlat    = Ny
558          snowprecip_nlat= Ny
559          uwind_nlon     = Nx
560          uwind_nlat     = Ny
561          vwind_nlon     = Nx
562          vwind_nlat     = Ny
563          wspeed_nlon    = Nx
564          wspeed_nlat    = Ny
565          lwflux_nlon    = Nx
566          lwflux_nlat    = Ny
567          swdown_nlon    = Nx
568          swdown_nlat    = Ny
569          lwdown_nlon    = Nx
570          lwdown_nlat    = Ny
571          apressure_nlon = Nx
572          apressure_nlat = Ny
573          Ustress_lon_inc   = delX(1)
574          vstress_lon_inc   = delX(1)
575          hflux_lon_inc     = delX(1)
576          sflux_lon_inc     = delX(1)
577          swflux_lon_inc    = delX(1)
578          runoff_lon_inc    = delX(1)
579          atemp_lon_inc     = delX(1)
580          aqh_lon_inc       = delX(1)
581          evap_lon_inc      = delX(1)
582          precip_lon_inc    = delX(1)
583          snowprecip_lon_inc= delX(1)
584          uwind_lon_inc     = delX(1)
585          vwind_lon_inc     = delX(1)
586          wspeed_lon_inc    = delX(1)
587          lwflux_lon_inc    = delX(1)
588          swdown_lon_inc    = delX(1)
589          lwdown_lon_inc    = delX(1)
590          apressure_lon_inc = delX(1)
591          climsst_lon0    = thetaMin + delX(1)*exf_half
592          climsss_lon0    = thetaMin + delX(1)*exf_half
593          climsst_lat0    = phimin   + delY(1)*exf_half
594          climsss_lat0    = phimin   + delY(1)*exf_half
595          climsst_nlon    = Nx
596          climsst_nlat    = Ny
597          climsss_nlon    = Nx
598          climsss_nlat    = Ny
599          climsst_lon_inc = delX(1)
600          climsss_lon_inc = delX(1)
601          DO i=1,MAX_LAT_INC
602             IF (i.LT.Ny) THEN
603                vstress_lat_inc(i)   =  delY(i)
604                vwind_lat_inc(i)     =  delY(i)
605                wspeed_lat_inc(i)    =  delY(i)
606                ustress_lat_inc(i)   = (delY(i) + delY(i))*exf_half
607                hflux_lat_inc(i)     = (delY(i) + delY(i))*exf_half
608                sflux_lat_inc(i)     = (delY(i) + delY(i))*exf_half
609                swflux_lat_inc(i)    = (delY(i) + delY(i))*exf_half
610                runoff_lat_inc(i)    = (delY(i) + delY(i))*exf_half
611                atemp_lat_inc(i)     = (delY(i) + delY(i))*exf_half
612                aqh_lat_inc(i)       = (delY(i) + delY(i))*exf_half
613                evap_lat_inc(i)      = (delY(i) + delY(i))*exf_half
614                precip_lat_inc(i)    = (delY(i) + delY(i))*exf_half
615                snowprecip_lat_inc(i)= (delY(i) + delY(i))*exf_half
616                uwind_lat_inc(i)     = (delY(i) + delY(i))*exf_half
617                lwflux_lat_inc(i)    = (delY(i) + delY(i))*exf_half
618                swdown_lat_inc(i)    = (delY(i) + delY(i))*exf_half
619                lwdown_lat_inc(i)    = (delY(i) + delY(i))*exf_half
620                apressure_lat_inc(i) = (delY(i) + delY(i))*exf_half
621                climsst_lat_inc(i)   = (delY(i) + delY(i))*exf_half
622                climsss_lat_inc(i)   = (delY(i) + delY(i))*exf_half
623             ELSE
624                ustress_lat_inc(i)   = 0.
625                vstress_lat_inc(i)   = 0.
626                hflux_lat_inc(i)     = 0.
627                sflux_lat_inc(i)     = 0.
628                swflux_lat_inc(i)    = 0.
629                runoff_lat_inc(i)    = 0.
630                atemp_lat_inc(i)     = 0.
631                aqh_lat_inc(i)       = 0.
632                evap_lat_inc(i)      = 0.
633                precip_lat_inc(i)    = 0.
634                snowprecip_lat_inc(i)= 0.
635                uwind_lat_inc(i)     = 0.
636                vwind_lat_inc(i)     = 0.
637                wspeed_lat_inc(i)    = 0.
638                lwflux_lat_inc(i)    = 0.
639                swdown_lat_inc(i)    = 0.
640                lwdown_lat_inc(i)    = 0.
641                apressure_lat_inc(i) = 0.
642                climsst_lat_inc(i)   = 0.
643                climsss_lat_inc(i)   = 0.
644             ENDIF
645          ENDDO
646    #endif /* USE_EXF_INTERPOLATION */
647    
648  c     Next, read the forcing data file.  c     Next, read the forcing data file.
649        call nml_filter( 'data.exf', scrunit1, myThid )        WRITE(msgBuf,'(A)') 'EXF_READPARMS: opening data.exf'
650        if (scrunit1 .eq. 0) then        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
651           stop 'exf_readparms: reading namelist failed'       &     SQUEEZE_RIGHT , 1)
652        end if  
653        read(  scrunit1, nml = exf_nml )        CALL OPEN_COPY_DATA_FILE(
654        close( scrunit1 )       I                          'data.exf', 'EXF_READPARMS',
655         O                          iUnit,
656  c     Complete the start date specifications for the forcing       I                          myThid )
657  c     fields to get a complete calendar date array.  
658          WRITE(msgBuf,'(A)')
659  c     check for consistency       &     'EXF_READPARMS: reading EXF_NML_01'
660          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
661        if (.NOT.       &     SQUEEZE_RIGHT , 1)
662       &     (exf_iprec .EQ. 32 .OR. exf_iprec .EQ. 64)        READ(  iUnit, nml = EXF_NML_01 )
663       &     ) then        WRITE(msgBuf,'(A)')
664           stop 'stop in exf_readparms: value of exf_iprec not allowed'       &     'EXF_READPARMS: reading EXF_NML_02'
665        else if (.NOT.        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
666       &        (exf_yftype .EQ. 'RS' .OR.       &     SQUEEZE_RIGHT , 1)
667       &        exf_yftype .EQ. 'RL')        READ(  iUnit, nml = EXF_NML_02 )
668       &        ) then        WRITE(msgBuf,'(A)')
669           stop 'stop in exf_readparms: value of exf_yftype not allowed'       &     'EXF_READPARMS: reading EXF_NML_03'
670        end if        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
671         &     SQUEEZE_RIGHT , 1)
672  #ifdef ALLOW_BULKFORMULAE        READ(  iUnit, nml = EXF_NML_03 )
673          WRITE(msgBuf,'(A)')
674  #ifdef ALLOW_ATM_TEMP       &     'EXF_READPARMS: reading EXF_NML_04'
675        call cal_FullDate(   atempstartdate1,   atempstartdate2,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
676       &                     atempstartdate,            mythid )       &     SQUEEZE_RIGHT , 1)
677        call cal_FullDate(     aqhstartdate1,     aqhstartdate2,        READ(  iUnit, nml = EXF_NML_04 )
678       &                       aqhstartdate,            mythid )  #ifdef ALLOW_OBCS
679        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,        WRITE(msgBuf,'(A)')
680       &                    swfluxstartdate,            mythid )       &     'EXF_READPARMS: reading EXF_NML_OBCS'
681        call cal_FullDate(  lwfluxstartdate1,  lwfluxstartdate2,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
682       &                    lwfluxstartdate,            mythid )       &     SQUEEZE_RIGHT , 1)
683        call cal_FullDate(  precipstartdate1,  precipstartdate2,        READ(  iUnit, nml = EXF_NML_OBCS )
684       &                    precipstartdate,            mythid )  #endif
685  #else  
686        call cal_FullDate(   hfluxstartdate1,   hfluxstartdate2,        WRITE(msgBuf,'(A)')
687       &                     hfluxstartdate,            mythid )       &     'EXF_READPARMS: finished reading data.exf'
688        call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
689       &                     sfluxstartdate,           mythid )       &                SQUEEZE_RIGHT , 1)
690  #ifdef ALLOW_KPP  
691        call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,        CLOSE( iUnit )
692       &                    swfluxstartdate,            mythid )  
693  #endif  C--   Derive other parameters:
694          hq = ht
695  #endif  #if ( ( defined (ALLOW_BULKFORMULAE) && defined (ALLOW_ATM_WIND) ) \
696         || defined (USE_EXF_INTERPOLATION) )
697  #ifdef ALLOW_ATM_WIND        stressIsOnCgrid = .FALSE.
       call cal_FullDate(   uwindstartdate1,   uwindstartdate2,  
      &                     uwindstartdate,            mythid )  
       call cal_FullDate(   vwindstartdate1,   vwindstartdate2,  
      &                     vwindstartdate,            mythid )  
 #else  
       call cal_FullDate( ustressstartdate1, ustressstartdate2,  
      &                   ustressstartdate,            mythid )  
       call cal_FullDate( vstressstartdate1, vstressstartdate2,  
      &                   vstressstartdate,            mythid )  
 #endif  
   
698  #else  #else
699        call cal_FullDate(   hfluxstartdate1,  hfluxstartdate2,        stressIsOnCgrid = readStressOnCgrid
      &                     hfluxstartdate,           mythid )  
       call cal_FullDate(   sfluxstartdate1,  sfluxstartdate2,  
      &                     sfluxstartdate,           mythid )  
       call cal_FullDate( ustressstartdate1, ustressstartdate2,  
      &                   ustressstartdate,            mythid )  
       call cal_FullDate( vstressstartdate1, vstressstartdate2,  
      &                   vstressstartdate,            mythid )  
 #ifdef ALLOW_KPP  
       call cal_FullDate(  swfluxstartdate1,  swfluxstartdate2,  
      &                    swfluxstartdate,            mythid )  
700  #endif  #endif
701    
702  #endif        CALL EXF_CHECK( myThid )
703    
704  #ifdef ALLOW_OBCS  c     Complete the start date specifications for the forcing
705  #ifdef ALLOW_OBCS_NORTH  c     fields to get a complete calendar date array.
706        call cal_FullDate(  obcsNstartdate1,  obcsNstartdate2,  C     => moved to EXF_INIT_FIXED
      &                    obcsNstartdate,           mythid )  
 #endif  
 #ifdef ALLOW_OBCS_SOUTH  
       call cal_FullDate(  obcsSstartdate1,  obcsSstartdate2,  
      &                    obcsSstartdate,           mythid )  
 #endif  
 #ifdef ALLOW_OBCS_EAST  
       call cal_FullDate(  obcsEstartdate1,  obcsEstartdate2,  
      &                    obcsEstartdate,           mythid )  
 #endif  
 #ifdef ALLOW_OBCS_WEST  
       call cal_FullDate(  obcsWstartdate1,  obcsWstartdate2,  
      &                    obcsWstartdate,           mythid )  
 #endif  
 #endif  
707    
708        _END_MASTER( mythid )        _END_MASTER( mythid )
   
709        _BARRIER        _BARRIER
710    
711  c--   Summarize the External forcing's setup.        RETURN
712        call exf_summary( mythid )        END
   
   
 c--   set climatology parameters  
       call exf_clim_readparms( mythid )  
   
 c--   summarize climatologic forcing configuration  
       call exf_clim_summary( mythid )  
   
       end  

Legend:
Removed from v.1.1.4.1  
changed lines
  Added in v.1.49

  ViewVC Help
Powered by ViewVC 1.1.22