Back to home page

MITgcm

 
 

    


File indexing completed on 2024-02-01 06:10:05 UTC

view on githubraw file Latest commit 427e24e1 on 2024-01-31 16:50:14 UTC
6d54cf9ca1 Ed H*0001 #include "PACKAGES_CONFIG.h"
5cd64f209f Jean*0002 #include "CPP_OPTIONS.h"
dc3adfb09b Jean*0003 #ifdef ALLOW_MOM_COMMON
                0004 # include "MOM_COMMON_OPTIONS.h"
                0005 #endif
aecc8b0f47 Mart*0006 #ifdef ALLOW_CTRL
                0007 # include "CTRL_OPTIONS.h"
                0008 #endif
5cd64f209f Jean*0009 
                0010 CBOP
                0011 C     !ROUTINE: CONFIG_CHECK
                0012 C     !INTERFACE:
                0013       SUBROUTINE CONFIG_CHECK( myThid )
                0014 C     !DESCRIPTION: \bv
                0015 C     *=========================================================*
                0016 C     | SUBROUTINE CONFIG_CHECK
                0017 C     | o Check model parameter settings.
                0018 C     *=========================================================*
                0019 C     | This routine help to prevent the use of parameters
                0020 C     | that are not compatible with the model configuration.
                0021 C     *=========================================================*
46979d29da Jean*0022 C     \ev
5cd64f209f Jean*0023 
                0024 C     !USES:
                0025       IMPLICIT NONE
                0026 C     === Global variables ===
                0027 #include "SIZE.h"
                0028 #include "EEPARAMS.h"
                0029 #include "PARAMS.h"
                0030 
                0031 C     !INPUT/OUTPUT PARAMETERS:
                0032 C     === Routine arguments ===
                0033 C     myThid -  Number of this instances of CONFIG_CHECK
                0034       INTEGER myThid
                0035 CEndOfInterface
                0036 
                0037 C     !LOCAL VARIABLES:
                0038 C     == Local variables ==
3c3b37da6e Jean*0039 C     msgBuf :: Informational/error message buffer
5cd64f209f Jean*0040       CHARACTER*(MAX_LEN_MBUF) msgBuf
fbf4b71a66 Jean*0041       INTEGER errCount
5cd64f209f Jean*0042 CEOP
                0043 
51a413ac3c Jean*0044       _BEGIN_MASTER(myThid)
                0045       WRITE(msgBuf,'(A)')
                0046      &'// ======================================================='
                0047       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0048      &                    SQUEEZE_RIGHT, myThid )
                0049       WRITE(msgBuf,'(A)') '// Check Model config. (CONFIG_CHECK):'
                0050       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0051      &                    SQUEEZE_RIGHT, myThid )
                0052       _END_MASTER(myThid)
                0053 
fbf4b71a66 Jean*0054 C--   MPI + multi-threads: seems to be OK to let master-thread check & stop
                0055 C      (as long as all procs finish cleanly by calling ALL_PROC_DIE)
                0056       _BEGIN_MASTER(myThid)
                0057       errCount = 0
                0058 
5cd64f209f Jean*0059 C-  check that CPP option is "defined" when running-flag parameter is on:
                0060 
51575f66de Mart*0061 #ifndef INCLUDE_CONVECT_CALL
                0062 C     o Check that Convective-adjustment code is compiled If cAdjFreq <> 0
                0063       IF ( cAdjFreq .NE. 0. ) THEN
                0064 #ifdef INCLUDE_CONVECT_INI_CALL
                0065         WRITE(msgBuf,'(2A)') '** Warning ** CONFIG_CHECK: ',
                0066      &  'Convective-Adjustment (cAdjFreq) turned off (except INI)'
                0067         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0068      &                      SQUEEZE_RIGHT, myThid )
                0069         WRITE(msgBuf,'(2A)') '** Warning ** CONFIG_CHECK: ',
                0070      &  ' without "#define INCLUDE_CONVECT_CALL" in CPP_OPTIONS.h'
                0071         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0072      &                      SQUEEZE_RIGHT, myThid )
                0073 #else
                0074         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0075      &  'Cannot use Convective-Adjustment (cAdjFreq) without'
                0076         CALL PRINT_ERROR( msgBuf, myThid )
                0077         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0078      &  ' defining INCLUDE_CONVECT_(CALL/INI_CALL) in CPP_OPTIONS.h'
                0079         CALL PRINT_ERROR( msgBuf, myThid )
                0080         errCount = errCount + 1
                0081 #endif
                0082       ENDIF
                0083 #endif /* ndef INCLUDE_CONVECT_CALL */
                0084 
53176ebafb Dimi*0085 C     o If diffKrFile is set, then we should make sure the corresponing
                0086 C       code is being compiled
6c944fd806 Jean*0087 #ifndef ALLOW_3D_DIFFKR
53176ebafb Dimi*0088       IF (diffKrFile.NE.' ') THEN
                0089         WRITE(msgBuf,'(A)')
                0090      &  'CONFIG_CHECK: diffKrFile is set but never used.'
3c3b37da6e Jean*0091         CALL PRINT_ERROR( msgBuf, myThid )
db8d49beca Jean*0092         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0093      &  'Re-compile with: "#define ALLOW_3D_DIFFKR"'
3c3b37da6e Jean*0094         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0095         errCount = errCount + 1
53176ebafb Dimi*0096       ENDIF
                0097 #endif
                0098 
bb2fd3f1ad Jean*0099 #ifdef EXCLUDE_PCELL_MIX_CODE
                0100       IF ( interDiffKr_pCell .OR. interViscAr_pCell
                0101      &                       .OR. pCellMix_select.NE.0 ) THEN
                0102         IF ( interDiffKr_pCell ) THEN
                0103           WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0104      &    'Cannot use interDiffKr_pCell=.TRUE.'
                0105           CALL PRINT_ERROR( msgBuf, myThid )
                0106         ENDIF
                0107         IF ( interViscAr_pCell ) THEN
                0108           WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0109      &    'Cannot use interViscAr_pCell=.TRUE.'
                0110           CALL PRINT_ERROR( msgBuf, myThid )
                0111         ENDIF
                0112         IF ( pCellMix_select.NE.0 ) THEN
                0113           WRITE(msgBuf,'(2A,I6)') 'CONFIG_CHECK: ',
                0114      &    'Cannot use pCellMix_select=', pCellMix_select
                0115           CALL PRINT_ERROR( msgBuf, myThid )
                0116         ENDIF
                0117         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: when compiled ',
                0118      &  'with "#define EXCLUDE_PCELL_MIX_CODE" in CPP_OPTIONS.h'
                0119         CALL PRINT_ERROR( msgBuf, myThid )
                0120         errCount = errCount + 1
                0121       ENDIF
                0122 #endif
                0123 
9dd0c3e7d6 Jean*0124 #ifndef ALLOW_LEITH_QG
                0125 C     Check that Leith QG viscosity coefficeint is zero if the
                0126 C     QGLeith code has not been compiled.
                0127       IF ( viscC2LeithQG.NE.zeroRL )  THEN
                0128         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0129      &  'must #define ALLOW_LEITH_QG in MOM_COMMON_OPTIONS.h'
                0130         CALL PRINT_ERROR( msgBuf, myThid )
                0131         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0132      &  ' in order to use QG-Leith (viscC2LeithQG > 0)'
                0133         CALL PRINT_ERROR( msgBuf, myThid )
                0134         errCount = errCount + 1
                0135       ENDIF
                0136 #endif /* ALLOW_LEITH_QG */
                0137 
dc3adfb09b Jean*0138 #ifndef ALLOW_SMAG_3D
                0139       IF ( useSmag3D ) THEN
                0140         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0141      &  'Cannot set useSmag3D=TRUE when compiled with'
                0142         CALL PRINT_ERROR( msgBuf, myThid )
                0143         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0144      &  '"#undef ALLOW_SMAG_3D" in MOM_COMMON_OPTIONS.h'
                0145         CALL PRINT_ERROR( msgBuf, myThid )
                0146         errCount = errCount + 1
                0147       ENDIF
                0148 #endif
2d5bb917cc Jean*0149 #ifndef ALLOW_SMAG_3D_DIFFUSIVITY
                0150       IF ( smag3D_diffCoeff.NE.zeroRL ) THEN
                0151         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0152      &  'Cannot use smag3D_diffCoeff > 0 when compiled with'
                0153         CALL PRINT_ERROR( msgBuf, myThid )
                0154         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0155      &  '"#undef ALLOW_SMAG_3D_DIFFUSIVITY" in CPP_OPTIONS.h'
                0156         CALL PRINT_ERROR( msgBuf, myThid )
                0157         errCount = errCount + 1
                0158       ENDIF
                0159 #endif
dc3adfb09b Jean*0160 
5cd64f209f Jean*0161 #ifndef ALLOW_NONHYDROSTATIC
8dc8e44fac Jean*0162       IF (use3Dsolver) THEN
                0163         WRITE(msgBuf,'(A)')
5cd64f209f Jean*0164      &   'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and'
3c3b37da6e Jean*0165         CALL PRINT_ERROR( msgBuf, myThid )
f9fd562f68 Jean*0166        IF ( implicitIntGravWave ) WRITE(msgBuf,'(A)')
                0167      &   'CONFIG_CHECK: implicitIntGravWave is TRUE'
                0168        IF ( nonHydrostatic ) WRITE(msgBuf,'(A)')
5cd64f209f Jean*0169      &   'CONFIG_CHECK: nonHydrostatic is TRUE'
3c3b37da6e Jean*0170         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0171         errCount = errCount + 1
5cd64f209f Jean*0172       ENDIF
                0173 #endif
                0174 
fdf5fb6af0 Jean*0175 #ifndef ALLOW_QHYD_STAGGER_TS
                0176       IF ( quasiHydrostatic .AND. staggerTimeStep ) THEN
                0177         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0178      &    'Cannot use quasiHydrostatic with staggerTimeStep'
                0179         CALL PRINT_ERROR( msgBuf, myThid )
                0180         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: when compiled ',
                0181      &  'with "#undef ALLOW_QHYD_STAGGER_TS" in CPP_OPTIONS.h'
                0182         CALL PRINT_ERROR( msgBuf, myThid )
                0183         errCount = errCount + 1
                0184       ENDIF
                0185 #endif
                0186 
92aa7be6ff Jean*0187 #ifndef ALLOW_ADAMSBASHFORTH_3
                0188       IF ( alph_AB.NE.UNSET_RL .OR. beta_AB.NE.UNSET_RL ) THEN
                0189         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0190      &   '#undef ALLOW_ADAMSBASHFORTH_3 but alph_AB,beta_AB'
3c3b37da6e Jean*0191         CALL PRINT_ERROR( msgBuf, myThid )
92aa7be6ff Jean*0192         WRITE(msgBuf,'(A,1P2E20.7)')
                0193      &   'CONFIG_CHECK: are set to:',alph_AB,beta_AB
3c3b37da6e Jean*0194         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0195         errCount = errCount + 1
92aa7be6ff Jean*0196       ENDIF
                0197 #endif
                0198 
b9d351b225 Jean*0199 #ifndef INCLUDE_IMPLVERTADV_CODE
8dc8e44fac Jean*0200       IF ( momImplVertAdv ) THEN
                0201         WRITE(msgBuf,'(A)')
b9d351b225 Jean*0202      &   'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
3c3b37da6e Jean*0203         CALL PRINT_ERROR( msgBuf, myThid )
b9d351b225 Jean*0204         WRITE(msgBuf,'(A)')
                0205      &   'CONFIG_CHECK: but momImplVertAdv is TRUE'
3c3b37da6e Jean*0206         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0207         errCount = errCount + 1
b9d351b225 Jean*0208       ENDIF
8dc8e44fac Jean*0209       IF ( tempImplVertAdv ) THEN
                0210         WRITE(msgBuf,'(A)')
b9d351b225 Jean*0211      &   'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
3c3b37da6e Jean*0212         CALL PRINT_ERROR( msgBuf, myThid )
b9d351b225 Jean*0213         WRITE(msgBuf,'(A)')
                0214      &   'CONFIG_CHECK: but tempImplVertAdv is TRUE'
3c3b37da6e Jean*0215         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0216         errCount = errCount + 1
b9d351b225 Jean*0217       ENDIF
8dc8e44fac Jean*0218       IF ( saltImplVertAdv ) THEN
                0219         WRITE(msgBuf,'(A)')
b9d351b225 Jean*0220      &   'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
3c3b37da6e Jean*0221         CALL PRINT_ERROR( msgBuf, myThid )
b9d351b225 Jean*0222         WRITE(msgBuf,'(A)')
                0223      &   'CONFIG_CHECK: but saltImplVertAdv is TRUE'
3c3b37da6e Jean*0224         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0225         errCount = errCount + 1
b9d351b225 Jean*0226       ENDIF
1883875e84 Jean*0227       IF ( dTtracerLev(1).NE.dTtracerLev(Nr) .AND. implicitDiffusion
8dc8e44fac Jean*0228      &     .AND. ( saltStepping .OR. tempStepping .OR. usePTRACERS )
1883875e84 Jean*0229      &   ) THEN
8dc8e44fac Jean*0230         WRITE(msgBuf,'(A)')
1883875e84 Jean*0231      &   'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
3c3b37da6e Jean*0232         CALL PRINT_ERROR( msgBuf, myThid )
1883875e84 Jean*0233         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0234      &   'but implicitDiffusion=T with non-uniform dTtracerLev'
3c3b37da6e Jean*0235         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0236         errCount = errCount + 1
1883875e84 Jean*0237       ENDIF
9e44938df7 Jean*0238       IF ( selectImplicitDrag.GT.0 ) THEN
                0239         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0240      &   'Needs to compile with #define INCLUDE_IMPLVERTADV_CODE'
                0241         CALL PRINT_ERROR( msgBuf, myThid )
                0242         WRITE(msgBuf,'(A)')
                0243      &   'CONFIG_CHECK:  to use selectImplicitDrag > 0 ==> STOP here'
                0244         CALL PRINT_ERROR( msgBuf, myThid )
                0245         errCount = errCount + 1
                0246       ENDIF
                0247 #endif
                0248 
                0249 #ifndef ALLOW_SOLVE4_PS_AND_DRAG
                0250       IF ( selectImplicitDrag.EQ.2 ) THEN
                0251         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0252      &   'Needs to compile with #define ALLOW_SOLVE4_PS_AND_DRAG'
                0253         CALL PRINT_ERROR( msgBuf, myThid )
                0254         WRITE(msgBuf,'(A)')
                0255      &   'CONFIG_CHECK:  to use selectImplicitDrag = 2 ==> STOP here'
                0256         CALL PRINT_ERROR( msgBuf, myThid )
                0257         errCount = errCount + 1
                0258       ENDIF
b9d351b225 Jean*0259 #endif
                0260 
02d90fb24c Jean*0261 #ifdef ALLOW_AUTODIFF
d666da8b50 Gael*0262       IF ( momImplVertAdv ) THEN
                0263         WRITE(msgBuf,'(A)')
                0264      &   'CONFIG_CHECK: momImplVertAdv is not yet'
                0265         CALL PRINT_ERROR( msgBuf, myThid )
                0266         WRITE(msgBuf,'(A)')
                0267      &   'CONFIG_CHECK: supported in adjoint mode'
                0268         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0269         errCount = errCount + 1
d666da8b50 Gael*0270       ENDIF
9e44938df7 Jean*0271       IF ( selectImplicitDrag.GT.0 ) THEN
                0272         WRITE(msgBuf,'(A)')
                0273      &   'CONFIG_CHECK: selectImplicitDrag is not yet'
                0274         CALL PRINT_ERROR( msgBuf, myThid )
                0275         WRITE(msgBuf,'(A)')
                0276      &   'CONFIG_CHECK: supported in adjoint mode'
                0277         CALL PRINT_ERROR( msgBuf, myThid )
                0278         errCount = errCount + 1
                0279       ENDIF
d666da8b50 Gael*0280 #endif
                0281 
88bca52623 Jean*0282 #ifdef ALLOW_DEPTH_CONTROL
                0283       IF ( useOBCS ) THEN
                0284         WRITE(msgBuf,'(A)')
                0285      &   'CONFIG_CHECK: DEPTH_CONTROL code not compatible with OBCS'
                0286         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0287         errCount = errCount + 1
88bca52623 Jean*0288       ENDIF
                0289 #endif
                0290 
5cd64f209f Jean*0291 #ifndef EXACT_CONSERV
8dc8e44fac Jean*0292       IF (exactConserv) THEN
                0293         WRITE(msgBuf,'(A)')
5cd64f209f Jean*0294      &   'CONFIG_CHECK: #undef EXACT_CONSERV and'
3c3b37da6e Jean*0295         CALL PRINT_ERROR( msgBuf, myThid )
5cd64f209f Jean*0296         WRITE(msgBuf,'(A)')
                0297      &   'CONFIG_CHECK: exactConserv is TRUE'
3c3b37da6e Jean*0298         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0299         errCount = errCount + 1
5cd64f209f Jean*0300       ENDIF
                0301 #endif
                0302 
                0303 #ifndef NONLIN_FRSURF
8dc8e44fac Jean*0304       IF (nonlinFreeSurf.NE.0) THEN
                0305         WRITE(msgBuf,'(A)')
5cd64f209f Jean*0306      &   'CONFIG_CHECK: #undef NONLIN_FRSURF and'
3c3b37da6e Jean*0307         CALL PRINT_ERROR( msgBuf, myThid )
5cd64f209f Jean*0308         WRITE(msgBuf,'(A)')
                0309      &   'CONFIG_CHECK: nonlinFreeSurf is non-zero'
3c3b37da6e Jean*0310         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0311         errCount = errCount + 1
5cd64f209f Jean*0312       ENDIF
                0313 #endif
                0314 
a97467b673 Jean*0315 #ifndef NONLIN_FRSURF
                0316       IF (select_rStar .NE. 0) THEN
8dc8e44fac Jean*0317         WRITE(msgBuf,'(A)')
a97467b673 Jean*0318      &   'CONFIG_CHECK: rStar is part of NonLin-FS '
3c3b37da6e Jean*0319         CALL PRINT_ERROR( msgBuf, myThid )
a97467b673 Jean*0320         WRITE(msgBuf,'(A)')
f15994caab Jean*0321      &   'CONFIG_CHECK: ==> set #define NONLIN_FRSURF to use it'
3c3b37da6e Jean*0322         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0323         errCount = errCount + 1
a97467b673 Jean*0324       ENDIF
                0325 #endif /* NONLIN_FRSURF */
                0326 
f15994caab Jean*0327 #ifdef DISABLE_RSTAR_CODE
                0328       IF ( select_rStar.NE.0 ) THEN
                0329         WRITE(msgBuf,'(A)')
                0330      &   'CONFIG_CHECK: rStar code disable (DISABLE_RSTAR_CODE defined)'
                0331         CALL PRINT_ERROR( msgBuf, myThid )
                0332         WRITE(msgBuf,'(A)')
                0333      &   'CONFIG_CHECK: ==> set #undef DISABLE_RSTAR_CODE to use it'
                0334         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0335         errCount = errCount + 1
f15994caab Jean*0336       ENDIF
                0337 #endif /* DISABLE_RSTAR_CODE */
                0338 
                0339 #ifdef DISABLE_SIGMA_CODE
                0340       IF ( selectSigmaCoord.NE.0 ) THEN
                0341         WRITE(msgBuf,'(A)')
                0342      &   'CONFIG_CHECK: Sigma code disable (DISABLE_SIGMA_CODE defined)'
                0343         CALL PRINT_ERROR( msgBuf, myThid )
                0344         WRITE(msgBuf,'(A)')
                0345      &   'CONFIG_CHECK: ==> set #undef DISABLE_SIGMA_CODE to use it'
                0346         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0347         errCount = errCount + 1
f15994caab Jean*0348       ENDIF
                0349 #endif /* DISABLE_SIGMA_CODE */
                0350 
5cd64f209f Jean*0351 #ifdef USE_NATURAL_BCS
8dc8e44fac Jean*0352         WRITE(msgBuf,'(A)')
745a0098ab Jean*0353      &   'CONFIG_CHECK: USE_NATURAL_BCS option has been replaced'
3c3b37da6e Jean*0354         CALL PRINT_ERROR( msgBuf, myThid )
5cd64f209f Jean*0355         WRITE(msgBuf,'(A)')
745a0098ab Jean*0356      &   'CONFIG_CHECK: by useRealFreshWaterFlux=TRUE in data file'
3c3b37da6e Jean*0357         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0358         errCount = errCount + 1
745a0098ab Jean*0359 #endif
                0360 
6c944fd806 Jean*0361 #ifndef ALLOW_ADDFLUID
                0362       IF ( selectAddFluid.NE.0 ) THEN
                0363         WRITE(msgBuf,'(A)')
db8d49beca Jean*0364      &   'CONFIG_CHECK: #undef ALLOW_ADDFLUID (CPP_OPTIONS.h) and'
6c944fd806 Jean*0365         CALL PRINT_ERROR( msgBuf, myThid )
                0366         WRITE(msgBuf,'(A,I4,A)') 'CONFIG_CHECK: selectAddFluid=',
                0367      &                           selectAddFluid, ' is not zero'
                0368         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0369         errCount = errCount + 1
6c944fd806 Jean*0370       ENDIF
                0371 #endif /* ALLOW_ADDFLUID */
                0372 
463053c692 Jean*0373 C     o If pLoadFile is set, then we should make sure the corresponing
                0374 C       code is being compiled
                0375 #ifndef ATMOSPHERIC_LOADING
                0376       IF (pLoadFile.NE.' ') THEN
                0377         WRITE(msgBuf,'(A)')
                0378      &  'CONFIG_CHECK: pLoadFile is set but you have not'
3c3b37da6e Jean*0379         CALL PRINT_ERROR( msgBuf, myThid )
463053c692 Jean*0380         WRITE(msgBuf,'(A)')
db8d49beca Jean*0381      &  ' compiled the model with the pressure loading code.'
3c3b37da6e Jean*0382         CALL PRINT_ERROR( msgBuf, myThid )
f4db9965d8 Jean*0383         WRITE(msgBuf,'(A)')
db8d49beca Jean*0384      &  ' Re-compile with: "#define ATMOSPHERIC_LOADING"'
3c3b37da6e Jean*0385         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0386         errCount = errCount + 1
f4db9965d8 Jean*0387       ENDIF
                0388       IF ( useRealFreshWaterFlux .AND. useThSIce ) THEN
                0389         WRITE(msgBuf,'(A)')
                0390      &  'CONFIG_CHECK: sIceLoad is computed but'
3c3b37da6e Jean*0391         CALL PRINT_ERROR( msgBuf, myThid )
f4db9965d8 Jean*0392         WRITE(msgBuf,'(A)')
db8d49beca Jean*0393      &  ' pressure loading code is not compiled.'
3c3b37da6e Jean*0394         CALL PRINT_ERROR( msgBuf, myThid )
f4db9965d8 Jean*0395         WRITE(msgBuf,'(A)')
db8d49beca Jean*0396      &  ' Re-compile with: "#define ATMOSPHERIC_LOADING"'
                0397         CALL PRINT_ERROR( msgBuf, myThid )
                0398         errCount = errCount + 1
                0399       ENDIF
                0400 #endif
                0401 
59b35dd864 Jean*0402       IF ( geothermalFile.NE.' ' ) THEN
                0403 C     o Need to use S/R APPLY_FORCING_T to get Geothermal forcing
                0404 #ifdef USE_OLD_EXTERNAL_FORCING
                0405         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0406      &  'geothermalFile is set but Geothermal-Flux code'
                0407         CALL PRINT_ERROR( msgBuf, myThid )
                0408         WRITE(msgBuf,'(2A)')' is missing.',
                0409      &  ' Re-compile with "#undef USE_OLD_EXTERNAL_FORCING"'
                0410         CALL PRINT_ERROR( msgBuf, myThid )
                0411         errCount = errCount + 1
                0412 #endif /* USE_OLD_EXTERNAL_FORCING */
aaea5aaeec Jean*0413 C     o Need to define ALLOW_GEOTHERMAL_FLUX to use geothermalFile forcing
                0414 #ifndef ALLOW_GEOTHERMAL_FLUX
                0415         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0416      &  'geothermalFile is set but Geothermal-Flux code'
                0417         CALL PRINT_ERROR( msgBuf, myThid )
                0418         WRITE(msgBuf,'(2A)')' is not compiled.',
                0419      &  ' Re-compile with "#define ALLOW_GEOTHERMAL_FLUX"'
                0420         CALL PRINT_ERROR( msgBuf, myThid )
                0421         errCount = errCount + 1
                0422 #endif /* ALLOW_GEOTHERMAL_FLUX */
59b35dd864 Jean*0423       ENDIF
                0424 
                0425 C     o Need to use S/R APPLY_FORCING_U,V to get Tidal forcing
                0426 #ifdef USE_OLD_EXTERNAL_FORCING
                0427       IF ( momTidalForcing ) THEN
                0428         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0429      &  'momTidalForcing is set but Tidal forcing code'
                0430         CALL PRINT_ERROR( msgBuf, myThid )
                0431         WRITE(msgBuf,'(2A)')' is missing.',
                0432      &  ' Re-compile with "#undef USE_OLD_EXTERNAL_FORCING"'
                0433         CALL PRINT_ERROR( msgBuf, myThid )
                0434         errCount = errCount + 1
                0435       ENDIF
                0436 #endif /* USE_OLD_EXTERNAL_FORCING */
aaea5aaeec Jean*0437 
db8d49beca Jean*0438 #ifndef ALLOW_FRICTION_HEATING
                0439       IF ( addFrictionHeating ) THEN
                0440         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: addFrictionHeating=T',
                0441      &  ' but FRICTIONAL_HEATING code is not compiled.'
                0442         CALL PRINT_ERROR( msgBuf, myThid )
                0443         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Re-compile with:',
                0444      &   ' "#define ALLOW_FRICTION_HEATING" (CPP_OPTIONS.h)'
3c3b37da6e Jean*0445         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0446         errCount = errCount + 1
463053c692 Jean*0447       ENDIF
                0448 #endif
                0449 
7e00d7e8f9 Jean*0450 #ifdef ALLOW_BALANCE_FLUXES
                0451       IF ( selectBalanceEmPmR.LT.0 .OR. selectBalanceEmPmR.GT.2 ) THEN
                0452         WRITE(msgBuf,'(2A,I6,A)') 'CONFIG_CHECK: ',
                0453      &   'selectBalanceEmPmR=', selectBalanceEmPmR,' : invalid value'
                0454         CALL PRINT_ERROR( msgBuf, myThid )
                0455         errCount = errCount + 1
                0456       ENDIF
                0457 #else /* ALLOW_BALANCE_FLUXES */
                0458       IF ( selectBalanceEmPmR.NE.0 .OR. balanceQnet ) THEN
2e21c62c84 Mart*0459         WRITE(msgBuf,'(A,A)')
                0460      &  'CONFIG_CHECK: balanceEmPmR/Qnet is set but balance code ',
                0461      &  'is not compiled.'
3c3b37da6e Jean*0462         CALL PRINT_ERROR( msgBuf, myThid )
db8d49beca Jean*0463         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0464      &  'Re-compile with:  ALLOW_BALANCE_FLUXES defined'
3c3b37da6e Jean*0465         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0466         errCount = errCount + 1
fc64655a31 Dimi*0467       ENDIF
7e00d7e8f9 Jean*0468 #endif /* ALLOW_BALANCE_FLUXES */
fc64655a31 Dimi*0469 
9e3a303fa3 Gael*0470 #ifndef ALLOW_BALANCE_RELAX
                0471       IF (balanceThetaClimRelax .OR. balanceSaltClimRelax) THEN
                0472         WRITE(msgBuf,'(A,A)')
                0473      &  'CONFIG_CHECK: balanceTheta/SaltClimRelax is set ',
                0474      &  'but balance code is not compiled.'
                0475         CALL PRINT_ERROR( msgBuf, myThid )
db8d49beca Jean*0476         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
9e3a303fa3 Gael*0477      &  'Re-compile with  ALLOW_BALANCE_RELAX defined'
                0478         CALL PRINT_ERROR( msgBuf, myThid )
                0479         errCount = errCount + 1
                0480       ENDIF
                0481 #endif
                0482 
aecc8b0f47 Mart*0483 #ifndef ALLOW_CG2D_NSA
                0484       IF (useNSACGSolver) THEN
                0485         WRITE(msgBuf,'(A,A)')
                0486      &  'CONFIG_CHECK: useNSACGSolver = .TRUE., but CG2D_NSA ',
                0487      &  'code is not compiled.'
                0488         CALL PRINT_ERROR( msgBuf, myThid )
                0489         WRITE(msgBuf,'(A)')
                0490      &  'CONFIG_CHECK: Re-compile with ALLOW_CG2D_NSA defined'
                0491         CALL PRINT_ERROR( msgBuf, myThid )
                0492         errCount = errCount + 1
                0493       ENDIF
                0494 #endif /* ALLOW_CG2D_NSA */
                0495 
c26312e441 Mart*0496 #ifndef ALLOW_SRCG
                0497       IF (useSRCGSolver) THEN
                0498         WRITE(msgBuf,'(A,A)')
                0499      &  'CONFIG_CHECK: useSRCGSolver = .TRUE., but single reduction ',
                0500      &  'code is not compiled.'
3c3b37da6e Jean*0501         CALL PRINT_ERROR( msgBuf, myThid )
c26312e441 Mart*0502         WRITE(msgBuf,'(A)')
                0503      &  'CONFIG_CHECK: Re-compile with ALLOW_SRCG defined'
3c3b37da6e Jean*0504         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0505         errCount = errCount + 1
c26312e441 Mart*0506       ENDIF
                0507 #endif /* ALLOW_SRCG */
                0508 
ab47de63dc Mart*0509 #ifndef ALLOW_BOTTOMDRAG_ROUGHNESS
                0510       IF (zRoughBot .GT. 0.) THEN
                0511         WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: zRoughBot > 0.',
                0512      &  ' but bottom drag code for roughness length is not compiled'
                0513         CALL PRINT_ERROR( msgBuf, myThid )
                0514         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Re-compile with',
                0515      &  ' #define ALLOW_BOTTOMDRAG_ROUGHNESS (MOM_COMMON_OPTIONS.h)'
                0516         CALL PRINT_ERROR( msgBuf, myThid )
                0517         errCount = errCount + 1
                0518       ENDIF
                0519 #endif /* ALLOW_BOTTOMDRAG_ROUGHNESS */
                0520 
aecc8b0f47 Mart*0521       IF ( useNSACGSolver .AND. useSRCGSolver ) THEN
                0522         WRITE(msgBuf,'(A,A)')
                0523      &      'CONFIG_CHECK: both useNSACGSolver and ',
                0524      &      'useSRCGSolver = .TRUE., this is not allowed.'
                0525         CALL PRINT_ERROR( msgBuf, myThid )
                0526         errCount = errCount + 1
                0527       ENDIF
                0528 
745a0098ab Jean*0529 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0530 
c7ad17745a Jean*0531 C--   Check parameter consistency :
745a0098ab Jean*0532 
aa6b2555c8 Jean*0533       IF ( ( OLx.LT.2 .OR. OLy.LT.2 ) .AND. momStepping ) THEN
                0534 C-    Current algorithm (solve_for_pressure, RHS) prevents to use
                0535 C     momAdvection or viscAh > 0 with OLx,y=1 ; it should still allow us
                0536 C     to use OLx,y=1 when momAdvection=F and viscAh=0 but some loop range
                0537 C     in few momentum S/R are not carefully set to support this.
                0538         WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: Cannot use momStepping',
                0539      &  ' with overlap (OLx,OLy) smaller than 2'
                0540         CALL PRINT_ERROR( msgBuf, myThid )
                0541         errCount = errCount + 1
                0542       ENDIF
7be5c07bb8 Jean*0543       IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND.
5f70aa61cc Jean*0544      &     ( viscC4leithD.NE.0.  .OR. viscC4leith.NE.0.
                0545      &     .OR. viscC4smag.NE.0. .OR. viscA4Grid.NE.0.
                0546      &     .OR. viscA4D.NE.0.    .OR. viscA4Z.NE.0. ) ) THEN
a67f2474bd Jean*0547         WRITE(msgBuf,'(A,A)')
                0548      &  'CONFIG_CHECK: cannot use Biharmonic Visc. (viscA4) with',
7be5c07bb8 Jean*0549      &  ' overlap (OLx,OLy) smaller than 3'
3c3b37da6e Jean*0550         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0551         errCount = errCount + 1
46979d29da Jean*0552       ENDIF
7be5c07bb8 Jean*0553       IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND.
f59d76b0dd Ed D*0554      &     ( viscC2leithD.NE.0. .OR. viscC4leithD.NE.0. .OR.
                0555      &       viscC2LeithQG.NE.0.)
5f70aa61cc Jean*0556      &   ) THEN
                0557         WRITE(msgBuf,'(A,A)')
f59d76b0dd Ed D*0558      &  'CONFIG_CHECK: cannot use Leith Visc.(div.part or QG) with',
7be5c07bb8 Jean*0559      &  ' overlap (OLx,OLy) smaller than 3'
3c3b37da6e Jean*0560         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0561         errCount = errCount + 1
46979d29da Jean*0562       ENDIF
2253ef4483 Jean*0563       IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND.
                0564      &     useSmag3D .AND. useCDscheme ) THEN
                0565         WRITE(msgBuf,'(A,A)')
                0566      &  'CONFIG_CHECK: cannot use Smag-3D + CD-scheme with',
                0567      &  ' overlap (OLx,OLy) smaller than 3'
                0568         CALL PRINT_ERROR( msgBuf, myThid )
                0569         errCount = errCount + 1
                0570       ENDIF
a67f2474bd Jean*0571 
f59d76b0dd Ed D*0572       IF ( ( viscC4leithD.NE.0. .OR. viscC4leith.NE.0. .OR.
                0573      &       viscC2leithD.NE.0. .OR. viscC2leith.NE.0.)
                0574      &     .AND. (viscC2LeithQG.NE.0) ) THEN
                0575         WRITE(msgBuf,'(A,A)')
                0576      &  'CONFIG_CHECK: cannot use LeithQG in conjunction with',
                0577      &  ' either standard Leith or LeithD'
                0578         CALL PRINT_ERROR( msgBuf, myThid )
                0579         errCount = errCount + 1
                0580       ENDIF
                0581 
402fba1a12 Jean*0582 #ifndef DISCONNECTED_TILES
                0583 C     Overlaps cannot be larger than interior tile except for special cases
5a05fd524d Mart*0584       IF ( sNx.LT.OLx ) THEN
                0585 #ifdef ALLOW_EXCH2
                0586        WRITE(msgBuf,'(A)')
                0587      &  'CONFIG_CHECK: sNx<OLx not allowed with ALLOW_EXCH2 defined'
                0588        CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0589         errCount = errCount + 1
5a05fd524d Mart*0590 #endif /* ALLOW_EXCH2 */
                0591        IF ( Nx.NE.1 ) THEN
                0592         WRITE(msgBuf,'(A)')
                0593      &  'CONFIG_CHECK: sNx<OLx not allowed unless Nx=1'
                0594         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0595         errCount = errCount + 1
5a05fd524d Mart*0596        ENDIF
                0597       ENDIF
                0598       IF ( sNy.LT.OLy ) THEN
                0599 #ifdef ALLOW_EXCH2
                0600        WRITE(msgBuf,'(A)')
                0601      &  'CONFIG_CHECK: sNy<OLy not allowed with ALLOW_EXCH2 defined'
                0602        CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0603         errCount = errCount + 1
5a05fd524d Mart*0604 #endif /* ALLOW_EXCH2 */
                0605        IF ( Ny.NE.1 ) THEN
                0606         WRITE(msgBuf,'(A)')
                0607      &  'CONFIG_CHECK: sNy<OLy not allowed unless Ny=1'
                0608         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0609         errCount = errCount + 1
5a05fd524d Mart*0610        ENDIF
                0611       ENDIF
402fba1a12 Jean*0612 #endif /* ndef DISCONNECTED_TILES */
5a05fd524d Mart*0613 
6ef71429db Jean*0614 C--   Gravity vertical profile limitations:
                0615       IF ( usingPCoords .AND. gravityFile .NE. ' ' ) THEN
                0616         WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: Variable gravity',
                0617      &  ' not yet implemented for P-coordinate'
                0618         CALL PRINT_ERROR( msgBuf, myThid )
                0619         errCount = errCount + 1
                0620       ENDIF
                0621       IF ( select_rStar.NE.0 .AND. gravityFile .NE. ' ' ) THEN
                0622         WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: Variable gravity',
                0623      &  ' not yet implemented with rStar'
                0624         CALL PRINT_ERROR( msgBuf, myThid )
                0625         errCount = errCount + 1
                0626       ENDIF
                0627 
c7ad17745a Jean*0628 C--   Deep-Atmosphere & Anelastic limitations:
8dc8e44fac Jean*0629       IF ( deepAtmosphere .AND.
                0630      &     useRealFreshWaterFlux .AND. usingPCoords ) THEN
                0631         WRITE(msgBuf,'(A,A)')
                0632      &  'CONFIG_CHECK: Deep-Atmosphere not yet implemented with',
                0633      &  ' real-Fresh-Water option in P-coordinate'
3c3b37da6e Jean*0634         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0635         errCount = errCount + 1
8dc8e44fac Jean*0636       ENDIF
                0637       IF ( select_rStar.NE.0 .AND.
                0638      &        ( deepAtmosphere .OR.
                0639      &          usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN
                0640         WRITE(msgBuf,'(A,A)')
                0641      &  'CONFIG_CHECK: Deep-Atmosphere or Anelastic',
                0642      &  ' not yet implemented with rStar'
3c3b37da6e Jean*0643         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0644         errCount = errCount + 1
8dc8e44fac Jean*0645       ENDIF
                0646 
c7ad17745a Jean*0647 C--   Free-surface related limitations:
b46f9da188 Jean*0648       IF ( cg2dUseMinResSol.LT.0 .OR. cg2dUseMinResSol.GT.1 ) THEN
                0649         WRITE(msgBuf,'(A,I10,A)')
                0650      &   'CONFIG_CHECK: cg2dUseMinResSol set to unvalid value(=',
                0651      &                  cg2dUseMinResSol, ')'
                0652         CALL PRINT_ERROR( msgBuf, myThid )
                0653         errCount = errCount + 1
                0654       ENDIF
                0655 
745a0098ab Jean*0656       IF ( rigidLid .AND. implicitFreeSurface ) THEN
                0657         WRITE(msgBuf,'(A,A)')
                0658      &  'CONFIG_CHECK: Cannot select both implicitFreeSurface',
                0659      &  ' and rigidLid.'
3c3b37da6e Jean*0660         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0661         errCount = errCount + 1
46979d29da Jean*0662       ENDIF
745a0098ab Jean*0663 
                0664       IF (rigidLid .AND. exactConserv) THEN
8dc8e44fac Jean*0665         WRITE(msgBuf,'(A)')
745a0098ab Jean*0666      &   'CONFIG_CHECK: exactConserv not compatible with'
3c3b37da6e Jean*0667         CALL PRINT_ERROR( msgBuf, myThid )
5cd64f209f Jean*0668         WRITE(msgBuf,'(A)')
745a0098ab Jean*0669      &   'CONFIG_CHECK: rigidLid (meaningless in that case)'
3c3b37da6e Jean*0670         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0671         errCount = errCount + 1
5cd64f209f Jean*0672       ENDIF
                0673 
1e6181f584 Davi*0674       IF ( linFSConserveTr .AND. nonlinFreeSurf.NE.0 ) THEN
                0675         WRITE(msgBuf,'(A)')
                0676      &   'CONFIG_CHECK: Cannot select both a Nonlinear Free Surf.'
3c3b37da6e Jean*0677         CALL PRINT_ERROR( msgBuf, myThid )
1e6181f584 Davi*0678         WRITE(msgBuf,'(A)')
                0679      &   'CONFIG_CHECK: and Tracer Correction of Lin. Free Surf.'
3c3b37da6e Jean*0680         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0681         errCount = errCount + 1
1e6181f584 Davi*0682       ENDIF
                0683 
745a0098ab Jean*0684       IF (rigidLid .AND. useRealFreshWaterFlux) THEN
8dc8e44fac Jean*0685         WRITE(msgBuf,'(A)')
745a0098ab Jean*0686      &   'CONFIG_CHECK: useRealFreshWaterFlux not compatible with'
3c3b37da6e Jean*0687         CALL PRINT_ERROR( msgBuf, myThid )
5cd64f209f Jean*0688         WRITE(msgBuf,'(A)')
                0689      &   'CONFIG_CHECK: rigidLid (meaningless in that case)'
3c3b37da6e Jean*0690         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0691         errCount = errCount + 1
5cd64f209f Jean*0692       ENDIF
                0693 
                0694       IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN
8dc8e44fac Jean*0695         WRITE(msgBuf,'(A)')
5cd64f209f Jean*0696      &   'CONFIG_CHECK: nonlinFreeSurf cannot be used'
3c3b37da6e Jean*0697         CALL PRINT_ERROR( msgBuf, myThid )
5cd64f209f Jean*0698         WRITE(msgBuf,'(A)')
                0699      &   'CONFIG_CHECK: without exactConserv'
3c3b37da6e Jean*0700         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0701         errCount = errCount + 1
5cd64f209f Jean*0702       ENDIF
                0703 
ef891516b3 Jean*0704       IF (select_rStar.NE.0 .AND. .NOT.exactConserv) THEN
8dc8e44fac Jean*0705         WRITE(msgBuf,'(A)')
ef891516b3 Jean*0706      &   'CONFIG_CHECK: r* Coordinate cannot be used'
3c3b37da6e Jean*0707         CALL PRINT_ERROR( msgBuf, myThid )
ef891516b3 Jean*0708         WRITE(msgBuf,'(A)')
                0709      &   'CONFIG_CHECK: without exactConserv'
3c3b37da6e Jean*0710         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0711         errCount = errCount + 1
ef891516b3 Jean*0712       ENDIF
                0713 
98b6d5abd6 Jean*0714       IF ( select_rStar.GE.1 .AND. nonlinFreeSurf.LE.0 ) THEN
                0715         WRITE(msgBuf,'(2A,I3,A)') 'CONFIG_CHECK: r* Coordinate',
                0716      &   ' (select_rStar=', select_rStar, ' ) cannot be used'
                0717         CALL PRINT_ERROR( msgBuf, myThid )
                0718         WRITE(msgBuf,'(2A,I3,A)') 'CONFIG_CHECK: ',
                0719      &   ' with Linear FreeSurf (nonlinFreeSurf=', nonlinFreeSurf,' )'
                0720         CALL PRINT_ERROR( msgBuf, myThid )
                0721         errCount = errCount + 1
                0722       ENDIF
4227e4b9a3 Jean*0723       IF ( select_rStar.EQ.2 .AND. nonlinFreeSurf.NE.4 ) THEN
                0724 C-    not consistent to account for the slope of the coordinate when
                0725 C     ignoring the variations of level-thickness in PhiHyd calculation;
                0726 C     for now, issue a warning (but might change the code later on):
                0727         WRITE(msgBuf,'(2A,I3)') '** WARNING ** CONFIG_CHECK: ',
                0728      &   'select_rStar=2 not right with nonlinFreeSurf=', nonlinFreeSurf
                0729         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0730      &                      SQUEEZE_RIGHT, myThid )
                0731       ENDIF
98b6d5abd6 Jean*0732 
f15994caab Jean*0733       IF ( selectSigmaCoord.NE.0 ) THEN
                0734        IF ( fluidIsWater ) THEN
                0735         WRITE(msgBuf,'(A)')
                0736      &   'CONFIG_CHECK: Sigma-Coords not yet coded for Oceanic set-up'
                0737         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0738         errCount = errCount + 1
f15994caab Jean*0739        ENDIF
                0740        IF ( nonlinFreeSurf.LE.0 ) THEN
                0741         WRITE(msgBuf,'(A)')
                0742      &   'CONFIG_CHECK: Sigma-Coords not coded for Lin-FreeSurf'
                0743         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0744         errCount = errCount + 1
f15994caab Jean*0745        ENDIF
                0746        IF (select_rStar.NE.0 ) THEN
                0747         WRITE(msgBuf,'(A)')
                0748      &   'CONFIG_CHECK: Sigma-Coords and rStar are not compatible'
                0749         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0750         errCount = errCount + 1
f15994caab Jean*0751        ENDIF
                0752         WRITE(msgBuf,'(A)')
                0753      &   'CONFIG_CHECK: Sigma-Coords code neither complete nor tested'
                0754         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0755      &                      SQUEEZE_RIGHT, myThid )
                0756       ENDIF
                0757 
ff02675122 Jean*0758 C- note : not implemented in checkpoint48b but it is done now (since 01-28-03)
87a066093f Jean*0759 c     IF (select_rStar.GT.0 .AND. useOBCS ) THEN
                0760 c       STOP 'ABNORMAL END: S/R CONFIG_CHECK'
                0761 c     ENDIF
5cd64f209f Jean*0762 
8dc8e44fac Jean*0763       IF ( nonlinFreeSurf.NE.0 .AND.
db8d49beca Jean*0764      &     deltaTFreeSurf.NE.dTtracerLev(1) ) THEN
3c3b37da6e Jean*0765         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0766      &                       'nonlinFreeSurf might cause problems'
463053c692 Jean*0767         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0768      &                      SQUEEZE_RIGHT, myThid )
                0769         WRITE(msgBuf,'(2A)') '** WARNING ** ',
                0770      &               'with different FreeSurf & Tracer time-steps'
463053c692 Jean*0771         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0772      &                      SQUEEZE_RIGHT, myThid )
745a0098ab Jean*0773       ENDIF
                0774 
f4db9965d8 Jean*0775       IF ( useRealFreshWaterFlux .AND. exactConserv
228881fcf1 Jean*0776      &     .AND. implicDiv2DFlow.EQ.0. _d 0
51d88069bf Jean*0777      &     .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN
8dc8e44fac Jean*0778         WRITE(msgBuf,'(A)')
745a0098ab Jean*0779      &   'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:'
3c3b37da6e Jean*0780         CALL PRINT_ERROR( msgBuf, myThid )
745a0098ab Jean*0781         WRITE(msgBuf,'(A)')
                0782      &   'CONFIG_CHECK: restart not implemented in this config'
3c3b37da6e Jean*0783         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0784         errCount = errCount + 1
745a0098ab Jean*0785       ENDIF
                0786 
8dc8e44fac Jean*0787       IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv
228881fcf1 Jean*0788      &     .AND. implicDiv2DFlow.NE.1. ) THEN
3c3b37da6e Jean*0789         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
228881fcf1 Jean*0790      &   'RealFreshWater & implicDiv2DFlow < 1'
f4db9965d8 Jean*0791         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0792      &                      SQUEEZE_RIGHT, myThid )
                0793         WRITE(msgBuf,'(2A)') '** WARNING ** works better',
f4db9965d8 Jean*0794      &   ' with exactConserv=.T. (+ #define EXACT_CONSERV)'
                0795         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0796      &                      SQUEEZE_RIGHT, myThid )
f4db9965d8 Jean*0797       ENDIF
                0798 
                0799 #ifdef EXACT_CONSERV
463053c692 Jean*0800       IF (useRealFreshWaterFlux .AND. .NOT.exactConserv
                0801      &            .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
8dc8e44fac Jean*0802         WRITE(msgBuf,'(A)')
463053c692 Jean*0803      &   'CONFIG_CHECK: RealFreshWaterFlux with OCEANICP'
3c3b37da6e Jean*0804         CALL PRINT_ERROR( msgBuf, myThid )
463053c692 Jean*0805         WRITE(msgBuf,'(A)')
                0806      &   'CONFIG_CHECK: requires exactConserv=T'
3c3b37da6e Jean*0807         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0808         errCount = errCount + 1
463053c692 Jean*0809       ENDIF
                0810 #else
                0811       IF (useRealFreshWaterFlux
                0812      &            .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
3c3b37da6e Jean*0813         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0814      &               'E-P effects on wVel are not included'
463053c692 Jean*0815         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0816      &                      SQUEEZE_RIGHT, myThid )
                0817         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0818      &               '==> use #define EXACT_CONSERV to fix it'
463053c692 Jean*0819         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0820      &                      SQUEEZE_RIGHT, myThid )
463053c692 Jean*0821       ENDIF
f4db9965d8 Jean*0822 #endif /* EXACT_CONSERV */
0870c568ac Jean*0823 
6c944fd806 Jean*0824       IF ( selectAddFluid.LT.-1 .OR. selectAddFluid.GT.2 ) THEN
                0825         WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: selectAddFluid=',
                0826      &                             selectAddFluid, ' not allowed'
3c3b37da6e Jean*0827         CALL PRINT_ERROR( msgBuf, myThid )
6c944fd806 Jean*0828         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0829      &       'should be =0 (Off), 1,2 (Add Mass) or -1 (Virtual Flux)'
3c3b37da6e Jean*0830         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0831         errCount = errCount + 1
6c944fd806 Jean*0832       ENDIF
                0833       IF ( selectAddFluid.GE.1 .AND. rigidLid ) THEN
                0834         WRITE(msgBuf,'(A)')
                0835      &   'CONFIG_CHECK: selectAddFluid > 0 not compatible with'
3c3b37da6e Jean*0836         CALL PRINT_ERROR( msgBuf, myThid )
6c944fd806 Jean*0837         WRITE(msgBuf,'(A)')
                0838      &   'CONFIG_CHECK: rigidLid (meaningless in that case)'
3c3b37da6e Jean*0839         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0840         errCount = errCount + 1
6c944fd806 Jean*0841       ENDIF
                0842       IF ( selectAddFluid.GE.1 .AND. .NOT.staggerTimeStep ) THEN
3c3b37da6e Jean*0843         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0844      &   'synchronous time-stepping =>'
6c944fd806 Jean*0845         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0846      &                      SQUEEZE_RIGHT, myThid )
                0847         WRITE(msgBuf,'(2A)') '** WARNING ** ',
6c944fd806 Jean*0848      &   '1 time-step mismatch in AddFluid effects on T & S'
                0849         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
3c3b37da6e Jean*0850      &                      SQUEEZE_RIGHT, myThid )
                0851       ENDIF
                0852 
898305944e Jean*0853 C--   Pressure calculation and pressure gradient:
                0854 #ifndef INCLUDE_PHIHYD_CALCULATION_CODE
6ef71429db Jean*0855       IF ( momPressureForcing .OR. storePhiHyd4Phys ) THEN
898305944e Jean*0856         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0857      &   'missing code to calculate pressure (totPhiHyd)'
                0858         CALL PRINT_ERROR( msgBuf, myThid )
                0859         errCount = errCount + 1
                0860       ENDIF
                0861 #endif /* INCLUDE_PHIHYD_CALCULATION_CODE */
6ef71429db Jean*0862       IF ( storePhiHyd4Phys .AND. .NOT.momStepping ) THEN
898305944e Jean*0863         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
6ef71429db Jean*0864      &   'storePhiHyd4Phys = TRUE but pressure is not computed'
898305944e Jean*0865         CALL PRINT_ERROR( msgBuf, myThid )
                0866         errCount = errCount + 1
                0867       ENDIF
                0868 
3c3b37da6e Jean*0869 C--   Non-hydrostatic and 3-D solver related limitations:
                0870       IF (nonlinFreeSurf.NE.0 .AND. use3Dsolver) THEN
                0871         WRITE(msgBuf,'(A)')
                0872      &   'CONFIG_CHECK: nonlinFreeSurf not yet implemented'
                0873         CALL PRINT_ERROR( msgBuf, myThid )
                0874         WRITE(msgBuf,'(A)')
                0875      &   'CONFIG_CHECK: in nonHydrostatic code'
                0876         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0877         errCount = errCount + 1
3c3b37da6e Jean*0878       ENDIF
                0879 
228881fcf1 Jean*0880       IF ( implicitNHPress*implicSurfPress*implicDiv2DFlow.NE.1.
3c3b37da6e Jean*0881      &     .AND. implicitIntGravWave ) THEN
                0882         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: implicitIntGravWave',
                0883      &    ' NOT SAFE with non-fully implicit solver'
                0884         CALL PRINT_ERROR( msgBuf, myThid )
                0885         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: To by-pass this',
                0886      &    'STOP, comment this test and re-compile config_check'
                0887         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0888         errCount = errCount + 1
3c3b37da6e Jean*0889       ENDIF
228881fcf1 Jean*0890       IF ( implicitNHPress*implicSurfPress*implicDiv2DFlow.EQ.0.
                0891      &     .AND. nonHydrostatic ) THEN
                0892         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0893      &   'Needs non-zero implicit factors (i.e., implicitNHPress,'
                0894         CALL PRINT_ERROR( msgBuf, myThid )
                0895         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0896      &   ' implicSurfPress & implicDiv2DFlow) to run nonHydrostatic'
                0897         CALL PRINT_ERROR( msgBuf, myThid )
                0898         errCount = errCount + 1
                0899       ENDIF
3c3b37da6e Jean*0900       IF ( nonHydrostatic .AND. .NOT.exactConserv
228881fcf1 Jean*0901      &     .AND. implicDiv2DFlow.NE.1. ) THEN
3c3b37da6e Jean*0902         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Needs exactConserv=T',
228881fcf1 Jean*0903      &               ' for nonHydrostatic with implicDiv2DFlow < 1'
3c3b37da6e Jean*0904         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0905         errCount = errCount + 1
3c3b37da6e Jean*0906       ENDIF
                0907       IF ( nonHydrostatic .AND.
                0908      &     implicitNHPress.NE.implicSurfPress ) THEN
                0909         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
9e44938df7 Jean*0910      &               'nonHydrostatic might cause problems with'
3c3b37da6e Jean*0911         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0912      &                      SQUEEZE_RIGHT, myThid )
                0913         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0914      &               'different implicitNHPress & implicSurfPress'
                0915         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0916      &                      SQUEEZE_RIGHT, myThid )
                0917       ENDIF
                0918 
9e44938df7 Jean*0919       IF ( selectImplicitDrag.EQ.2 .AND. use3Dsolver ) THEN
                0920         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: selectImplicitDrag=2',
                0921      &               ' not compatible with 3-D Press. solver'
                0922         CALL PRINT_ERROR( msgBuf, myThid )
                0923         errCount = errCount + 1
                0924       ENDIF
                0925 
3c3b37da6e Jean*0926       IF ( implicitViscosity .AND. use3Dsolver ) THEN
                0927         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0928      &    'Implicit viscosity applies to provisional u,vVel'
                0929         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0930      &                      SQUEEZE_RIGHT, myThid )
                0931         WRITE(msgBuf,'(2A)') '** WARNING ** => not consistent with',
4c3e5a1532 Jean*0932      &    ' final vertical shear (after appling 3-D solver solution'
3c3b37da6e Jean*0933         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0934      &                      SQUEEZE_RIGHT, myThid )
                0935       ENDIF
                0936       IF ( implicitViscosity .AND. nonHydrostatic ) THEN
                0937         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0938      &    'Implicit viscosity not implemented in CALC_GW'
                0939         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0940      &                      SQUEEZE_RIGHT, myThid )
                0941         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0942      &    'Explicit viscosity might become unstable if too large'
                0943         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0944      &                      SQUEEZE_RIGHT, myThid )
6c944fd806 Jean*0945       ENDIF
                0946 
c7ad17745a Jean*0947 C--   Momentum related limitations:
7fe6343684 Jean*0948       IF ( vectorInvariantMomentum.AND.momStepping ) THEN
                0949        IF ( highOrderVorticity.AND.upwindVorticity ) THEN
                0950         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0951      &   '"highOrderVorticity" conflicts with "upwindVorticity"'
3c3b37da6e Jean*0952         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0953         errCount = errCount + 1
7fe6343684 Jean*0954        ENDIF
                0955       ENDIF
51a413ac3c Jean*0956       IF ( .NOT.vectorInvariantMomentum .AND. momAdvection ) THEN
                0957        IF ( usingCurvilinearGrid ) THEN
                0958         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                0959      &       'missing metric-terms for CurvilinearGrid'
                0960         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                0961      &                      SQUEEZE_RIGHT, myThid )
                0962        ENDIF
                0963        IF ( hasWetCSCorners ) THEN
                0964         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momAdvection ',
                0965      &   'in flux-form is wrong on CubedSphere grid (corners)'
                0966         CALL PRINT_ERROR( msgBuf, myThid )
                0967         errCount = errCount + 1
                0968        ENDIF
                0969       ENDIF
dfc353d300 Jean*0970       IF ( selectCoriMap.LT.0 .OR. selectCoriMap.GT.3 ) THEN
                0971         WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ',
                0972      &       'Invalid option: selectCoriMap=', selectCoriMap
                0973         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*0974         errCount = errCount + 1
dfc353d300 Jean*0975       ENDIF
f9ef55fa0c Jean*0976       IF ( selectBotDragQuadr.LT.-1 .OR. selectBotDragQuadr.GT.2 ) THEN
                0977         WRITE(msgBuf,'(2A,I8,A)') 'CONFIG_CHECK: ',
                0978      &       'selectBotDragQuadr=', selectBotDragQuadr,
                0979      &       ' not valid (-1,0,1,2)'
                0980         CALL PRINT_ERROR( msgBuf, myThid )
                0981         errCount = errCount + 1
                0982       ENDIF
dc3adfb09b Jean*0983       IF ( useSmag3D .AND.
                0984      &    ( usingPCoords .OR. deepAtmosphere .OR. selectSigmaCoord.NE.0
                0985      &                   .OR. rhoRefFile.NE.' ' .OR. hasWetCSCorners )
                0986      &   ) THEN
                0987         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
                0988      &       'Smag-3D not yet implemented for this set-up'
                0989         CALL PRINT_ERROR( msgBuf, myThid )
                0990         errCount = errCount + 1
                0991       ENDIF
7fe6343684 Jean*0992 
2b0fbf127e Jean*0993       IF ( momStepping .AND. .NOT.useCDscheme
                0994      &                 .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN
8dc8e44fac Jean*0995 C- jmc: since useCDscheme is a new [04-13-03] flag (default=F),
                0996 C       put this WARNING to stress that even if CD-scheme parameters
                0997 C       (tauCD,rCD) are set, CD-scheme is not used without useCDscheme=T
a97467b673 Jean*0998 C-    and STOP if using mom_fluxform (following Chris advise).
                0999 C- jmc: but ultimately, this block can/will be removed.
2b0fbf127e Jean*1000        IF ( vectorInvariantMomentum ) THEN
                1001         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
                1002      &   'CD-scheme is OFF but params(tauCD,rCD) are set'
                1003         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                1004      &                      SQUEEZE_RIGHT, myThid )
                1005         WRITE(msgBuf,'(3A)') '** WARNING ** to turn ON CD-scheme:',
                1006      &   ' => "useCDscheme=.TRUE." in "data", namelist PARM01'
                1007         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                1008      &                      SQUEEZE_RIGHT, myThid )
                1009        ELSE
8dc8e44fac Jean*1010         WRITE(msgBuf,'(A)')
a97467b673 Jean*1011      &   'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set'
3c3b37da6e Jean*1012         CALL PRINT_ERROR( msgBuf, myThid )
a97467b673 Jean*1013         WRITE(msgBuf,'(2A)')
                1014      &   'CONFIG_CHECK: to turn ON CD-scheme: => "useCDscheme=.TRUE."',
8dc8e44fac Jean*1015      &   ' in "data", namelist PARM01'
3c3b37da6e Jean*1016         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*1017         errCount = errCount + 1
a97467b673 Jean*1018        ENDIF
0870c568ac Jean*1019       ENDIF
745a0098ab Jean*1020 
51a413ac3c Jean*1021       IF ( useCDscheme .AND. hasWetCSCorners ) THEN
a77afd21fa Jean*1022         WRITE(msgBuf,'(2A)')
                1023      &   'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid'
3c3b37da6e Jean*1024         CALL PRINT_ERROR( msgBuf, myThid )
51a413ac3c Jean*1025         errCount = errCount + 1
d964dd04ff Jean*1026       ENDIF
9e44938df7 Jean*1027       IF ( useCDscheme .AND. momImplVertAdv ) THEN
                1028         WRITE(msgBuf,'(2A)')'CONFIG_CHECK: ',
                1029      &   'Implicit Vert. Advect. not coded for CD-scheme velocity'
                1030         CALL PRINT_ERROR( msgBuf, myThid )
                1031         errCount = errCount + 1
                1032       ENDIF
                1033       IF ( useCDscheme .AND. selectImplicitDrag.GT.0 ) THEN
                1034         WRITE(msgBuf,'(2A)')'CONFIG_CHECK: ',
                1035      &   'Implicit (bottom) drag not coded for CD-scheme velocity'
                1036         CALL PRINT_ERROR( msgBuf, myThid )
                1037         errCount = errCount + 1
                1038       ENDIF
d964dd04ff Jean*1039 
c7ad17745a Jean*1040 C--   Time-stepping limitations
6d54334e28 Jean*1041       IF ( implicitIntGravWave .AND. staggerTimeStep ) THEN
                1042         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: staggerTimeStep',
                1043      &    ' incompatible with implicitIntGravWave'
                1044         CALL PRINT_ERROR( msgBuf, myThid )
                1045         errCount = errCount + 1
                1046       ENDIF
8dc8e44fac Jean*1047       IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN
c2b6ed6bfd Jean*1048         WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=',
                1049      &                             momForcingOutAB, ' not allowed'
3c3b37da6e Jean*1050         CALL PRINT_ERROR( msgBuf, myThid )
c2b6ed6bfd Jean*1051         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momForcingOutAB ',
                1052      &                       'should be =1 (Out of AB) or =0 (In AB)'
3c3b37da6e Jean*1053         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*1054         errCount = errCount + 1
c2b6ed6bfd Jean*1055       ENDIF
8dc8e44fac Jean*1056       IF ( tracForcingOutAB.NE.0 .AND. tracForcingOutAB.NE.1 ) THEN
c2b6ed6bfd Jean*1057         WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: tracForcingOutAB=',
                1058      &                             tracForcingOutAB, ' not allowed'
3c3b37da6e Jean*1059         CALL PRINT_ERROR( msgBuf, myThid )
c2b6ed6bfd Jean*1060         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: tracForcingOutAB ',
                1061      &                       'should be =1 (Out of AB) or =0 (In AB)'
3c3b37da6e Jean*1062         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*1063         errCount = errCount + 1
a77afd21fa Jean*1064       ENDIF
9e44938df7 Jean*1065       IF ( selectImplicitDrag.LT.0 .OR. selectImplicitDrag.GT.2 ) THEN
                1066         WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ',
                1067      &    'Invalid option: selectImplicitDrag=',  selectImplicitDrag
                1068         CALL PRINT_ERROR( msgBuf, myThid )
                1069         errCount = errCount + 1
                1070       ENDIF
                1071       IF ( selectImplicitDrag.EQ.1 ) THEN
                1072         WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: selectImplicitDrag=1',
                1073      &  ' not yet available'
f9ef55fa0c Jean*1074         CALL PRINT_ERROR( msgBuf, myThid )
                1075         errCount = errCount + 1
                1076       ENDIF
a77afd21fa Jean*1077 
c7ad17745a Jean*1078 C--   Grid limitations:
7514c1bd55 Mart*1079       IF ( rotateGrid ) THEN
                1080        IF ( .NOT. usingSphericalPolarGrid ) THEN
                1081         WRITE(msgBuf,'(2A)')
                1082      &       'CONFIG_CHECK: specifying Euler angles makes only ',
                1083      &       'sense with usingSphericalGrid=.TRUE.'
3c3b37da6e Jean*1084         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*1085         errCount = errCount + 1
7514c1bd55 Mart*1086        ENDIF
427e24e121 Jean*1087        IF ( useFLT .OR. useECCO ) THEN
                1088         WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: specifying',
                1089      &       ' Euler angles may not work with pkgs FLT, ECCO'
                1090         CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
                1091      &                      SQUEEZE_RIGHT, myThid )
7514c1bd55 Mart*1092        ENDIF
                1093       ENDIF
                1094 
c7ad17745a Jean*1095 C--   Packages conflict
                1096       IF ( useMATRIX .AND. useGCHEM ) THEN
                1097         WRITE(msgBuf,'(2A)')
                1098      &   'CONFIG_CHECK: cannot set both: useMATRIX & useGCHEM'
3c3b37da6e Jean*1099         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*1100         errCount = errCount + 1
c7ad17745a Jean*1101       ENDIF
                1102 
                1103       IF ( useMATRIX .AND. .NOT.usePTRACERS ) THEN
                1104         WRITE(msgBuf,'(2A)')
                1105      &       'CONFIG_CHECK: cannot set useMATRIX without ',
                1106      &       'setting usePTRACERS'
3c3b37da6e Jean*1107         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*1108         errCount = errCount + 1
c7ad17745a Jean*1109       ENDIF
                1110 
6c944fd806 Jean*1111       IF ( (useSEAICE .OR. useThSIce) .AND. allowFreezing ) THEN
                1112         WRITE(msgBuf,'(2A)')
                1113      &       'CONFIG_CHECK: cannot set allowFreezing',
                1114      &       ' with pkgs SEAICE or THSICE'
3c3b37da6e Jean*1115         CALL PRINT_ERROR( msgBuf, myThid )
fbf4b71a66 Jean*1116         errCount = errCount + 1
                1117       ENDIF
                1118 
                1119       IF ( errCount.GE.1 ) THEN
                1120         WRITE(msgBuf,'(A,I3,A)')
                1121      &       'CONFIG_CHECK: detected', errCount,' fatal error(s)'
                1122         CALL PRINT_ERROR( msgBuf, myThid )
                1123         CALL ALL_PROC_DIE( 0 )
6c944fd806 Jean*1124         STOP 'ABNORMAL END: S/R CONFIG_CHECK'
                1125       ENDIF
fbf4b71a66 Jean*1126       _END_MASTER(myThid)
                1127 
                1128 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
6c944fd806 Jean*1129 
fbf4b71a66 Jean*1130       _BEGIN_MASTER(myThid)
c19461ac28 Jean*1131       WRITE(msgBuf,'(A)') '// CONFIG_CHECK : Normal End'
                1132       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                1133      &                    SQUEEZE_RIGHT, myThid )
                1134       WRITE(msgBuf,'(A)')
                1135      &'// ======================================================='
                1136       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                1137      &                    SQUEEZE_RIGHT, myThid )
                1138       WRITE(msgBuf,'(A)') ' '
                1139       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                1140      &                    SQUEEZE_RIGHT, myThid )
fbf4b71a66 Jean*1141       _END_MASTER(myThid)
5cd64f209f Jean*1142 
                1143       RETURN
                1144       END