Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:38:19 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
a6c1c05757 Jean*0001 #include "GCHEM_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: CFC_CHECK
                0005 C     !INTERFACE:
                0006       SUBROUTINE CFC_CHECK( myThid )
                0007 
                0008 C     !DESCRIPTION: \bv
                0009 C     *==========================================================*
                0010 C     | S/R CFC_CHECK
                0011 C     | o Print CFC parameter summary and
                0012 C     | o Check for consistent CFC pkg setting
                0013 C     *==========================================================*
                0014 C     \ev
                0015 
                0016 C     !USES:
                0017       IMPLICIT NONE
                0018 
                0019 C     === Global variables ===
                0020 #include "SIZE.h"
                0021 #include "EEPARAMS.h"
                0022 #include "PARAMS.h"
                0023 #include "CFC.h"
                0024 
                0025 C     !INPUT/OUTPUT PARAMETERS:
                0026 C     myThid    :: My Thread Id. number
                0027       INTEGER myThid
                0028 CEOP
                0029 
                0030 #ifdef ALLOW_CFC
                0031 C     !LOCAL VARIABLES:
                0032 C     msgBuf    :: Informational/error message buffer
                0033 C     ioUnit    :: Work variable for IO unit number
                0034       CHARACTER*(MAX_LEN_MBUF) msgBuf
                0035       INTEGER ioUnit
                0036       INTEGER errCount
                0037 
                0038 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0039 
                0040       _BEGIN_MASTER(myThid)
                0041 
                0042       ioUnit = standardMessageUnit
                0043       WRITE(msgBuf,'(A)') 'CFC_CHECK:   #define ALLOW_CFC'
                0044       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0045 
                0046 C---  Print summary:
                0047 
                0048       WRITE(msgBuf,'(A)')
                0049      &'// ======================================================='
                0050       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0051       WRITE(msgBuf,'(A)') '// CFC pkg configuration summary'
                0052       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0053       WRITE(msgBuf,'(A)')
                0054      &'// ======================================================='
                0055       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0056 
                0057       CALL WRITE_0D_C( atmCFC_inpFile, -1, INDEX_NONE,
                0058      & 'atmCFC_inpFile =', ' /* atmos CFC time-series input file */')
                0059       CALL WRITE_0D_RL( atmCFC_recSepTime, INDEX_NONE,
                0060      &  'atmCFC_recSepTime =', ' /* time record spacing (s) */')
                0061       CALL WRITE_0D_RL( atmCFC_timeOffset, INDEX_NONE,
                0062      &  'atmCFC_timeOffset =', ' /* time offset for atm CFC (s) */')
                0063       CALL WRITE_0D_RL( atmCFC_ySouthBnd, INDEX_NONE,
                0064      &  'atmCFC_ySouthBnd =', ' /* S Lat boundary for atm CFC (s) */')
                0065       CALL WRITE_0D_RL( atmCFC_yNorthBnd, INDEX_NONE,
                0066      &  'atmCFC_yNorthBnd =', ' /* N Lat boundary for atm CFC (s) */')
                0067       CALL WRITE_0D_RL( CFC_monFreq, INDEX_NONE,
                0068      &  'CFC_monFreq =', ' /* frequency for CFC monitor (s) */')
                0069 
                0070 c     CALL WRITE_0D_L( fluidIsAir,   INDEX_NONE,
                0071 c    & 'fluidIsAir   =', '  /* fluid major constituent is Air */')
                0072 
                0073       CALL WRITE_0D_C( CFC_windFile, -1, INDEX_NONE,
                0074      & 'CFC_windFile =', ' /* wind-speed input file */')
                0075       CALL WRITE_0D_C( CFC_atmospFile, -1, INDEX_NONE,
                0076      & 'CFC_atmospFile =', ' /* atmos surf pressure input file */')
                0077       CALL WRITE_0D_C( CFC_iceFile, -1, INDEX_NONE,
                0078      & 'CFC_iceFile =', ' /* seaice fraction input file */')
                0079 
                0080       CALL WRITE_0D_RL( CFC_forcingPeriod, INDEX_NONE,
                0081      &  'CFC_forcingPeriod =',
                0082      &  ' /* forcing period (s) of input file */')
                0083       CALL WRITE_0D_RL( CFC_forcingCycle, INDEX_NONE,
                0084      &  'CFC_forcingCycle =',
                0085      &  ' /* period of Cycle for input file (s) */')
                0086 
                0087       WRITE(msgBuf,'(A)')
                0088      &'// ======================================================='
                0089       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0090       WRITE(msgBuf,'(A)') '// End of CFC pkg config summary'
                0091       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0092       WRITE(msgBuf,'(A)')
                0093      &'// ======================================================='
                0094       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0095 
                0096 C---  Check CFC pkg settings:
                0097       errCount = 0
                0098 
                0099       IF ( CFC_windFile .NE. ' ' .AND. useEXF ) THEN
                0100         WRITE(msgBuf,'(A)')
                0101      &    'CFC_CHECK: setting CFC_windFile conflicts with using EXF'
                0102         CALL PRINT_ERROR( msgBuf, myThid )
                0103         errCount = errCount + 1
                0104       ENDIF
                0105 
                0106       IF ( CFC_iceFile .NE. ' ' .AND.
                0107      &     ( useThSIce .OR. useSEAICE ) ) THEN
                0108         WRITE(msgBuf,'(A)')
                0109      &    'CFC_CHECK: setting CFC_iceFile conflicts with using seaice'
                0110         CALL PRINT_ERROR( msgBuf, myThid )
                0111         errCount = errCount + 1
                0112       ENDIF
                0113 
                0114       IF ( CFC_forcingCycle.LE.zeroRL .AND.
                0115      &     ( CFC_windFile   .NE. ' '
                0116      &  .OR. CFC_atmospFile .NE. ' '
                0117      &  .OR. CFC_iceFile    .NE. ' ' ) ) THEN
                0118         WRITE(msgBuf,'(A)')
                0119      &       'CFC_CHECK: CFC_forcingCycle=0 but code to load'
                0120         CALL PRINT_ERROR( msgBuf, myThid )
                0121         WRITE(msgBuf,'(A)')
                0122      &       'CFC_CHECK:  non periodic forcing is missing'
                0123         CALL PRINT_ERROR( msgBuf, myThid )
                0124         errCount = errCount + 1
                0125       ENDIF
                0126 
                0127       IF ( errCount.GE.1 ) THEN
                0128         WRITE(msgBuf,'(A,I3,A)')
                0129      &       'CFC_CHECK: detected', errCount,' fatal error(s)'
                0130         CALL PRINT_ERROR( msgBuf, myThid )
                0131         CALL ALL_PROC_DIE( 0 )
                0132         STOP 'ABNORMAL END: S/R CFC_CHECK'
                0133       ENDIF
                0134 
                0135       WRITE(msgBuf,'(A)') 'CFC_CHECK: done'
                0136       CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
                0137 
                0138       _END_MASTER(myThid)
                0139 
                0140 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0141 
                0142 #endif /* ALLOW_CFC */
                0143 
                0144       RETURN
                0145       END