/[MITgcm]/MITgcm/pkg/ggl90/ggl90_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/ggl90/ggl90_readparms.F

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


Revision 1.12 - (show annotations) (download)
Wed Aug 8 22:22:42 2012 UTC (11 years, 11 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint64x, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63r, checkpoint63s, checkpoint64
Changes since 1.11: +6 -2 lines
- added run time flag mxlSurfFlag to include the code that ensure
  mixing between first and second level (previously included as a comment)

1 C $Header: /u/gcmpack/MITgcm/pkg/ggl90/ggl90_readparms.F,v 1.11 2009/04/28 23:27:24 jmc Exp $
2 C $Name: $
3
4 #include "GGL90_OPTIONS.h"
5
6 SUBROUTINE GGL90_READPARMS( myThid )
7 C *==========================================================*
8 C | SUBROUTINE GGL90_READPARMS |
9 C | o Routine to read in file data.ggl90 |
10 C *==========================================================*
11 IMPLICIT NONE
12
13 C === Global variables ===
14 #include "SIZE.h"
15 #include "EEPARAMS.h"
16 #include "PARAMS.h"
17 #include "GRID.h"
18 #include "GGL90.h"
19
20 C === Routine arguments ===
21 C myThid - Number of this instance of GGL90_READPARMS
22 INTEGER myThid
23
24 #ifdef ALLOW_GGL90
25
26 C === Local variables ===
27 C msgBuf - Informational/error meesage buffer
28 C errIO - IO error flag
29 C iUnit - Work variable for IO unit number
30
31 CHARACTER*(MAX_LEN_MBUF) msgBuf
32 INTEGER errIO, iUnit, iL
33
34 INTEGER ILNBLNK
35 EXTERNAL ILNBLNK
36
37 C-- GGL90 vertical mixing parameters
38 NAMELIST /GGL90_PARM01/
39 & GGL90dumpFreq, GGL90taveFreq,
40 & GGL90diffTKEh,
41 & GGL90mixingMaps, GGL90writeState,
42 & GGL90ck, GGL90ceps, GGL90alpha, GGL90m2,
43 & GGL90TKEmin, GGL90TKEsurfMin, GGL90TKEbottom,
44 & GGL90mixingLengthMin, mxlMaxFlag, mxlSurfFlag,
45 & GGL90viscMax, GGL90diffMax, GGL90TKEFile
46 _BEGIN_MASTER(myThid)
47
48 WRITE(msgBuf,'(A)') ' GGL90_READPARMS: opening data.ggl90'
49 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
50 & SQUEEZE_RIGHT , 1)
51
52
53 CALL OPEN_COPY_DATA_FILE(
54 I 'data.ggl90', 'GGL90_READPARMS',
55 O iUnit,
56 I myThid )
57
58 C-- set default TKE vertical mixing parameters
59 GGL90dumpFreq = dumpFreq
60 GGL90taveFreq = taveFreq
61 GGL90mixingMaps = .FALSE.
62 GGL90writeState = .FALSE.
63 GGL90ck = 0.1 _d 0
64 GGL90ceps = 0.7 _d 0
65 GGL90alpha = 1.0 _d 0
66 C Blanke and Delecluse (1993, JPO) use
67 GGL90m2 = 3.75 _d 0
68 GGL90TKEmin = 1.0 _d -11
69 C Blanke and Delecluse (1993, JPO) use
70 GGL90TKEsurfMin = 1.0 _d -04
71 GGL90TKEbottom = UNSET_RL
72 GGL90viscMax = 1. _d 2
73 GGL90diffMax = 1. _d 2
74 GGL90diffTKEh = 0.0 _d 0
75 GGL90mixingLengthMin = 1.0 _d -08
76 mxlMaxFlag = 0
77 mxlSurfFlag = .FALSE.
78 GGL90TKEFile = ' '
79
80 C-----------------------------------------------------------------------
81 C define some non-dimensional constants and
82 C the vertical mixing coefficients in m-k-s units
83 C-----------------------------------------------------------------------
84
85 C-- Read settings from model parameter file "data.ggl90".
86 READ(UNIT=iUnit,NML=GGL90_PARM01,IOSTAT=errIO)
87 IF ( errIO .LT. 0 ) THEN
88 WRITE(msgBuf,'(A)')
89 & 'S/R INI_PARMS'
90 CALL PRINT_ERROR( msgBuf , 1)
91 WRITE(msgBuf,'(A)')
92 & 'Error reading numerical model '
93 CALL PRINT_ERROR( msgBuf , 1)
94 WRITE(msgBuf,'(A)')
95 & 'parameter file "data.ggl90"'
96 CALL PRINT_ERROR( msgBuf , 1)
97 WRITE(msgBuf,'(A)')
98 & 'Problem in namelist GGL90_PARM01'
99 CALL PRINT_ERROR( msgBuf , 1)
100 C CALL MODELDATA_EXAMPLE( myThid )
101 STOP 'ABNORMAL END: S/R GGL90_READPARMS'
102 ENDIF
103
104 CLOSE(iUnit)
105
106 WRITE(msgBuf,'(A)')
107 & ' GGL90_READPARMS: finished reading data.ggl90'
108 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
109 & SQUEEZE_RIGHT , 1)
110
111 C Now set-up any remaining parameters that result from the input parameters
112 IF ( GGL90TKEbottom .EQ. UNSET_RL ) THEN
113 GGL90TKEbottom = GGL90TKEmin
114 ENDIF
115 IF ( GGL90TKEmin .LE. 0. ) THEN
116 WRITE(msgBuf,'(A)')
117 & 'GGL90TKEmin must be greater than zero'
118 CALL PRINT_ERROR( msgBuf , 1)
119 STOP 'ABNORMAL END: S/R GGL90_READPARMS'
120 ENDIF
121 IF ( GGL90TKEbottom .LT. 0. ) THEN
122 WRITE(msgBuf,'(A)')
123 & 'GGL90TKEbottom must not be less than zero'
124 CALL PRINT_ERROR( msgBuf , 1)
125 STOP 'ABNORMAL END: S/R GGL90_READPARMS'
126 ENDIF
127 IF ( GGL90mixingLengthMin .LE. 0. ) THEN
128 WRITE(msgBuf,'(A)')
129 & 'GGL90mixingLengthMin must be greater than zero'
130 CALL PRINT_ERROR( msgBuf , 1)
131 STOP 'ABNORMAL END: S/R GGL90_READPARMS'
132 ENDIF
133 IF ( GGL90viscMax .LE. 0. ) THEN
134 WRITE(msgBuf,'(A)') 'GGL90viscMax must be greater than zero'
135 CALL PRINT_ERROR( msgBuf , 1)
136 STOP 'ABNORMAL END: S/R GGL90_READPARMS'
137 ENDIF
138 IF ( GGL90diffMax .LE. 0. ) THEN
139 WRITE(msgBuf,'(A)') 'GGL90diffMax must be greater than zero'
140 CALL PRINT_ERROR( msgBuf , 1)
141 STOP 'ABNORMAL END: S/R GGL90_READPARMS'
142 ENDIF
143
144 C-- print TKE vertical mixing parameters to stdout for better debugging
145 WRITE(msgBuf,'(A)')
146 &'// ======================================================='
147 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
148 & SQUEEZE_RIGHT , 1)
149 WRITE(msgBuf,'(A)') '// GGL90 configuration'
150 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
151 & SQUEEZE_RIGHT , 1)
152 WRITE(msgBuf,'(A)')
153 &'// ======================================================='
154 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
155 & SQUEEZE_RIGHT , 1)
156
157 CALL WRITE_0D_RL( GGL90dumpFreq, INDEX_NONE,'GGL90dumpFreq =',
158 &' /* GGL90 state write out interval ( s ). */')
159 CALL WRITE_0D_RL( GGL90taveFreq, INDEX_NONE,'GGL90taveFreq =',
160 &' /* GGL90 averaging interval ( s ). */')
161 CALL WRITE_0D_L(GGL90mixingMaps,INDEX_NONE,
162 & 'GGL90mixingMAPS =', ' /* GGL90 IO flag. */')
163 CALL WRITE_0D_L(GGL90writeState,INDEX_NONE,
164 & 'GGL90writeState =', ' /* GGL90 IO flag. */')
165 CALL WRITE_0D_RL( GGL90ck, INDEX_NONE,'GGL90ck =',
166 &' /* GGL90 viscosity parameter. */')
167 CALL WRITE_0D_RL( GGL90ceps, INDEX_NONE,'GGL90ceps =',
168 &' /* GGL90 dissipation parameter. */')
169 CALL WRITE_0D_RL( GGL90alpha, INDEX_NONE,'GGL90alpha =',
170 &' /* GGL90 TKE diffusivity parameter. */')
171 CALL WRITE_0D_RL( GGL90m2, INDEX_NONE,'GGL90m2 =',
172 &' /* GGL90 wind stress to vertical stress ratio. */')
173 CALL WRITE_0D_RL( GGL90TKEmin, INDEX_NONE,'GGL90TKEmin =',
174 &' /* GGL90 minimum kinetic energy ( m^2/s^2 ). */')
175 CALL WRITE_0D_RL( GGL90TKEsurfMin, INDEX_NONE,
176 & 'GGL90TKEsurfMin =',
177 &' /* GGL90 minimum surface kinetic energy ( m^2/s^2 ). */')
178 CALL WRITE_0D_RL( GGL90TKEbottom, INDEX_NONE,
179 & 'GGL90TKEbottom =',
180 & ' /* GGL90 bottom kinetic energy ( m^2/s^2 ). */')
181 CALL WRITE_0D_RL( GGL90viscMax, INDEX_NONE,'GGL90viscMax =',
182 & ' /* GGL90 upper limit for viscosity ( m^2/s ). */')
183 CALL WRITE_0D_RL( GGL90diffMax, INDEX_NONE,'GGL90diffMax =',
184 & ' /* GGL90 upper limit for diffusivity ( m^2/s ). */')
185 CALL WRITE_0D_RL( GGL90diffTKEh, INDEX_NONE,'GGL90diffTKEh =',
186 & ' /* GGL90 horizontal diffusivity for TKE ( m^2/s ). */')
187 CALL WRITE_0D_RL( GGL90mixingLengthMin, INDEX_NONE,
188 & 'GGL90mixingLengthMin =',
189 & ' /* GGL90 minimum mixing length ( m ). */')
190 CALL WRITE_0D_I(mxlMaxFlag, INDEX_NONE, 'mxlMaxFlag =',
191 & ' /* Flag for limiting mixing-length method */')
192 CALL WRITE_0D_L(mxlSurfFlag,INDEX_NONE,
193 & 'mxlSurfFlag =',
194 & ' /* GGL90 flag for near surface mixing. */')
195 iL = MAX_LEN_MBUF - 22
196 iL = MIN( iL, MAX(ILNBLNK(GGL90TKEFile),1) )
197 WRITE(msgBuf,'(A,A)')'GGL90: GGL90TKEFile = ',GGL90TKEFile(1:iL)
198 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
199 & SQUEEZE_RIGHT , 1)
200
201 WRITE(msgBuf,'(A)')
202 &'// ======================================================='
203 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
204 & SQUEEZE_RIGHT , 1)
205 WRITE(msgBuf,'(A)') '// End of GGL90 config. summary'
206 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
207 & SQUEEZE_RIGHT , 1)
208 WRITE(msgBuf,'(A)')
209 &'// ======================================================='
210 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
211 & SQUEEZE_RIGHT , 1)
212 WRITE(msgBuf,'(A)') ' '
213 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
214 & SQUEEZE_RIGHT , 1)
215
216 _END_MASTER(myThid)
217
218 C-- Everyone else must wait for the parameters to be loaded
219 _BARRIER
220
221 #endif /* ALLOW_GGL90 */
222
223 return
224 end

  ViewVC Help
Powered by ViewVC 1.1.22