Back to home page

MITgcm

 
 

    


File indexing completed on 2025-12-03 06:08:08 UTC

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