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