Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
887dcb13f8 Patr*0001 #include "KPP_OPTIONS.h"
                0002 
                0003       SUBROUTINE KPP_CHECK( myThid )
3560db2fad Jean*0004 
                0005 C     *==========================================================*
                0006 C     | SUBROUTINE KPP_CHECK
                0007 C     | o Validate basic package setup and inter-package
                0008 C     |   dependencies.
                0009 C     *==========================================================*
                0010 
887dcb13f8 Patr*0011       IMPLICIT NONE
                0012 
                0013 C     === Global variables ===
                0014 #include "SIZE.h"
                0015 #include "EEPARAMS.h"
                0016 #include "PARAMS.h"
77317392b9 Jean*0017 #include "KPP_PARAMS.h"
887dcb13f8 Patr*0018 
                0019 C     === Routine arguments ===
3560db2fad Jean*0020 C     myThid :: my Thread Id Number
887dcb13f8 Patr*0021       INTEGER myThid
                0022 
                0023 #ifdef ALLOW_KPP
                0024 C     === Local variables ===
3560db2fad Jean*0025 C     msgBuf :: Informational/error message buffer
887dcb13f8 Patr*0026       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0027 
3560db2fad Jean*0028       _BEGIN_MASTER(myThid)
                0029 
887dcb13f8 Patr*0030       WRITE(msgBuf,'(A)') 'KPP_CHECK: #define ALLOW_KPP'
                0031       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
ce6d0964b8 Jean*0032      &                    SQUEEZE_RIGHT, myThid )
                0033 
                0034 C--   Print out KPP parameters:
                0035       CALL WRITE_0D_RL( kpp_freq, INDEX_NONE, ' kpp_freq =',
                0036      &  ' /* frequency of KPP calculation */')
                0037 
                0038       CALL WRITE_0D_L( KPP_ghatUseTotalDiffus, INDEX_NONE,
                0039      &  'KPP_ghatUseTotalDiffus=',
                0040      &  ' /* non-local term fct of total diffus */')
                0041       CALL WRITE_0D_L( KPPuseDoubleDiff, INDEX_NONE,
                0042      &  'KPPuseDoubleDiff =', ' /* include double diffusive contrib */')
                0043       CALL WRITE_0D_L( LimitHblStable, INDEX_NONE,
                0044      &  'LimitHblStable =', ' /* limits depth of hbl if stable cond.*/')
                0045       CALL WRITE_0D_RL( minKPPhbl, INDEX_NONE, ' minKPPhbl =',
                0046      &  ' /* minimum KPPhbl value [m] */')
                0047       CALL WRITE_0D_RL( epsln,     INDEX_NONE, ' epsln     =',
                0048      &  ' /* constant [-] */')
                0049       CALL WRITE_0D_RL( phepsi,    INDEX_NONE, ' phepsi    =',
                0050      &  ' /* constant [-] */')
                0051       CALL WRITE_0D_RL( epsilon,   INDEX_NONE, ' epsilon   =',
                0052      &  ' /* constant [-] */')
                0053       CALL WRITE_0D_RL( vonk,      INDEX_NONE, ' vonk      =',
                0054      &  ' /* Von Karmans constant [-] */')
                0055       CALL WRITE_0D_RL( dB_dz,     INDEX_NONE, ' dB_dz     =',
                0056      &  ' /* maximum N^2 in mixed layer [s^-2] */')
                0057       CALL WRITE_0D_RL( conc1,     INDEX_NONE, ' conc1     =',
                0058      &  ' /* scalar constant [-] */')
                0059       CALL WRITE_0D_RL( conam,     INDEX_NONE, ' conam     =',
                0060      &  ' /* scalar constant [-] */')
                0061       CALL WRITE_0D_RL( concm,     INDEX_NONE, ' concm     =',
                0062      &  ' /* scalar constant [-] */')
                0063       CALL WRITE_0D_RL( conc2,     INDEX_NONE, ' conc2     =',
                0064      &  ' /* scalar constant [-] */')
                0065       CALL WRITE_0D_RL( conas,     INDEX_NONE, ' conas     =',
                0066      &  ' /* scalar constant [-] */')
                0067       CALL WRITE_0D_RL( concs,     INDEX_NONE, ' concs     =',
                0068      &  ' /* scalar constant [-] */')
                0069       CALL WRITE_0D_RL( conc3,     INDEX_NONE, ' conc3     =',
                0070      &  ' /* scalar constant [-] */')
                0071       CALL WRITE_0D_RL( zetam,     INDEX_NONE, ' zetam     =',
                0072      &  ' /* scalar constant [-] */')
                0073       CALL WRITE_0D_RL( zetas,     INDEX_NONE, ' zetas     =',
                0074      &  ' /* scalar constant [-] */')
                0075       CALL WRITE_0D_RL( Ricr,      INDEX_NONE, ' Ricr      =',
                0076      &  ' /* critical bulk Richardson Number [-] */')
                0077       CALL WRITE_0D_RL( cekman,    INDEX_NONE, ' cekman    =',
                0078      &  ' /* coeff for Ekman depth [-] */')
                0079       CALL WRITE_0D_RL( cmonob,    INDEX_NONE, ' cmonob    =',
                0080      &  ' /* coeff for Monin-Obukhov depth [-] */')
                0081       CALL WRITE_0D_RL( concv,     INDEX_NONE, ' concv     =',
                0082      &  ' /* buoyancy freq ratio [-] */')
                0083       CALL WRITE_0D_RL( hbf,       INDEX_NONE, ' hbf       =',
                0084      &  ' /* solar radiation depth ratio [-] */')
                0085       CALL WRITE_0D_RL( zmin,      INDEX_NONE, ' zmin      =',
                0086      &  ' /* minimum for zehat in table [m3/s3] */')
                0087       CALL WRITE_0D_RL( zmax,      INDEX_NONE, ' zmax      =',
                0088      &  ' /* maximum for zehat in table [m3/s3] */')
                0089       CALL WRITE_0D_RL( umin,      INDEX_NONE, ' umin      =',
                0090      &  ' /* minimum for ustar in table [m/s] */')
                0091       CALL WRITE_0D_RL( umax,      INDEX_NONE, ' umax      =',
                0092      &  ' /* maximum for ustar in table [m/s] */')
                0093       CALL WRITE_0D_I( num_v_smooth_Ri, INDEX_NONE,
                0094      & 'num_v_smooth_Ri =', ' /* number of vertical smoothing */')
                0095       CALL WRITE_0D_RL( Riinfty,   INDEX_NONE, ' Riinfty   =',
                0096      &  ' /* shear instability Ri number limit [-] */')
                0097       CALL WRITE_0D_RL( BVSQcon,   INDEX_NONE, ' BVSQcon   =',
                0098      &  ' /* Brunt-Vaisala squared (=N^2) [s^-2] */')
                0099       CALL WRITE_0D_RL( difm0,     INDEX_NONE, ' difm0     =',
                0100      &  ' /* max viscosity from shear instab. [m2/s] */')
                0101       CALL WRITE_0D_RL( difs0,     INDEX_NONE, ' difs0     =',
                0102      &  ' /* max diffusiv. from shear instab. [m2/s] */')
                0103       CALL WRITE_0D_RL( dift0,     INDEX_NONE, ' dift0     =',
                0104      &  ' /* max diffusiv. from shear instab. [m2/s] */')
                0105       CALL WRITE_0D_RL( difmcon,   INDEX_NONE, ' difmcon   =',
                0106      &  ' /* convective viscosity [m2/s] */')
                0107       CALL WRITE_0D_RL( difscon,   INDEX_NONE, ' difscon   =',
                0108      &  ' /* convective diffusiv. [m2/s] */')
                0109       CALL WRITE_0D_RL( diftcon,   INDEX_NONE, ' diftcon   =',
                0110      &  ' /* convective diffusiv. [m2/s] */')
                0111       CALL WRITE_0D_RL( Rrho0,     INDEX_NONE, ' Rrho0     =',
                0112      &  ' /* double diffusion density ratio [-] */')
                0113       CALL WRITE_0D_RL( dsfmax,    INDEX_NONE, ' dsfmax    =',
                0114      &  ' /* max diffusiv. for salt fingering [m2/s] */')
                0115       CALL WRITE_0D_RL( cstar,     INDEX_NONE, ' cstar     =',
                0116      &  ' /* coeff for non-locak transport [-] */')
                0117 C--
                0118       CALL WRITE_0D_L( KPPwriteState, INDEX_NONE,
                0119      &  'KPPwriteState =', ' /* write KPP fields to file */')
                0120       CALL WRITE_0D_RL( kpp_dumpFreq, INDEX_NONE, ' kpp_dumpFreq =',
                0121      &  ' /* dump freq of KPP output */')
                0122       CALL WRITE_0D_RL( kpp_taveFreq, INDEX_NONE, ' kpp_taveFreq =',
                0123      &  ' /* time-averaging freq of KPP output */')
                0124 
                0125 C--  Check parameters:
887dcb13f8 Patr*0126 
                0127 C     KPP needs convection turned off (will be packaged later)
                0128       IF (cAdjFreq.NE.0.  .OR.
                0129      &     ivdc_kappa.NE.0.) THEN
                0130          WRITE(msgBuf,'(A)') 'Some form of convection has been enabled'
77317392b9 Jean*0131          CALL PRINT_ERROR( msgBuf , myThid )
887dcb13f8 Patr*0132          STOP 'ABNORMAL END: S/R KPP_CHECK'
                0133       ENDIF
                0134 
                0135 C     KPP needs implicit vertical diffusion and viscosity
                0136       IF (.NOT.implicitDiffusion ) THEN
                0137          WRITE(msgBuf,'(A)') 'KPP needs implicitDiffusion to be enabled'
77317392b9 Jean*0138          CALL PRINT_ERROR( msgBuf , myThid )
887dcb13f8 Patr*0139          STOP 'ABNORMAL END: S/R KPP_CHECK'
                0140       ENDIF
4ede532ddb Step*0141       IF ( .NOT.implicitViscosity .AND. momStepping ) THEN
887dcb13f8 Patr*0142          WRITE(msgBuf,'(A)') 'KPP needs implicitViscosity to be enabled'
77317392b9 Jean*0143          CALL PRINT_ERROR( msgBuf , myThid )
887dcb13f8 Patr*0144          STOP 'ABNORMAL END: S/R KPP_CHECK'
                0145       ENDIF
                0146 
                0147 C     Shortwave heating should be defined with KPP
                0148 #ifndef SHORTWAVE_HEATING
                0149       WRITE(msgBuf,'(A)') 'KPP needs CPP flag SHORTWAVE_HEATING enabled'
77317392b9 Jean*0150       CALL PRINT_ERROR( msgBuf , myThid )
887dcb13f8 Patr*0151       STOP 'ABNORMAL END: S/R KPP_CHECK'
                0152 #endif /* SHORTWAVE_HEATING */
                0153 
956c0a5824 Patr*0154 C     Check that overlap region is adequate.
                0155 C     When horizontal smoothing is turned on,
                0156 C     KPP_CALC computes vertical viscosity and diffusivity for region
                0157 C     (-2:sNx+3,-2:sNy+3) as required by CALC_DIFFUSIVITY and requires
f2d9fbc2ed Jean*0158 C     values of uVel, vVel, surfaceForcingU, surfaceForcingV in the
956c0a5824 Patr*0159 C     region (-2:sNx+4,-2:sNy+4).
                0160 C     Hence overlap region needs to be set OLx=4, OLy=4.
4fa51dc730 Dimi*0161 #if defined(KPP_SMOOTH_SHSQ) || defined(KPP_SMOOTH_DVSQ)
                0162 #  define KPP_NEEDS_OVERLAP_4
                0163 #endif
                0164 #if defined(KPP_SMOOTH_DBLOC) || defined(KPP_SMOOTH_DENS)
                0165 #  define KPP_NEEDS_OVERLAP_4
                0166 #endif
                0167 #ifdef KPP_NEEDS_OVERLAP_4
8164aa1823 Patr*0168 #ifdef KPP_REACTIVATE_OL4
956c0a5824 Patr*0169       IF (OLx.LT.4 .OR. OLy.LT.4) THEN
                0170        WRITE(msgBuf,'(A)') 'KPP horizontal smoothing requires OLx=OLy=4'
77317392b9 Jean*0171        CALL PRINT_ERROR( msgBuf , myThid )
956c0a5824 Patr*0172        STOP 'ABNORMAL END: S/R KPP_CHECK'
                0173       ENDIF
8164aa1823 Patr*0174 #endif
956c0a5824 Patr*0175 #endif
                0176 
e750a5e49e Mart*0177 #ifdef EXCLUDE_KPP_DOUBLEDIFF
                0178       IF ( KPPuseDoubleDiff ) THEN
                0179        WRITE(msgBuf,'(A,A)') 'KPPuseDoubleDiff=.TRUE. requires ',
                0180      &      'that EXCLUDE_KPP_DOUBLEDIFF is undefined'
                0181        CALL PRINT_ERROR( msgBuf , myThid )
                0182        STOP 'ABNORMAL END: S/R KPP_CHECK'
                0183       ENDIF
                0184 #endif /* EXCLUDE_KPP_DOUBLEDIFF */
                0185 
ce6d0964b8 Jean*0186       WRITE(msgBuf,'(A)') ' '
                0187       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0188      &                    SQUEEZE_RIGHT, myThid )
                0189 
3560db2fad Jean*0190       _END_MASTER(myThid)
887dcb13f8 Patr*0191 
3560db2fad Jean*0192 #endif /* ALLOW_KPP */
77317392b9 Jean*0193       RETURN
                0194       END