1 |
dgoldberg |
1.1 |
C $Header: /u/gcmpack/MITgcm_contrib/dgoldberg/streamice/streamice_readparms.F,v 1.16 2013/06/11 17:42:17 dgoldberg Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
|
5 |
|
|
C this needs changes |
6 |
|
|
|
7 |
|
|
#include "STREAMICE_OPTIONS.h" |
8 |
|
|
|
9 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
10 |
|
|
CBOP 0 |
11 |
|
|
SUBROUTINE STREAMICE_READPARMS( myThid ) |
12 |
|
|
|
13 |
|
|
C !DESCRIPTION: |
14 |
|
|
C Initialize STREAMICE variables and constants. |
15 |
|
|
|
16 |
|
|
C !USES: |
17 |
|
|
IMPLICIT NONE |
18 |
|
|
#include "SIZE.h" |
19 |
|
|
#include "EEPARAMS.h" |
20 |
|
|
#include "PARAMS.h" |
21 |
|
|
#include "STREAMICE.h" |
22 |
|
|
#include "STREAMICE_BDRY.h" |
23 |
|
|
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
24 |
|
|
#include "STREAMICE_CTRL_FLUX.h" |
25 |
|
|
#endif |
26 |
|
|
|
27 |
|
|
C !INPUT PARAMETERS: |
28 |
|
|
INTEGER myThid |
29 |
|
|
CEOP |
30 |
|
|
|
31 |
|
|
#ifdef ALLOW_STREAMICE |
32 |
|
|
|
33 |
|
|
C !LOCAL VARIABLES: |
34 |
|
|
C msgBuf :: Informational/error message buffer |
35 |
|
|
C iUnit :: Work variable for IO unit number |
36 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
37 |
|
|
INTEGER iUnit, iarr, tarr |
38 |
|
|
|
39 |
|
|
NAMELIST /STREAMICE_PARM01/ |
40 |
|
|
& streamice_density, streamice_density_ocean_avg, |
41 |
|
|
& B_glen_isothermal, n_glen, eps_glen_min, eps_u_min, |
42 |
|
|
& C_basal_fric_const, n_basal_friction, |
43 |
|
|
& streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol, |
44 |
|
|
& streamice_nonlin_tol_fp, |
45 |
|
|
& streamice_max_cg_iter, streamice_max_nl_iter, |
46 |
|
|
& STREAMICE_GL_regularize, |
47 |
|
|
& STREAMICEthickInit, |
48 |
|
|
& STREAMICEsigcoordInit, |
49 |
|
|
& STREAMICEsigcoordFile, |
50 |
|
|
& STREAMICEthickFile, |
51 |
|
|
& STREAMICEcalveMaskFile, |
52 |
|
|
& STREAMICEcostMaskFile, |
53 |
|
|
& STREAMICEison, |
54 |
|
|
& STREAMICE_dump_mdsio, STREAMICE_tave_mdsio, |
55 |
|
|
& STREAMICE_dump_mnc, STREAMICE_tave_mnc, |
56 |
|
|
& STREAMICE_GL_regularize, STREAMICE_move_front, |
57 |
|
|
& STREAMICE_calve_to_mask, |
58 |
|
|
& STREAMICE_diagnostic_only, |
59 |
|
|
& STREAMICE_lower_cg_tol, |
60 |
|
|
& streamice_CFL_factor, |
61 |
|
|
& streamice_adjDump, |
62 |
|
|
& streamice_bg_surf_slope_x, streamice_bg_surf_slope_y, |
63 |
|
|
& streamice_kx_b_init, streamice_ky_b_init, |
64 |
|
|
& STREAMICEbasalTracConfig, |
65 |
|
|
& STREAMICEbasalTracFile, |
66 |
|
|
& STREAMICEvelOptimFile, |
67 |
|
|
& STREAMICEtopogFile, |
68 |
|
|
& STREAMICEhmaskFile, |
69 |
|
|
& STREAMICEHBCyFile, |
70 |
|
|
& STREAMICEHBCxFile, |
71 |
|
|
& STREAMICEuFaceBdryFile, |
72 |
|
|
& STREAMICEvFaceBdryFile, |
73 |
|
|
& STREAMICEuDirichValsFile, |
74 |
|
|
& STREAMICEvDirichValsFile, |
75 |
|
|
& STREAMICEGlenConstFile, STREAMICEGlenConstConfig, |
76 |
|
|
& STREAMICE_ppm_driving_stress, |
77 |
|
|
& STREAMICE_h_ctrl_const_surf, |
78 |
|
|
& streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel, |
79 |
|
|
& streamice_wgt_avthick, streamice_wgt_tikh, |
80 |
|
|
& streamice_addl_backstress, |
81 |
|
|
& streamice_smooth_gl_width, |
82 |
|
|
& streamice_adot_uniform, |
83 |
|
|
& STREAMICE_ADV_SCHEME |
84 |
|
|
|
85 |
|
|
#ifdef ALLOW_STREAMICE_2DTRACER |
86 |
|
|
NAMELIST /STREAMICE_PARMTRACER/ |
87 |
|
|
& STREAMICETrac2DBCxFile, |
88 |
|
|
& STREAMICETrac2DBCyFile, |
89 |
|
|
& STREAMICETrac2DINITFile |
90 |
|
|
#endif |
91 |
|
|
|
92 |
|
|
#ifdef ALLOW_PETSC |
93 |
|
|
NAMELIST /STREAMICE_PARMPETSC/ |
94 |
|
|
& PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE |
95 |
|
|
#endif |
96 |
|
|
|
97 |
|
|
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
98 |
|
|
NAMELIST /STREAMICE_PARMFLUXCTRL/ |
99 |
|
|
& n_fluxes, n_epochs, |
100 |
|
|
& streamice_ctrl_flux_id, |
101 |
|
|
& streamice_ctrl_flux_scaleVel |
102 |
|
|
#endif |
103 |
|
|
|
104 |
|
|
|
105 |
|
|
NAMELIST /STREAMICE_PARM02/ |
106 |
|
|
& shelf_max_draft, |
107 |
|
|
& shelf_min_draft, |
108 |
|
|
& shelf_edge_pos, |
109 |
|
|
& shelf_slope_scale, |
110 |
|
|
& shelf_flat_width, |
111 |
|
|
& flow_dir |
112 |
|
|
|
113 |
|
|
NAMELIST /STREAMICE_PARM03/ |
114 |
|
|
& min_x_noflow_NORTH, max_x_noflow_NORTH, |
115 |
|
|
& min_x_noflow_SOUTH, max_x_noflow_SOUTH, |
116 |
|
|
& min_y_noflow_WEST, max_y_noflow_WEST, |
117 |
|
|
& min_y_noflow_EAST, max_y_noflow_EAST, |
118 |
|
|
& min_x_noStress_NORTH, max_x_noStress_NORTH, |
119 |
|
|
& min_x_noStress_SOUTH, max_x_noStress_SOUTH, |
120 |
|
|
& min_y_noStress_WEST, max_y_noStress_WEST, |
121 |
|
|
& min_y_noStress_EAST, max_y_noStress_EAST, |
122 |
|
|
& min_x_FluxBdry_NORTH, max_x_FluxBdry_NORTH, |
123 |
|
|
& min_x_FluxBdry_SOUTH, max_x_FluxBdry_SOUTH, |
124 |
|
|
& min_y_FluxBdry_WEST, max_y_FluxBdry_WEST, |
125 |
|
|
& min_y_FluxBdry_EAST, max_y_FluxBdry_EAST, |
126 |
|
|
& min_x_Dirich_NORTH, max_x_Dirich_NORTH, |
127 |
|
|
& min_x_Dirich_SOUTH, max_x_Dirich_SOUTH, |
128 |
|
|
& min_y_Dirich_WEST, max_y_Dirich_WEST, |
129 |
|
|
& min_y_Dirich_EAST, max_y_Dirich_EAST, |
130 |
|
|
& min_x_CFBC_NORTH, max_x_CFBC_NORTH, |
131 |
|
|
& min_x_CFBC_SOUTH, max_x_CFBC_SOUTH, |
132 |
|
|
& min_y_CFBC_WEST, max_y_CFBC_WEST, |
133 |
|
|
& min_y_CFBC_EAST, max_y_CFBC_EAST, |
134 |
|
|
& flux_bdry_val_SOUTH, flux_bdry_val_NORTH, |
135 |
|
|
& flux_bdry_val_WEST, flux_bdry_val_EAST, |
136 |
|
|
& STREAMICE_NS_periodic, STREAMICE_EW_periodic |
137 |
|
|
|
138 |
|
|
_BEGIN_MASTER(myThid) |
139 |
|
|
|
140 |
|
|
C-- Default values for STREAMICE |
141 |
|
|
|
142 |
|
|
streamice_density = 917. |
143 |
|
|
streamice_density_ocean_avg = 1024. |
144 |
|
|
B_glen_isothermal = 9.461e-18 ! Pa (-1/3) a |
145 |
|
|
n_glen = 3. |
146 |
|
|
eps_glen_min = 1.0e-12 |
147 |
|
|
eps_u_min = 1.0e-6 |
148 |
|
|
C_basal_fric_const = 31.71 ! Pa (m/a)-1n |
149 |
|
|
n_basal_friction = 1. |
150 |
|
|
streamice_vel_update = 169200. ! seconds |
151 |
|
|
streamice_cg_tol = 1e-6 |
152 |
|
|
streamice_nonlin_tol = 1e-6 |
153 |
|
|
streamice_nonlin_tol_fp = 1.e-14 |
154 |
|
|
streamice_max_cg_iter = 2000 |
155 |
|
|
streamice_max_nl_iter = 100 |
156 |
|
|
streamice_n_sub_regularize = 4 |
157 |
|
|
streamice_CFL_factor = .5 |
158 |
|
|
streamice_adjDump = 0. |
159 |
|
|
streamice_bg_surf_slope_x = .0 |
160 |
|
|
streamice_bg_surf_slope_y = 0. |
161 |
|
|
streamice_kx_b_init = 1. |
162 |
|
|
streamice_ky_b_init = 1. |
163 |
|
|
streamice_wgt_drift = 0. |
164 |
|
|
streamice_wgt_tikh = 0. |
165 |
|
|
streamice_wgt_surf = 0. |
166 |
|
|
streamice_wgt_vel = 0. |
167 |
|
|
streamice_wgt_avthick = 0. |
168 |
|
|
streamice_addl_backstress = 0.0 |
169 |
|
|
streamice_smooth_gl_width = 0.0 |
170 |
|
|
streamice_adot_uniform = 0.0 |
171 |
|
|
|
172 |
|
|
STREAMICEthickInit = 'FILE' |
173 |
|
|
STREAMICEthickFile = ' ' |
174 |
|
|
STREAMICEcalveMaskFile = ' ' |
175 |
|
|
STREAMICEsigcoordInit = 'UNIFORM' |
176 |
|
|
STREAMICEsigcoordFile = ' ' |
177 |
|
|
STREAMICEbasalTracConfig = 'UNIFORM' |
178 |
|
|
STREAMICEbasalTracFile = ' ' |
179 |
|
|
STREAMICEvelOptimFile = '' |
180 |
|
|
STREAMICEtopogFile = '' |
181 |
|
|
STREAMICEhmaskFile = '' |
182 |
|
|
STREAMICEHBCyFile = '' |
183 |
|
|
STREAMICEHBCxFile = '' |
184 |
|
|
#ifdef ALLOW_STREAMICE_2DTRACER |
185 |
|
|
STREAMICETrac2DBCxFile = '' |
186 |
|
|
STREAMICETrac2DBCyFile = '' |
187 |
|
|
STREAMICETrac2DInitFile = '' |
188 |
|
|
#endif |
189 |
|
|
STREAMICEuFaceBdryFile = '' |
190 |
|
|
STREAMICEvFaceBdryFile = '' |
191 |
|
|
STREAMICEuDirichValsFile = '' |
192 |
|
|
STREAMICEvDirichValsFile = '' |
193 |
|
|
STREAMICEGlenConstFile = '' |
194 |
|
|
STREAMICEcostMaskFile = '' |
195 |
|
|
STREAMICEGlenConstConfig = 'UNIFORM' |
196 |
|
|
#ifdef ALLOW_PETSC |
197 |
|
|
PETSC_PRECOND_TYPE = 'PCBJACOBI' |
198 |
|
|
PETSC_SOLVER_TYPE = 'KSPCG' |
199 |
|
|
#endif |
200 |
|
|
STREAMICE_ADV_SCHEME = '' |
201 |
|
|
|
202 |
|
|
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
203 |
|
|
n_fluxes = 0 |
204 |
|
|
n_epochs = 0 |
205 |
|
|
DO iarr=1,n_fluxes_max |
206 |
|
|
streamice_ctrl_flux_id(iarr) = 0 |
207 |
|
|
DO tarr=1,n_epochs_max |
208 |
|
|
streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 |
209 |
|
|
ENDDO |
210 |
|
|
ENDDO |
211 |
|
|
#endif |
212 |
|
|
|
213 |
|
|
STREAMICEison = .TRUE. |
214 |
|
|
STREAMICE_tave_mdsio = .TRUE. |
215 |
|
|
STREAMICE_dump_mdsio = .TRUE. |
216 |
|
|
STREAMICE_dump_mnc = .FALSE. |
217 |
|
|
STREAMICE_tave_mnc = .FALSE. |
218 |
|
|
STREAMICE_GL_regularize = .FALSE. |
219 |
|
|
STREAMICE_move_front = .FALSE. |
220 |
|
|
STREAMICE_calve_to_mask = .FALSE. |
221 |
|
|
! STREAMICE_geom_file_setup = .FALSE. |
222 |
|
|
! STREAMICE_construct_matrix = .TRUE. |
223 |
|
|
STREAMICE_lower_cg_tol = .FALSE. |
224 |
|
|
STREAMICE_diagnostic_only = .FALSE. |
225 |
|
|
STREAMICE_ppm_driving_stress = .FALSE. |
226 |
|
|
STREAMICE_h_ctrl_const_surf = .FALSE. |
227 |
|
|
! STREAMICE_hybrid_stress= .FALSE. |
228 |
|
|
|
229 |
|
|
min_x_noflow_NORTH = 0. |
230 |
|
|
max_x_noflow_NORTH = 0. |
231 |
|
|
min_x_noflow_SOUTH = 0. |
232 |
|
|
max_x_noflow_SOUTH = 0. |
233 |
|
|
min_y_noflow_WEST = 0. |
234 |
|
|
max_y_noflow_WEST = 0. |
235 |
|
|
min_y_noflow_EAST = 0. |
236 |
|
|
max_y_noflow_EAST = 0. |
237 |
|
|
min_x_noStress_NORTH = 0. |
238 |
|
|
max_x_noStress_NORTH = 0. |
239 |
|
|
min_x_noStress_SOUTH = 0. |
240 |
|
|
max_x_noStress_SOUTH = 0. |
241 |
|
|
min_y_noStress_WEST = 0. |
242 |
|
|
max_y_noStress_WEST = 0. |
243 |
|
|
min_y_noStress_EAST = 0. |
244 |
|
|
max_y_noStress_EAST = 0. |
245 |
|
|
min_x_FluxBdry_NORTH = 0. |
246 |
|
|
max_x_FluxBdry_NORTH = 0. |
247 |
|
|
min_x_FluxBdry_SOUTH = 0. |
248 |
|
|
max_x_FluxBdry_SOUTH = 0. |
249 |
|
|
min_y_FluxBdry_WEST = 0. |
250 |
|
|
max_y_FluxBdry_WEST = 0. |
251 |
|
|
min_y_FluxBdry_EAST = 0. |
252 |
|
|
max_y_FluxBdry_EAST = 0. |
253 |
|
|
min_x_Dirich_NORTH = 0. |
254 |
|
|
max_x_Dirich_NORTH = 0. |
255 |
|
|
min_x_Dirich_SOUTH = 0. |
256 |
|
|
max_x_Dirich_SOUTH = 0. |
257 |
|
|
min_y_Dirich_WEST = 0. |
258 |
|
|
max_y_Dirich_WEST = 0. |
259 |
|
|
min_y_Dirich_EAST = 0. |
260 |
|
|
max_y_Dirich_EAST = 0. |
261 |
|
|
min_y_CFBC_WEST = 0. |
262 |
|
|
max_y_CFBC_WEST = 0. |
263 |
|
|
min_y_CFBC_EAST = 0. |
264 |
|
|
max_y_CFBC_EAST = 0. |
265 |
|
|
flux_bdry_val_SOUTH = 0. |
266 |
|
|
flux_bdry_val_NORTH = 0. |
267 |
|
|
flux_bdry_val_WEST = 0. |
268 |
|
|
flux_bdry_val_EAST = 0. |
269 |
|
|
|
270 |
|
|
STREAMICE_NS_periodic = .FALSE. |
271 |
|
|
STREAMICE_EW_periodic = .FALSE. |
272 |
|
|
|
273 |
|
|
WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice' |
274 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
275 |
|
|
& SQUEEZE_RIGHT , 1) |
276 |
|
|
CALL OPEN_COPY_DATA_FILE( |
277 |
|
|
I 'data.streamice', 'STREAMICE_READPARMS', |
278 |
|
|
O iUnit, |
279 |
|
|
I myThid ) |
280 |
|
|
|
281 |
|
|
C Read parameters from open data file |
282 |
|
|
READ(UNIT=iUnit,NML=STREAMICE_PARM01) |
283 |
|
|
WRITE(msgBuf,'(A)') |
284 |
|
|
& 'STREAMICE_READPARMS: read first param block' |
285 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
286 |
|
|
& SQUEEZE_RIGHT , 1) |
287 |
|
|
|
288 |
|
|
IF (TRIM(STREAMICEthickInit) .eq. "PARAM") THEN |
289 |
|
|
READ(UNIT=iUnit,NML=STREAMICE_PARM02) |
290 |
|
|
WRITE(msgBuf,'(A)') |
291 |
|
|
& 'STREAMICE_READPARMS: read second param block' |
292 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
293 |
|
|
& SQUEEZE_RIGHT , 1) |
294 |
|
|
ENDIF |
295 |
|
|
|
296 |
|
|
#ifdef ALLOW_STREAMICE_2DTRACER |
297 |
|
|
READ(UNIT=iUnit,NML=STREAMICE_PARMTRACER) |
298 |
|
|
WRITE(msgBuf,'(A)') |
299 |
|
|
& 'STREAMICE_READPARMS: read tracer param block' |
300 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
301 |
|
|
& SQUEEZE_RIGHT , 1) |
302 |
|
|
#endif |
303 |
|
|
|
304 |
|
|
#ifdef ALLOW_PETSC |
305 |
|
|
READ(UNIT=iUnit,NML=STREAMICE_PARMPETSC) |
306 |
|
|
WRITE(msgBuf,'(A)') |
307 |
|
|
& 'STREAMICE_READPARMS: read petsc param block' |
308 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
309 |
|
|
& SQUEEZE_RIGHT , 1) |
310 |
|
|
#endif |
311 |
|
|
|
312 |
|
|
|
313 |
|
|
READ(UNIT=iUnit,NML=STREAMICE_PARM03) |
314 |
|
|
WRITE(msgBuf,'(A)') |
315 |
|
|
& 'STREAMICE_READPARMS: read third param block' |
316 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
317 |
|
|
& SQUEEZE_RIGHT , 1) |
318 |
|
|
CLOSE(iUnit) |
319 |
|
|
|
320 |
|
|
|
321 |
|
|
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
322 |
|
|
|
323 |
|
|
CALL OPEN_COPY_DATA_FILE( |
324 |
|
|
I 'data.strmctrlflux', 'STREAMICE_READPARMS', |
325 |
|
|
O iUnit, |
326 |
|
|
I myThid ) |
327 |
|
|
|
328 |
|
|
|
329 |
|
|
READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL) |
330 |
|
|
WRITE(msgBuf,'(A)') |
331 |
|
|
& 'STREAMICE_READPARMS: read flux_ctrl param block' |
332 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
333 |
|
|
& SQUEEZE_RIGHT , 1) |
334 |
|
|
CLOSE(iUnit) |
335 |
|
|
#endif |
336 |
|
|
|
337 |
|
|
|
338 |
|
|
|
339 |
|
|
streamice_nstep_velocity = NINT (streamice_vel_update / deltaT) |
340 |
|
|
|
341 |
|
|
C- Set Output type flags : |
342 |
|
|
|
343 |
|
|
#ifdef ALLOW_MNC |
344 |
|
|
IF (useMNC) THEN |
345 |
|
|
IF ( .NOT.outputTypesInclusive |
346 |
|
|
& .AND. STREAMICE_tave_mnc ) STREAMICE_tave_mdsio = .FALSE. |
347 |
|
|
IF ( .NOT.outputTypesInclusive |
348 |
|
|
& .AND. STREAMICE_dump_mnc ) STREAMICE_dump_mdsio = .FALSE. |
349 |
|
|
ENDIF |
350 |
|
|
#endif |
351 |
|
|
|
352 |
|
|
_END_MASTER(myThid) |
353 |
|
|
|
354 |
|
|
C-- Everyone else must wait for the parameters to be loaded |
355 |
|
|
_BARRIER |
356 |
|
|
|
357 |
|
|
#endif /* ALLOW_STREAMICE */ |
358 |
|
|
|
359 |
|
|
RETURN |
360 |
|
|
END |