/[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.42 by heimbach, Wed Apr 18 05:02:11 2007 UTC revision 1.43 by heimbach, Wed Apr 18 19:55:34 2007 UTC
# Line 59  c     == routine arguments == Line 59  c     == routine arguments ==
59    
60  c     == local variables ==  c     == local variables ==
61    
62        integer i        integer i, idummy
63        integer date_array(4), difftime(4)        integer date_array(4), difftime(4)
64        integer iUnit        integer iUnit
65    
# Line 68  c     == local variables == Line 68  c     == local variables ==
68  c     == end of interface ==  c     == end of interface ==
69    
70  c     Surface flux data.  c     Surface flux data.
71        namelist /exf_nml/        NAMELIST /EXF_NML_01/
72       &      windstressmax,       repeatPeriod,   exf_albedo,         &      windstressmax,       repeatPeriod,   exf_albedo,  
73       &   ocean_emissivity,     ice_emissivity, snow_emissivity,       &   ocean_emissivity,     ice_emissivity, snow_emissivity,
74       &   exf_scal_BulkCdn,       &   exf_scal_BulkCdn,     climtempfreeze,
75         &          exf_iprec,  exf_yftype,
76         & useExfYearlyFields,  twoDigitYear,         useExfCheckRange
77    
78          NAMELIST /EXF_NML_02/
79         &          hfluxfile,          atempfile,       aqhfile,
80         &          sfluxfile,         precipfile,    runofffile,
81         &        ustressfile,        vstressfile,      evapfile,
82         &     snowprecipfile,          uwindfile,     vwindfile,
83         &         wspeedfile,         swfluxfile,    lwfluxfile,
84         &      apressurefile,         swdownfile,    lwdownfile,
85         &        climsstfile,        climsssfile,      
86       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,       &    hfluxstartdate1,    hfluxstartdate2,   hfluxperiod,
87       &    atempstartdate1,    atempstartdate2,   atempperiod,       &    atempstartdate1,    atempstartdate2,   atempperiod,
88       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,       &      aqhstartdate1,      aqhstartdate2,     aqhperiod,
# Line 89  c     Surface flux data. Line 100  c     Surface flux data.
100       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,       &   lwfluxstartdate1,   lwfluxstartdate2,  lwfluxperiod,
101       &   swdownstartdate1,   swdownstartdate2,  swdownperiod,       &   swdownstartdate1,   swdownstartdate2,  swdownperiod,
102       &   lwdownstartdate1,   lwdownstartdate2,  lwdownperiod,       &   lwdownstartdate1,   lwdownstartdate2,  lwdownperiod,
      &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,  
      &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,  
      &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,  
      &    obcsWstartdate1,    obcsWstartdate2,   obcsWperiod,  
103       &apressurestartdate1,apressurestartdate2,apressureperiod,       &apressurestartdate1,apressurestartdate2,apressureperiod,
104       &          hfluxfile,          atempfile,       aqhfile,       &  climsststartdate1,  climsststartdate2,  climsstperiod,
105       &          sfluxfile,         precipfile,    runofffile,       &  climsssstartdate1,  climsssstartdate2,  climsssperiod
106       &        ustressfile,        vstressfile,      evapfile,  
107       &     snowprecipfile,          uwindfile,     vwindfile,        NAMELIST /EXF_NML_03/
      &         wspeedfile,         swfluxfile,    lwfluxfile,  
      &      apressurefile,         swdownfile,    lwdownfile,  
      &          exf_iprec,  exf_yftype,  
      & useExfYearlyFields,  twoDigitYear,         useExfCheckRange,  
108       &   exf_inscal_hflux,  exf_inscal_sflux,      exf_inscal_evap,       &   exf_inscal_hflux,  exf_inscal_sflux,      exf_inscal_evap,
109       & exf_inscal_ustress,  exf_inscal_vstress,       & exf_inscal_ustress,  exf_inscal_vstress,
110       &   exf_inscal_uwind,  exf_inscal_vwind,    exf_inscal_wspeed,       &   exf_inscal_uwind,  exf_inscal_vwind,    exf_inscal_wspeed,
# Line 110  c     Surface flux data. Line 113  c     Surface flux data.
113       &  exf_inscal_swflux,  exf_inscal_lwflux,   exf_inscal_precip,       &  exf_inscal_swflux,  exf_inscal_lwflux,   exf_inscal_precip,
114       &  exf_inscal_runoff,  exf_inscal_apressure, exf_inscal_snowprecip,       &  exf_inscal_runoff,  exf_inscal_apressure, exf_inscal_snowprecip,
115       &  exf_inscal_swdown,  exf_inscal_lwdown,       &  exf_inscal_swdown,  exf_inscal_lwdown,
116         & exf_inscal_climsst, exf_inscal_climsss,
117       &  exf_outscal_hflux,  exf_outscal_ustress, exf_outscal_vstress,       &  exf_outscal_hflux,  exf_outscal_ustress, exf_outscal_vstress,
118       & exf_outscal_swflux,  exf_outscal_sst,     exf_outscal_sss,       & exf_outscal_swflux,  exf_outscal_sst,     exf_outscal_sss,
119       &  exf_outscal_sflux,  exf_outscal_apressure,       &  exf_outscal_sflux,  exf_outscal_apressure,
# Line 117  c     Surface flux data. Line 121  c     Surface flux data.
121       &  precipconst, snowprecipconst, runoffconst, ustressconst,       &  precipconst, snowprecipconst, runoffconst, ustressconst,
122       &  vstressconst, uwindconst, vwindconst, wspeedconst, swfluxconst,       &  vstressconst, uwindconst, vwindconst, wspeedconst, swfluxconst,
123       &  lwfluxconst, swdownconst, lwdownconst, apressureconst,       &  lwfluxconst, swdownconst, lwdownconst, apressureconst,
124         &  climsstconst,   climsssconst,
125       &     hflux_exfremo_intercept, hflux_exfremo_slope,       &     hflux_exfremo_intercept, hflux_exfremo_slope,
126       &     atemp_exfremo_intercept, atemp_exfremo_slope,       &     atemp_exfremo_intercept, atemp_exfremo_slope,
127       &     aqh_exfremo_intercept, aqh_exfremo_slope,       &     aqh_exfremo_intercept, aqh_exfremo_slope,
# Line 134  c     Surface flux data. Line 139  c     Surface flux data.
139       &     lwflux_exfremo_intercept, lwflux_exfremo_slope,       &     lwflux_exfremo_intercept, lwflux_exfremo_slope,
140       &     swdown_exfremo_intercept, swdown_exfremo_slope,       &     swdown_exfremo_intercept, swdown_exfremo_slope,
141       &     lwdown_exfremo_intercept, lwdown_exfremo_slope,       &     lwdown_exfremo_intercept, lwdown_exfremo_slope,
142       &     apressure_exfremo_intercept, apressure_exfremo_slope       &     apressure_exfremo_intercept, apressure_exfremo_slope,
143         &     climsst_exfremo_intercept, climsst_exfremo_slope,
144         &     climsss_exfremo_intercept, climsss_exfremo_slope
145    
146          NAMELIST /EXF_NML_04/
147         & idummy
148  #ifdef USE_EXF_INTERPOLATION  #ifdef USE_EXF_INTERPOLATION
149       & ,ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,       & , ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,
150       & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,       & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,
151       & ustress_nlon, ustress_nlat, vstress_nlon, vstress_nlat,       & ustress_nlon, ustress_nlat, vstress_nlon, vstress_nlat,
152       & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,       & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,
# Line 163  c     Surface flux data. Line 173  c     Surface flux data.
173       & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,       & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
174       & swdown_nlon, swdown_nlat, lwdown_nlon, lwdown_nlat,       & swdown_nlon, swdown_nlat, lwdown_nlon, lwdown_nlat,
175       & apressure_lon0,apressure_lon_inc,apressure_nlon,       & apressure_lon0,apressure_lon_inc,apressure_nlon,
176       & apressure_lat0,apressure_lat_inc,apressure_nlat       & apressure_lat0,apressure_lat_inc,apressure_nlat,
177         & climsst_lon0, climsst_lon_inc, climsst_nlon,
178         & climsst_lat0, climsst_lat_inc, climsst_nlat,
179         & climsss_lon0, climsss_lon_inc, climsss_nlon,
180         & climsss_lat0, climsss_lat_inc, climsss_nlat
181  #endif  #endif
182    
183          NAMELIST /EXF_NML_OBCS/
184         &    obcsNstartdate1,    obcsNstartdate2,   obcsNperiod,
185         &    obcsSstartdate1,    obcsSstartdate2,   obcsSperiod,
186         &    obcsEstartdate1,    obcsEstartdate2,   obcsEperiod,
187         &    obcsWstartdate1,    obcsWstartdate2,   obcsWperiod
188    
189        _BEGIN_MASTER(mythid)        _BEGIN_MASTER(mythid)
190    
191  c     Set default values.  c     Set default values.
# Line 300  c     Calendar data. Line 320  c     Calendar data.
320        apressure_exfremo_intercept = 0.0 _d 0        apressure_exfremo_intercept = 0.0 _d 0
321        apressure_exfremo_slope = 0.0 _d 0        apressure_exfremo_slope = 0.0 _d 0
322    
323          climsststartdate1  = 0
324          climsststartdate2  = 0
325          climsstperiod      = 0
326          climsstconst         = 0.0 _d 0
327          climsst_exfremo_intercept = 0.0 _d 0
328          climsst_exfremo_slope = 0.0 _d 0
329    
330          climsssstartdate1  = 0
331          climsssstartdate2  = 0
332          climsssperiod      = 0
333          climsssconst         = 0.0 _d 0
334          climsss_exfremo_intercept = 0.0 _d 0
335          climsss_exfremo_slope = 0.0 _d 0
336    
337        obcsNstartdate1    = 0        obcsNstartdate1    = 0
338        obcsNstartdate2    = 0        obcsNstartdate2    = 0
339        obcsNperiod        = 0.0 _d 0        obcsNperiod        = 0.0 _d 0
# Line 325  c--   an earlier setting of 5.5 = ocean_ Line 359  c--   an earlier setting of 5.5 = ocean_
359        ice_emissivity     = 0.98 _d 0        ice_emissivity     = 0.98 _d 0
360        snow_emissivity    = 0.98 _d 0        snow_emissivity    = 0.98 _d 0
361    
362        exf_scal_BulkCdn   = 1.00 _d 0        exf_scal_BulkCdn   = 1.0  _d 0
363    
364    c     Initialise freezing temperature of sea water
365          climtempfreeze     = -1.9 _d 0
366    
367  c     Data files.  c     Data files.
368        hfluxfile          = ' '        hfluxfile          = ' '
# Line 346  c     Data files. Line 383  c     Data files.
383        swdownfile         = ' '        swdownfile         = ' '
384        lwdownfile         = ' '        lwdownfile         = ' '
385        apressurefile      = ' '        apressurefile      = ' '
386          climsstfile        = ' '
387          climsssfile        = ' '
388    
389  c     Start dates.  c     Start dates.
390        hfluxstartdate     = 0.        hfluxstartdate     = 0.
# Line 370  c     Start dates. Line 409  c     Start dates.
409        obcsEstartdate     = 0.        obcsEstartdate     = 0.
410        obcsWstartdate     = 0.        obcsWstartdate     = 0.
411        apressurestartdate = 0.        apressurestartdate = 0.
412          climsststartdate   = 0.
413          climsssstartdate   = 0.
414    
415  c     Initialise file type and field precision  c     Initialise file type and field precision
416        exf_iprec            = 32        exf_iprec            = 32
# Line 400  c     Input scaling factors. Line 441  c     Input scaling factors.
441        exf_inscal_runoff    =  1. _d 0        exf_inscal_runoff    =  1. _d 0
442        exf_inscal_swdown    =  1. _d 0        exf_inscal_swdown    =  1. _d 0
443        exf_inscal_lwdown    =  1. _d 0        exf_inscal_lwdown    =  1. _d 0
444          exf_inscal_climsst   =  1. _d 0
445          exf_inscal_climsss   =  1. _d 0
446    
447  c     Output scaling factors.  c     Output scaling factors.
448        exf_outscal_hflux    =  1. _d 0        exf_outscal_hflux    =  1. _d 0
# Line 502  c     Output scaling factors. Line 545  c     Output scaling factors.
545        swdown_lon_inc    = delX(1)        swdown_lon_inc    = delX(1)
546        lwdown_lon_inc    = delX(1)        lwdown_lon_inc    = delX(1)
547        apressure_lon_inc = delX(1)        apressure_lon_inc = delX(1)
548          climsst_lon0    = thetaMin + delX(1) / 2
549          climsss_lon0    = thetaMin + delX(1) / 2
550          climsst_lat0    = phimin   + delY(1) / 2
551          climsss_lat0    = phimin   + delY(1) / 2
552          climsst_nlon    = Nx
553          climsst_nlat    = Ny
554          climsss_nlon    = Nx
555          climsss_nlat    = Ny
556          climsst_lon_inc = delX(1)
557          climsss_lon_inc = delX(1)
558        DO i=1,MAX_LAT_INC        DO i=1,MAX_LAT_INC
559           IF (i.LT.Ny) THEN           IF (i.LT.Ny) THEN
560              vstress_lat_inc(i)   =  delY(i)              vstress_lat_inc(i)   =  delY(i)
# Line 522  c     Output scaling factors. Line 575  c     Output scaling factors.
575              swdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.              swdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
576              lwdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.              lwdown_lat_inc(i)    = (delY(i) + delY(i)) / 2.
577              apressure_lat_inc(i) = (delY(i) + delY(i)) / 2.              apressure_lat_inc(i) = (delY(i) + delY(i)) / 2.
578                climsst_lat_inc(i)   = (delY(i) + delY(i)) / 2.
579                climsss_lat_inc(i)   = (delY(i) + delY(i)) / 2.
580           ELSE           ELSE
581              ustress_lat_inc(i)   = 0.              ustress_lat_inc(i)   = 0.
582              vstress_lat_inc(i)   = 0.              vstress_lat_inc(i)   = 0.
# Line 541  c     Output scaling factors. Line 596  c     Output scaling factors.
596              swdown_lat_inc(i)    = 0.              swdown_lat_inc(i)    = 0.
597              lwdown_lat_inc(i)    = 0.              lwdown_lat_inc(i)    = 0.
598              apressure_lat_inc(i) = 0.              apressure_lat_inc(i) = 0.
599                climsst_lat_inc(i)   = 0.
600                climsss_lat_inc(i)   = 0.
601           ENDIF           ENDIF
602        ENDDO        ENDDO
603  #endif /* USE_EXF_INTERPOLATION */  #endif /* USE_EXF_INTERPOLATION */
604    
605  c     Next, read the forcing data file.  c     Next, read the forcing data file.
606          WRITE(msgBuf,'(A)') 'EXF_READPARMS: opening data.exf'        WRITE(msgBuf,'(A)') 'EXF_READPARMS: opening data.exf'
607          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
608       &                    SQUEEZE_RIGHT , 1)       &     SQUEEZE_RIGHT , 1)
609    
610          CALL OPEN_COPY_DATA_FILE(        CALL OPEN_COPY_DATA_FILE(
611       I                          'data.exf', 'EXF_READPARMS',       I                          'data.exf', 'EXF_READPARMS',
612       O                          iUnit,       O                          iUnit,
613       I                          myThid )       I                          myThid )
614    
615        READ(  iUnit, nml = exf_nml )        WRITE(msgBuf,'(A)')
616         &     'EXF_READPARMS: reading EXF_NML_01'
617          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
618         &     SQUEEZE_RIGHT , 1)
619          READ(  iUnit, nml = EXF_NML_01 )
620          WRITE(msgBuf,'(A)')
621         &     'EXF_READPARMS: reading EXF_NML_02'
622          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
623         &     SQUEEZE_RIGHT , 1)
624          READ(  iUnit, nml = EXF_NML_02 )
625          WRITE(msgBuf,'(A)')
626         &     'EXF_READPARMS: reading EXF_NML_03'
627          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
628         &     SQUEEZE_RIGHT , 1)
629          READ(  iUnit, nml = EXF_NML_03 )
630          WRITE(msgBuf,'(A)')
631         &     'EXF_READPARMS: reading EXF_NML_04'
632          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
633         &     SQUEEZE_RIGHT , 1)
634          READ(  iUnit, nml = EXF_NML_04 )
635    #ifdef ALLOW_OBCS
636          WRITE(msgBuf,'(A)')
637         &     'EXF_READPARMS: reading EXF_NML_OBCS'
638          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
639         &     SQUEEZE_RIGHT , 1)
640          READ(  iUnit, nml = EXF_NML_OBCS )
641    #endif
642    
643        WRITE(msgBuf,'(A)')        WRITE(msgBuf,'(A)')
644       &     'EXF_READPARMS: finished reading data.exf'       &     'EXF_READPARMS: finished reading data.exf'
# Line 757  c     fields to get a complete calendar Line 840  c     fields to get a complete calendar
840  #endif  #endif
841  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
842    
843    #ifdef USE_EXF_INTERPOLATION
844          if ( climsst_nlat .GT. MAX_LAT_INC )
845         & stop 'stopped in exf_clim_readparms: climsst_nlat > MAX_LAT_INC'
846          if ( climsss_nlat .GT. MAX_LAT_INC )
847         & stop 'stopped in exf_clim_readparms: climsss_nlat > MAX_LAT_INC'
848    #endif
849    
850    #ifdef ALLOW_CLIMSST_RELAXATION
851          if ( climsstfile .NE. ' ' .AND. climsstperiod .NE. 0. ) then
852             call cal_FullDate( climsststartdate1, climsststartdate2,
853         &        date_array,                  mythid )
854             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
855             call cal_ToSeconds (difftime,       climsststartdate  ,mythid)
856             climsststartdate=modelstart+climsststartdate
857          endif
858    #endif
859    
860    #ifdef ALLOW_CLIMSSS_RELAXATION
861          if ( climsssfile .NE. ' ' .AND. climsssperiod .NE. 0. ) then
862             call cal_FullDate( climsssstartdate1, climsssstartdate2,
863         &        date_array,                  mythid )
864             call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
865             call cal_ToSeconds (difftime,       climsssstartdate  ,mythid)
866             climsssstartdate=modelstart+climsssstartdate
867          endif
868    #endif
869    
870        _END_MASTER( mythid )        _END_MASTER( mythid )
871    
872        _BARRIER        _BARRIER
# Line 764  c     fields to get a complete calendar Line 874  c     fields to get a complete calendar
874  c--   Summarize the External forcing's setup.  c--   Summarize the External forcing's setup.
875        call exf_summary( mythid )        call exf_summary( mythid )
876    
 c--   set climatology parameters  
       call exf_clim_readparms( mythid )  
   
 c--   summarize climatologic forcing configuration  
       call exf_clim_summary( mythid )  
   
877        end        end

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

  ViewVC Help
Powered by ViewVC 1.1.22