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