c $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/exf/exf_readparms.F,v 1.4.2.1 2002/12/27 15:09:45 cheisey Exp $ #include "EXF_CPPOPTIONS.h" #ifdef ALLOW_OBCS # include "OBCS_OPTIONS.h" #endif subroutine exf_readparms( mythid ) c ================================================================== c SUBROUTINE exf_readparms c ================================================================== c c o This routine initialises the package that calculates external c forcing fields for a given timestep of the MITgcmUV. Parameters c for this package are set in "data.externalforcing". Some additional c precompiler switches have to be specified in "EXF_CPPOPTIONS.h". c c started: Christian Eckert eckert@mit.edu 30-Jun-1999 c c changed: Christian Eckert eckert@mit.edu 11-Jan-2000 c - Restructured the code in order to create a package c for the MITgcmUV. c Christian Eckert eckert@mit.edu 12-Feb-2000 c - Changed Routine names (package prefix: exf_) c changed: Patrick Heimbach, heimbach@mit.edu 04-May-2000 c - changed the handling of precip and sflux with respect c to CPP options ALLOW_BULKFORMULAE and ALLOW_ATM_TEMP c changed: Ralf.Giering@FastOpt.de 25-Mai-20000 c - moved relaxation and climatology to extra routines c Patrick Heimbach, heimbach@mit.edu 04-May-2000 c - added obcs parameters c changed: Virginie Thierry, vthierry@ucsd.edu 04-June-2001 c - added new obcs parameters (for each boundaries) c included runoff D. Stammer, Nov. 25, 2001 c included pressure forcing. heimbach@mit.edu 05-Nov-2002 c c added "repeatPeriod" for cycling of forcing datasets 19-Dec-2002 c ================================================================== c SUBROUTINE exf_readparms c ================================================================== implicit none c == global variables == #include "EEPARAMS.h" #include "SIZE.h" #include "cal.h" #include "exf.h" #include "exf_param.h" #include "exf_constants.h" c == routine arguments == integer mythid c == local variables == integer i c == external == integer ilnblnk external ilnblnk c == end of interface == c Surface flux data. namelist /exf_nml/ & repeatPeriod, & hfluxstartdate1, hfluxstartdate2, hfluxperiod, & atempstartdate1, atempstartdate2, atempperiod, & aqhstartdate1, aqhstartdate2, aqhperiod, & sfluxstartdate1, sfluxstartdate2, sfluxperiod, & precipstartdate1, precipstartdate2, precipperiod, & runoffstartdate1, runoffstartdate2, runoffperiod, & ustressstartdate1, ustressstartdate2, ustressperiod, & vstressstartdate1, vstressstartdate2, vstressperiod, & uwindstartdate1, uwindstartdate2, uwindperiod, & vwindstartdate1, vwindstartdate2, vwindperiod, & swfluxstartdate1, swfluxstartdate2, swfluxperiod, & lwfluxstartdate1, lwfluxstartdate2, lwfluxperiod, & obcsNstartdate1, obcsNstartdate2, obcsNperiod, & obcsSstartdate1, obcsSstartdate2, obcsSperiod, & obcsEstartdate1, obcsEstartdate2, obcsEperiod, & obcsWstartdate1, obcsWstartdate2, obcsWperiod, &apressurestartdate1,apressurestartdate2,apressureperiod, & hfluxfile, atempfile, aqhfile, & sfluxfile, precipfile, runofffile, & ustressfile, vstressfile, & uwindfile, vwindfile, & swfluxfile, lwfluxfile, apressurefile, & exf_iprec, exf_yftype, & scal_hfl, scal_ust, scal_vst, & scal_swf, scal_sst, scal_sss, & scal_apressure, scal_prc, scal_sfl, & windspeedstartdate1, windspeedstartdate2, & windspeedperiod, windspeedfile _BEGIN_MASTER(mythid) c Set default values. c Calendar data. hfluxstartdate1 = 0 hfluxstartdate2 = 0 hfluxperiod = 0.0 _d 0 atempstartdate1 = 0 atempstartdate2 = 0 atempperiod = 0.0 _d 0 aqhstartdate1 = 0 aqhstartdate2 = 0 aqhperiod = 0.0 _d 0 sfluxstartdate1 = 0 sfluxstartdate2 = 0 sfluxperiod = 0.0 _d 0 precipstartdate1 = 0 precipstartdate2 = 0 precipperiod = 0.0 _d 0 runoffstartdate1 = 0 runoffstartdate2 = 0 runoffperiod = 0.0 _d 0 ustressstartdate1 = 0 ustressstartdate2 = 0 ustressperiod = 0.0 _d 0 vstressstartdate1 = 0 vstressstartdate2 = 0 vstressperiod = 0.0 _d 0 uwindstartdate1 = 0 uwindstartdate2 = 0 uwindperiod = 0.0 _d 0 vwindstartdate1 = 0 vwindstartdate2 = 0 vwindperiod = 0.0 _d 0 swfluxstartdate1 = 0 swfluxstartdate2 = 0 swfluxperiod = 0.0 _d 0 lwfluxstartdate1 = 0 lwfluxstartdate2 = 0 lwfluxperiod = 0.0 _d 0 obcsNstartdate1 = 0 obcsNstartdate2 = 0 obcsNperiod = 0.0 _d 0 obcsSstartdate1 = 0 obcsSstartdate2 = 0 obcsSperiod = 0.0 _d 0 obcsEstartdate1 = 0 obcsEstartdate2 = 0 obcsEperiod = 0.0 _d 0 obcsWstartdate1 = 0 obcsWstartdate2 = 0 obcsWperiod = 0.0 _d 0 apressurestartdate1 = 0 apressurestartdate2 = 0 apressureperiod = 0.0 _d 0 windspeedstartdate1 = 0 windspeedstartdate2 = 0 windspeedperiod = 0.0 _d 0 repeatPeriod = 0.0 _d 0 c Data files. hfluxfile = ' ' atempfile = ' ' aqhfile = ' ' precipfile = ' ' sfluxfile = ' ' runofffile = ' ' ustressfile = ' ' vstressfile = ' ' uwindfile = ' ' vwindfile = ' ' swfluxfile = ' ' lwfluxfile = ' ' apressurefile = ' ' windspeedfile = ' ' c Initialise the date arrays. do i = 1,4 hfluxstartdate(i) = 0 atempstartdate(i) = 0 aqhstartdate(i) = 0 precipstartdate(i) = 0 sfluxstartdate(i) = 0 runoffstartdate(i) = 0 ustressstartdate(i) = 0 vstressstartdate(i) = 0 uwindstartdate(i) = 0 vwindstartdate(i) = 0 swfluxstartdate(i) = 0 lwfluxstartdate(i) = 0 obcsNstartdate(i) = 0 obcsSstartdate(i) = 0 obcsEstartdate(i) = 0 obcsWstartdate(i) = 0 apressurestartdate(i)= 0 windspeedstartdate(i)= 0 enddo c Initialise file type and field precision exf_iprec = 32 exf_yftype = 'RL' c scaling between exf units and MITgcm units scal_hfl = 1. _d 0 scal_ust = 1. _d 0 scal_vst = 1. _d 0 scal_swf = 1. _d 0 scal_sst = 1. _d 0 scal_sss = 1. _d 0 scal_apressure = 1. _d 0 #if (defined (ALLOW_BULKFORMULAE) && defined (ALLOW_ATM_TEMP)) scal_prc = 1. _d 0 #else scal_sfl = 1. _d 0 #endif 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_RUNOFF call cal_FullDate( runoffstartdate1, runoffstartdate2, & runoffstartdate, mythid ) #endif #ifdef ALLOW_BULKFORMULAE #ifdef ALLOW_ATM_TEMP call cal_FullDate( atempstartdate1, atempstartdate2, & atempstartdate, mythid ) call cal_FullDate( aqhstartdate1, aqhstartdate2, & aqhstartdate, mythid ) call cal_FullDate( swfluxstartdate1, swfluxstartdate2, & swfluxstartdate, mythid ) call cal_FullDate( lwfluxstartdate1, lwfluxstartdate2, & lwfluxstartdate, mythid ) call cal_FullDate( precipstartdate1, precipstartdate2, & precipstartdate, mythid ) call cal_FullDate(windspeedstartdate1, windspeedstartdate2, & windspeedstartdate, mythid ) #else call cal_FullDate( hfluxstartdate1, hfluxstartdate2, & hfluxstartdate, mythid ) call cal_FullDate( sfluxstartdate1, sfluxstartdate2, & sfluxstartdate, mythid ) #ifdef ALLOW_KPP call cal_FullDate( swfluxstartdate1, swfluxstartdate2, & swfluxstartdate, mythid ) #endif #endif #ifdef ALLOW_ATM_WIND 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 #else call cal_FullDate( hfluxstartdate1, hfluxstartdate2, & 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 ) #endif #endif #ifdef ALLOW_OBCS #ifdef ALLOW_OBCS_NORTH call cal_FullDate( obcsNstartdate1, obcsNstartdate2, & 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 #ifdef ATMOSPHERIC_LOADING call cal_FullDate( apressurestartdate1, apressurestartdate2, & apressurestartdate, mythid ) #endif _END_MASTER( mythid ) _BARRIER c-- Summarize the External forcing's setup. call exf_summary( mythid ) c-- set climatology parameters call exf_clim_readparms( mythid ) c-- summarize climatologic forcing configuration call exf_clim_summary( mythid ) end