Back to home page

MITgcm

 
 

    


File indexing completed on 2025-07-08 05:10:41 UTC

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