/[MITgcm]/MITgcm/model/src/config_check.F
ViewVC logotype

Diff of /MITgcm/model/src/config_check.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.45 by mlosch, Fri Feb 8 07:57:44 2008 UTC revision 1.51 by heimbach, Sat Oct 10 22:36:14 2009 UTC
# Line 42  C-  check that CPP option is "defined" w Line 42  C-  check that CPP option is "defined" w
42    
43  C     o If diffKrFile is set, then we should make sure the corresponing  C     o If diffKrFile is set, then we should make sure the corresponing
44  C       code is being compiled  C       code is being compiled
45  #if !(defined ALLOW_3D_DIFFKR || \  #ifndef ALLOW_3D_DIFFKR
       (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_DIFFKR_CONTROL)))  
46        IF (diffKrFile.NE.' ') THEN        IF (diffKrFile.NE.' ') THEN
47          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
48       &  'CONFIG_CHECK: diffKrFile is set but never used.'       &  'CONFIG_CHECK: diffKrFile is set but never used.'
# Line 168  C       code is being compiled Line 167  C       code is being compiled
167          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
168  #endif  #endif
169    
170    #ifndef ALLOW_ADDFLUID
171          IF ( selectAddFluid.NE.0 ) THEN
172            WRITE(msgBuf,'(A)')
173         &   'CONFIG_CHECK: #undef ALLOW_ADDFLUID and'
174            CALL PRINT_ERROR( msgBuf, myThid )
175            WRITE(msgBuf,'(A,I4,A)') 'CONFIG_CHECK: selectAddFluid=',
176         &                           selectAddFluid, ' is not zero'
177            CALL PRINT_ERROR( msgBuf, myThid )
178            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
179          ENDIF
180    #endif /* ALLOW_ADDFLUID */
181    
182  C     o If pLoadFile is set, then we should make sure the corresponing  C     o If pLoadFile is set, then we should make sure the corresponing
183  C       code is being compiled  C       code is being compiled
184  #ifndef ATMOSPHERIC_LOADING  #ifndef ATMOSPHERIC_LOADING
# Line 212  C       code is being compiled Line 223  C       code is being compiled
223    
224  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
225    
226  C-  check parameter consistency :  C--   Check parameter consistency :
227    
228        IF ( ( Olx.LT.3 .OR. Oly.LT.3 ) .AND.        IF ( ( Olx.LT.3 .OR. Oly.LT.3 ) .AND.
229       &     ( viscC4leithD.NE.0.  .OR. viscC4leith.NE.0.       &     ( viscC4leithD.NE.0.  .OR. viscC4leith.NE.0.
# Line 234  C-  check parameter consistency : Line 245  C-  check parameter consistency :
245          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
246        ENDIF        ENDIF
247    
248  C-    Deep-Atmosphere & Anelastic limitations:  C--   Deep-Atmosphere & Anelastic limitations:
249        IF ( deepAtmosphere .AND.        IF ( deepAtmosphere .AND.
250       &     useRealFreshWaterFlux .AND. usingPCoords ) THEN       &     useRealFreshWaterFlux .AND. usingPCoords ) THEN
251          WRITE(msgBuf,'(A,A)')          WRITE(msgBuf,'(A,A)')
# Line 262  C-    Deep-Atmosphere & Anelastic limita Line 273  C-    Deep-Atmosphere & Anelastic limita
273          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
274        ENDIF        ENDIF
275    
276    C--   Free-surface related limitations:
277        IF ( rigidLid .AND. implicitFreeSurface ) THEN        IF ( rigidLid .AND. implicitFreeSurface ) THEN
278          WRITE(msgBuf,'(A,A)')          WRITE(msgBuf,'(A,A)')
279       &  'CONFIG_CHECK: Cannot select both implicitFreeSurface',       &  'CONFIG_CHECK: Cannot select both implicitFreeSurface',
# Line 300  C-    Deep-Atmosphere & Anelastic limita Line 312  C-    Deep-Atmosphere & Anelastic limita
312          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
313        ENDIF        ENDIF
314    
315        IF ( (implicSurfPress.NE.1. .OR. implicDiv2DFlow.NE.1.)        IF ( (implicSurfPress.NE.1. .OR. implicDiv2Dflow.NE.1.)
316       &    .AND. nonHydrostatic ) THEN       &    .AND. nonHydrostatic ) THEN
317          WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: nonHydrostatic',          WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: nonHydrostatic',
318       & ' NOT SAFE with non-fully implicit Barotropic solver'       & ' NOT SAFE with non-fully implicit Barotropic solver'
# Line 333  C-    Deep-Atmosphere & Anelastic limita Line 345  C-    Deep-Atmosphere & Anelastic limita
345    
346  C- note : not implemented in checkpoint48b but it's done now (since 01-28-03)  C- note : not implemented in checkpoint48b but it's done now (since 01-28-03)
347  c     IF (select_rStar.GT.0 .AND. useOBCS ) THEN  c     IF (select_rStar.GT.0 .AND. useOBCS ) THEN
 c       WRITE(msgBuf,'(A)')  
 c    &   'CONFIG_CHECK: r* Coordinate not yet implemented'  
 c       CALL PRINT_ERROR( msgBuf , 1)  
 c       WRITE(msgBuf,'(A)')  
 c    &   'CONFIG_CHECK: in OBC package'  
 c       CALL PRINT_ERROR( msgBuf , 1)  
348  c       STOP 'ABNORMAL END: S/R CONFIG_CHECK'  c       STOP 'ABNORMAL END: S/R CONFIG_CHECK'
349  c     ENDIF  c     ENDIF
350    
# Line 366  c     IF (nonlinFreeSurf.NE.0 .AND. nonH Line 372  c     IF (nonlinFreeSurf.NE.0 .AND. nonH
372        ENDIF        ENDIF
373    
374        IF ( useRealFreshWaterFlux .AND. exactConserv        IF ( useRealFreshWaterFlux .AND. exactConserv
375       &     .AND. implicDiv2DFlow.EQ.0. _d 0       &     .AND. implicDiv2Dflow.EQ.0. _d 0
376       &     .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN       &     .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN
377          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
378       &   'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:'       &   'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:'
# Line 378  c     IF (nonlinFreeSurf.NE.0 .AND. nonH Line 384  c     IF (nonlinFreeSurf.NE.0 .AND. nonH
384        ENDIF        ENDIF
385    
386        IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv        IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv
387       &     .AND. implicDiv2DFlow.NE.1. ) THEN       &     .AND. implicDiv2Dflow.NE.1. ) THEN
388          WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: **WARNNING** ',          WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: **WARNNING** ',
389       &   'RealFreshWater & implicDiv2DFlow < 1'       &   'RealFreshWater & implicDiv2Dflow < 1'
390          CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,          CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
391       &                    SQUEEZE_RIGHT , myThid)       &                    SQUEEZE_RIGHT , myThid)
392          WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: works better',          WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: works better',
# Line 414  c     IF (nonlinFreeSurf.NE.0 .AND. nonH Line 420  c     IF (nonlinFreeSurf.NE.0 .AND. nonH
420        ENDIF        ENDIF
421  #endif /* EXACT_CONSERV */  #endif /* EXACT_CONSERV */
422    
423          IF ( selectAddFluid.LT.-1 .OR. selectAddFluid.GT.2 ) THEN
424            WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: selectAddFluid=',
425         &                             selectAddFluid, ' not allowed'
426            CALL PRINT_ERROR( msgBuf , myThid)
427            WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
428         &       'should be =0 (Off), 1,2 (Add Mass) or -1 (Virtual Flux)'
429            CALL PRINT_ERROR( msgBuf , myThid)
430            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
431          ENDIF
432          IF ( selectAddFluid.GE.1 .AND. rigidLid ) THEN
433            WRITE(msgBuf,'(A)')
434         &   'CONFIG_CHECK: selectAddFluid > 0 not compatible with'
435            CALL PRINT_ERROR( msgBuf , myThid)
436            WRITE(msgBuf,'(A)')
437         &   'CONFIG_CHECK: rigidLid (meaningless in that case)'
438            CALL PRINT_ERROR( msgBuf , myThid)
439            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
440          ENDIF
441          IF ( selectAddFluid.GE.1 .AND. .NOT.staggerTimeStep ) THEN
442            WRITE(msgBuf,'(2A)') '**WARNNING** ',
443         &   'CONFIG_CHECK: synchronous time-stepping =>'
444            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
445         &                      SQUEEZE_RIGHT , myThid)
446            WRITE(msgBuf,'(2A)') '**WARNNING** ',
447         &   '1 time-step mismatch in AddFluid effects on T & S'
448            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
449         &                      SQUEEZE_RIGHT , myThid)
450          ENDIF
451    
452    C--   Momentum related limitations:
453          IF ( vectorInvariantMomentum.AND.momStepping ) THEN
454           IF ( highOrderVorticity.AND.upwindVorticity ) THEN
455            WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
456         &   '"highOrderVorticity" conflicts with "upwindVorticity"'
457            CALL PRINT_ERROR( msgBuf , myThid)
458            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
459           ENDIF
460          ENDIF
461    
462        IF (.NOT.useCDscheme .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN        IF (.NOT.useCDscheme .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN
463  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),
464  C       put this WARNING to stress that even if CD-scheme parameters  C       put this WARNING to stress that even if CD-scheme parameters
# Line 445  C- jmc: but ultimately, this block can/w Line 490  C- jmc: but ultimately, this block can/w
490          WRITE(msgBuf,'(2A)')          WRITE(msgBuf,'(2A)')
491       &   'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid'       &   'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid'
492          CALL PRINT_ERROR( msgBuf , myThid)          CALL PRINT_ERROR( msgBuf , myThid)
493          STOP 'ABNORMAL END: S/R CONFIG_CHECK'  cph        STOP 'ABNORMAL END: S/R CONFIG_CHECK'
494        ENDIF        ENDIF
495    
496    C--   Time-stepping limitations
497        IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN        IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN
498          WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=',          WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=',
499       &                             momForcingOutAB, ' not allowed'       &                             momForcingOutAB, ' not allowed'
# Line 467  C- jmc: but ultimately, this block can/w Line 513  C- jmc: but ultimately, this block can/w
513          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
514        ENDIF        ENDIF
515    
516        IF ( useMATRIX .AND. useGCHEM ) THEN  C--   Grid limitations:
         WRITE(msgBuf,'(2A)')  
      &   'CONFIG_CHECK: cannot set both: useMATRIX & useGCHEM'  
         CALL PRINT_ERROR( msgBuf , myThid)  
         STOP 'ABNORMAL END: S/R CONFIG_CHECK'  
       ENDIF  
   
       IF ( useMATRIX .AND. .NOT.usePTRACERS ) THEN  
         WRITE(msgBuf,'(2A)')  
      &       'CONFIG_CHECK: cannot set useMATRIX without ',  
      &       'setting usePTRACERS'  
         CALL PRINT_ERROR( msgBuf , myThid)  
         STOP 'ABNORMAL END: S/R CONFIG_CHECK'  
       ENDIF  
   
517        IF ( rotateGrid ) THEN        IF ( rotateGrid ) THEN
518         IF ( .NOT. usingSphericalPolarGrid ) THEN         IF ( .NOT. usingSphericalPolarGrid ) THEN
519          WRITE(msgBuf,'(2A)')          WRITE(msgBuf,'(2A)')
# Line 497  C- jmc: but ultimately, this block can/w Line 529  C- jmc: but ultimately, this block can/w
529          CALL PRINT_ERROR( msgBuf , myThid)          CALL PRINT_ERROR( msgBuf , myThid)
530          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
531         ENDIF         ENDIF
        IF ( use3dCoriolis ) THEN  
         WRITE(msgBuf,'(3A)')  
      &       'CONFIG_CHECK: computation of angleCosC and angleSinC ',  
      &       'as required by use3dCoriolis ',  
      &       'not yet implemented with rotated grid. Sorry!'  
         CALL PRINT_ERROR( msgBuf , myThid)  
         STOP 'ABNORMAL END: S/R CONFIG_CHECK'  
        ENDIF  
532  #ifdef ALLOW_PROFILES  #ifdef ALLOW_PROFILES
533          WRITE(msgBuf,'(2A)')          WRITE(msgBuf,'(2A)')
534       &       'CONFIG_CHECK: specifying Euler angles will probably ',       &       'CONFIG_CHECK: specifying Euler angles will probably ',
# Line 514  C- jmc: but ultimately, this block can/w Line 538  C- jmc: but ultimately, this block can/w
538  #endif /* ALLOW_PROFILES */  #endif /* ALLOW_PROFILES */
539        ENDIF        ENDIF
540    
541        WRITE(msgBuf,'(A)') 'CONFIG_CHECK: OK'  C--   Packages conflict
542        CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,        IF ( useMATRIX .AND. useGCHEM ) THEN
543       &                   SQUEEZE_RIGHT,myThid)          WRITE(msgBuf,'(2A)')
544         &   'CONFIG_CHECK: cannot set both: useMATRIX & useGCHEM'
545            CALL PRINT_ERROR( msgBuf , myThid)
546            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
547          ENDIF
548    
549          IF ( useMATRIX .AND. .NOT.usePTRACERS ) THEN
550            WRITE(msgBuf,'(2A)')
551         &       'CONFIG_CHECK: cannot set useMATRIX without ',
552         &       'setting usePTRACERS'
553            CALL PRINT_ERROR( msgBuf , myThid)
554            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
555          ENDIF
556    
557          IF ( (useSEAICE .OR. useThSIce) .AND. allowFreezing ) THEN
558            WRITE(msgBuf,'(2A)')
559         &       'CONFIG_CHECK: cannot set allowFreezing',
560         &       ' with pkgs SEAICE or THSICE'
561            CALL PRINT_ERROR( msgBuf , myThid)
562            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
563          ENDIF
564    
565          WRITE(msgBuf,'(A)')
566         &'// ======================================================='
567          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
568         &                    SQUEEZE_RIGHT, myThid )
569          WRITE(msgBuf,'(A)') '// CONFIG_CHECK : Normal End'
570          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
571         &                    SQUEEZE_RIGHT, myThid )
572          WRITE(msgBuf,'(A)')
573         &'// ======================================================='
574          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
575         &                    SQUEEZE_RIGHT, myThid )
576          WRITE(msgBuf,'(A)') ' '
577          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
578         &                    SQUEEZE_RIGHT, myThid )
579    
580        RETURN        RETURN
581        END        END

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.22