Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:41:39 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d2895c0628 Jean*0001 #include "LAND_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: LAND_CHECK
                0005 C     !INTERFACE:
                0006       SUBROUTINE LAND_CHECK( myThid )
                0007 
                0008 C     !DESCRIPTION: \bv
                0009 C     *==========================================================*
                0010 C     | S/R LAND_CHECK
                0011 C     | o Check parameters and other package dependences
                0012 C     *==========================================================*
                0013 C     \ev
                0014 
                0015 C     !USES:
                0016       IMPLICIT NONE
                0017 
                0018 C     == Global variables ===
                0019 C-- size for MITgcm & Land package :
                0020 #include "LAND_SIZE.h"
                0021 
                0022 #include "EEPARAMS.h"
                0023 #include "PARAMS.h"
                0024 #include "LAND_PARAMS.h"
                0025 #ifdef ALLOW_MNC
                0026 # include "MNC_PARAMS.h"
                0027 #endif
                0028 
                0029 C     !INPUT/OUTPUT PARAMETERS:
                0030 C     myThid     :: my Thread Id number
                0031       INTEGER myThid
                0032 
                0033 #ifdef ALLOW_LAND
                0034 C     !FUNCTIONS:
                0035       INTEGER  ILNBLNK
                0036       EXTERNAL ILNBLNK
                0037 
                0038 C     !LOCAL VARIABLES:
                0039 C     msgBuf     :: Informational/error message buffer
                0040 C     iUnit      :: Work variable for IO unit number
                0041 C     iL         :: Work variable for length of file-name
                0042       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0043       INTEGER iUnit, iL
                0044 CEOP
                0045 
                0046 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0047 
                0048       _BEGIN_MASTER(myThid)
                0049 
                0050       iUnit = standardMessageUnit
                0051       WRITE(msgBuf,'(A)') 'LAND_CHECK: #define ALLOW_LAND'
                0052       CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0053 
                0054 C--   Print out parameter values :
                0055       WRITE(msgBuf,'(A)') '// ==================================='
                0056       CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0057       WRITE(msgBuf,'(A)') '// Land package parameters :'
                0058       CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0059       WRITE(msgBuf,'(A)') '// ==================================='
                0060       CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0061 
                0062 C- namelist LAND_MODEL_PAR:
                0063        CALL WRITE_0D_L( land_calc_grT, INDEX_NONE,
                0064      &                 'land_calc_grT =',
                0065      &   ' /* step forward ground Temp. on/off flag */')
                0066        CALL WRITE_0D_L( land_calc_grW, INDEX_NONE,
                0067      &                 'land_calc_grW =',
                0068      &   ' /* step forward soil moiture on/off flag */')
                0069        CALL WRITE_0D_L( land_impl_grT, INDEX_NONE,
                0070      &                 'land_impl_grT =',
                0071      &   ' /* solve ground temperature implicitly */')
                0072        CALL WRITE_0D_L( land_calc_snow, INDEX_NONE,
                0073      &                 'land_calc_snow =',
                0074      &   ' /* step forward snow thickness */')
                0075        CALL WRITE_0D_L( land_calc_alb, INDEX_NONE,
                0076      &                 'land_calc_alb =',
                0077      &   ' /* compute land+snow albedo */')
                0078       iL = ILNBLNK( land_grT_iniFile )
                0079       IF ( iL.GE.1 ) THEN
                0080        WRITE(msgBuf,'(A,A)') 'land_grT_iniFile = ',
                0081      &                       '/* Initial ground-Temp Input-File */'
                0082        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0083        WRITE(msgBuf,'(16X,A)') land_grT_iniFile(1:iL)
                0084        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0085        msgBuf='    ;'
                0086        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0087       ENDIF
                0088       iL = ILNBLNK( land_grW_iniFile )
                0089       IF ( iL.GE.1 ) THEN
                0090        WRITE(msgBuf,'(A,A)') 'land_grW_iniFile = ',
                0091      &                       '/* Initial soil-Water Input-File */'
                0092        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0093        WRITE(msgBuf,'(16X,A)') land_grW_iniFile(1:iL)
                0094        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0095        msgBuf='    ;'
                0096        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0097       ENDIF
                0098       iL = ILNBLNK( land_snow_iniFile )
                0099       IF ( iL.GE.1 ) THEN
                0100        WRITE(msgBuf,'(A,A)') 'land_snow_iniFile= ',
                0101      &                  '/* Initial snow thickness Input-File */'
                0102        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0103        WRITE(msgBuf,'(16X,A)') land_grW_iniFile(1:iL)
                0104        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0105        msgBuf='    ;'
                0106        CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0107       ENDIF
                0108        CALL WRITE_0D_RL( land_deltaT, INDEX_NONE,'land_deltaT =',
                0109      &  ' /* land model Time-Step (s) */')
                0110        CALL WRITE_0D_RL( land_taveFreq, INDEX_NONE,'land_taveFreq =',
                0111      &   ' /* Frequency^-1 for time-Aver. output (s) */')
                0112        CALL WRITE_0D_RL( land_diagFreq, INDEX_NONE,'land_diagFreq =',
                0113      &   ' /* Frequency^-1 for diagnostic output (s) */')
                0114        CALL WRITE_0D_RL( land_diagFreq, INDEX_NONE,'land_monFreq =',
                0115      &   ' /* Frequency^-1 for monitor output (s) */')
                0116        CALL WRITE_1D_RL( land_dzF,land_nLev, INDEX_K,'land_dzF = ',
                0117      &   ' /* layer thickness ( m ) */')
                0118        CALL WRITE_1D_RL(land_rec_dzC,land_nLev,INDEX_K,'land_rec_dzC= '
                0119      &  ,' /* recip. vertical spacing (m-1) */')
                0120       CALL WRITE_0D_L( land_timeave_mdsio, INDEX_NONE,
                0121      &     'land_timeave_mdsio =',' /* use MDSIO for Tave output */')
                0122       CALL WRITE_0D_L( land_timeave_mnc, INDEX_NONE,
                0123      &     'land_timeave_mnc =',' /* use MNC for Tave output */')
                0124       CALL WRITE_0D_L( land_snapshot_mdsio, INDEX_NONE,
                0125      &     'land_snapshot_mdsio =',
                0126      &     ' /* use MDSIO for snapshot output */')
                0127       CALL WRITE_0D_L( land_snapshot_mnc, INDEX_NONE,
                0128      &     'land_snapshot_mnc =',' /* use MNC for snapshot output */')
                0129       CALL WRITE_0D_L( land_mon_stdio, INDEX_NONE,
                0130      &     'land_mon_stdio =',' /* use STDOUT for monitor output */')
                0131       CALL WRITE_0D_L( land_mon_mnc, INDEX_NONE,
                0132      &     'land_mon_mnc =',' /* use MNC for monitor output */')
                0133       CALL WRITE_0D_L( land_pickup_write_mnc, INDEX_NONE,
                0134      &     'land_pickup_write_mnc =',
                0135      &     ' /* use MNC for writing pickups */')
                0136       CALL WRITE_0D_L( land_pickup_read_mnc, INDEX_NONE,
                0137      &     'land_pickup_read_mnc =',
                0138      &     ' /* use MNC for reading pickups */')
                0139 
                0140 C- namelist LAND_PHYS_PAR:
                0141        CALL WRITE_0D_RL(land_grdLambda,INDEX_NONE,'land_grdLambda =',
                0142      &   ' /* Thermal conductivity of the ground (W/m/K)*/')
                0143        CALL WRITE_0D_RL( land_heatCs,INDEX_NONE,'land_heatCs =',
                0144      &   ' /* Heat capacity of dry soil (J/m3/K) */')
                0145        CALL WRITE_0D_RL( land_CpWater,INDEX_NONE,'land_CpWater =',
                0146      &   ' /* Heat capacity of water    (J/kg/K) */')
                0147        CALL WRITE_0D_RL( land_wTauDiff,INDEX_NONE,'land_wTauDiff =',
                0148      &   ' /* soil moisture diffusion time scale (s) */')
                0149        CALL WRITE_0D_RL( land_waterCap,INDEX_NONE,'land_waterCap =',
                0150      &   ' /* field capacity per meter of soil (1) */')
                0151        CALL WRITE_0D_RL(land_fractRunOff,INDEX_NONE,'land_fractRunOff='
                0152      &  ,' /* fraction of water in excess which run-off */')
                0153        CALL WRITE_0D_RL(land_rhoLiqW,INDEX_NONE,'land_rhoLiqW =',
                0154      &   ' /* density of liquid water (kg/m3) */')
                0155        CALL WRITE_0D_RL(land_rhoSnow,INDEX_NONE,'land_rhoSnow =',
                0156      &   ' /* density of snow (kg/m3) */')
                0157        CALL WRITE_0D_RL(land_Lfreez,INDEX_NONE,'land_Lfreez =',
                0158      &   ' /* Latent heat of freezing (J/kg) */')
                0159        CALL WRITE_0D_RL(land_hMaxSnow,INDEX_NONE,'land_hMaxSnow =',
                0160      &   ' /* maximum snow-thickness (m) */')
                0161        CALL WRITE_0D_RL(diffKsnow,INDEX_NONE,'diffKsnow =',
                0162      &   ' /* thermal conductivity of snow (W/m/K) */')
                0163        CALL WRITE_0D_RL(timeSnowAge,INDEX_NONE,'timeSnowAge =',
                0164      &   ' /* snow aging time scale   (s) */')
                0165        CALL WRITE_0D_RL(hNewSnowAge,INDEX_NONE,'hNewSnowAge =',
                0166      &   ' /* new snow thickness to refresh snow-age by 1/e */')
                0167        CALL WRITE_0D_RL(albColdSnow,INDEX_NONE,'albColdSnow =',
                0168      &   ' /* albedo of cold (=dry) new snow */')
                0169        CALL WRITE_0D_RL(albWarmSnow,INDEX_NONE,'albWarmSnow =',
                0170      &   ' /* albedo of warm (=wet) new snow */')
                0171        CALL WRITE_0D_RL(tempSnowAlbL,INDEX_NONE,'tempSnowAlbL =',
                0172      &   ' /* Temp. transition from ColdSnow to WarmSnow Alb. (oC) */')
                0173        CALL WRITE_0D_RL(albOldSnow, INDEX_NONE,'albOldSnow =',
                0174      &   ' /* albedo of old snow (snowAge >35.d)*/')
                0175        CALL WRITE_0D_RL(hAlbSnow, INDEX_NONE,'hAlbSnow =',
                0176      &   ' /* snow depth for albedo transition */')
                0177 
                0178       WRITE(msgBuf,'(A)') '// ==================================='
                0179       CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,myThid)
                0180 
                0181 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0182 C--   Check parameters and model configuration
                0183 
                0184 C-    for now, Land package works only with AIM package:
                0185       IF ( .NOT.useAIM ) THEN
                0186         WRITE(msgBuf,'(A)')
                0187      &  'LAND_CHECK: land pkg only implemented with AIM physics'
                0188         CALL PRINT_ERROR( msgBuf, myThid)
                0189         WRITE(msgBuf,'(A)')
                0190      &  'DO NOT use Land (useLand=T) without AIM (useAIM=F, data.pkg)'
                0191         CALL PRINT_ERROR( msgBuf, myThid)
                0192         STOP 'ABNORMAL END: S/R LAND_CHECK'
                0193       ENDIF
                0194 
                0195       IF ( land_nLev.NE.2 .AND. land_impl_grT ) THEN
                0196         WRITE(msgBuf,'(2A,I3)') 'LAND_CHECK: ',
                0197      &  ' land_impl_grT=.T. but land_nLev=',land_nLev
                0198         CALL PRINT_ERROR( msgBuf, myThid)
                0199         WRITE(msgBuf,'(A)')
                0200      &  'Implicit scheme only implemented for 2 levels land Temp'
                0201         CALL PRINT_ERROR( msgBuf, myThid)
                0202         STOP 'ABNORMAL END: S/R LAND_CHECK'
                0203       ENDIF
                0204 
                0205 C-    If land_taveFreq is positive, then must compile the land-diagnostics code
                0206 #ifndef ALLOW_LAND_TAVE
                0207       IF (land_taveFreq.GT.0.) THEN
                0208         WRITE(msgBuf,'(2A)') 'LAND_CHECK:',
                0209      &  ' land_taveFreq > 0 but ALLOW_LAND_TAVE undefined'
                0210         CALL PRINT_ERROR( msgBuf, myThid)
                0211         WRITE(msgBuf,'(2A)') 'Re-compile setting: ',
                0212      &  '#define ALLOW_LAND_TAVE (in LAND_OPTIONS.h)'
                0213         CALL PRINT_ERROR( msgBuf, myThid)
                0214         STOP 'ABNORMAL END: S/R LAND_CHECK'
                0215       ENDIF
                0216 #endif /* ALLOW_LAND_TAVE */
                0217 
                0218 C-    If land_monFreq is > 0, then must compile the monitor pkg
                0219 #ifndef ALLOW_MONITOR
                0220       IF (land_monFreq.GT.0.) THEN
                0221         WRITE(msgBuf,'(2A)') 'LAND_CHECK:',
                0222      &  ' land_monFreq > 0 but ALLOW_MONITOR undefined'
                0223         CALL PRINT_ERROR( msgBuf, myThid)
                0224         WRITE(msgBuf,'(2A)')
                0225      &  'Re-compile with pkg monitor (in packages.conf)'
                0226         CALL PRINT_ERROR( msgBuf, myThid)
                0227         STOP 'ABNORMAL END: S/R LAND_CHECK'
                0228       ENDIF
                0229 #endif /* ALLOW_MONITOR */
                0230 
                0231 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0232 
                0233       _END_MASTER(myThid)
                0234 
                0235 #endif /* ALLOW_LAND */
                0236 
                0237       RETURN
                0238       END