/[MITgcm]/MITgcm/pkg/ocn_compon_interf/cpl_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/ocn_compon_interf/cpl_readparms.F

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


Revision 1.7 - (show annotations) (download)
Fri Sep 15 15:45:18 2006 UTC (17 years, 8 months ago) by jscott
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post
Changes since 1.6: +2 -2 lines
fixed syntax error when undef ATMOSPHERIC_LOADING

1 C $Header: /u/gcmpack/MITgcm/pkg/ocn_compon_interf/cpl_readparms.F,v 1.6 2005/04/19 14:36:08 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: CPL_READPARMS
9 C !INTERFACE:
10 SUBROUTINE CPL_READPARMS( myThid )
11
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | S/R CPL_READPARMS
15 C | o Read Coupling parameters that control import/export
16 C | from/to the coupler layer
17 C *==========================================================*
18 C | this version is specific to 1 component (ocean)
19 C *==========================================================*
20 C \ev
21
22 C !USES:
23 IMPLICIT NONE
24
25 C == Global variables ===
26
27 #include "SIZE.h"
28
29 #include "EEPARAMS.h"
30 #include "PARAMS.h"
31 #include "CPL_PARAMS.h"
32 #ifdef ALLOW_MNC
33 #include "MNC_PARAMS.h"
34 #endif
35
36 C !INPUT/OUTPUT PARAMETERS:
37 C == Routine Arguments ==
38 C myThid - Number of this instance
39 INTEGER myThid
40 CEOP
41
42 #ifdef COMPONENT_MODULE
43
44 C Functions
45 INTEGER ILNBLNK
46
47 C == Local Variables ==
48 C msgBuf :: Informational/error meesage buffer
49 C iUnit :: Work variable for IO unit number
50 C k :: loop counter
51 C iL :: Work variable for length of file-name
52 CHARACTER*(MAX_LEN_MBUF) msgBuf
53 INTEGER iUnit, k, iL
54
55 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
56
57 C-- Coupling parameters:
58 C cpl_earlyExpImpCall :: call coupler early in the time stepping call sequence
59 C useImportHFlx :: True => use the Imported HeatFlux from couler
60 C useImportFW :: True => use the Imported Fresh Water flux fr cpl
61 C useImportTau :: True => use the Imported Wind-Stress from couler
62 C useImportSLP :: True => use the Imported Sea-level Atmos. Pressure
63 C useImportSIce :: True => use the Imported Sea-Ice loading
64 C cpl_taveFreq :: Frequency^-1 for time-Aver. output (s)
65 NAMELIST /CPL_OCN_PARAM/
66 & cpl_earlyExpImpCall,
67 & useImportHFlx, useImportFW, useImportTau,
68 & useImportSLP, useImportSIce,
69 & cpl_taveFreq, cpl_snapshot_mnc, cpl_timeave_mnc
70
71 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
72
73 C- Set default value:
74 cpl_earlyExpImpCall = .TRUE.
75 useImportHFlx = .TRUE.
76 useImportFW = .TRUE.
77 useImportTau = .TRUE.
78 useImportSLP = .TRUE.
79 useImportSIce = .TRUE.
80 cpl_taveFreq = taveFreq
81 #ifdef ALLOW_MNC
82 cpl_snapshot_mnc = snapshot_mnc
83 cpl_timeave_mnc = timeave_mnc
84 #else
85 cpl_snapshot_mnc = .FALSE.
86 cpl_timeave_mnc = .FALSE.
87 #endif
88
89 _BEGIN_MASTER(myThid)
90
91 WRITE(msgBuf,'(A)') ' CPL_READPARMS: opening data.cpl'
92 CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
93
94 CALL OPEN_COPY_DATA_FILE( 'data.cpl', 'CPL_READPARMS',
95 O iUnit, myThid )
96
97 C-- Read parameters from open data file:
98
99 C- Parameters for coupling interface:
100 READ(UNIT=iUnit,NML=CPL_OCN_PARAM)
101
102 WRITE(msgBuf,'(A)')
103 & ' CPL_READPARMS: finished reading data.cpl'
104 CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
105
106 C-- Close the open data file
107 CLOSE(iUnit)
108
109 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
110 C-- Check parameters and model configuration
111
112 C- If land_taveFreq is positive, then must compile the land-diagnostics code
113 #ifndef ALLOW_TIMEAVE
114 IF (cpl_taveFreq.GT.0.) THEN
115 WRITE(msgBuf,'(A)')
116 & 'CPL_READPARMS: cpl_taveFreq > 0 but not compiled pkg/timeave'
117 CALL PRINT_ERROR( msgBuf, myThid)
118 WRITE(msgBuf,'(A)')
119 & 'Re-compile with pkg "timeave" in packages.conf'
120 CALL PRINT_ERROR( msgBuf, myThid)
121 STOP 'ABNORMAL END: S/R CPL_READPARMS'
122 ENDIF
123 #endif /* ALLOW_TIMEAVE */
124
125 #ifndef ATMOSPHERIC_LOADING
126 IF ( useImportSLP ) THEN
127 WRITE(msgBuf,'(A)')
128 & 'CPL_READPARMS: useImportSLP is set but'
129 CALL PRINT_ERROR( msgBuf , myThid)
130 ELSEIF ( useImportSIce ) THEN
131 WRITE(msgBuf,'(A)')
132 & 'CPL_READPARMS: useImportSIce is set but'
133 CALL PRINT_ERROR( msgBuf , myThid)
134 ENDIF
135 IF ( useImportSLP .OR. useImportSIce ) THEN
136 WRITE(msgBuf,'(A)')
137 & 'CPL_READPARMS: pressure loading code is not compiled.'
138 CALL PRINT_ERROR( msgBuf , myThid)
139 WRITE(msgBuf,'(A)')
140 & 'Re-compile with: #define ATMOSPHERIC_LOADING'
141 CALL PRINT_ERROR( msgBuf , myThid)
142 STOP 'ABNORMAL END: S/R CPL_READPARMS'
143 ENDIF
144 #endif
145
146 IF ( .NOT.cpl_earlyExpImpCall .AND. staggerTimeStep ) THEN
147 WRITE(msgBuf,'(A,L5,A,L5)')
148 & 'CPL_READPARMS: staggerTimeStep=',staggerTimeStep,
149 & ' ; cpl_earlyExpImpCall=', cpl_earlyExpImpCall
150 CALL PRINT_ERROR( msgBuf, myThid)
151 WRITE(msgBuf,'(A)')
152 & 'CPL_READPARMS: taggerTimeStep requires cpl_earlyExpImpCall'
153 CALL PRINT_ERROR( msgBuf, myThid)
154 STOP 'ABNORMAL END: S/R CPL_READPARMS'
155 ENDIF
156
157 C Set IO flags
158 cpl_snapshot_mdsio = .TRUE.
159 cpl_timeave_mdsio = .TRUE.
160 #ifdef ALLOW_MNC
161 IF (useMNC) THEN
162 IF ( .NOT.outputTypesInclusive
163 & .AND. cpl_snapshot_mnc ) cpl_snapshot_mdsio = .FALSE.
164 IF ( .NOT.outputTypesInclusive
165 & .AND. cpl_timeave_mnc ) cpl_timeave_mdsio = .FALSE.
166 ENDIF
167 #endif
168
169 C- derive other parameters:
170
171 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
172 C-- Print out parameter values :
173
174 iUnit = standardMessageUnit
175 WRITE(msgBuf,'(A)') ' '
176 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1)
177 WRITE(msgBuf,'(A)') '// ==================================='
178 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1)
179 WRITE(msgBuf,'(A)') '// Coupling package parameters :'
180 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1)
181 WRITE(msgBuf,'(A)') '// ==================================='
182 CALL PRINT_MESSAGE(msgBuf,iUnit,SQUEEZE_RIGHT,1)
183
184 C- namelist CPL_OCN_PARAM:
185 CALL WRITE_0D_L( cpl_earlyExpImpCall, INDEX_NONE,
186 & 'cpl_earlyExpImpCall=',
187 & ' /* call coupler early in the time-stepping */')
188 CALL WRITE_0D_L( useImportHFlx, INDEX_NONE,
189 & 'useImportHFlx=',
190 & ' /* use Imported Heat-Flx fr Coupler on/off flag */')
191 CALL WRITE_0D_L( useImportFW , INDEX_NONE,
192 & 'useImportFW =',
193 & ' /* use Imported Fresh-Water fr Cpl. on/off flag */')
194 CALL WRITE_0D_L( useImportTau , INDEX_NONE,
195 & 'useImportTau =',
196 & ' /* use Imported Wind-Stress fr Cpl. on/off flag */')
197 CALL WRITE_0D_L( useImportSLP , INDEX_NONE,
198 & 'useImportSLP =',
199 & ' /* use Imported Sea-level Atm Press on/off flag */')
200 CALL WRITE_0D_L( useImportSIce , INDEX_NONE,
201 & 'useImportSIce=',
202 & ' /* use Imported Sea-Ice loading on/off flag */')
203 CALL WRITE_0D_R8( cpl_taveFreq, INDEX_NONE, 'cpl_taveFreq =',
204 & ' /* Frequency^-1 for time-Aver. output (s) */')
205 CALL WRITE_0D_L( cpl_timeave_mnc , INDEX_NONE,
206 & 'cpl_timeave_mnc =',
207 & ' /* write TimeAv to MNC file on/off flag */')
208 CALL WRITE_0D_L( cpl_timeave_mdsio , INDEX_NONE,
209 & 'cpl_timeave_mdsio =',
210 & ' /* write TimeAv to MDSIO file on/off flag */')
211
212 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
213
214 _END_MASTER(myThid)
215
216 C-- Everyone else must wait for the parameters to be loaded
217 _BARRIER
218
219 #endif /* COMPONENT_MODULE */
220
221 RETURN
222 END

  ViewVC Help
Powered by ViewVC 1.1.22