3 |
|
|
4 |
#include "PACKAGES_CONFIG.h" |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
#ifdef ALLOW_MOM_COMMON |
7 |
|
# include "MOM_COMMON_OPTIONS.h" |
8 |
|
#endif |
9 |
|
|
10 |
CBOP |
CBOP |
11 |
C !ROUTINE: CONFIG_CHECK |
C !ROUTINE: CONFIG_CHECK |
27 |
#include "SIZE.h" |
#include "SIZE.h" |
28 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
29 |
#include "PARAMS.h" |
#include "PARAMS.h" |
|
c #include "GRID.h" |
|
30 |
|
|
31 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
32 |
C === Routine arguments === |
C === Routine arguments === |
41 |
INTEGER errCount |
INTEGER errCount |
42 |
CEOP |
CEOP |
43 |
|
|
44 |
|
_BEGIN_MASTER(myThid) |
45 |
|
WRITE(msgBuf,'(A)') |
46 |
|
&'// =======================================================' |
47 |
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
48 |
|
& SQUEEZE_RIGHT, myThid ) |
49 |
|
WRITE(msgBuf,'(A)') '// Check Model config. (CONFIG_CHECK):' |
50 |
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
51 |
|
& SQUEEZE_RIGHT, myThid ) |
52 |
|
_END_MASTER(myThid) |
53 |
|
|
54 |
C-- MPI + multi-threads: seems to be OK to let master-thread check & stop |
C-- MPI + multi-threads: seems to be OK to let master-thread check & stop |
55 |
C (as long as all procs finish cleanly by calling ALL_PROC_DIE) |
C (as long as all procs finish cleanly by calling ALL_PROC_DIE) |
56 |
_BEGIN_MASTER(myThid) |
_BEGIN_MASTER(myThid) |
65 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
66 |
& 'CONFIG_CHECK: diffKrFile is set but never used.' |
& 'CONFIG_CHECK: diffKrFile is set but never used.' |
67 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
68 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
69 |
& 'Re-compile with: #define ALLOW_3D_DIFFKR' |
& 'Re-compile with: "#define ALLOW_3D_DIFFKR"' |
70 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
71 |
|
errCount = errCount + 1 |
72 |
|
ENDIF |
73 |
|
#endif |
74 |
|
|
75 |
|
#ifdef EXCLUDE_PCELL_MIX_CODE |
76 |
|
IF ( interDiffKr_pCell .OR. interViscAr_pCell |
77 |
|
& .OR. pCellMix_select.NE.0 ) THEN |
78 |
|
IF ( interDiffKr_pCell ) THEN |
79 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
80 |
|
& 'Cannot use interDiffKr_pCell=.TRUE.' |
81 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
82 |
|
ENDIF |
83 |
|
IF ( interViscAr_pCell ) THEN |
84 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
85 |
|
& 'Cannot use interViscAr_pCell=.TRUE.' |
86 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
87 |
|
ENDIF |
88 |
|
IF ( pCellMix_select.NE.0 ) THEN |
89 |
|
WRITE(msgBuf,'(2A,I6)') 'CONFIG_CHECK: ', |
90 |
|
& 'Cannot use pCellMix_select=', pCellMix_select |
91 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
92 |
|
ENDIF |
93 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: when compiled ', |
94 |
|
& 'with "#define EXCLUDE_PCELL_MIX_CODE" in CPP_OPTIONS.h' |
95 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
96 |
|
errCount = errCount + 1 |
97 |
|
ENDIF |
98 |
|
#endif |
99 |
|
|
100 |
|
#ifndef ALLOW_SMAG_3D |
101 |
|
IF ( useSmag3D ) THEN |
102 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
103 |
|
& 'Cannot set useSmag3D=TRUE when compiled with' |
104 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
105 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
106 |
|
& '"#undef ALLOW_SMAG_3D" in MOM_COMMON_OPTIONS.h' |
107 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
108 |
errCount = errCount + 1 |
errCount = errCount + 1 |
109 |
ENDIF |
ENDIF |
174 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
175 |
errCount = errCount + 1 |
errCount = errCount + 1 |
176 |
ENDIF |
ENDIF |
177 |
|
IF ( selectImplicitDrag.GT.0 ) THEN |
178 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
179 |
|
& 'Needs to compile with #define INCLUDE_IMPLVERTADV_CODE' |
180 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
181 |
|
WRITE(msgBuf,'(A)') |
182 |
|
& 'CONFIG_CHECK: to use selectImplicitDrag > 0 ==> STOP here' |
183 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
184 |
|
errCount = errCount + 1 |
185 |
|
ENDIF |
186 |
#endif |
#endif |
187 |
|
|
188 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifndef ALLOW_SOLVE4_PS_AND_DRAG |
189 |
|
IF ( selectImplicitDrag.EQ.2 ) THEN |
190 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
191 |
|
& 'Needs to compile with #define ALLOW_SOLVE4_PS_AND_DRAG' |
192 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
193 |
|
WRITE(msgBuf,'(A)') |
194 |
|
& 'CONFIG_CHECK: to use selectImplicitDrag = 2 ==> STOP here' |
195 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
196 |
|
errCount = errCount + 1 |
197 |
|
ENDIF |
198 |
|
#endif |
199 |
|
|
200 |
|
#ifdef ALLOW_AUTODIFF |
201 |
IF ( momImplVertAdv ) THEN |
IF ( momImplVertAdv ) THEN |
202 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
203 |
& 'CONFIG_CHECK: momImplVertAdv is not yet' |
& 'CONFIG_CHECK: momImplVertAdv is not yet' |
207 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
208 |
errCount = errCount + 1 |
errCount = errCount + 1 |
209 |
ENDIF |
ENDIF |
210 |
|
IF ( selectImplicitDrag.GT.0 ) THEN |
211 |
|
WRITE(msgBuf,'(A)') |
212 |
|
& 'CONFIG_CHECK: selectImplicitDrag is not yet' |
213 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
214 |
|
WRITE(msgBuf,'(A)') |
215 |
|
& 'CONFIG_CHECK: supported in adjoint mode' |
216 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
217 |
|
errCount = errCount + 1 |
218 |
|
ENDIF |
219 |
#endif |
#endif |
220 |
|
|
221 |
#ifdef ALLOW_DEPTH_CONTROL |
#ifdef ALLOW_DEPTH_CONTROL |
300 |
#ifndef ALLOW_ADDFLUID |
#ifndef ALLOW_ADDFLUID |
301 |
IF ( selectAddFluid.NE.0 ) THEN |
IF ( selectAddFluid.NE.0 ) THEN |
302 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
303 |
& 'CONFIG_CHECK: #undef ALLOW_ADDFLUID and' |
& 'CONFIG_CHECK: #undef ALLOW_ADDFLUID (CPP_OPTIONS.h) and' |
304 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
305 |
WRITE(msgBuf,'(A,I4,A)') 'CONFIG_CHECK: selectAddFluid=', |
WRITE(msgBuf,'(A,I4,A)') 'CONFIG_CHECK: selectAddFluid=', |
306 |
& selectAddFluid, ' is not zero' |
& selectAddFluid, ' is not zero' |
317 |
& 'CONFIG_CHECK: pLoadFile is set but you have not' |
& 'CONFIG_CHECK: pLoadFile is set but you have not' |
318 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
319 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
320 |
& 'compiled the model with the pressure loading code.' |
& ' compiled the model with the pressure loading code.' |
321 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
322 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
323 |
& 'Re-compile with: #define ATMOSPHERIC_LOADING' |
& ' Re-compile with: "#define ATMOSPHERIC_LOADING"' |
324 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
325 |
errCount = errCount + 1 |
errCount = errCount + 1 |
326 |
ENDIF |
ENDIF |
329 |
& 'CONFIG_CHECK: sIceLoad is computed but' |
& 'CONFIG_CHECK: sIceLoad is computed but' |
330 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
331 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
332 |
& 'pressure loading code is not compiled.' |
& ' pressure loading code is not compiled.' |
333 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
334 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
335 |
& 'Re-compile with: #define ATMOSPHERIC_LOADING' |
& ' Re-compile with: "#define ATMOSPHERIC_LOADING"' |
336 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
337 |
|
errCount = errCount + 1 |
338 |
|
ENDIF |
339 |
|
#endif |
340 |
|
|
341 |
|
IF ( geothermalFile.NE.' ' ) THEN |
342 |
|
C o Need to use S/R APPLY_FORCING_T to get Geothermal forcing |
343 |
|
#ifdef USE_OLD_EXTERNAL_FORCING |
344 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
345 |
|
& 'geothermalFile is set but Geothermal-Flux code' |
346 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
347 |
|
WRITE(msgBuf,'(2A)')' is missing.', |
348 |
|
& ' Re-compile with "#undef USE_OLD_EXTERNAL_FORCING"' |
349 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
350 |
|
errCount = errCount + 1 |
351 |
|
#endif /* USE_OLD_EXTERNAL_FORCING */ |
352 |
|
C o Need to define ALLOW_GEOTHERMAL_FLUX to use geothermalFile forcing |
353 |
|
#ifndef ALLOW_GEOTHERMAL_FLUX |
354 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
355 |
|
& 'geothermalFile is set but Geothermal-Flux code' |
356 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
357 |
|
WRITE(msgBuf,'(2A)')' is not compiled.', |
358 |
|
& ' Re-compile with "#define ALLOW_GEOTHERMAL_FLUX"' |
359 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
360 |
|
errCount = errCount + 1 |
361 |
|
#endif /* ALLOW_GEOTHERMAL_FLUX */ |
362 |
|
ENDIF |
363 |
|
|
364 |
|
C o Need to use S/R APPLY_FORCING_U,V to get Tidal forcing |
365 |
|
#ifdef USE_OLD_EXTERNAL_FORCING |
366 |
|
IF ( momTidalForcing ) THEN |
367 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
368 |
|
& 'momTidalForcing is set but Tidal forcing code' |
369 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
370 |
|
WRITE(msgBuf,'(2A)')' is missing.', |
371 |
|
& ' Re-compile with "#undef USE_OLD_EXTERNAL_FORCING"' |
372 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
373 |
|
errCount = errCount + 1 |
374 |
|
ENDIF |
375 |
|
#endif /* USE_OLD_EXTERNAL_FORCING */ |
376 |
|
|
377 |
|
#ifndef ALLOW_FRICTION_HEATING |
378 |
|
IF ( addFrictionHeating ) THEN |
379 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: addFrictionHeating=T', |
380 |
|
& ' but FRICTIONAL_HEATING code is not compiled.' |
381 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
382 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Re-compile with:', |
383 |
|
& ' "#define ALLOW_FRICTION_HEATING" (CPP_OPTIONS.h)' |
384 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
385 |
errCount = errCount + 1 |
errCount = errCount + 1 |
386 |
ENDIF |
ENDIF |
392 |
& 'CONFIG_CHECK: balanceEmPmR/Qnet is set but balance code ', |
& 'CONFIG_CHECK: balanceEmPmR/Qnet is set but balance code ', |
393 |
& 'is not compiled.' |
& 'is not compiled.' |
394 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
395 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
396 |
& 'Re-compile with ALLOW_BALANCE_FLUXES defined' |
& 'Re-compile with: ALLOW_BALANCE_FLUXES defined' |
397 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
398 |
errCount = errCount + 1 |
errCount = errCount + 1 |
399 |
ENDIF |
ENDIF |
405 |
& 'CONFIG_CHECK: balanceTheta/SaltClimRelax is set ', |
& 'CONFIG_CHECK: balanceTheta/SaltClimRelax is set ', |
406 |
& 'but balance code is not compiled.' |
& 'but balance code is not compiled.' |
407 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
408 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
409 |
& 'Re-compile with ALLOW_BALANCE_RELAX defined' |
& 'Re-compile with ALLOW_BALANCE_RELAX defined' |
410 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
411 |
errCount = errCount + 1 |
errCount = errCount + 1 |
448 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
449 |
errCount = errCount + 1 |
errCount = errCount + 1 |
450 |
ENDIF |
ENDIF |
451 |
|
IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND. |
452 |
|
& useSmag3D .AND. useCDscheme ) THEN |
453 |
|
WRITE(msgBuf,'(A,A)') |
454 |
|
& 'CONFIG_CHECK: cannot use Smag-3D + CD-scheme with', |
455 |
|
& ' overlap (OLx,OLy) smaller than 3' |
456 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
457 |
|
errCount = errCount + 1 |
458 |
|
ENDIF |
459 |
|
|
460 |
#ifndef DISCONNECTED_TILES |
#ifndef DISCONNECTED_TILES |
461 |
C Overlaps cannot be larger than interior tile except for special cases |
C Overlaps cannot be larger than interior tile except for special cases |
489 |
ENDIF |
ENDIF |
490 |
#endif /* ndef DISCONNECTED_TILES */ |
#endif /* ndef DISCONNECTED_TILES */ |
491 |
|
|
492 |
|
C-- Gravity vertical profile limitations: |
493 |
|
IF ( usingPCoords .AND. gravityFile .NE. ' ' ) THEN |
494 |
|
WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: Variable gravity', |
495 |
|
& ' not yet implemented for P-coordinate' |
496 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
497 |
|
errCount = errCount + 1 |
498 |
|
ENDIF |
499 |
|
IF ( select_rStar.NE.0 .AND. gravityFile .NE. ' ' ) THEN |
500 |
|
WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: Variable gravity', |
501 |
|
& ' not yet implemented with rStar' |
502 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
503 |
|
errCount = errCount + 1 |
504 |
|
ENDIF |
505 |
|
|
506 |
C-- Deep-Atmosphere & Anelastic limitations: |
C-- Deep-Atmosphere & Anelastic limitations: |
507 |
IF ( deepAtmosphere .AND. |
IF ( deepAtmosphere .AND. |
508 |
& useRealFreshWaterFlux .AND. usingPCoords ) THEN |
& useRealFreshWaterFlux .AND. usingPCoords ) THEN |
521 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
522 |
errCount = errCount + 1 |
errCount = errCount + 1 |
523 |
ENDIF |
ENDIF |
524 |
IF ( vectorInvariantMomentum .AND. |
|
525 |
& ( deepAtmosphere .OR. |
C-- Free-surface related limitations: |
526 |
& usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN |
IF ( cg2dUseMinResSol.LT.0 .OR. cg2dUseMinResSol.GT.1 ) THEN |
527 |
WRITE(msgBuf,'(A,A)') |
WRITE(msgBuf,'(A,I10,A)') |
528 |
& 'CONFIG_CHECK: Deep-Atmosphere or Anelastic', |
& 'CONFIG_CHECK: cg2dUseMinResSol set to unvalid value(=', |
529 |
& ' not yet implemented in Vector-Invariant momentum code' |
& cg2dUseMinResSol, ')' |
530 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
531 |
errCount = errCount + 1 |
errCount = errCount + 1 |
532 |
ENDIF |
ENDIF |
533 |
|
|
|
C-- Free-surface related limitations: |
|
534 |
IF ( rigidLid .AND. implicitFreeSurface ) THEN |
IF ( rigidLid .AND. implicitFreeSurface ) THEN |
535 |
WRITE(msgBuf,'(A,A)') |
WRITE(msgBuf,'(A,A)') |
536 |
& 'CONFIG_CHECK: Cannot select both implicitFreeSurface', |
& 'CONFIG_CHECK: Cannot select both implicitFreeSurface', |
598 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
599 |
errCount = errCount + 1 |
errCount = errCount + 1 |
600 |
ENDIF |
ENDIF |
601 |
|
IF ( select_rStar.EQ.2 .AND. nonlinFreeSurf.NE.4 ) THEN |
602 |
|
C- not consistent to account for the slope of the coordinate when |
603 |
|
C ignoring the variations of level-thickness in PhiHyd calculation; |
604 |
|
C for now, issue a warning (but might change the code later on): |
605 |
|
WRITE(msgBuf,'(2A,I3)') '** WARNING ** CONFIG_CHECK: ', |
606 |
|
& 'select_rStar=2 not right with nonlinFreeSurf=', nonlinFreeSurf |
607 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
608 |
|
& SQUEEZE_RIGHT, myThid ) |
609 |
|
ENDIF |
610 |
|
|
611 |
IF ( selectSigmaCoord.NE.0 ) THEN |
IF ( selectSigmaCoord.NE.0 ) THEN |
612 |
IF ( fluidIsWater ) THEN |
IF ( fluidIsWater ) THEN |
639 |
c ENDIF |
c ENDIF |
640 |
|
|
641 |
IF ( nonlinFreeSurf.NE.0 .AND. |
IF ( nonlinFreeSurf.NE.0 .AND. |
642 |
& deltaTfreesurf.NE.dTtracerLev(1) ) THEN |
& deltaTFreeSurf.NE.dTtracerLev(1) ) THEN |
643 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
644 |
& 'nonlinFreeSurf might cause problems' |
& 'nonlinFreeSurf might cause problems' |
645 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
651 |
ENDIF |
ENDIF |
652 |
|
|
653 |
IF ( useRealFreshWaterFlux .AND. exactConserv |
IF ( useRealFreshWaterFlux .AND. exactConserv |
654 |
& .AND. implicDiv2Dflow.EQ.0. _d 0 |
& .AND. implicDiv2DFlow.EQ.0. _d 0 |
655 |
& .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN |
& .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN |
656 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
657 |
& 'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:' |
& 'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:' |
663 |
ENDIF |
ENDIF |
664 |
|
|
665 |
IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv |
IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv |
666 |
& .AND. implicDiv2Dflow.NE.1. ) THEN |
& .AND. implicDiv2DFlow.NE.1. ) THEN |
667 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
668 |
& 'RealFreshWater & implicDiv2Dflow < 1' |
& 'RealFreshWater & implicDiv2DFlow < 1' |
669 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
670 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
671 |
WRITE(msgBuf,'(2A)') '** WARNING ** works better', |
WRITE(msgBuf,'(2A)') '** WARNING ** works better', |
728 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
729 |
ENDIF |
ENDIF |
730 |
|
|
731 |
|
C-- Pressure calculation and pressure gradient: |
732 |
|
#ifndef INCLUDE_PHIHYD_CALCULATION_CODE |
733 |
|
IF ( momPressureForcing .OR. storePhiHyd4Phys ) THEN |
734 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
735 |
|
& 'missing code to calculate pressure (totPhiHyd)' |
736 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
737 |
|
errCount = errCount + 1 |
738 |
|
ENDIF |
739 |
|
#endif /* INCLUDE_PHIHYD_CALCULATION_CODE */ |
740 |
|
IF ( storePhiHyd4Phys .AND. .NOT.momStepping ) THEN |
741 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
742 |
|
& 'storePhiHyd4Phys = TRUE but pressure is not computed' |
743 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
744 |
|
errCount = errCount + 1 |
745 |
|
ENDIF |
746 |
|
|
747 |
C-- Non-hydrostatic and 3-D solver related limitations: |
C-- Non-hydrostatic and 3-D solver related limitations: |
748 |
IF (nonlinFreeSurf.NE.0 .AND. use3Dsolver) THEN |
IF (nonlinFreeSurf.NE.0 .AND. use3Dsolver) THEN |
749 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
755 |
errCount = errCount + 1 |
errCount = errCount + 1 |
756 |
ENDIF |
ENDIF |
757 |
|
|
758 |
IF ( implicitNHPress*implicSurfPress*implicDiv2Dflow.NE.1. |
IF ( implicitNHPress*implicSurfPress*implicDiv2DFlow.NE.1. |
759 |
& .AND. implicitIntGravWave ) THEN |
& .AND. implicitIntGravWave ) THEN |
760 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: implicitIntGravWave', |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: implicitIntGravWave', |
761 |
& ' NOT SAFE with non-fully implicit solver' |
& ' NOT SAFE with non-fully implicit solver' |
765 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
766 |
errCount = errCount + 1 |
errCount = errCount + 1 |
767 |
ENDIF |
ENDIF |
768 |
|
IF ( implicitNHPress*implicSurfPress*implicDiv2DFlow.EQ.0. |
769 |
|
& .AND. nonHydrostatic ) THEN |
770 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
771 |
|
& 'Needs non-zero implicit factors (i.e., implicitNHPress,' |
772 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
773 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
774 |
|
& ' implicSurfPress & implicDiv2DFlow) to run nonHydrostatic' |
775 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
776 |
|
errCount = errCount + 1 |
777 |
|
ENDIF |
778 |
IF ( nonHydrostatic .AND. .NOT.exactConserv |
IF ( nonHydrostatic .AND. .NOT.exactConserv |
779 |
& .AND. implicDiv2Dflow.NE.1. ) THEN |
& .AND. implicDiv2DFlow.NE.1. ) THEN |
780 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Needs exactConserv=T', |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Needs exactConserv=T', |
781 |
& ' for nonHydrostatic with implicDiv2Dflow < 1' |
& ' for nonHydrostatic with implicDiv2DFlow < 1' |
782 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
783 |
errCount = errCount + 1 |
errCount = errCount + 1 |
784 |
ENDIF |
ENDIF |
785 |
IF ( nonHydrostatic .AND. |
IF ( nonHydrostatic .AND. |
786 |
& implicitNHPress.NE.implicSurfPress ) THEN |
& implicitNHPress.NE.implicSurfPress ) THEN |
787 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
788 |
& ' nonHydrostatic might cause problems with' |
& 'nonHydrostatic might cause problems with' |
789 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
790 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
791 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
794 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
795 |
ENDIF |
ENDIF |
796 |
|
|
797 |
|
IF ( selectImplicitDrag.EQ.2 .AND. use3Dsolver ) THEN |
798 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: selectImplicitDrag=2', |
799 |
|
& ' not compatible with 3-D Press. solver' |
800 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
801 |
|
errCount = errCount + 1 |
802 |
|
ENDIF |
803 |
|
|
804 |
IF ( implicitViscosity .AND. use3Dsolver ) THEN |
IF ( implicitViscosity .AND. use3Dsolver ) THEN |
805 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
806 |
& 'Implicit viscosity applies to provisional u,vVel' |
& 'Implicit viscosity applies to provisional u,vVel' |
807 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
808 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
809 |
WRITE(msgBuf,'(2A)') '** WARNING ** => not consistent with', |
WRITE(msgBuf,'(2A)') '** WARNING ** => not consistent with', |
810 |
& 'final vertical shear (after appling 3-D solver solution' |
& ' final vertical shear (after appling 3-D solver solution' |
811 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
812 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |
813 |
ENDIF |
ENDIF |
831 |
errCount = errCount + 1 |
errCount = errCount + 1 |
832 |
ENDIF |
ENDIF |
833 |
ENDIF |
ENDIF |
834 |
|
IF ( .NOT.vectorInvariantMomentum .AND. momAdvection ) THEN |
835 |
|
IF ( usingCurvilinearGrid ) THEN |
836 |
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
837 |
|
& 'missing metric-terms for CurvilinearGrid' |
838 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
839 |
|
& SQUEEZE_RIGHT, myThid ) |
840 |
|
ENDIF |
841 |
|
IF ( hasWetCSCorners ) THEN |
842 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momAdvection ', |
843 |
|
& 'in flux-form is wrong on CubedSphere grid (corners)' |
844 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
845 |
|
errCount = errCount + 1 |
846 |
|
ENDIF |
847 |
|
ENDIF |
848 |
IF ( selectCoriMap.LT.0 .OR. selectCoriMap.GT.3 ) THEN |
IF ( selectCoriMap.LT.0 .OR. selectCoriMap.GT.3 ) THEN |
849 |
WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ', |
WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ', |
850 |
& 'Invalid option: selectCoriMap=', selectCoriMap |
& 'Invalid option: selectCoriMap=', selectCoriMap |
851 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
852 |
errCount = errCount + 1 |
errCount = errCount + 1 |
853 |
ENDIF |
ENDIF |
854 |
|
IF ( selectBotDragQuadr.LT.-1 .OR. selectBotDragQuadr.GT.2 ) THEN |
855 |
|
WRITE(msgBuf,'(2A,I8,A)') 'CONFIG_CHECK: ', |
856 |
|
& 'selectBotDragQuadr=', selectBotDragQuadr, |
857 |
|
& ' not valid (-1,0,1,2)' |
858 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
859 |
|
errCount = errCount + 1 |
860 |
|
ENDIF |
861 |
|
IF ( useSmag3D .AND. |
862 |
|
& ( usingPCoords .OR. deepAtmosphere .OR. selectSigmaCoord.NE.0 |
863 |
|
& .OR. rhoRefFile.NE.' ' .OR. hasWetCSCorners ) |
864 |
|
& ) THEN |
865 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
866 |
|
& 'Smag-3D not yet implemented for this set-up' |
867 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
868 |
|
errCount = errCount + 1 |
869 |
|
ENDIF |
870 |
|
|
871 |
IF (.NOT.useCDscheme .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN |
IF ( momStepping .AND. .NOT.useCDscheme |
872 |
|
& .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN |
873 |
C- jmc: since useCDscheme is a new [04-13-03] flag (default=F), |
C- jmc: since useCDscheme is a new [04-13-03] flag (default=F), |
874 |
C put this WARNING to stress that even if CD-scheme parameters |
C put this WARNING to stress that even if CD-scheme parameters |
875 |
C (tauCD,rCD) are set, CD-scheme is not used without useCDscheme=T |
C (tauCD,rCD) are set, CD-scheme is not used without useCDscheme=T |
876 |
C- and STOP if using mom_fluxform (following Chris advise). |
C- and STOP if using mom_fluxform (following Chris advise). |
877 |
C- jmc: but ultimately, this block can/will be removed. |
C- jmc: but ultimately, this block can/will be removed. |
878 |
IF (.NOT.vectorInvariantMomentum.AND.momStepping) THEN |
IF ( vectorInvariantMomentum ) THEN |
879 |
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
880 |
|
& 'CD-scheme is OFF but params(tauCD,rCD) are set' |
881 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
882 |
|
& SQUEEZE_RIGHT, myThid ) |
883 |
|
WRITE(msgBuf,'(3A)') '** WARNING ** to turn ON CD-scheme:', |
884 |
|
& ' => "useCDscheme=.TRUE." in "data", namelist PARM01' |
885 |
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
886 |
|
& SQUEEZE_RIGHT, myThid ) |
887 |
|
ELSE |
888 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
889 |
& 'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set' |
& 'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set' |
890 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
894 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
895 |
errCount = errCount + 1 |
errCount = errCount + 1 |
896 |
ENDIF |
ENDIF |
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
|
|
& 'CD-scheme is OFF but params(tauCD,rCD) are set' |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
|
|
& SQUEEZE_RIGHT, myThid ) |
|
|
WRITE(msgBuf,'(3A)') '** WARNING ** ', |
|
|
& 'to turn ON CD-scheme: => "useCDscheme=.TRUE."', |
|
|
& ' in "data", namelist PARM01' |
|
|
WRITE(msgBuf,'(3A)') '** WARNING ** to turn ON CD-scheme:', |
|
|
& ' => "useCDscheme=.TRUE." in "data", namelist PARM01' |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
|
|
& SQUEEZE_RIGHT, myThid ) |
|
897 |
ENDIF |
ENDIF |
898 |
|
|
899 |
IF ( useCDscheme .AND. useCubedSphereExchange ) THEN |
IF ( useCDscheme .AND. hasWetCSCorners ) THEN |
900 |
WRITE(msgBuf,'(2A)') |
WRITE(msgBuf,'(2A)') |
901 |
& 'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid' |
& 'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid' |
902 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
903 |
cph errCount = errCount + 1 |
errCount = errCount + 1 |
904 |
|
ENDIF |
905 |
|
IF ( useCDscheme .AND. momImplVertAdv ) THEN |
906 |
|
WRITE(msgBuf,'(2A)')'CONFIG_CHECK: ', |
907 |
|
& 'Implicit Vert. Advect. not coded for CD-scheme velocity' |
908 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
909 |
|
errCount = errCount + 1 |
910 |
|
ENDIF |
911 |
|
IF ( useCDscheme .AND. selectImplicitDrag.GT.0 ) THEN |
912 |
|
WRITE(msgBuf,'(2A)')'CONFIG_CHECK: ', |
913 |
|
& 'Implicit (bottom) drag not coded for CD-scheme velocity' |
914 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
915 |
|
errCount = errCount + 1 |
916 |
ENDIF |
ENDIF |
917 |
|
|
918 |
C-- Time-stepping limitations |
C-- Time-stepping limitations |
919 |
|
IF ( implicitIntGravWave .AND. staggerTimeStep ) THEN |
920 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: staggerTimeStep', |
921 |
|
& ' incompatible with implicitIntGravWave' |
922 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
923 |
|
errCount = errCount + 1 |
924 |
|
ENDIF |
925 |
IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN |
IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN |
926 |
WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=', |
WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=', |
927 |
& momForcingOutAB, ' not allowed' |
& momForcingOutAB, ' not allowed' |
940 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
941 |
errCount = errCount + 1 |
errCount = errCount + 1 |
942 |
ENDIF |
ENDIF |
943 |
|
IF ( selectImplicitDrag.LT.0 .OR. selectImplicitDrag.GT.2 ) THEN |
944 |
|
WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ', |
945 |
|
& 'Invalid option: selectImplicitDrag=', selectImplicitDrag |
946 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
947 |
|
errCount = errCount + 1 |
948 |
|
ENDIF |
949 |
|
IF ( selectImplicitDrag.EQ.1 ) THEN |
950 |
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: selectImplicitDrag=1', |
951 |
|
& ' not yet available' |
952 |
|
CALL PRINT_ERROR( msgBuf, myThid ) |
953 |
|
errCount = errCount + 1 |
954 |
|
ENDIF |
955 |
|
|
956 |
C-- Grid limitations: |
C-- Grid limitations: |
957 |
IF ( rotateGrid ) THEN |
IF ( rotateGrid ) THEN |
1007 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
1008 |
|
|
1009 |
_BEGIN_MASTER(myThid) |
_BEGIN_MASTER(myThid) |
|
WRITE(msgBuf,'(A)') |
|
|
&'// =======================================================' |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
|
|
& SQUEEZE_RIGHT, myThid ) |
|
1010 |
WRITE(msgBuf,'(A)') '// CONFIG_CHECK : Normal End' |
WRITE(msgBuf,'(A)') '// CONFIG_CHECK : Normal End' |
1011 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1012 |
& SQUEEZE_RIGHT, myThid ) |
& SQUEEZE_RIGHT, myThid ) |