Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:38:14 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
6d54cf9ca1 Ed H*0001 #include "BULK_FORCE_OPTIONS.h"
7753507405 Curt*0002 
                0003       SUBROUTINE BULKF_READPARMS( myThid )
ae4c29e0db Jean*0004 C     *==========================================================*
6a1d3c464b Jean*0005 C     | SUBROUTINE BULKF_READPARMS                               |
                0006 C     | o Routine to initialize BULKF variables and constants.   |
ae4c29e0db Jean*0007 C     *==========================================================*
6a1d3c464b Jean*0008 C     | Initialize BULKF    parameters, read in data.blk         |
ae4c29e0db Jean*0009 C     *==========================================================*
7753507405 Curt*0010       IMPLICIT NONE
                0011 
                0012 C     === Global variables ===
                0013 #include "SIZE.h"
                0014 #include "EEPARAMS.h"
                0015 #include "PARAMS.h"
6a1d3c464b Jean*0016 #include "BULKF_PARAMS.h"
7753507405 Curt*0017 #include "BULKF.h"
                0018 #ifdef CONSERV_BULKF
                0019 #include "BULKF_CONSERV.h"
                0020 #endif
                0021 
                0022 C     === Routine arguments ===
                0023       INTEGER myThid
                0024 
                0025 #ifdef ALLOW_BULK_FORCE
6a1d3c464b Jean*0026 C     === Local variables ===
ae4c29e0db Jean*0027 C     msgBuf     :: Informational/error message buffer
                0028 C     iUnit      :: Work variable for IO unit number
6a1d3c464b Jean*0029       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0030       INTEGER iUnit
7753507405 Curt*0031 
                0032 C--   Bulk Formula parameter
6a1d3c464b Jean*0033       NAMELIST /BULKF_CONST/
69f66dfb04 Jean*0034      &  rhoA, rhoFW,
                0035      &  cpAir, Lvap, Lfresh,
                0036      &  Tf0kel, Rgas, xkar, stefan,
                0037      &  zref, zwd, zth,
                0038      &  cDrag_1, cDrag_2, cDrag_3,
                0039      &  cStantonS, cStantonU, cDalton,
                0040      &  umin, humid_fac, saltQsFac, gamma_blk,
6a1d3c464b Jean*0041      &  atm_emissivity, ocean_emissivity,
                0042      &  snow_emissivity, ice_emissivity,
679d149d01 Jean*0043 #ifdef ALLOW_FORMULA_AIM
                0044      &  FWIND0, CHS, VGUST, DTHETA, dTstab, FSTAB,
                0045 #endif
                0046      &  ocean_albedo
6a1d3c464b Jean*0047 
7753507405 Curt*0048       NAMELIST /BULKF_PARM01/
69f66dfb04 Jean*0049      &         useFluxFormula_AIM, blk_nIter, calcWindStress,
679d149d01 Jean*0050      &         blk_taveFreq,
7753507405 Curt*0051      &         AirTempFile, AirHumidityFile, RainFile,
                0052      &         SolarFile, LongwaveFile, UWindFile,
                0053      &         VWindFile,  RunoffFile, WSpeedFile, QnetFile,
679d149d01 Jean*0054      &         EmPFile, CloudFile, airPotTempFile
7753507405 Curt*0055 
                0056 #ifdef CONSERV_BULKF
                0057 c-    conserving qnet, empmr
                0058       NAMELIST /BULKF_PARM02/
                0059      &         qnet_off, empmr_off, conservcycle
                0060 #endif
                0061 
ae4c29e0db Jean*0062 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0063 
                0064       IF ( .NOT.useBulkForce ) THEN
                0065 C-    pkg BULK_FORCE is not used
                0066         _BEGIN_MASTER(myThid)
                0067 C-    Track pkg activation status:
                0068 C     print a (weak) warning if data.blk is found
                0069          CALL PACKAGES_UNUSED_MSG(
                0070      I                'useBulkForce', 'BULKF_READPARMS', 'blk' )
                0071         _END_MASTER(myThid)
                0072         RETURN
                0073       ENDIF
7753507405 Curt*0074 
                0075       _BEGIN_MASTER(myThid)
                0076 
                0077       CALL OPEN_COPY_DATA_FILE(
                0078      I                          'data.blk', 'BULKF_READPARMS',
                0079      O                          iUnit,
                0080      I                          myThid )
                0081 
679d149d01 Jean*0082 C--   Default values
6a1d3c464b Jean*0083 C-    Physical constant :
69f66dfb04 Jean*0084 c     slp0   = atm_Po / 100.  ! reference sea-level atmospheric pressure [mb]
                0085       rhoA   = 1.3 _d 0
                0086       rhoFW  = rhoConstFresh
                0087       cpAir  = atm_Cp
                0088 c     cpwv   = 1.81 _d 3
6a1d3c464b Jean*0089       Lvap   = 2.5 _d 6
                0090       Lfresh = 3.34 _d 5
69f66dfb04 Jean*0091 c     Lvap_ice = 2.83 _d 6
6a1d3c464b Jean*0092       Tf0kel = celsius2K
69f66dfb04 Jean*0093       Rgas   = atm_Rd
                0094 c     Rvap   = 461. _d 0
6a1d3c464b Jean*0095       xkar   = 0.4  _d 0
69f66dfb04 Jean*0096       stefan = 5.67 _d -8
                0097       zref   = 10.0 _d 0
                0098       zwd    = zref
                0099       zth    = zref
                0100       cDrag_1 = 2.70   _d -3
                0101       cDrag_2 = 0.142  _d -3
                0102       cDrag_3 = 0.0764 _d -3
                0103       cStantonS = 18.0 _d -3
                0104       cStantonU = 32.7 _d -3
                0105       cDalton   = 34.6 _d -3
                0106       umin      =  1.0 _d 0
6a1d3c464b Jean*0107       humid_fac =  0.606 _d 0
69f66dfb04 Jean*0108       saltQsFac =  0.980 _d 0
6a1d3c464b Jean*0109       gamma_blk =  0.010 _d 0
                0110       atm_emissivity  = .90 _d 0
                0111       ocean_emissivity= .985 _d 0
                0112       snow_emissivity = .98 _d 0
                0113       ice_emissivity  = .98 _d 0
679d149d01 Jean*0114       ocean_albedo    = .10 _d 0
                0115 #ifdef ALLOW_FORMULA_AIM
                0116       FWIND0 = 0.6 _d 0
                0117       CHS = 0.8 _d -3
                0118       VGUST  = 5. _d 0
                0119       DTHETA = 3. _d 0
                0120       dTstab = 1. _d 0
                0121       FSTAB  = 0.67 _d 0
                0122 #endif
6a1d3c464b Jean*0123 
                0124 C-    bulk-forcing parameters:
679d149d01 Jean*0125       useFluxFormula_AIM = .FALSE.
69f66dfb04 Jean*0126       blk_nIter = 5
679d149d01 Jean*0127       calcWindStress = zonalWindFile .EQ. ' '
                0128      &           .AND. meridWindFile .EQ. ' '
6a1d3c464b Jean*0129       blk_taveFreq = taveFreq
                0130 
                0131 C-    Input data files names :
7753507405 Curt*0132       AirTempFile=' '
                0133       AirHumidityFile=' '
                0134       RainFile=' '
                0135       SolarFile=' '
                0136       LongwaveFile=' '
                0137       UWindFile=' '
                0138       VWindFile=' '
                0139       WspeedFile=' '
                0140       RunoffFile=' '
                0141       QnetFile=' '
                0142       EmPFile=' '
                0143       CloudFile=' '
                0144       SnowFile=' '
679d149d01 Jean*0145       airPotTempFile=' '
7753507405 Curt*0146 
                0147 C--   Read parameters from open data file
69f66dfb04 Jean*0148       WRITE(msgBuf,'(A)')' BULKF_READPARMS: starts to read BULKF_CONST'
                0149       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0150      &                    SQUEEZE_RIGHT , myThid)
6a1d3c464b Jean*0151       READ(UNIT=iUnit,NML=BULKF_CONST)
69f66dfb04 Jean*0152       WRITE(msgBuf,'(A)') ' BULKF_READPARMS: read BULKF_CONST : OK'
6a1d3c464b Jean*0153       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
69f66dfb04 Jean*0154      &                    SQUEEZE_RIGHT , myThid)
7753507405 Curt*0155 
69f66dfb04 Jean*0156       WRITE(msgBuf,'(A)')' BULKF_READPARMS: starts to read BULKF_PARM01'
                0157       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0158      &                    SQUEEZE_RIGHT , myThid)
6a1d3c464b Jean*0159       READ(UNIT=iUnit,NML=BULKF_PARM01)
69f66dfb04 Jean*0160       WRITE(msgBuf,'(A)') ' BULKF_READPARMS: read BULKF_PARM01 : OK'
7753507405 Curt*0161       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
69f66dfb04 Jean*0162      &                    SQUEEZE_RIGHT , myThid)
7753507405 Curt*0163 
                0164 #ifdef CONSERV_BULKF
                0165 c -- default
                0166       qnet_off=0.d0
                0167       empmr_off=0.d0
69f66dfb04 Jean*0168       WRITE(msgBuf,'(A)')' BULKF_READPARMS: starts reading BULKF_PARM02'
                0169       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0170      &                    SQUEEZE_RIGHT , myThid)
7753507405 Curt*0171       READ(UNIT=iUnit,NML=BULKF_PARM02)
69f66dfb04 Jean*0172       WRITE(msgBuf,'(A)') ' BULKF_READPARMS: read BULKF_PARM02 : OK'
7753507405 Curt*0173       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
69f66dfb04 Jean*0174      &                    SQUEEZE_RIGHT , myThid)
7753507405 Curt*0175 
                0176 #endif /* CONSERV_BULKF */
                0177 
                0178 C--   Close the open data file
7a77863887 Mart*0179 #ifdef SINGLE_DISK_IO
7753507405 Curt*0180       CLOSE(iUnit)
7a77863887 Mart*0181 #else
                0182       CLOSE(iUnit,STATUS='DELETE')
                0183 #endif /* SINGLE_DISK_IO */
6a1d3c464b Jean*0184 
679d149d01 Jean*0185 C-  check that CPP option is "defined" when running-flag parameter is on:
                0186 #ifndef ALLOW_FORMULA_AIM
                0187       IF ( useFluxFormula_AIM ) THEN
                0188         WRITE(msgBuf,'(2A)') ' BULKF_READPARMS: ',
                0189      &   'useFluxFormula_AIM is TRUE and #undef ALLOW_FORMULA_AIM'
                0190         CALL PRINT_ERROR( msgBuf , myThid)
                0191         WRITE(msgBuf,'(2A)') ' BULKF_READPARMS: => recompile with',
                0192      &   ' #define ALLOW_FORMULA_AIM in BULK_FORCE_OPTIONS.h'
                0193         CALL PRINT_ERROR( msgBuf , myThid)
                0194         STOP 'ABNORMAL END: S/R CONFIG_CHECK'
                0195       ENDIF
                0196 #endif
                0197 
6a1d3c464b Jean*0198 C-    Define other constants (from previous ones):
69f66dfb04 Jean*0199 c     Qcoef  = 6.11 _d 0 * 0.622 _d 0 / p0
                0200 c     Sha    = Rgas / .286 _d 0
6a1d3c464b Jean*0201 
8d92b2862f Jean*0202       useQnetch = QnetFile .NE. ' '
                0203       useEmPch  = EmPFile  .NE. ' '
                0204 
6a1d3c464b Jean*0205 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0206       iUnit = standardMessageUnit
                0207 c     iUnit=88
                0208 c     OPEN(iUnit,file='bulkf_check_params',status='unknown')
69f66dfb04 Jean*0209 c     WRITE(iUnit,*) 'BlkF: slp0     =',slp0
                0210       WRITE(iUnit,*) 'BlkF: rhoA     =',rhoA
                0211       WRITE(iUnit,*) 'BlkF: rhoFW    =',rhoFW
                0212       WRITE(iUnit,*) 'BlkF: cpAir    =',cpAir
                0213 c     WRITE(iUnit,*) 'BlkF: cpwv     =',cpwv
6a1d3c464b Jean*0214       WRITE(iUnit,*) 'BlkF: Lvap     =',Lvap
                0215       WRITE(iUnit,*) 'BlkF: Lfresh   =',Lfresh
69f66dfb04 Jean*0216 c     WRITE(iUnit,*) 'BlkF: Lvap_ice =',Lvap_ice
                0217 c     WRITE(iUnit,*) 'BlkF: Sha      =',Sha
6a1d3c464b Jean*0218       WRITE(iUnit,*) 'BlkF: Tf0kel   =',Tf0kel
69f66dfb04 Jean*0219       WRITE(iUnit,*) 'BlkF: Rgas     =',Rgas
                0220 c     WRITE(iUnit,*) 'BlkF: Rvap     =',Rvap
6a1d3c464b Jean*0221       WRITE(iUnit,*) 'BlkF: xkar     =',xkar
69f66dfb04 Jean*0222       WRITE(iUnit,*) 'BlkF: stefan   =',stefan
                0223       WRITE(iUnit,*) 'BlkF: zref     =',zref
                0224       WRITE(iUnit,*) 'BlkF: zwd      =',zwd
                0225       WRITE(iUnit,*) 'BlkF: zth      =',zth
                0226       WRITE(iUnit,*) 'BlkF: cDrag_1  =',cDrag_1
                0227       WRITE(iUnit,*) 'BlkF: cDrag_2  =',cDrag_2
                0228       WRITE(iUnit,*) 'BlkF: cDrag_3  =',cDrag_3
                0229       WRITE(iUnit,*) 'BlkF: cStantonS=',cStantonS
                0230       WRITE(iUnit,*) 'BlkF: cStantonU=',cStantonU
                0231       WRITE(iUnit,*) 'BlkF: cDalton  =',cDalton
                0232       WRITE(iUnit,*) 'BlkF: umin     =',umin
6a1d3c464b Jean*0233       WRITE(iUnit,*) 'BlkF: humid_fac=',humid_fac
69f66dfb04 Jean*0234       WRITE(iUnit,*) 'BlkF: saltQsFac=',saltQsFac
6a1d3c464b Jean*0235       WRITE(iUnit,*) 'BlkF: gamma_blk=',gamma_blk
                0236       WRITE(iUnit,*) 'BlkF: atm_emissivity  =',atm_emissivity
                0237       WRITE(iUnit,*) 'BlkF: ocean_emissivity=',ocean_emissivity
                0238       WRITE(iUnit,*) 'BlkF: snow_emissivity =',snow_emissivity
                0239       WRITE(iUnit,*) 'BlkF: ice_emissivity  =',ice_emissivity
679d149d01 Jean*0240       WRITE(iUnit,*) 'BlkF: ocean_albedo    =',ocean_albedo
                0241 #ifdef ALLOW_FORMULA_AIM
                0242       WRITE(iUnit,*) 'BlkF: FWIND0   =', FWIND0
                0243       WRITE(iUnit,*) 'BlkF: CHS      =', CHS
                0244       WRITE(iUnit,*) 'BlkF: VGUST    =', VGUST
                0245       WRITE(iUnit,*) 'BlkF: DTHETA   =', DTHETA
                0246       WRITE(iUnit,*) 'BlkF: dTstab   =', dTstab
                0247       WRITE(iUnit,*) 'BlkF: FSTAB    =', FSTAB
                0248 #endif
                0249       WRITE(iUnit,*) 'BlkF: useFluxFormula_AIM=',useFluxFormula_AIM
8d92b2862f Jean*0250       WRITE(iUnit,*) 'BlkF: calcWindStress  =', calcWindStress
                0251       WRITE(iUnit,*) 'BlkF: useQnetch       =', useQnetch
                0252       WRITE(iUnit,*) 'BlkF: useEmPch        =', useEmPch
69f66dfb04 Jean*0253       WRITE(iUnit,*) 'BlkF: blk_nIter   =',blk_nIter
679d149d01 Jean*0254       WRITE(iUnit,*) 'BlkF: blk_taveFreq=', blk_taveFreq
6a1d3c464b Jean*0255       IF (iUnit.EQ.88) CLOSE(iUnit)
                0256 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0257 
7753507405 Curt*0258       _END_MASTER(myThid)
                0259 
                0260 C--   Everyone else must wait for the parameters to be loaded
                0261       _BARRIER
                0262 
                0263 #endif /* ALLOW_BULK_FORCE */
                0264 
6a1d3c464b Jean*0265       RETURN
                0266       END