1 |
C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_readparms.F,v 1.36 2017/04/03 17:09:01 ou.wang Exp $ |
2 |
C $Name: BASE $ |
3 |
|
4 |
#include "GMREDI_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GMREDI_READPARMS |
8 |
C !INTERFACE: |
9 |
SUBROUTINE GMREDI_READPARMS( myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
13 |
C | SUBROUTINE GMREDI_READPARMS |
14 |
C | o Routine to initialize GM/Redi variables and constants. |
15 |
C *==========================================================* |
16 |
C | Initialize GM/Redi parameters, read in data.gmredi |
17 |
C *==========================================================* |
18 |
C \ev |
19 |
|
20 |
C !USES: |
21 |
IMPLICIT NONE |
22 |
|
23 |
C === Global variables === |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
#include "GMREDI.h" |
29 |
|
30 |
C !INPUT/OUTPUT PARAMETERS: |
31 |
C === Routine arguments === |
32 |
INTEGER myThid |
33 |
|
34 |
#ifdef ALLOW_GMREDI |
35 |
C !LOCAL VARIABLES: |
36 |
C === Local variables === |
37 |
C msgBuf :: Informational/error message buffer |
38 |
C iUnit :: Work variable for IO unit number |
39 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
40 |
INTEGER iUnit |
41 |
CEOP |
42 |
|
43 |
C-- GM/Redi parameter |
44 |
C GM_Small_Number :: epsilon used in computing the slope |
45 |
C GM_slopeSqCutoff :: slope^2 cut-off value |
46 |
NAMELIST /GM_PARM01/ |
47 |
& GM_AdvForm, GM_AdvSeparate, |
48 |
& GM_InMomAsStress, |
49 |
& GM_isopycK, |
50 |
& GM_background_K, |
51 |
& GM_iso2dFile, GM_iso1dFile, |
52 |
& GM_bol2dFile, GM_bol1dFile, |
53 |
& GM_background_K3dFile, |
54 |
& GM_isopycK3dFile, |
55 |
& GM_taper_scheme, |
56 |
& GM_maxSlope, |
57 |
& GM_Kmin_horiz, |
58 |
& GM_Small_Number, GM_slopeSqCutoff, |
59 |
& GM_Visbeck_alpha, GM_Visbeck_length, |
60 |
& GM_Visbeck_depth, |
61 |
& GM_Visbeck_minDepth, GM_Visbeck_maxSlope, |
62 |
& GM_Visbeck_minVal_K, GM_Visbeck_maxVal_K, |
63 |
& GM_facTrL2dz, GM_facTrL2ML, GM_maxTransLay, |
64 |
& GM_Scrit, GM_Sd, |
65 |
& GM_MNC, |
66 |
& GM_UseBVP, GM_BVP_cMin, GM_BVP_ModeNumber, |
67 |
& GM_useSubMeso, subMeso_Ceff, subMeso_invTau, |
68 |
& subMeso_LfMin, subMeso_Lmax, GM_K3D_b1, |
69 |
& GM_K3D_gamma, GM_useK3D, GM_K3D_vecFreq, |
70 |
& GM_K3D_EadyMinDepth, GM_K3D_EadyMaxDepth, |
71 |
& GM_K3D_Lambda, GM_K3D_smallK, GM_K3D_surfK, |
72 |
& GM_K3D_maxC, GM_K3D_minCori, GM_K3D_minN2, |
73 |
& GM_K3D_surfMinDepth, GM_maxK3D, GM_K3D_Rmax, |
74 |
& GM_K3D_constK, GM_K3D_use_constK, GM_K3D_smooth, |
75 |
& GM_K3D_beta_eq_0, GM_K3D_Rmin, GM_K3D_ThickSheet, |
76 |
& GM_K3D_constRedi, GM_K3D_minRenorm, |
77 |
& GM_K3D_maxRenorm |
78 |
|
79 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
80 |
|
81 |
IF ( .NOT.useGMRedi ) THEN |
82 |
C- pkg GMREDI is not used |
83 |
_BEGIN_MASTER(myThid) |
84 |
C- Track pkg activation status: |
85 |
C print a (weak) warning if data.gmredi is found |
86 |
CALL PACKAGES_UNUSED_MSG( 'useGMRedi', ' ', ' ' ) |
87 |
_END_MASTER(myThid) |
88 |
RETURN |
89 |
ENDIF |
90 |
|
91 |
_BEGIN_MASTER(myThid) |
92 |
|
93 |
C-- Default values GM/Redi |
94 |
GM_AdvForm = .FALSE. |
95 |
GM_AdvSeparate = .FALSE. |
96 |
GM_InMomAsStress = .FALSE. |
97 |
GM_isopycK = -999. |
98 |
GM_background_K = 0. _d 0 |
99 |
GM_maxSlope = 1. _d -2 |
100 |
GM_Kmin_horiz = 0. _d 0 |
101 |
GM_Small_Number = 1. _d -20 |
102 |
GM_slopeSqCutoff = 1. _d +48 |
103 |
GM_taper_scheme = ' ' |
104 |
GM_facTrL2dz = 1. |
105 |
GM_facTrL2ML = 5. |
106 |
GM_maxTransLay = 500. |
107 |
GM_Scrit = 0.004 _d 0 |
108 |
GM_Sd = 0.001 _d 0 |
109 |
GM_MNC = useMNC |
110 |
GM_iso2dFile = ' ' |
111 |
GM_iso1dFile = ' ' |
112 |
GM_bol2dFile = ' ' |
113 |
GM_bol1dFile = ' ' |
114 |
GM_background_K3dFile = ' ' |
115 |
GM_isopycK3dFile = ' ' |
116 |
|
117 |
C-- Default values GM/Redi I/O control |
118 |
c GM_dumpFreq = -1. |
119 |
c GM_taveFreq = -1. |
120 |
|
121 |
C-- Default values Visbeck |
122 |
GM_Visbeck_alpha = 0. _d 0 |
123 |
GM_Visbeck_length = 200. _d 3 |
124 |
GM_Visbeck_depth = 1000. _d 0 |
125 |
GM_Visbeck_minDepth = 0. _d 0 |
126 |
GM_Visbeck_maxSlope = UNSET_RL |
127 |
GM_Visbeck_minVal_K = 0. _d 0 |
128 |
GM_Visbeck_maxVal_K = 2500. _d 0 |
129 |
|
130 |
C-- Default values BVP |
131 |
GM_UseBVP = .FALSE. |
132 |
GM_BVP_ModeNumber = 1 |
133 |
GM_BVP_cMin = 1. _d -1 |
134 |
|
135 |
C-- Default values Sub-Meso (corresponding tau = 5.8 days): |
136 |
GM_useSubMeso = .FALSE. |
137 |
subMeso_invTau = 2.0 _d -6 |
138 |
subMeso_LfMin = 1.0 _d +3 |
139 |
subMeso_Ceff = 7.0 _d -2 |
140 |
subMeso_Lmax = 110. _d +3 |
141 |
|
142 |
C-- Default values for K3D |
143 |
GM_useK3D = .FALSE. |
144 |
GM_K3D_beta_eq_0 = .TRUE. |
145 |
GM_K3D_use_constK= .FALSE. |
146 |
GM_K3D_ThickSheet= .FALSE. |
147 |
GM_K3D_smooth = .TRUE. |
148 |
GM_K3D_surfK = .FALSE. |
149 |
GM_K3D_constRedi = .FALSE. |
150 |
GM_K3D_constK = 1000.0 |
151 |
GM_K3D_gamma = 1.0 |
152 |
GM_K3D_b1 = 4.0 |
153 |
GM_K3D_EadyMinDepth = 50.0 |
154 |
GM_K3D_EadyMaxDepth = 1000.0 |
155 |
GM_K3D_Lambda = 1.0 |
156 |
GM_K3D_smallK = 100.0 |
157 |
GM_K3D_maxC = 0.15 |
158 |
GM_maxK3D = 20e3 |
159 |
GM_K3D_Rmin = 30e3 |
160 |
GM_K3D_Rmax = 75e3 |
161 |
GM_K3D_minCori = zeroRL |
162 |
GM_K3D_minN2 = 1.0e-8 |
163 |
GM_K3D_surfMinDepth = 100.0 |
164 |
GM_K3D_vecFreq = 2592000.0 |
165 |
GM_K3D_minRenorm = oneRL |
166 |
GM_K3D_maxRenorm = 20.0 |
167 |
|
168 |
WRITE(msgBuf,'(A)') ' GM_READPARMS: opening data.gmredi' |
169 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
170 |
& SQUEEZE_RIGHT , 1) |
171 |
CALL OPEN_COPY_DATA_FILE( |
172 |
I 'data.gmredi', 'GM_READPARMS', |
173 |
O iUnit, |
174 |
I myThid ) |
175 |
|
176 |
C Read parameters from open data file |
177 |
READ(UNIT=iUnit,NML=GM_PARM01) |
178 |
WRITE(msgBuf,'(A)') ' GM_READPARMS: finished reading data.gmredi' |
179 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
180 |
& SQUEEZE_RIGHT , 1) |
181 |
C Close the open data file |
182 |
#ifdef SINGLE_DISK_IO |
183 |
CLOSE(iUnit) |
184 |
#else |
185 |
CLOSE(iUnit,STATUS='DELETE') |
186 |
#endif /* SINGLE_DISK_IO */ |
187 |
|
188 |
C Default value for GM_isopycK is equal to GM_background_K : |
189 |
IF (GM_isopycK.EQ.-999.) GM_isopycK = GM_background_K |
190 |
|
191 |
C Default value for GM_Visbeck_maxSlope is equal to GM_maxSlope : |
192 |
IF ( GM_Visbeck_maxSlope .EQ. UNSET_RL ) |
193 |
& GM_Visbeck_maxSlope = GM_maxSlope |
194 |
|
195 |
C Some constants |
196 |
GM_rMaxSlope = 0. |
197 |
if (GM_maxSlope.NE.0.) GM_rMaxSlope = 1. _d 0 / GM_maxSlope |
198 |
|
199 |
IF (GM_AdvForm) THEN |
200 |
GM_skewflx = 0. |
201 |
GM_advect = 1. |
202 |
GM_ExtraDiag = GM_Visbeck_alpha.NE.0. .OR. GM_isopycK.NE.0. |
203 |
ELSE |
204 |
GM_skewflx = 1. |
205 |
GM_advect = 0. |
206 |
GM_ExtraDiag = GM_isopycK.NE.GM_background_K |
207 |
ENDIF |
208 |
IF ( GM_iso2dFile .NE. GM_bol2dFile .OR. |
209 |
& GM_iso1dFile .NE. GM_bol1dFile ) THEN |
210 |
GM_ExtraDiag = .TRUE. |
211 |
ENDIF |
212 |
|
213 |
IF (GM_UseBVP) THEN |
214 |
GM_BVP_rModeNumber = 1. _d 0/DBLE(GM_BVP_ModeNumber) |
215 |
GM_BVP_cHat2Min = GM_BVP_cMin**2*rhoConst/gravity |
216 |
ENDIF |
217 |
|
218 |
C Make sure that we locally honor the global MNC on/off flag |
219 |
GM_MNC = GM_MNC .AND. useMNC |
220 |
#ifndef ALLOW_MNC |
221 |
C Fix to avoid running without getting any output: |
222 |
GM_MNC = .FALSE. |
223 |
#endif |
224 |
GM_MDSIO = (.NOT. GM_MNC) .OR. outputTypesInclusive |
225 |
|
226 |
_END_MASTER(myThid) |
227 |
|
228 |
C-- Everyone else must wait for the parameters to be loaded |
229 |
_BARRIER |
230 |
|
231 |
#endif /* ALLOW_GMREDI */ |
232 |
|
233 |
RETURN |
234 |
END |