/[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.19 by dimitri, Thu Oct 7 01:10:43 2004 UTC revision 1.89 by jmc, Tue Jan 31 18:59:14 2017 UTC
# Line 2  C $Header$ Line 2  C $Header$
2  C $Name$  C $Name$
3    
4  #include "EXF_OPTIONS.h"  #include "EXF_OPTIONS.h"
5  #ifdef ALLOW_OBCS  #ifdef ALLOW_EXCH2
6  # include "OBCS_OPTIONS.h"  # include "W2_OPTIONS.h"
7  #endif  #endif /* ALLOW_EXCH2 */
8    
9        subroutine exf_readparms( mythid )        SUBROUTINE EXF_READPARMS( myThid )
10    
11  c     ==================================================================  C     ==================================================================
12  c     SUBROUTINE exf_readparms  C     SUBROUTINE exf_readparms
13  c     ==================================================================  C     ==================================================================
14  c  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_OPTIONS.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
22  c     changed: Christian Eckert eckert@mit.edu  11-Jan-2000  C     changed: Christian Eckert eckert@mit.edu  11-Jan-2000
23  c              - Restructured the code in order to create a package  C              - Restructured the code in order to create a package
24  c                for the MITgcmUV.  C                for the MITgcmUV.
25  c              Christian Eckert eckert@mit.edu  12-Feb-2000  C              Christian Eckert eckert@mit.edu  12-Feb-2000
26  c              - Changed Routine names (package prefix: exf_)  C              - Changed Routine names (package prefix: exf_)
27  c     changed: Patrick Heimbach, heimbach@mit.edu  04-May-2000  C     changed: Patrick Heimbach, heimbach@mit.edu  04-May-2000
28  c              - changed the handling of precip and sflux with respect  C              - changed the handling of precip and sflux with respect
29  c                to CPP options ALLOW_BULKFORMULAE and ALLOW_ATM_TEMP  C                to CPP options ALLOW_BULKFORMULAE and ALLOW_ATM_TEMP
30  c     changed: Ralf.Giering@FastOpt.de 25-Mai-20000  C     changed: Ralf.Giering@FastOpt.de 25-Mai-20000
31  c              - moved relaxation and climatology to extra routines  C              - moved relaxation and climatology to extra routines
32  c              Patrick Heimbach, heimbach@mit.edu  04-May-2000  C              Patrick Heimbach, heimbach@mit.edu  04-May-2000
33  c              - added obcs parameters  C              - added obcs parameters
34  c     changed: Virginie Thierry, vthierry@ucsd.edu 04-June-2001  C     changed: Virginie Thierry, vthierry@ucsd.edu 04-June-2001
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  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     ==================================================================
42  c     SUBROUTINE exf_readparms  C     SUBROUTINE exf_readparms
43  c     ==================================================================  C     ==================================================================
44    
45        implicit none        implicit none
46    
47  c     == global variables ==  C     == global variables ==
48    
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"  #ifdef USE_EXF_INTERPOLATION
53  #include "exf.h"  # ifdef ALLOW_EXCH2
54  #include "exf_param.h"  # include "W2_EXCH2_SIZE.h"
55  #include "exf_constants.h"  # include "W2_EXCH2_TOPOLOGY.h"
56    # endif /* ALLOW_EXCH2 */
57  c     == routine arguments ==  # include "SET_GRID.h"
58    #endif /* USE_EXF_INTERPOLATION */
59        integer mythid  c#include "cal.h"
60    #include "EXF_PARAM.h"
61  c     == local variables ==  #include "EXF_CONSTANTS.h"
   
       integer i  
       integer date_array(4), difftime(4)  
   
 c     == external ==  
62    
63        integer  ilnblnk  C     == routine arguments ==
64        external ilnblnk        INTEGER myThid
65    
66  c     == end of interface ==  C     == local variables ==
67    #ifdef USE_EXF_INTERPOLATION
68          INTEGER gridNx, gridNy
69          INTEGER j
70          _RL inp_lon0, inp_lat0, inp_dLon, inp_dLat
71    #endif /* USE_EXF_INTERPOLATION */
72          INTEGER iUnit
73          LOGICAL exf_verbose
74          CHARACTER*(2) exf_yftype
75          CHARACTER*(MAX_LEN_MBUF) msgBuf
76    C     == end of interface ==
77    
78  c     Surface flux data.  C     Surface flux data.
79        namelist /exf_nml/        NAMELIST /EXF_NML_01/
80       &      windstressmax,       repeatPeriod,    exf_albedo,       &      windstressmax,       repeatPeriod,    exf_albedo,
81         &   ocean_emissivity,     ice_emissivity, snow_emissivity,
82         &          exf_iceCd,          exf_iceCe,     exf_iceCh,
83         &   exf_scal_BulkCdn,     climtempfreeze, useExfCheckRange,
84         &      exf_iprec    ,   exf_iprec_obcs  , exf_yftype,
85         &      exf_verbose  ,   exf_debugLev    , exf_monFreq,
86         & useExfYearlyFields,  twoDigitYear,
87         & useStabilityFct_overIce, readStressOnAgrid, readStressOnCgrid,
88         & rotateStressOnAgrid, useAtmWind, useRelativeWind, noNegativeEvap,
89         & select_ZenAlbedo, useExfZenIncoming,
90         & hu, ht, umin, atmrho, atmcp, cen2kel, gravity_mks,
91         & cdrag_1, cdrag_2, cdrag_3, cstanton_1, cstanton_2, cdalton,
92         & flamb, flami, zolmin, zref,
93         & cvapor_fac, cvapor_exp, cvapor_fac_ice, cvapor_exp_ice,
94         & humid_fac, gamma_blk, saltsat, sstExtrapol, psim_fac
95    
96          NAMELIST /EXF_NML_02/
97         &          hfluxfile,          atempfile,       aqhfile,
98         &                                hs_file,       hl_file,
99         &          sfluxfile,           evapfile,    precipfile,
100         &     snowprecipfile,         runofffile, runoftempfile,
101         &        saltflxfile,        ustressfile,   vstressfile,
102         &          uwindfile,          vwindfile,    wspeedfile,
103         &         swfluxfile,         lwfluxfile,    swdownfile,
104         &         lwdownfile,      apressurefile,  areamaskfile,
105         &        climsstfile,        climsssfile,
106         &       climustrfile,       climvstrfile,
107       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,
108       &    atempstartdate1,    atempstartdate2,   atempperiod,       &    atempstartdate1,    atempstartdate2,   atempperiod,
109       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,
110         &      hs_startdate1,      hs_startdate2,     hs_period,
111         &      hl_startdate1,      hl_startdate2,     hl_period,
112       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,       &    sfluxstartdate1,    sfluxstartdate2,   sfluxperiod,
113       &     evapstartdate1,     evapstartdate2,    evapperiod,       &     evapstartdate1,     evapstartdate2,    evapperiod,
114       &   precipstartdate1,   precipstartdate2,  precipperiod,       &   precipstartdate1,   precipstartdate2,  precipperiod,
115         & snowprecipstartdate1, snowprecipstartdate2, snowprecipperiod,
116       &   runoffstartdate1,   runoffstartdate2,  runoffperiod,       &   runoffstartdate1,   runoffstartdate2,  runoffperiod,
117         &   saltflxstartdate1, saltflxstartdate2, saltflxperiod,
118       &  ustressstartdate1,  ustressstartdate2, ustressperiod,       &  ustressstartdate1,  ustressstartdate2, ustressperiod,
119       &  vstressstartdate1,  vstressstartdate2, vstressperiod,       &  vstressstartdate1,  vstressstartdate2, vstressperiod,
120       &    uwindstartdate1,    uwindstartdate2,   uwindperiod,       &    uwindstartdate1,    uwindstartdate2,   uwindperiod,
121       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,       &    vwindstartdate1,    vwindstartdate2,   vwindperiod,
122         &   wspeedstartdate1,   wspeedstartdate2,  wspeedperiod,
123       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,       &   swfluxstartdate1,   swfluxstartdate2,  swfluxperiod,
124       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,
125       &   swdownstartdate1,   swdownstartdate2,  swdownperiod,       &   swdownstartdate1,   swdownstartdate2,  swdownperiod,
126       &   lwdownstartdate1,   lwdownstartdate2,  lwdownperiod,       &   lwdownstartdate1,   lwdownstartdate2,  lwdownperiod,
      &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,  
      &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,  
      &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,  
      &    obcsWstartdate1,    obcsWstartdate2,   obcsWperiod,  
127       &apressurestartdate1,apressurestartdate2,apressureperiod,       &apressurestartdate1,apressurestartdate2,apressureperiod,
128       &          hfluxfile,          atempfile,       aqhfile,       &  areamaskstartdate1,areamaskstartdate2,areamaskperiod,
129       &          sfluxfile,         precipfile,    runofffile,       &  climsststartdate1,  climsststartdate2, climsstperiod,
130       &        ustressfile,        vstressfile,      evapfile,       &  climsssstartdate1,  climsssstartdate2, climsssperiod,
131       &          uwindfile,          vwindfile,       & climustrstartdate1, climustrstartdate2,climustrperiod,
132       &         swfluxfile,         lwfluxfile, apressurefile,       & climvstrstartdate1, climvstrstartdate2,climvstrperiod,
133       &         swdownfile,         lwdownfile,       &   areamaskTauRelax,    climsstTauRelax, climsssTauRelax,
134       &          exf_iprec,         exf_yftype,       &   climustrTauRelax,climvstrTauRelax
135       &   exf_inscal_hflux,  exf_inscal_sflux,  
136          NAMELIST /EXF_NML_03/
137         &   exf_inscal_hflux,  exf_inscal_sflux,    exf_inscal_evap,
138       & exf_inscal_ustress,  exf_inscal_vstress,       & exf_inscal_ustress,  exf_inscal_vstress,
139       &   exf_inscal_uwind,  exf_inscal_vwind,    exf_inscal_evap,       &   exf_inscal_uwind,  exf_inscal_vwind,    exf_inscal_wspeed,
140       &   exf_inscal_atemp,  exf_offset_atemp,    exf_inscal_aqh,       &   exf_inscal_atemp,  exf_offset_atemp,
141         &   exf_inscal_aqh,    exf_inscal_hs,       exf_inscal_hl,
142       &     exf_inscal_sst,  exf_inscal_sss,       &     exf_inscal_sst,  exf_inscal_sss,
143       &  exf_inscal_swflux,  exf_inscal_lwflux,   exf_inscal_precip,       &  exf_inscal_swflux,  exf_inscal_lwflux,   exf_inscal_precip,
144       &  exf_inscal_runoff,  exf_inscal_apressure,       &  exf_inscal_runoff,  exf_inscal_apressure, exf_inscal_snowprecip,
145         &  exf_inscal_runoftemp, exf_inscal_saltflx,
146       &  exf_inscal_swdown,  exf_inscal_lwdown,       &  exf_inscal_swdown,  exf_inscal_lwdown,
147         & exf_inscal_climsst, exf_inscal_climsss,
148         & exf_inscal_climustr, exf_inscal_climvstr,
149       &  exf_outscal_hflux,  exf_outscal_ustress, exf_outscal_vstress,       &  exf_outscal_hflux,  exf_outscal_ustress, exf_outscal_vstress,
150       & exf_outscal_swflux,  exf_outscal_sst,     exf_outscal_sss,       & exf_outscal_swflux,  exf_outscal_sst,     exf_outscal_sss,
151       &  exf_outscal_sflux,  exf_outscal_apressure,       &  exf_outscal_sflux,  exf_outscal_apressure,
152       &         hfluxconst,       & exf_inscal_areamask, exf_outscal_areamask,
153       &         atempconst,       &  hfluxconst, atempconst, aqhconst, hs_const, hl_const,
154       &         aqhconst,       &  sfluxconst, evapconst, precipconst, snowprecipconst,
155       &         sfluxconst,       &  runoffconst, runoftempconst, saltflxconst, ustressconst,
156       &         evapconst,       &  vstressconst, uwindconst, vwindconst, wspeedconst, swfluxconst,
157       &         precipconst,       &  lwfluxconst, swdownconst, lwdownconst, apressureconst,
158       &         runoffconst,       &  areamaskconst, climsstconst,   climsssconst,
159       &         ustressconst,       &  climustrconst, climvstrconst,
160       &         vstressconst,       &     hflux_exfremo_intercept, hflux_exfremo_slope,
161       &         uwindconst,       &     atemp_exfremo_intercept, atemp_exfremo_slope,
162       &         vwindconst,       &     aqh_exfremo_intercept, aqh_exfremo_slope,
163       &         swfluxconst,       &     hs_exfremo_intercept,  hs_exfremo_slope,
164       &         lwfluxconst,       &     hl_exfremo_intercept,  hl_exfremo_slope,
165       &         swdownconst,       &     sflux_exfremo_intercept, sflux_exfremo_slope,
166       &         lwdownconst,       &     evap_exfremo_intercept, evap_exfremo_slope,
167       &         apressureconst       &     precip_exfremo_intercept, precip_exfremo_slope,
168         &     snowprecip_exfremo_intercept, snowprecip_exfremo_slope,
169         &     runoff_exfremo_intercept, runoff_exfremo_slope,
170         &     runoftemp_exfremo_intercept, runoftemp_exfremo_slope,
171         &     saltflx_exfremo_intercept, saltflx_exfremo_slope,
172         &     ustress_exfremo_intercept, ustress_exfremo_slope,
173         &     vstress_exfremo_intercept, vstress_exfremo_slope,
174         &     uwind_exfremo_intercept, uwind_exfremo_slope,
175         &     vwind_exfremo_intercept, vwind_exfremo_slope,
176         &     wspeed_exfremo_intercept, wspeed_exfremo_slope,
177         &     swflux_exfremo_intercept, swflux_exfremo_slope,
178         &     lwflux_exfremo_intercept, lwflux_exfremo_slope,
179         &     swdown_exfremo_intercept, swdown_exfremo_slope,
180         &     lwdown_exfremo_intercept, lwdown_exfremo_slope,
181         &     apressure_exfremo_intercept, apressure_exfremo_slope,
182         &     areamask_exfremo_intercept, areamask_exfremo_slope,
183         &     climsst_exfremo_intercept, climsst_exfremo_slope,
184         &     climsss_exfremo_intercept, climsss_exfremo_slope,
185         &     climustr_exfremo_intercept, climustr_exfremo_slope,
186         &     climvstr_exfremo_intercept, climvstr_exfremo_slope
187    
188  #ifdef USE_EXF_INTERPOLATION  #ifdef USE_EXF_INTERPOLATION
189       & ,ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,        NAMELIST /EXF_NML_04/
190       & ustress_nlon, ustress_nlat,       & ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,
191         & ustress_nlon, ustress_nlat, ustress_interpMethod,
192       & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,       & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,
193       & vstress_nlon, vstress_nlat,       & vstress_nlon, vstress_nlat, vstress_interpMethod,
194       & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,       & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,
195       & hflux_nlon, hflux_nlat,       & hflux_nlon, hflux_nlat, hflux_interpMethod,
196       & sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc,       & sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc,
197       & sflux_nlon, sflux_nlat,       & sflux_nlon, sflux_nlat, sflux_interpMethod,
198       & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,       & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,
199       & swflux_nlon, swflux_nlat,       & swflux_nlon, swflux_nlat, swflux_interpMethod,
200       & runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc,       & lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc,
201       & runoff_nlon, runoff_nlat,       & lwflux_nlon, lwflux_nlat, lwflux_interpMethod,
202       & atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc,       & atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc,
203       & atemp_nlon, atemp_nlat,       & atemp_nlon, atemp_nlat, atemp_interpMethod,
204       & aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc,       & aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc,
205       & aqh_nlon, aqh_nlat,       & aqh_nlon, aqh_nlat, aqh_interpMethod,
206         & hs_lon0, hs_lon_inc, hs_lat0, hs_lat_inc,
207         & hs_nlon, hs_nlat, hs_interpMethod,
208         & hl_lon0, hl_lon_inc, hl_lat0, hl_lat_inc,
209         & hl_nlon, hl_nlat, hl_interpMethod,
210       & evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc,       & evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc,
211       & evap_nlon, evap_nlat,       & evap_nlon, evap_nlat, evap_interpMethod,
212       & precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc,       & precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc,
213       & precip_nlon, precip_nlat,       & precip_nlon, precip_nlat, precip_interpMethod,
214         & runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc,
215         & runoff_nlon, runoff_nlat, runoff_interpMethod,
216         & saltflx_lon0, saltflx_lon_inc,
217         & saltflx_lat0, saltflx_lat_inc,
218         & saltflx_nlon, saltflx_nlat, saltflx_interpMethod,
219         & snowprecip_lon0, snowprecip_lon_inc,
220         & snowprecip_lat0, snowprecip_lat_inc,
221         & snowprecip_nlon, snowprecip_nlat, snowprecip_interpMethod,
222       & uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc,       & uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc,
223       & uwind_nlon, uwind_nlat,       & uwind_nlon, uwind_nlat, uwind_interpMethod,
224       & vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc,       & vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc,
225       & vwind_nlon, vwind_nlat,       & vwind_nlon, vwind_nlat, vwind_interpMethod,
226       & lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc,       & wspeed_lon0, wspeed_lon_inc, wspeed_lat0, wspeed_lat_inc,
227       & lwflux_nlon, lwflux_nlat,       & wspeed_nlon, wspeed_nlat, wspeed_interpMethod,
228       & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,       & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,
229       & swdown_nlon, swdown_nlat,       & swdown_nlon, swdown_nlat, swdown_interpMethod,
230       & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,       & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
231       & lwdown_nlon, lwdown_nlat,       & lwdown_nlon, lwdown_nlat, lwdown_interpMethod,
232       & apressure_lon0,apressure_lon_inc,       & apressure_lon0,apressure_lon_inc,apressure_lat0,apressure_lat_inc
233       & apressure_lat0,apressure_lat_inc,       & , apressure_nlon, apressure_nlat, apressure_interpMethod,
234       & apressure_nlon,apressure_nlat       & areamask_lon0, areamask_lon_inc, areamask_lat0, areamask_lat_inc,
235  #endif       & areamask_nlon, areamask_nlat, areamask_interpMethod,
236         & climsst_lon0, climsst_lon_inc, climsst_lat0, climsst_lat_inc,
237         & climsst_nlon, climsst_nlat, climsst_interpMethod,
238         & climsss_lon0, climsss_lon_inc,climsss_lat0, climsss_lat_inc,
239         & climsss_nlon, climsss_nlat, climsss_interpMethod,
240         & climustr_lon0, climustr_lon_inc, climustr_lat0, climustr_lat_inc,
241         & climustr_nlon, climustr_nlat, climustr_interpMethod,
242         & climvstr_lon0, climvstr_lon_inc, climvstr_lat0, climvstr_lat_inc,
243         & climvstr_nlon, climvstr_nlat, climvstr_interpMethod,
244         & exf_output_interp
245    #endif /* USE_EXF_INTERPOLATION */
246    
247    #ifdef ALLOW_OBCS
248          NAMELIST /EXF_NML_OBCS/
249         &    useOBCSYearlyFields,
250         &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,
251         &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,
252         &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,
253         &    obcsWstartdate1,    obcsWstartdate2,   obcsWperiod,
254         &    siobNstartdate1,    siobNstartdate2,   siobNperiod,
255         &    siobSstartdate1,    siobSstartdate2,   siobSperiod,
256         &    siobEstartdate1,    siobEstartdate2,   siobEperiod,
257         &    siobWstartdate1,    siobWstartdate2,   siobWperiod
258    #endif /* ALLOW_OBCS */
259    
260        _BEGIN_MASTER(mythid)  #ifdef USE_EXF_INTERPOLATION
261    # ifdef ALLOW_EXCH2
262          gridNx = exch2_mydNx(1)
263          gridNy = exch2_mydNy(1)
264    # else /* ALLOW_EXCH2 */
265          gridNx = Nx
266          gridNy = Ny
267    # endif /* ALLOW_EXCH2 */
268    #endif /* USE_EXF_INTERPOLATION */
269    
270  c     Set default values.        IF ( .NOT.useEXF ) THEN
271    C-    pkg EXF is not used
272            _BEGIN_MASTER(myThid)
273    C-    Track pkg activation status:
274    C     print a (weak) warning if data.exf is found
275             CALL PACKAGES_UNUSED_MSG( 'useEXF', ' ', ' ' )
276            _END_MASTER(myThid)
277            RETURN
278          ENDIF
279    
280          _BEGIN_MASTER(myThid)
281    
282    C     Set default values.
283    
284    c     exf_verbose        = debugMode
285          exf_verbose        = .FALSE.
286          exf_debugLev       = debugLevel
287          exf_monFreq        = monitorFreq
288          useExfCheckRange   = .TRUE.
289          useExfZenAlbedo    = .FALSE.
290          select_ZenAlbedo   = 0
291          useExfZenIncoming  = .FALSE.
292          readStressOnAgrid  = .FALSE.
293          rotateStressOnAgrid = .FALSE.
294          readStressOnCgrid  = .FALSE.
295    #ifdef ALLOW_ATM_WIND
296          useAtmWind         = .TRUE.
297    #else
298          useAtmWind         = .FALSE.
299    #endif
300          useRelativeWind    = .FALSE.
301          noNegativeEvap     = .FALSE.
302    
303  c     Calendar data.  C-  default value should be set to main model parameter:
304    c     cen2kel     =  celsius2K
305    c     gravity_mks = gravity
306    c     atmcp       =  atm_Cp
307    c     humid_fac   =  atm_Rq     <- default is zero !!!
308    
309          cen2kel        =      273.150  _d 0
310          gravity_mks    =        9.81   _d 0
311          atmrho         =        1.200  _d 0
312          atmcp          =     1005.000  _d 0
313          flamb          =  2500000.000  _d 0
314          flami          =   334000.000  _d 0
315          cvapor_fac     =   640380.000  _d 0
316          cvapor_exp     =     5107.400  _d 0
317          cvapor_fac_ice = 11637800.000  _d 0
318          cvapor_exp_ice =     5897.800  _d 0
319          humid_fac      =        0.606  _d 0
320          gamma_blk      =        0.010  _d 0
321          saltsat        =        0.980  _d 0
322          sstExtrapol    =        0.0    _d 0
323          cdrag_1        =        0.0027000 _d 0
324          cdrag_2        =        0.0001420 _d 0
325          cdrag_3        =        0.0000764 _d 0
326          cstanton_1     =        0.0327 _d 0
327          cstanton_2     =        0.0180 _d 0
328          cdalton        =        0.0346 _d 0
329          zolmin         =     -100.000  _d 0
330          psim_fac       =        5.000  _d 0
331          zref           =       10.000  _d 0
332          hu             =       10.000  _d 0
333          ht             =        2.000  _d 0
334          umin           =        0.5    _d 0
335          useStabilityFct_overIce = .FALSE.
336          exf_iceCd        = 1.63 _d -3
337          exf_iceCe        = 1.63 _d -3
338          exf_iceCh        = 1.63 _d -3
339          exf_albedo       = 0.1 _d 0
340    C--   this default is chosen to be backward compatible with
341    C--   an earlier setting of 5.5 = ocean_emissivity*stefanBoltzmann
342          ocean_emissivity = 5.50 _d -8 / 5.670 _d -8
343          ice_emissivity   = 0.95 _d 0
344          snow_emissivity  = 0.95 _d 0
345    
346    C     Calendar data.
347        hfluxstartdate1    = 0        hfluxstartdate1    = 0
348        hfluxstartdate2    = 0        hfluxstartdate2    = 0
349        hfluxperiod        = 0.0 _d 0        hfluxperiod        = 0.0 _d 0
350        hfluxconst         = 0.0 _d 0        hfluxconst         = 0.0 _d 0
351          hflux_exfremo_intercept = 0.0 _d 0
352          hflux_exfremo_slope = 0.0 _d 0
353    
354        atempstartdate1    = 0        atempstartdate1    = 0
355        atempstartdate2    = 0        atempstartdate2    = 0
356        atempperiod        = 0.0 _d 0        atempperiod        = 0.0 _d 0
357        atempconst         = celsius2K        atempconst         = celsius2K
358          atemp_exfremo_intercept = 0.0 _d 0
359          atemp_exfremo_slope = 0.0 _d 0
360    
361        aqhstartdate1      = 0        aqhstartdate1      = 0
362        aqhstartdate2      = 0        aqhstartdate2      = 0
363        aqhperiod          = 0.0 _d 0        aqhperiod          = 0.0 _d 0
364        aqhconst           = 0.0 _d 0        aqhconst           = 0.0 _d 0
365          aqh_exfremo_intercept = 0.0 _d 0
366          aqh_exfremo_slope  = 0.0 _d 0
367    
368          hs_startdate1      = 0
369          hs_startdate2      = 0
370          hs_period          = 0.0 _d 0
371          hs_const           = 0.0 _d 0
372          hs_exfremo_intercept = 0.0 _d 0
373          hs_exfremo_slope   = 0.0 _d 0
374    
375          hl_startdate1      = 0
376          hl_startdate2      = 0
377          hl_period          = 0.0 _d 0
378          hl_const           = 0.0 _d 0
379          hl_exfremo_intercept = 0.0 _d 0
380          hl_exfremo_slope   = 0.0 _d 0
381    
382        sfluxstartdate1    = 0        sfluxstartdate1    = 0
383        sfluxstartdate2    = 0        sfluxstartdate2    = 0
384        sfluxperiod        = 0.0 _d 0        sfluxperiod        = 0.0 _d 0
385        sfluxconst         = 0.0 _d 0        sfluxconst         = 0.0 _d 0
386          sflux_exfremo_intercept = 0.0 _d 0
387          sflux_exfremo_slope = 0.0 _d 0
388    
389        evapstartdate1   = 0        evapstartdate1   = 0
390        evapstartdate2   = 0        evapstartdate2   = 0
391        evapperiod       = 0.0 _d 0        evapperiod       = 0.0 _d 0
392        evapconst        = 0.0 _d 0        evapconst        = 0.0 _d 0
393          evap_exfremo_intercept = 0.0 _d 0
394          evap_exfremo_slope = 0.0 _d 0
395    
396        precipstartdate1   = 0        precipstartdate1   = 0
397        precipstartdate2   = 0        precipstartdate2   = 0
398        precipperiod       = 0.0 _d 0        precipperiod       = 0.0 _d 0
399        precipconst        = 0.0 _d 0        precipconst        = 0.0 _d 0
400          precip_exfremo_intercept = 0.0 _d 0
401          precip_exfremo_slope = 0.0 _d 0
402    
403          snowprecipstartdate1   = 0
404          snowprecipstartdate2   = 0
405          snowprecipperiod       = 0.0 _d 0
406          snowprecipconst        = 0.0 _d 0
407          snowprecip_exfremo_intercept = 0.0 _d 0
408          snowprecip_exfremo_slope = 0.0 _d 0
409    
410        runoffstartdate1   = 0        runoffstartdate1   = 0
411        runoffstartdate2   = 0        runoffstartdate2   = 0
412        runoffperiod       = 0.0 _d 0        runoffperiod       = 0.0 _d 0
413        runoffconst        = 0.0 _d 0        runoffconst        = 0.0 _d 0
414          runoff_exfremo_intercept = 0.0 _d 0
415          runoff_exfremo_slope = 0.0 _d 0
416    
417          runoftempconst              = 0.0 _d 0
418          runoftemp_exfremo_intercept = 0.0 _d 0
419          runoftemp_exfremo_slope     = 0.0 _d 0
420    
421          saltflxstartdate1  = 0
422          saltflxstartdate2  = 0
423          saltflxperiod      = 0.0 _d 0
424          saltflxconst       = 0.0 _d 0
425          saltflx_exfremo_intercept = 0.0 _d 0
426          saltflx_exfremo_slope = 0.0 _d 0
427    
428        ustressstartdate1  = 0        ustressstartdate1  = 0
429        ustressstartdate2  = 0        ustressstartdate2  = 0
430        ustressperiod      = 0.0 _d 0        ustressperiod      = 0.0 _d 0
431        ustressconst       = 0.0 _d 0        ustressconst       = 0.0 _d 0
432          ustress_exfremo_intercept = 0.0 _d 0
433          ustress_exfremo_slope = 0.0 _d 0
434    
435        vstressstartdate1  = 0        vstressstartdate1  = 0
436        vstressstartdate2  = 0        vstressstartdate2  = 0
437        vstressperiod      = 0.0 _d 0        vstressperiod      = 0.0 _d 0
438        vstressconst       = 0.0 _d 0        vstressconst       = 0.0 _d 0
439          vstress_exfremo_intercept = 0.0 _d 0
440          vstress_exfremo_slope = 0.0 _d 0
441    
442        uwindstartdate1    = 0        uwindstartdate1    = 0
443        uwindstartdate2    = 0        uwindstartdate2    = 0
444        uwindperiod        = 0.0 _d 0        uwindperiod        = 0.0 _d 0
445        uwindconst         = 0.0 _d 0        uwindconst         = 0.0 _d 0
446          uwind_exfremo_intercept = 0.0 _d 0
447          uwind_exfremo_slope = 0.0 _d 0
448    
449        vwindstartdate1    = 0        vwindstartdate1    = 0
450        vwindstartdate2    = 0        vwindstartdate2    = 0
451        vwindperiod        = 0.0 _d 0        vwindperiod        = 0.0 _d 0
452        vwindconst         = 0.0 _d 0        vwindconst         = 0.0 _d 0
453          vwind_exfremo_intercept = 0.0 _d 0
454          vwind_exfremo_slope = 0.0 _d 0
455    
456          wspeedstartdate1    = 0
457          wspeedstartdate2    = 0
458          wspeedperiod        = 0.0 _d 0
459          wspeedconst         = 0.0 _d 0
460          wspeed_exfremo_intercept = 0.0 _d 0
461          wspeed_exfremo_slope = 0.0 _d 0
462    
463        swfluxstartdate1   = 0        swfluxstartdate1   = 0
464        swfluxstartdate2   = 0        swfluxstartdate2   = 0
465        swfluxperiod       = 0.0 _d 0        swfluxperiod       = 0.0 _d 0
466        swfluxconst        = 0.0 _d 0        swfluxconst        = 0.0 _d 0
467          swflux_exfremo_intercept = 0.0 _d 0
468          swflux_exfremo_slope = 0.0 _d 0
469    
470        lwfluxstartdate1   = 0        lwfluxstartdate1   = 0
471        lwfluxstartdate2   = 0        lwfluxstartdate2   = 0
472        lwfluxperiod       = 0.0 _d 0        lwfluxperiod       = 0.0 _d 0
473        lwfluxconst        = 0.0 _d 0        lwfluxconst        = 0.0 _d 0
474          lwflux_exfremo_intercept = 0.0 _d 0
475          lwflux_exfremo_slope = 0.0 _d 0
476    
477        swdownstartdate1   = 0        swdownstartdate1   = 0
478        swdownstartdate2   = 0        swdownstartdate2   = 0
479        swdownperiod       = 0.0 _d 0        swdownperiod       = 0.0 _d 0
480        swdownconst        = 0.0 _d 0        swdownconst        = 0.0 _d 0
481          swdown_exfremo_intercept = 0.0 _d 0
482          swdown_exfremo_slope = 0.0 _d 0
483    
484        lwdownstartdate1   = 0        lwdownstartdate1   = 0
485        lwdownstartdate2   = 0        lwdownstartdate2   = 0
486        lwdownperiod       = 0.0 _d 0        lwdownperiod       = 0.0 _d 0
487        lwdownconst        = 0.0 _d 0        lwdownconst        = 0.0 _d 0
488          lwdown_exfremo_intercept = 0.0 _d 0
489          lwdown_exfremo_slope = 0.0 _d 0
490    
491          apressurestartdate1    = 0
492          apressurestartdate2    = 0
493          apressureperiod        = 0.0 _d 0
494          apressureconst         = 0.0 _d 0
495          apressure_exfremo_intercept = 0.0 _d 0
496          apressure_exfremo_slope = 0.0 _d 0
497    
498          areamaskstartdate1    = 0
499          areamaskstartdate2    = 0
500          areamaskperiod        = 0.0 _d 0
501          areamaskTauRelax      = 0.0 _d 0
502          areamaskconst         = 0.0 _d 0
503          areamask_exfremo_intercept = 0. _d 0
504          areamask_exfremo_slope = 0. _d 0
505    
506          climsststartdate1  = 0
507          climsststartdate2  = 0
508          climsstperiod      = 0
509          climsstTauRelax    = 0.0 _d 0
510          climsstconst         = 0.0 _d 0
511          climsst_exfremo_intercept = 0.0 _d 0
512          climsst_exfremo_slope = 0.0 _d 0
513    
514          climsssstartdate1  = 0
515          climsssstartdate2  = 0
516          climsssperiod      = 0
517          climsssTauRelax    = 0.0 _d 0
518          climsssconst         = 0.0 _d 0
519          climsss_exfremo_intercept = 0.0 _d 0
520          climsss_exfremo_slope = 0.0 _d 0
521    
522          climustrstartdate1  = 0
523          climustrstartdate2  = 0
524          climustrperiod      = 0
525          climustrTauRelax    = 0.0 _d 0
526          climustrconst         = 0.0 _d 0
527          climustr_exfremo_intercept = 0.0 _d 0
528          climustr_exfremo_slope = 0.0 _d 0
529    
530          climvstrstartdate1  = 0
531          climvstrstartdate2  = 0
532          climvstrperiod      = 0
533          climvstrTauRelax    = 0.0 _d 0
534          climvstrconst         = 0.0 _d 0
535          climvstr_exfremo_intercept = 0.0 _d 0
536          climvstr_exfremo_slope = 0.0 _d 0
537    
538          useOBCSYearlyFields = .FALSE.
539        obcsNstartdate1    = 0        obcsNstartdate1    = 0
540        obcsNstartdate2    = 0        obcsNstartdate2    = 0
541        obcsNperiod        = 0.0 _d 0        obcsNperiod        = 0.0 _d 0
   
542        obcsSstartdate1    = 0        obcsSstartdate1    = 0
543        obcsSstartdate2    = 0        obcsSstartdate2    = 0
544        obcsSperiod        = 0.0 _d 0        obcsSperiod        = 0.0 _d 0
   
545        obcsEstartdate1    = 0        obcsEstartdate1    = 0
546        obcsEstartdate2    = 0        obcsEstartdate2    = 0
547        obcsEperiod        = 0.0 _d 0        obcsEperiod        = 0.0 _d 0
   
548        obcsWstartdate1    = 0        obcsWstartdate1    = 0
549        obcsWstartdate2    = 0        obcsWstartdate2    = 0
550        obcsWperiod        = 0.0 _d 0        obcsWperiod        = 0.0 _d 0
551    
552        apressurestartdate1    = 0        siobNstartdate1    = UNSET_I
553        apressurestartdate2    = 0        siobNstartdate2    = UNSET_I
554        apressureperiod        = 0.0 _d 0        siobNperiod        = UNSET_RL
555        apressureconst         = 0.0 _d 0        siobSstartdate1    = UNSET_I
556          siobSstartdate2    = UNSET_I
557          siobSperiod        = UNSET_RL
558          siobEstartdate1    = UNSET_I
559          siobEstartdate2    = UNSET_I
560          siobEperiod        = UNSET_RL
561          siobWstartdate1    = UNSET_I
562          siobWstartdate2    = UNSET_I
563          siobWperiod        = UNSET_RL
564    
565          repeatPeriod       = 0.0 _d 0
566          windstressmax      = 2.0 _d 0
567    
568          exf_scal_BulkCdn   = 1.0  _d 0
569    
570        repeatPeriod           = 0.0 _d 0  C     Initialise freezing temperature of sea water
571        exf_albedo             = 0.1 _d 0        climtempfreeze     = -1.9 _d 0
       windstressmax          = 2.0 _d 0  
572    
573  c     Data files.  C     Data files.
574        hfluxfile          = ' '        hfluxfile          = ' '
575        atempfile          = ' '        atempfile          = ' '
576        aqhfile            = ' '        aqhfile            = ' '
577          hs_file            = ' '
578          hl_file            = ' '
579        evapfile           = ' '        evapfile           = ' '
580        precipfile         = ' '        precipfile         = ' '
581          snowprecipfile     = ' '
582        sfluxfile          = ' '        sfluxfile          = ' '
583        runofffile         = ' '        runofffile         = ' '
584          runoftempfile      = ' '
585          saltflxfile        = ' '
586        ustressfile        = ' '        ustressfile        = ' '
587        vstressfile        = ' '        vstressfile        = ' '
588        uwindfile          = ' '        uwindfile          = ' '
589        vwindfile          = ' '        vwindfile          = ' '
590          wspeedfile         = ' '
591        swfluxfile         = ' '        swfluxfile         = ' '
592        lwfluxfile         = ' '        lwfluxfile         = ' '
593        swdownfile         = ' '        swdownfile         = ' '
594        lwdownfile         = ' '        lwdownfile         = ' '
595        apressurefile      = ' '        apressurefile      = ' '
596          areamaskfile       = ' '
597          climsstfile        = ' '
598          climsssfile        = ' '
599          climustrfile       = ' '
600          climvstrfile       = ' '
601    
602    C     Start dates.
603          hfluxStartTime     = 0.
604          atempStartTime     = 0.
605          aqhStartTime       = 0.
606          hs_StartTime       = 0.
607          hl_StartTime       = 0.
608          evapStartTime      = 0.
609          precipStartTime    = 0.
610          snowprecipStartTime= 0.
611          sfluxStartTime     = 0.
612          runoffStartTime    = 0.
613          saltflxStartTime   = 0.
614          ustressStartTime   = 0.
615          vstressStartTime   = 0.
616          uwindStartTime     = 0.
617          vwindStartTime     = 0.
618          wspeedStartTime    = 0.
619          swfluxStartTime    = 0.
620          lwfluxStartTime    = 0.
621          swdownStartTime    = 0.
622          lwdownStartTime    = 0.
623          obcsNStartTime     = 0.
624          obcsSStartTime     = 0.
625          obcsEStartTime     = 0.
626          obcsWStartTime     = 0.
627          siobNStartTime     = 0.
628          siobSStartTime     = 0.
629          siobEStartTime     = 0.
630          siobWStartTime     = 0.
631          apressureStartTime = 0.
632          areamaskStartTime  = 0.
633          climsstStartTime   = 0.
634          climsssStartTime   = 0.
635          climustrStartTime  = 0.
636          climvstrStartTime  = 0.
637    
638    C     Initialise file type and field precision
639          exf_iprec            = 32
640          exf_iprec_obcs       = UNSET_I
641          exf_yftype           = 'RL'
642          useExfYearlyFields   = .FALSE.
643          twoDigitYear         = .FALSE.
644    
645  c     Start dates.  C     Input scaling factors.
       hfluxstartdate     = 0  
       atempstartdate     = 0  
       aqhstartdate       = 0  
       evapstartdate      = 0  
       precipstartdate    = 0  
       sfluxstartdate     = 0  
       runoffstartdate    = 0  
       ustressstartdate   = 0  
       vstressstartdate   = 0  
       uwindstartdate     = 0  
       vwindstartdate     = 0  
       swfluxstartdate    = 0  
       lwfluxstartdate    = 0  
       swdownstartdate    = 0  
       lwdownstartdate    = 0  
       obcsNstartdate     = 0  
       obcsSstartdate     = 0  
       obcsEstartdate     = 0  
       obcsWstartdate     = 0  
       apressurestartdate = 0  
   
 c     Initialise file type and field precision  
       exf_iprec       = 32  
       exf_yftype      = 'RL'  
   
 c     Input scaling factors.  
646        exf_inscal_hflux     =  1. _d 0        exf_inscal_hflux     =  1. _d 0
647        exf_inscal_sflux     =  1. _d 0        exf_inscal_sflux     =  1. _d 0
648        exf_inscal_ustress   =  1. _d 0        exf_inscal_ustress   =  1. _d 0
649        exf_inscal_vstress   =  1. _d 0        exf_inscal_vstress   =  1. _d 0
650        exf_inscal_uwind     =  1. _d 0        exf_inscal_uwind     =  1. _d 0
651        exf_inscal_vwind     =  1. _d 0        exf_inscal_vwind     =  1. _d 0
652          exf_inscal_wspeed    =  1. _d 0
653        exf_inscal_swflux    =  1. _d 0        exf_inscal_swflux    =  1. _d 0
654        exf_inscal_lwflux    =  1. _d 0        exf_inscal_lwflux    =  1. _d 0
655        exf_inscal_precip    =  1. _d 0        exf_inscal_precip    =  1. _d 0
656          exf_inscal_snowprecip=  1. _d 0
657        exf_inscal_sst       =  1. _d 0        exf_inscal_sst       =  1. _d 0
658        exf_inscal_sss       =  1. _d 0        exf_inscal_sss       =  1. _d 0
659        exf_inscal_atemp     =  1. _d 0        exf_inscal_atemp     =  1. _d 0
660        exf_offset_atemp     =  0. _d 0        exf_offset_atemp     =  0. _d 0
661        exf_inscal_aqh       =  1. _d 0        exf_inscal_aqh       =  1. _d 0
662          exf_inscal_hs        =  1. _d 0
663          exf_inscal_hl        =  1. _d 0
664        exf_inscal_evap      =  1. _d 0        exf_inscal_evap      =  1. _d 0
665        exf_inscal_apressure =  1. _d 0        exf_inscal_apressure =  1. _d 0
666  cds   convert runoff from m/yr to m/s and change sign.        exf_inscal_runoff    =  1. _d 0
667        exf_inscal_runoff    = -1.0/(86400.*365.0)        exf_inscal_runoftemp =  1. _d 0
668          exf_inscal_saltflx   =  1. _d 0
669        exf_inscal_swdown    =  1. _d 0        exf_inscal_swdown    =  1. _d 0
670        exf_inscal_lwdown    =  1. _d 0        exf_inscal_lwdown    =  1. _d 0
671          exf_inscal_climsst   =  1. _d 0
672          exf_inscal_climsss   =  1. _d 0
673          exf_inscal_climustr  =  1. _d 0
674          exf_inscal_climvstr  =  1. _d 0
675          exf_inscal_areamask  =  1. _d 0
676    
677  c     Output scaling factors.  C     Output scaling factors.
678        exf_outscal_hflux    =  1. _d 0        exf_outscal_hflux    =  1. _d 0
679        exf_outscal_sflux    =  1. _d 0        exf_outscal_sflux    =  1. _d 0
680        exf_outscal_ustress  =  1. _d 0        exf_outscal_ustress  =  1. _d 0
# Line 343  c     Output scaling factors. Line 683  c     Output scaling factors.
683        exf_outscal_sst      =  1. _d 0        exf_outscal_sst      =  1. _d 0
684        exf_outscal_sss      =  1. _d 0        exf_outscal_sss      =  1. _d 0
685        exf_outscal_apressure=  1. _d 0        exf_outscal_apressure=  1. _d 0
686          exf_outscal_areamask =  1. _d 0
687    
688  #ifdef USE_EXF_INTERPOLATION  #ifdef USE_EXF_INTERPOLATION
689        ustress_lon0   = thetaMin  C--   set default input location to match (in case of simple Lat-Lonp grid)
690        uwind_lon0     = thetaMin  C     model grid cell-center position (leading to trivial interpolation)
691        vstress_lon0   = thetaMin + delX(1) / 2        inp_lon0 = xgOrigin + delX(1)*exf_half
692        hflux_lon0     = thetaMin + delX(1) / 2        inp_lat0 = ygOrigin + delY(1)*exf_half
693        sflux_lon0     = thetaMin + delX(1) / 2        inp_dLon = delX(1)
694        swflux_lon0    = thetaMin + delX(1) / 2        inp_dLat = delY(1)
695        runoff_lon0    = thetaMin + delX(1) / 2  
696        atemp_lon0     = thetaMin + delX(1) / 2        ustress_lon0   = inp_lon0
697        aqh_lon0       = thetaMin + delX(1) / 2        uwind_lon0     = inp_lon0
698        evap_lon0      = thetaMin + delX(1) / 2        vstress_lon0   = inp_lon0
699        precip_lon0    = thetaMin + delX(1) / 2        hflux_lon0     = inp_lon0
700        vwind_lon0     = thetaMin + delX(1) / 2        sflux_lon0     = inp_lon0
701        lwflux_lon0    = thetaMin + delX(1) / 2        swflux_lon0    = inp_lon0
702        swdown_lon0    = thetaMin + delX(1) / 2        runoff_lon0    = inp_lon0
703        lwdown_lon0    = thetaMin + delX(1) / 2        saltflx_lon0   = inp_lon0
704        apressure_lon0 = thetaMin + delX(1) / 2        atemp_lon0     = inp_lon0
705        vstress_lat0   = phimin        aqh_lon0       = inp_lon0
706        vwind_lat0     = phimin        hs_lon0        = inp_lon0
707        ustress_lat0   = phimin   + delY(1) / 2        hl_lon0        = inp_lon0
708        hflux_lat0     = phimin   + delY(1) / 2        evap_lon0      = inp_lon0
709        sflux_lat0     = phimin   + delY(1) / 2        precip_lon0    = inp_lon0
710        runoff_lat0    = phimin   + delY(1) / 2        snowprecip_lon0= inp_lon0
711        swflux_lat0    = phimin   + delY(1) / 2        vwind_lon0     = inp_lon0
712        atemp_lat0     = phimin   + delY(1) / 2        wspeed_lon0    = inp_lon0
713        aqh_lat0       = phimin   + delY(1) / 2        lwflux_lon0    = inp_lon0
714        evap_lat0      = phimin   + delY(1) / 2        swdown_lon0    = inp_lon0
715        precip_lat0    = phimin   + delY(1) / 2        lwdown_lon0    = inp_lon0
716        uwind_lat0     = phimin   + delY(1) / 2        apressure_lon0 = inp_lon0
717        lwflux_lat0    = phimin   + delY(1) / 2        areamask_lon0  = inp_lon0
718        swdown_lat0    = phimin   + delY(1) / 2        vstress_lat0   = inp_lat0
719        lwdown_lat0    = phimin   + delY(1) / 2        vwind_lat0     = inp_lat0
720        apressure_lat0 = phimin   + delY(1) / 2        wspeed_lat0    = inp_lat0
721        ustress_nlon   = Nx        ustress_lat0   = inp_lat0
722        ustress_nlat   = Ny        hflux_lat0     = inp_lat0
723        vstress_nlon   = Nx        sflux_lat0     = inp_lat0
724        vstress_nlat   = Ny        runoff_lat0    = inp_lat0
725        hflux_nlon     = Nx        saltflx_lat0   = inp_lat0
726        hflux_nlat     = Ny        swflux_lat0    = inp_lat0
727        sflux_nlon     = Nx        atemp_lat0     = inp_lat0
728        sflux_nlat     = Ny        aqh_lat0       = inp_lat0
729        swflux_nlon    = Nx        hs_lat0        = inp_lat0
730        swflux_nlat    = Ny        hl_lat0        = inp_lat0
731        runoff_nlon    = Nx        evap_lat0      = inp_lat0
732        runoff_nlat    = Ny        precip_lat0    = inp_lat0
733        atemp_nlon     = Nx        snowprecip_lat0= inp_lat0
734        atemp_nlat     = Ny        uwind_lat0     = inp_lat0
735        aqh_nlon       = Nx        lwflux_lat0    = inp_lat0
736        aqh_nlat       = Ny        swdown_lat0    = inp_lat0
737        evap_nlon      = Nx        lwdown_lat0    = inp_lat0
738        evap_nlat      = Ny        apressure_lat0 = inp_lat0
739        precip_nlon    = Nx        areamask_lat0  = inp_lat0
740        precip_nlat    = Ny        ustress_nlon   = gridNx
741        uwind_nlon     = Nx        ustress_nlat   = gridNy
742        uwind_nlat     = Ny        vstress_nlon   = gridNx
743        vwind_nlon     = Nx        vstress_nlat   = gridNy
744        vwind_nlat     = Ny        hflux_nlon     = gridNx
745        lwflux_nlon    = Nx        hflux_nlat     = gridNy
746        lwflux_nlat    = Ny        sflux_nlon     = gridNx
747        swdown_nlon    = Nx        sflux_nlat     = gridNy
748        swdown_nlat    = Ny        swflux_nlon    = gridNx
749        lwdown_nlon    = Nx        swflux_nlat    = gridNy
750        lwdown_nlat    = Ny        runoff_nlon    = gridNx
751        apressure_nlon = Nx        runoff_nlat    = gridNy
752        apressure_nlat = Ny        saltflx_nlon   = gridNx
753        Ustress_lon_inc   = delX(1)        saltflx_nlat   = gridNy
754        vstress_lon_inc   = delX(1)        atemp_nlon     = gridNx
755        hflux_lon_inc     = delX(1)        atemp_nlat     = gridNy
756        sflux_lon_inc     = delX(1)        aqh_nlon       = gridNx
757        swflux_lon_inc    = delX(1)        aqh_nlat       = gridNy
758        runoff_lon_inc    = delX(1)        hs_nlon        = gridNx
759        atemp_lon_inc     = delX(1)        hs_nlat        = gridNy
760        aqh_lon_inc       = delX(1)        hl_nlon        = gridNx
761        evap_lon_inc      = delX(1)        hl_nlat        = gridNy
762        precip_lon_inc    = delX(1)        evap_nlon      = gridNx
763        uwind_lon_inc     = delX(1)        evap_nlat      = gridNy
764        vwind_lon_inc     = delX(1)        precip_nlon    = gridNx
765        lwflux_lon_inc    = delX(1)        precip_nlat    = gridNy
766        swdown_lon_inc    = delX(1)        snowprecip_nlon= gridNx
767        lwdown_lon_inc    = delX(1)        snowprecip_nlat= gridNy
768        apressure_lon_inc = delX(1)        uwind_nlon     = gridNx
769        DO i=1,MAX_LAT_INC        uwind_nlat     = gridNy
770           IF (i.LT.Ny) THEN        vwind_nlon     = gridNx
771              vstress_lat_inc(i)   =  delY(i)        vwind_nlat     = gridNy
772              vwind_lat_inc(i)     =  delY(i)        wspeed_nlon    = gridNx
773              ustress_lat_inc(i)   = (delY(i) + delY(i)) / 2.        wspeed_nlat    = gridNy
774              hflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.        lwflux_nlon    = gridNx
775              sflux_lat_inc(i)     = (delY(i) + delY(i)) / 2.        lwflux_nlat    = gridNy
776              swflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.        swdown_nlon    = gridNx
777              runoff_lat_inc(i)    = (delY(i) + delY(i)) / 2.        swdown_nlat    = gridNy
778              atemp_lat_inc(i)     = (delY(i) + delY(i)) / 2.        lwdown_nlon    = gridNx
779              aqh_lat_inc(i)       = (delY(i) + delY(i)) / 2.        lwdown_nlat    = gridNy
780              evap_lat_inc(i)      = (delY(i) + delY(i)) / 2.        apressure_nlon = gridNx
781              precip_lat_inc(i)    = (delY(i) + delY(i)) / 2.        apressure_nlat = gridNy
782              uwind_lat_inc(i)     = (delY(i) + delY(i)) / 2.        areamask_nlon  = gridNx
783              lwflux_lat_inc(i)    = (delY(i) + delY(i)) / 2.        areamask_nlat  = gridNy
784              swdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.        ustress_lon_inc   = inp_dLon
785              lwdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.        vstress_lon_inc   = inp_dLon
786              apressure_lat_inc(i) = (delY(i) + delY(i)) / 2.        hflux_lon_inc     = inp_dLon
787           ELSE        sflux_lon_inc     = inp_dLon
788              ustress_lat_inc(i)   = 0.        swflux_lon_inc    = inp_dLon
789              vstress_lat_inc(i)   = 0.        runoff_lon_inc    = inp_dLon
790              hflux_lat_inc(i)     = 0.        saltflx_lon_inc   = inp_dLon
791              sflux_lat_inc(i)     = 0.        atemp_lon_inc     = inp_dLon
792              swflux_lat_inc(i)    = 0.        aqh_lon_inc       = inp_dLon
793              runoff_lat_inc(i)    = 0.        hs_lon_inc        = inp_dLon
794              atemp_lat_inc(i)     = 0.        hl_lon_inc        = inp_dLon
795              aqh_lat_inc(i)       = 0.        evap_lon_inc      = inp_dLon
796              evap_lat_inc(i)      = 0.        precip_lon_inc    = inp_dLon
797              precip_lat_inc(i)    = 0.        snowprecip_lon_inc= inp_dLon
798              uwind_lat_inc(i)     = 0.        uwind_lon_inc     = inp_dLon
799              vwind_lat_inc(i)     = 0.        vwind_lon_inc     = inp_dLon
800              lwflux_lat_inc(i)    = 0.        wspeed_lon_inc    = inp_dLon
801              swdown_lat_inc(i)    = 0.        lwflux_lon_inc    = inp_dLon
802              lwdown_lat_inc(i)    = 0.        swdown_lon_inc    = inp_dLon
803              apressure_lat_inc(i) = 0.        lwdown_lon_inc    = inp_dLon
804           ENDIF        apressure_lon_inc = inp_dLon
805          areamask_lon_inc  = inp_dLon
806    
807          climsst_lon0    = inp_lon0
808          climsss_lon0    = inp_lon0
809          climustr_lon0   = inp_lon0
810          climvstr_lon0   = inp_lon0
811          climsst_lat0    = inp_lat0
812          climsss_lat0    = inp_lat0
813          climustr_lat0   = inp_lat0
814          climvstr_lat0   = inp_lat0
815          climsst_nlon    = gridNx
816          climsst_nlat    = gridNy
817          climsss_nlon    = gridNx
818          climsss_nlat    = gridNy
819          climustr_nlon   = gridNx
820          climustr_nlat   = gridNy
821          climvstr_nlon   = gridNx
822          climvstr_nlat   = gridNy
823          climsst_lon_inc = inp_dLon
824          climsss_lon_inc = inp_dLon
825          climustr_lon_inc= inp_dLon
826          climvstr_lon_inc= inp_dLon
827    
828          DO j=1,MAX_LAT_INC
829            IF (j.LT.gridNy) THEN
830              inp_dLat = (delY(j) + delY(j+1))*exf_half
831            ELSE
832              inp_dLat = 0.
833            ENDIF
834            ustress_lat_inc(j)   = inp_dLat
835            vstress_lat_inc(j)   = inp_dLat
836            hflux_lat_inc(j)     = inp_dLat
837            sflux_lat_inc(j)     = inp_dLat
838            swflux_lat_inc(j)    = inp_dLat
839            runoff_lat_inc(j)    = inp_dLat
840            saltflx_lat_inc(j)   = inp_dLat
841            atemp_lat_inc(j)     = inp_dLat
842            aqh_lat_inc(j)       = inp_dLat
843            hs_lat_inc(j)        = inp_dLat
844            hl_lat_inc(j)        = inp_dLat
845            evap_lat_inc(j)      = inp_dLat
846            precip_lat_inc(j)    = inp_dLat
847            snowprecip_lat_inc(j)= inp_dLat
848            uwind_lat_inc(j)     = inp_dLat
849            vwind_lat_inc(j)     = inp_dLat
850            wspeed_lat_inc(j)    = inp_dLat
851            lwflux_lat_inc(j)    = inp_dLat
852            swdown_lat_inc(j)    = inp_dLat
853            lwdown_lat_inc(j)    = inp_dLat
854            apressure_lat_inc(j) = inp_dLat
855            areamask_lat_inc(j)  = inp_dLat
856            climsst_lat_inc(j)   = inp_dLat
857            climsss_lat_inc(j)   = inp_dLat
858            climustr_lat_inc(j)  = inp_dLat
859            climvstr_lat_inc(j)  = inp_dLat
860        ENDDO        ENDDO
 #endif /* USE_EXF_INTERPOLATION */  
   
 c     Check for the availability of the right calendar version.  
       if ( calendarversion .ne. usescalendarversion ) then  
          print*,' exf_readparms: You are not using the appropriate'  
          print*,'           version of the calendar package.'  
          print*  
          print*,' You are using Calendar version: ', calendarversion  
          print*,' Please use    Calendar version: ', usescalendarversion  
          stop ' stopped in exf_readparms.'  
       endif  
   
 c     Next, read the forcing data file.  
       call nml_filter( 'data.exf', scrunit1, myThid )  
       if (scrunit1 .eq. 0) then  
          stop 'exf_readparms: reading namelist failed'  
       end if  
       read(  scrunit1, nml = exf_nml )  
       close( scrunit1 )  
   
 c     Complete the start date specifications for the forcing  
 c     fields to get a complete calendar date array.  
   
 c     check for consistency  
   
       if (.NOT.  
      &     (exf_iprec .EQ. 32 .OR. exf_iprec .EQ. 64)  
      &     ) then  
          stop 'stop in exf_readparms: value of exf_iprec not allowed'  
       else if (.NOT.  
      &        (exf_yftype .EQ. 'RS' .OR.  
      &        exf_yftype .EQ. 'RL')  
      &        ) then  
          stop 'stop in exf_readparms: value of exf_yftype not allowed'  
       end if  
   
 #ifdef ALLOW_ATM_WIND  
       if ( uwindfile .NE. ' ' ) then  
          call cal_FullDate  ( uwindstartdate1    ,      uwindstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,    uwindstartdate     ,mythid )  
          uwindstartdate     = modelstart   + uwindstartdate  
       endif  
       if ( vwindfile .NE. ' ' ) then  
          call cal_FullDate  ( vwindstartdate1    ,      vwindstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,    vwindstartdate     ,mythid )  
          vwindstartdate     = modelstart   + vwindstartdate  
       endif  
 #else  
       if ( ustressfile .NE. ' ' ) then  
          call cal_FullDate  ( ustressstartdate1  ,    ustressstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,  ustressstartdate     ,mythid )  
          ustressstartdate   = modelstart + ustressstartdate  
       endif  
       if ( vstressfile .NE. ' ' ) then  
          call cal_FullDate  ( vstressstartdate1  ,    vstressstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,  vstressstartdate     ,mythid )  
          vstressstartdate   = modelstart + vstressstartdate  
       endif  
 #endif  
   
 #ifdef ALLOW_ATM_TEMP  
       if ( atempfile .NE. ' ' ) then  
          call cal_FullDate  ( atempstartdate1    ,      atempstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,    atempstartdate     ,mythid )  
          atempstartdate     = modelstart   + atempstartdate  
       endif  
       if ( aqhfile .NE. ' ' ) then  
          call cal_FullDate  ( aqhstartdate1      ,        aqhstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,      aqhstartdate     ,mythid )  
          aqhstartdate       = modelstart     + aqhstartdate  
       endif  
       if ( lwfluxfile .NE. ' ' ) then  
          call cal_FullDate  ( lwfluxstartdate1   ,     lwfluxstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,   lwfluxstartdate     ,mythid )  
          lwfluxstartdate    = modelstart  + lwfluxstartdate  
       endif  
       if ( precipfile .NE. ' ' ) then  
          call cal_FullDate  ( precipstartdate1   ,     precipstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,   precipstartdate     ,mythid )  
          precipstartdate    = modelstart  + precipstartdate  
       endif  
 #else  
       if ( hfluxfile .NE. ' ' ) then  
          call cal_FullDate  ( hfluxstartdate1    ,      hfluxstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,    hfluxstartdate     ,mythid )  
          hfluxstartdate     = modelstart   + hfluxstartdate  
       endif  
       if ( sfluxfile .NE. ' ' ) then  
          call cal_FullDate  ( sfluxstartdate1    ,      sfluxstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,    sfluxstartdate     ,mythid )  
          sfluxstartdate     = modelstart   + sfluxstartdate  
       endif  
 #endif  
861    
862  #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)        ustress_interpMethod   = 12
863        if ( swfluxfile .NE. ' ' ) then        vstress_interpMethod   = 22
864           call cal_FullDate  ( swfluxstartdate1   ,     swfluxstartdate2,        hflux_interpMethod     =  1
865       &        date_array                        ,mythid )        sflux_interpMethod     =  1
866           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)        swflux_interpMethod    =  1
867           call cal_ToSeconds ( difftime,   swfluxstartdate     ,mythid )        runoff_interpMethod    =  1
868           swfluxstartdate    = modelstart  + swfluxstartdate        saltflx_interpMethod   =  1
869        endif        atemp_interpMethod     =  1
870  #endif        aqh_interpMethod       =  1
871          hs_interpMethod        =  1
872          hl_interpMethod        =  1
873          evap_interpMethod      =  1
874          precip_interpMethod    =  1
875          snowprecip_interpMethod=  1
876          uwind_interpMethod     = 12
877          vwind_interpMethod     = 22
878          wspeed_interpMethod    =  1
879          lwflux_interpMethod    =  1
880          swdown_interpMethod    =  1
881          lwdown_interpMethod    =  1
882          apressure_interpMethod =  1
883          areamask_interpMethod  =  1
884          climsst_interpMethod   =  2
885          climsss_interpMethod   =  2
886          climustr_interpMethod  = 12
887          climvstr_interpMethod  = 22
888    
889  #ifdef EXF_READ_EVAP        exf_output_interp = .FALSE.
890        if ( evapfile .NE. ' ' ) then  #endif /* USE_EXF_INTERPOLATION */
          call cal_FullDate  ( evapstartdate1     ,       evapstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,     evapstartdate     ,mythid )  
          evapstartdate      = modelstart    + evapstartdate  
       endif  
 #endif  
891    
892  #ifdef ALLOW_RUNOFF  C     Next, read the forcing data file.
893        if ( runofffile .NE. ' ' ) then        WRITE(msgBuf,'(A)') 'EXF_READPARMS: opening data.exf'
894           call cal_FullDate  ( runoffstartdate1   ,     runoffstartdate2,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
895       &        date_array                        ,mythid )       &     SQUEEZE_RIGHT , 1)
896           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
897           call cal_ToSeconds ( difftime,   runoffstartdate     ,mythid )        CALL OPEN_COPY_DATA_FILE(
898           runoffstartdate    = modelstart  + runoffstartdate       I                          'data.exf', 'EXF_READPARMS',
899        endif       O                          iUnit,
900  #endif       I                          myThid )
901    
902          WRITE(msgBuf,'(A)')
903         &     'EXF_READPARMS: reading EXF_NML_01'
904          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
905         &     SQUEEZE_RIGHT , 1)
906          READ(  iUnit, nml = EXF_NML_01 )
907          WRITE(msgBuf,'(A)')
908         &     'EXF_READPARMS: reading EXF_NML_02'
909          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
910         &     SQUEEZE_RIGHT , 1)
911          READ(  iUnit, nml = EXF_NML_02 )
912          WRITE(msgBuf,'(A)')
913         &     'EXF_READPARMS: reading EXF_NML_03'
914          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
915         &     SQUEEZE_RIGHT , 1)
916          READ(  iUnit, nml = EXF_NML_03 )
917    #ifdef USE_EXF_INTERPOLATION
918          WRITE(msgBuf,'(A)')
919         &     'EXF_READPARMS: reading EXF_NML_04'
920          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
921         &     SQUEEZE_RIGHT , 1)
922          READ(  iUnit, nml = EXF_NML_04 )
923    #endif /* USE_EXF_INTERPOLATION */
924    
925  #ifdef ALLOW_DOWNWARD_RADIATION  #ifdef ALLOW_OBCS
926        if ( swdownfile .NE. ' ' ) then        IF ( useOBCS ) THEN
927           call cal_FullDate  ( swdownstartdate1   ,     swdownstartdate2,         WRITE(msgBuf,'(A)')
928       &        date_array                        ,mythid )       &      'EXF_READPARMS: reading EXF_NML_OBCS'
929           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
930           call cal_ToSeconds ( difftime,   swdownstartdate     ,mythid )       &      SQUEEZE_RIGHT , 1)
931           swdownstartdate    = modelstart  + swdownstartdate         READ(  iUnit, nml = EXF_NML_OBCS )
932        endif        ENDIF
933        if ( lwdownfile .NE. ' ' ) then         IF(siobNstartdate1.EQ.UNSET_I ) siobNstartdate1=obcsNstartdate1
934           call cal_FullDate  ( lwdownstartdate1   ,     lwdownstartdate2,         IF(siobNstartdate2.EQ.UNSET_I ) siobNstartdate2=obcsNstartdate2
935       &        date_array                        ,mythid )         IF(siobNperiod    .EQ.UNSET_RL) siobNperiod    =obcsNperiod
936           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)         IF(siobSstartdate1.EQ.UNSET_I ) siobSstartdate1=obcsSstartdate1
937           call cal_ToSeconds ( difftime,   lwdownstartdate     ,mythid )         IF(siobSstartdate2.EQ.UNSET_I ) siobSstartdate2=obcsSstartdate2
938           lwdownstartdate    = modelstart  + lwdownstartdate         IF(siobSperiod    .EQ.UNSET_RL) siobSperiod    =obcsSperiod
939        endif         IF(siobEstartdate1.EQ.UNSET_I ) siobEstartdate1=obcsEstartdate1
940  #endif         IF(siobEstartdate2.EQ.UNSET_I ) siobEstartdate2=obcsEstartdate2
941           IF(siobEperiod    .EQ.UNSET_RL) siobEperiod    =obcsEperiod
942           IF(siobWstartdate1.EQ.UNSET_I ) siobWstartdate1=obcsWstartdate1
943           IF(siobWstartdate2.EQ.UNSET_I ) siobWstartdate2=obcsWstartdate2
944           IF(siobWperiod    .EQ.UNSET_RL) siobWperiod    =obcsWperiod
945    
946  #ifdef ATMOSPHERIC_LOADING         IF(exf_iprec_obcs .EQ. UNSET_I) exf_iprec_obcs =exf_iprec
947        if ( apressurefile .NE. ' ' ) then  #endif /* ALLOW_OBCS */
          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  
 #endif  
948    
949  #ifdef ALLOW_OBCS        WRITE(msgBuf,'(A)')
950  #ifdef ALLOW_OBCS_NORTH       &     'EXF_READPARMS: finished reading data.exf'
951        if ( obcsNperiod .NE. 0 ) then        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
952           call cal_FullDate  ( obcsNstartdate1    ,      obcsNstartdate2,       &                SQUEEZE_RIGHT , 1)
953       &        date_array                        ,mythid )  
954           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)        CLOSE( iUnit )
955           call cal_ToSeconds ( difftime,   obcsNstartdate      ,mythid )  
956           obcsNstartdate     = modelstart + obcsNstartdate  C--   Retired parameters
957        endif        IF ( exf_yftype.NE.'RL' ) THEN
958  #endif         STOP 'S/R EXF_READPARAMS: value of exf_yftype not allowed'
959  #ifdef ALLOW_OBCS_SOUTH        ENDIF
960        if ( obcsSperiod .NE. 0 ) then  
961           call cal_FullDate  ( obcsSstartdate1    ,      obcsSstartdate2,  C--   Derive other parameters:
962       &        date_array                        ,mythid )        IF ( exf_verbose ) exf_debugLev = MAX( exf_debugLev, debLevD )
963           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)        hq = ht
964           call cal_ToSeconds ( difftime,   obcsSstartdate      ,mythid )        stressIsOnCgrid = readStressOnCgrid
965           obcsSstartdate     = modelstart + obcsSstartdate  #if ( defined (ALLOW_BULKFORMULAE) )
966        endif        IF ( useAtmWind ) stressIsOnCgrid = .FALSE.
967  #endif  #endif
968  #ifdef ALLOW_OBCS_EAST  #ifdef USE_EXF_INTERPOLATION
969        if ( obcsEperiod .NE. 0 ) then        IF ( (ustress_interpMethod.GE.1 .AND. ustressfile.NE.' ') .OR.
970           call cal_FullDate  ( obcsEstartdate1    ,      obcsEstartdate2,       &     (vstress_interpMethod.GE.1 .AND. vstressfile.NE.' ') )
971       &        date_array                        ,mythid )       &   stressIsOnCgrid = .FALSE.
972           call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  #endif /* USE_EXF_INTERPOLATION */
          call cal_ToSeconds ( difftime,   obcsEstartdate      ,mythid )  
          obcsEstartdate     = modelstart + obcsEstartdate  
       endif  
 #endif  
 #ifdef ALLOW_OBCS_WEST  
       if ( obcsNperiod .NE. 0 ) then  
          call cal_FullDate  ( obcsWstartdate1    ,      obcsWstartdate2,  
      &        date_array                        ,mythid )  
          call cal_TimePassed(modelstartdate,date_array,difftime,mythid)  
          call cal_ToSeconds ( difftime,  obcsWstartdate       ,mythid )  
          obcsWstartdate     = modelstart + obcsWstartdate  
       endif  
 #endif  
 #endif /* ALLOW_OBCS */  
973    
974        _END_MASTER( mythid )        IF ( select_ZenAlbedo.GT.0 ) THEN
975               useExfZenAlbedo=.TRUE.
976          ENDIf
977    
978    C--   Overwrite tauThetaClimRelax but stop if already set.
979    C- Note: need this, even if EXF option ALLOW_CLIMSST_RELAXATION is undef;
980    C        this prevents to apply relaxation towards potentially wrong SST since,
981    C        with EXF, we skip the update of loaded SST in EXTERNAL_FIELDS_LOAD.
982    C- Note2: let s see whether we can put this back under ifdef
983    C        ALLOW_CLIMSST_RELAXATION, but always call EXTERNAL_FIELDS_LOAD.
984    C        If ALLOW_CLIMSST_RELAXATION is undef, clim.relaxation could still
985    C        be done outside of exf.
986    #ifdef ALLOW_CLIMSST_RELAXATION
987          IF ( tauThetaClimRelax.NE.0. _d 0 ) THEN
988            WRITE(msgBuf,'(2A)') 'EXF_READPARMS: ',
989         &   'with EXF, cannot use "tauThetaClimRelax" in "data"'
990            CALL PRINT_ERROR( msgBuf, myThid )
991            WRITE(msgBuf,'(2A)') 'since SST relax. is handled by EXF',
992         &   ' (data.exf, "climsstTauRelax")'
993            CALL PRINT_ERROR( msgBuf, myThid )
994            STOP 'ABNORMAL END: S/R EXF_READPARMS'
995          ENDIF
996          tauThetaClimRelax = climsstTauRelax
997    #endif
998    
999    #ifdef ALLOW_CLIMSSS_RELAXATION
1000    C--   Overwrite tauSaltClimRelax but stop if already set.
1001          IF ( tauSaltClimRelax.NE.0. _d 0 ) THEN
1002            WRITE(msgBuf,'(2A)') 'EXF_READPARMS: ',
1003         &   'with EXF, cannot use "tauSaltClimRelax" in "data"'
1004            CALL PRINT_ERROR( msgBuf, myThid )
1005            WRITE(msgBuf,'(2A)') 'since SSS relax. is handled by EXF',
1006         &   ' (data.exf, "climsssTauRelax")'
1007            CALL PRINT_ERROR( msgBuf, myThid )
1008            STOP 'ABNORMAL END: S/R EXF_READPARMS'
1009          ENDIF
1010          tauSaltClimRelax = climsssTauRelax
1011    #endif
1012    
1013    C     Complete the start date specifications for the forcing
1014    C     fields to get a complete calendar date array.
1015    C     => moved to EXF_INIT_FIXED
1016    
1017          _END_MASTER( myThid )
1018        _BARRIER        _BARRIER
1019    
1020  c--   Summarize the External forcing's setup.        RETURN
1021        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.19  
changed lines
  Added in v.1.89

  ViewVC Help
Powered by ViewVC 1.1.22