forked from altMITgcm/MITgcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfc_check.F
148 lines (121 loc) · 5.06 KB
/
cfc_check.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
C $Header: /u/gcmpack/MITgcm/pkg/cfc/cfc_check.F,v 1.1 2013/06/10 02:59:02 jmc Exp $
C $Name: $
#include "GCHEM_OPTIONS.h"
CBOP
C !ROUTINE: CFC_CHECK
C !INTERFACE:
SUBROUTINE CFC_CHECK( myThid )
C !DESCRIPTION: \bv
C *==========================================================*
C | S/R CFC_CHECK
C | o Print CFC parameter summary and
C | o Check for consistent CFC pkg setting
C *==========================================================*
C \ev
C !USES:
IMPLICIT NONE
C === Global variables ===
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "CFC.h"
C !INPUT/OUTPUT PARAMETERS:
C myThid :: My Thread Id. number
INTEGER myThid
CEOP
#ifdef ALLOW_CFC
C !LOCAL VARIABLES:
C msgBuf :: Informational/error message buffer
C ioUnit :: Work variable for IO unit number
CHARACTER*(MAX_LEN_MBUF) msgBuf
INTEGER ioUnit
INTEGER errCount
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
_BEGIN_MASTER(myThid)
ioUnit = standardMessageUnit
WRITE(msgBuf,'(A)') 'CFC_CHECK: #define ALLOW_CFC'
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
C--- Print summary:
WRITE(msgBuf,'(A)')
&'// ======================================================='
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
WRITE(msgBuf,'(A)') '// CFC pkg configuration summary'
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
WRITE(msgBuf,'(A)')
&'// ======================================================='
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
CALL WRITE_0D_C( atmCFC_inpFile, -1, INDEX_NONE,
& 'atmCFC_inpFile =', ' /* atmos CFC time-series input file */')
CALL WRITE_0D_RL( atmCFC_recSepTime, INDEX_NONE,
& 'atmCFC_recSepTime =', ' /* time record spacing (s) */')
CALL WRITE_0D_RL( atmCFC_timeOffset, INDEX_NONE,
& 'atmCFC_timeOffset =', ' /* time offset for atm CFC (s) */')
CALL WRITE_0D_RL( atmCFC_ySouthBnd, INDEX_NONE,
& 'atmCFC_ySouthBnd =', ' /* S Lat boundary for atm CFC (s) */')
CALL WRITE_0D_RL( atmCFC_yNorthBnd, INDEX_NONE,
& 'atmCFC_yNorthBnd =', ' /* N Lat boundary for atm CFC (s) */')
CALL WRITE_0D_RL( CFC_monFreq, INDEX_NONE,
& 'CFC_monFreq =', ' /* frequency for CFC monitor (s) */')
c CALL WRITE_0D_L( fluidIsAir, INDEX_NONE,
c & 'fluidIsAir =', ' /* fluid major constituent is Air */')
CALL WRITE_0D_C( CFC_windFile, -1, INDEX_NONE,
& 'CFC_windFile =', ' /* wind-speed input file */')
CALL WRITE_0D_C( CFC_atmospFile, -1, INDEX_NONE,
& 'CFC_atmospFile =', ' /* atmos surf pressure input file */')
CALL WRITE_0D_C( CFC_iceFile, -1, INDEX_NONE,
& 'CFC_iceFile =', ' /* seaice fraction input file */')
CALL WRITE_0D_RL( CFC_forcingPeriod, INDEX_NONE,
& 'CFC_forcingPeriod =',
& ' /* forcing period (s) of input file */')
CALL WRITE_0D_RL( CFC_forcingCycle, INDEX_NONE,
& 'CFC_forcingCycle =',
& ' /* period of Cycle for input file (s) */')
WRITE(msgBuf,'(A)')
&'// ======================================================='
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
WRITE(msgBuf,'(A)') '// End of CFC pkg config summary'
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
WRITE(msgBuf,'(A)')
&'// ======================================================='
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
C--- Check CFC pkg settings:
errCount = 0
IF ( CFC_windFile .NE. ' ' .AND. useEXF ) THEN
WRITE(msgBuf,'(A)')
& 'CFC_CHECK: setting CFC_windFile conflicts with using EXF'
CALL PRINT_ERROR( msgBuf, myThid )
errCount = errCount + 1
ENDIF
IF ( CFC_iceFile .NE. ' ' .AND.
& ( useThSIce .OR. useSEAICE ) ) THEN
WRITE(msgBuf,'(A)')
& 'CFC_CHECK: setting CFC_iceFile conflicts with using seaice'
CALL PRINT_ERROR( msgBuf, myThid )
errCount = errCount + 1
ENDIF
IF ( CFC_forcingCycle.LE.zeroRL .AND.
& ( CFC_windFile .NE. ' '
& .OR. CFC_atmospFile .NE. ' '
& .OR. CFC_iceFile .NE. ' ' ) ) THEN
WRITE(msgBuf,'(A)')
& 'CFC_CHECK: CFC_forcingCycle=0 but code to load'
CALL PRINT_ERROR( msgBuf, myThid )
WRITE(msgBuf,'(A)')
& 'CFC_CHECK: non periodic forcing is missing'
CALL PRINT_ERROR( msgBuf, myThid )
errCount = errCount + 1
ENDIF
IF ( errCount.GE.1 ) THEN
WRITE(msgBuf,'(A,I3,A)')
& 'CFC_CHECK: detected', errCount,' fatal error(s)'
CALL PRINT_ERROR( msgBuf, myThid )
CALL ALL_PROC_DIE( 0 )
STOP 'ABNORMAL END: S/R CFC_CHECK'
ENDIF
WRITE(msgBuf,'(A)') 'CFC_CHECK: done'
CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
_END_MASTER(myThid)
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
#endif /* ALLOW_CFC */
RETURN
END