1 |
C $Header: /u/gcmpack/MITgcm_contrib/verification_other/shelfice_remeshing/code/streamice_readparms.F,v 1.1 2016/01/22 16:09:34 dgoldberg Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
C this needs changes |
5 |
|
6 |
#include "STREAMICE_OPTIONS.h" |
7 |
|
8 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
9 |
CBOP 0 |
10 |
SUBROUTINE STREAMICE_READPARMS( myThid ) |
11 |
|
12 |
C !DESCRIPTION: |
13 |
C Initialize STREAMICE variables and constants. |
14 |
|
15 |
C !USES: |
16 |
IMPLICIT NONE |
17 |
#include "SIZE.h" |
18 |
#include "EEPARAMS.h" |
19 |
#include "PARAMS.h" |
20 |
#include "STREAMICE.h" |
21 |
#include "STREAMICE_BDRY.h" |
22 |
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
23 |
!#include "STREAMICE_CTRL_FLUX.h" |
24 |
!#endif |
25 |
|
26 |
C !INPUT PARAMETERS: |
27 |
INTEGER myThid |
28 |
CEOP |
29 |
|
30 |
#ifdef ALLOW_STREAMICE |
31 |
|
32 |
C !LOCAL VARIABLES: |
33 |
C msgBuf :: Informational/error message buffer |
34 |
C iUnit :: Work variable for IO unit number |
35 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
36 |
INTEGER iUnit, iarr, tarr |
37 |
|
38 |
NAMELIST /STREAMICE_PARM01/ |
39 |
& streamice_density, streamice_density_ocean_avg, |
40 |
& streamice_density_firn, |
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_maxcgiter_cpl, streamice_maxnliter_cpl, |
47 |
& STREAMICEthickInit, |
48 |
& STREAMICEsigcoordInit, |
49 |
& STREAMICEsigcoordFile, |
50 |
& STREAMICEthickFile, |
51 |
& STREAMICEcalveMaskFile, |
52 |
& STREAMICEcostMaskFile, |
53 |
& STREAMICE_dump_mdsio, STREAMICE_tave_mdsio, |
54 |
& STREAMICE_dump_mnc, STREAMICE_tave_mnc, |
55 |
& STREAMICE_move_front, |
56 |
& STREAMICE_calve_to_mask, |
57 |
& STREAMICE_diagnostic_only, |
58 |
& STREAMICE_lower_cg_tol, |
59 |
& streamice_CFL_factor, |
60 |
& streamice_adjDump, |
61 |
& streamice_bg_surf_slope_x, streamice_bg_surf_slope_y, |
62 |
& streamice_kx_b_init, streamice_ky_b_init, |
63 |
& STREAMICEbasalTracConfig, |
64 |
& STREAMICEBdotConfig, |
65 |
& STREAMICEbasalTracFile, |
66 |
& STREAMICEBdotFile, |
67 |
& STREAMICEBdotTimeDepFile, |
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 |
& STREAMICEuNormalTimeDepFile, |
84 |
& STREAMICEvNormalTimeDepFile, |
85 |
& STREAMICEuShearTimeDepFile, |
86 |
& STREAMICEvShearTimeDepFile, |
87 |
& STREAMICEuFluxTimeDepFile, STREAMICEvFluxTimeDepFile, |
88 |
& STREAMICEGlenConstFile, STREAMICEGlenConstConfig, |
89 |
& STREAMICE_ppm_driving_stress, |
90 |
& STREAMICE_h_ctrl_const_surf, |
91 |
& streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel, |
92 |
& streamice_wgt_avthick, streamice_wgt_tikh, |
93 |
& streamice_addl_backstress, |
94 |
& streamice_smooth_gl_width, |
95 |
& streamice_adot_uniform, |
96 |
& streamice_firn_correction, |
97 |
& STREAMICE_apply_firn_correction, |
98 |
& STREAMICE_ADV_SCHEME, streamice_forcing_period, |
99 |
& STREAMICE_chkfixedptconvergence, |
100 |
& STREAMICE_chkresidconvergence, |
101 |
#ifdef STREAMICE_FLOWLINE_BUTTRESS |
102 |
& streamice_buttr_width, |
103 |
& useStreamiceFlowlineButtr, |
104 |
#endif |
105 |
& STREAMICE_allow_cpl |
106 |
|
107 |
#ifdef ALLOW_STREAMICE_2DTRACER |
108 |
NAMELIST /STREAMICE_PARMTRACER/ |
109 |
& STREAMICETrac2DBCxFile, |
110 |
& STREAMICETrac2DBCyFile, |
111 |
& STREAMICETrac2DINITFile |
112 |
#endif |
113 |
|
114 |
#ifdef ALLOW_PETSC |
115 |
NAMELIST /STREAMICE_PARMPETSC/ |
116 |
& PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE, |
117 |
& streamice_use_petsc |
118 |
#endif |
119 |
|
120 |
#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) |
121 |
NAMELIST /STREAMICE_PARMOAD/ |
122 |
& streamice_nonlin_tol_adjoint |
123 |
#ifdef ALLOW_PETSC |
124 |
& ,STREAMICE_OAD_petsc_reuse, |
125 |
& PETSC_PRECOND_OAD |
126 |
#endif |
127 |
#endif |
128 |
|
129 |
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
130 |
! NAMELIST /STREAMICE_PARMFLUXCTRL/ |
131 |
! & n_fluxes, n_epochs, |
132 |
! & streamice_ctrl_flux_id, |
133 |
! & streamice_ctrl_flux_scaleVel |
134 |
!#endif |
135 |
|
136 |
NAMELIST /STREAMICE_PARM02/ |
137 |
& shelf_max_draft, |
138 |
& shelf_min_draft, |
139 |
& shelf_edge_pos, |
140 |
& shelf_slope_scale, |
141 |
& shelf_flat_width, |
142 |
& flow_dir |
143 |
|
144 |
NAMELIST /STREAMICE_PARM03/ |
145 |
& min_x_noflow_NORTH, max_x_noflow_NORTH, |
146 |
& min_x_noflow_SOUTH, max_x_noflow_SOUTH, |
147 |
& min_y_noflow_WEST, max_y_noflow_WEST, |
148 |
& min_y_noflow_EAST, max_y_noflow_EAST, |
149 |
& min_x_noStress_NORTH, max_x_noStress_NORTH, |
150 |
& min_x_noStress_SOUTH, max_x_noStress_SOUTH, |
151 |
& min_y_noStress_WEST, max_y_noStress_WEST, |
152 |
& min_y_noStress_EAST, max_y_noStress_EAST, |
153 |
& min_x_FluxBdry_NORTH, max_x_FluxBdry_NORTH, |
154 |
& min_x_FluxBdry_SOUTH, max_x_FluxBdry_SOUTH, |
155 |
& min_y_FluxBdry_WEST, max_y_FluxBdry_WEST, |
156 |
& min_y_FluxBdry_EAST, max_y_FluxBdry_EAST, |
157 |
& min_x_Dirich_NORTH, max_x_Dirich_NORTH, |
158 |
& min_x_Dirich_SOUTH, max_x_Dirich_SOUTH, |
159 |
& min_y_Dirich_WEST, max_y_Dirich_WEST, |
160 |
& min_y_Dirich_EAST, max_y_Dirich_EAST, |
161 |
& min_x_CFBC_NORTH, max_x_CFBC_NORTH, |
162 |
& min_x_CFBC_SOUTH, max_x_CFBC_SOUTH, |
163 |
& min_y_CFBC_WEST, max_y_CFBC_WEST, |
164 |
& min_y_CFBC_EAST, max_y_CFBC_EAST, |
165 |
& flux_bdry_val_SOUTH, flux_bdry_val_NORTH, |
166 |
& flux_bdry_val_WEST, flux_bdry_val_EAST, |
167 |
& STREAMICE_NS_periodic, STREAMICE_EW_periodic |
168 |
|
169 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
170 |
|
171 |
IF ( .NOT.useStreamIce ) THEN |
172 |
C- pkg STREAMICE is not used |
173 |
_BEGIN_MASTER(myThid) |
174 |
C- Track pkg activation status: |
175 |
STREAMICEisOn = .FALSE. |
176 |
C print a (weak) warning if data.streamice is found |
177 |
CALL PACKAGES_UNUSED_MSG( 'useStreamIce', ' ', ' ' ) |
178 |
_END_MASTER(myThid) |
179 |
RETURN |
180 |
ENDIF |
181 |
|
182 |
_BEGIN_MASTER(myThid) |
183 |
|
184 |
C This routine has been called by the main model so we set our |
185 |
C internal flag to indicate we are in business |
186 |
STREAMICEisOn = .TRUE. |
187 |
|
188 |
C-- Default values for STREAMICE |
189 |
|
190 |
streamice_density = 917. |
191 |
streamice_density_ocean_avg = 1024. |
192 |
streamice_density_firn = streamice_density |
193 |
B_glen_isothermal = 9.461e-18 ! Pa (-1/3) a |
194 |
n_glen = 3. |
195 |
eps_glen_min = 1.0e-12 |
196 |
eps_u_min = 1.0e-6 |
197 |
C_basal_fric_const = 31.71 ! Pa (m/a)-1n |
198 |
n_basal_friction = 1. |
199 |
streamice_vel_update = deltaT ! seconds |
200 |
streamice_cg_tol = 1e-6 |
201 |
streamice_nonlin_tol = 1e-6 |
202 |
streamice_nonlin_tol_fp = 1.e-14 |
203 |
#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) |
204 |
streamice_nonlin_tol_adjoint = 1.e-14 |
205 |
#ifdef ALLOW_PETSC |
206 |
PETSC_PRECOND_OAD = 'MUMPS' |
207 |
STREAMICE_OAD_petsc_reuse =.false. |
208 |
#endif |
209 |
#endif |
210 |
streamice_max_cg_iter = 2000 |
211 |
streamice_max_nl_iter = 100 |
212 |
streamice_maxcgiter_cpl = 0 |
213 |
streamice_maxnliter_cpl = 0 |
214 |
! streamice_n_sub_regularize = 4 |
215 |
streamice_CFL_factor = .5 |
216 |
streamice_adjDump = 0. |
217 |
streamice_bg_surf_slope_x = .0 |
218 |
streamice_bg_surf_slope_y = 0. |
219 |
streamice_kx_b_init = 1. |
220 |
streamice_ky_b_init = 1. |
221 |
streamice_wgt_drift = 0. |
222 |
streamice_wgt_tikh = 0. |
223 |
streamice_wgt_surf = 0. |
224 |
streamice_wgt_vel = 0. |
225 |
streamice_wgt_avthick = 0. |
226 |
streamice_addl_backstress = 0.0 |
227 |
streamice_smooth_gl_width = 0.0 |
228 |
streamice_adot_uniform = 0.0 |
229 |
streamice_forcing_period = 0 |
230 |
streamice_firn_correction = 0. |
231 |
#ifdef STREAMICE_FLOWLINE_BUTTRESS |
232 |
streamice_buttr_width = 1000000000. |
233 |
#endif |
234 |
STREAMICE_apply_firn_correction = .false. |
235 |
|
236 |
STREAMICEthickInit = 'FILE' |
237 |
STREAMICEthickFile = ' ' |
238 |
STREAMICEcalveMaskFile = ' ' |
239 |
STREAMICEsigcoordInit = 'UNIFORM' |
240 |
STREAMICEsigcoordFile = ' ' |
241 |
STREAMICEbasalTracConfig = 'UNIFORM' |
242 |
STREAMICEBdotConfig = '' |
243 |
STREAMICEBdotFile = '' |
244 |
STREAMICEBdotTimeDepFile = ' ' |
245 |
STREAMICEbasalTracFile = ' ' |
246 |
STREAMICEvelOptimFile = '' |
247 |
STREAMICEtopogFile = '' |
248 |
STREAMICEhmaskFile = '' |
249 |
STREAMICEHBCyFile = '' |
250 |
STREAMICEHBCxFile = '' |
251 |
STREAMICEuNormalStressFile = '' |
252 |
STREAMICEvNormalStressFile = '' |
253 |
STREAMICEuShearStressFile = '' |
254 |
STREAMICEvShearStressFile = '' |
255 |
STREAMICEuNormalTimeDepFile = ' ' |
256 |
STREAMICEvNormalTimeDepFile = ' ' |
257 |
STREAMICEuShearTimeDepFile = ' ' |
258 |
STREAMICEvShearTimeDepFile = ' ' |
259 |
STREAMICEuFluxTimeDepFile = ' ' |
260 |
STREAMICEvFluxTimeDepFile = ' ' |
261 |
|
262 |
#ifdef ALLOW_STREAMICE_2DTRACER |
263 |
STREAMICETrac2DBCxFile = '' |
264 |
STREAMICETrac2DBCyFile = '' |
265 |
STREAMICETrac2DInitFile = '' |
266 |
#endif |
267 |
STREAMICEuFaceBdryFile = '' |
268 |
STREAMICEvFaceBdryFile = '' |
269 |
STREAMICEuDirichValsFile = '' |
270 |
STREAMICEvDirichValsFile = '' |
271 |
STREAMICEuMassFluxFile = '' |
272 |
STREAMICEvMassFluxFile = '' |
273 |
STREAMICEGlenConstFile = '' |
274 |
STREAMICEcostMaskFile = '' |
275 |
STREAMICEGlenConstConfig = 'UNIFORM' |
276 |
#ifdef ALLOW_PETSC |
277 |
PETSC_PRECOND_TYPE = 'PCBJACOBI' |
278 |
PETSC_SOLVER_TYPE = 'KSPCG' |
279 |
streamice_use_petsc = .true. |
280 |
#endif |
281 |
STREAMICE_ADV_SCHEME = '' |
282 |
|
283 |
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
284 |
! n_fluxes = 0 |
285 |
! n_epochs = 0 |
286 |
! DO iarr=1,n_fluxes_max |
287 |
! streamice_ctrl_flux_id(iarr) = 0 |
288 |
! DO tarr=1,n_epochs_max |
289 |
! streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 |
290 |
! ENDDO |
291 |
! ENDDO |
292 |
!#endif |
293 |
|
294 |
STREAMICE_tave_mdsio = .TRUE. |
295 |
STREAMICE_dump_mdsio = .TRUE. |
296 |
STREAMICE_dump_mnc = .FALSE. |
297 |
STREAMICE_tave_mnc = .FALSE. |
298 |
! STREAMICE_GL_regularize = .FALSE. |
299 |
STREAMICE_move_front = .FALSE. |
300 |
STREAMICE_calve_to_mask = .FALSE. |
301 |
! STREAMICE_geom_file_setup = .FALSE. |
302 |
! STREAMICE_construct_matrix = .TRUE. |
303 |
STREAMICE_lower_cg_tol = .FALSE. |
304 |
STREAMICE_diagnostic_only = .FALSE. |
305 |
#ifdef STREAMICE_FLOWLINE_BUTTRESS |
306 |
useStreamiceFlowlineButtr=.FALSE. |
307 |
#endif |
308 |
STREAMICE_ppm_driving_stress = .FALSE. |
309 |
STREAMICE_chkfixedptconvergence = .true. |
310 |
STREAMICE_chkresidconvergence = .true. |
311 |
STREAMICE_h_ctrl_const_surf = .FALSE. |
312 |
STREAMICE_allow_cpl = .false. |
313 |
! STREAMICE_hybrid_stress= .FALSE. |
314 |
|
315 |
min_x_noflow_NORTH = 0. |
316 |
max_x_noflow_NORTH = 0. |
317 |
min_x_noflow_SOUTH = 0. |
318 |
max_x_noflow_SOUTH = 0. |
319 |
min_y_noflow_WEST = 0. |
320 |
max_y_noflow_WEST = 0. |
321 |
min_y_noflow_EAST = 0. |
322 |
max_y_noflow_EAST = 0. |
323 |
min_x_noStress_NORTH = 0. |
324 |
max_x_noStress_NORTH = 0. |
325 |
min_x_noStress_SOUTH = 0. |
326 |
max_x_noStress_SOUTH = 0. |
327 |
min_y_noStress_WEST = 0. |
328 |
max_y_noStress_WEST = 0. |
329 |
min_y_noStress_EAST = 0. |
330 |
max_y_noStress_EAST = 0. |
331 |
min_x_FluxBdry_NORTH = 0. |
332 |
max_x_FluxBdry_NORTH = 0. |
333 |
min_x_FluxBdry_SOUTH = 0. |
334 |
max_x_FluxBdry_SOUTH = 0. |
335 |
min_y_FluxBdry_WEST = 0. |
336 |
max_y_FluxBdry_WEST = 0. |
337 |
min_y_FluxBdry_EAST = 0. |
338 |
max_y_FluxBdry_EAST = 0. |
339 |
min_x_Dirich_NORTH = 0. |
340 |
max_x_Dirich_NORTH = 0. |
341 |
min_x_Dirich_SOUTH = 0. |
342 |
max_x_Dirich_SOUTH = 0. |
343 |
min_y_Dirich_WEST = 0. |
344 |
max_y_Dirich_WEST = 0. |
345 |
min_y_Dirich_EAST = 0. |
346 |
max_y_Dirich_EAST = 0. |
347 |
min_y_CFBC_WEST = 0. |
348 |
max_y_CFBC_WEST = 0. |
349 |
min_y_CFBC_EAST = 0. |
350 |
max_y_CFBC_EAST = 0. |
351 |
flux_bdry_val_SOUTH = 0. |
352 |
flux_bdry_val_NORTH = 0. |
353 |
flux_bdry_val_WEST = 0. |
354 |
flux_bdry_val_EAST = 0. |
355 |
|
356 |
STREAMICE_NS_periodic = .FALSE. |
357 |
STREAMICE_EW_periodic = .FALSE. |
358 |
|
359 |
WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice' |
360 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
361 |
& SQUEEZE_RIGHT , 1) |
362 |
CALL OPEN_COPY_DATA_FILE( |
363 |
I 'data.streamice', 'STREAMICE_READPARMS', |
364 |
O iUnit, |
365 |
I myThid ) |
366 |
|
367 |
C Read parameters from open data file |
368 |
READ(UNIT=iUnit,NML=STREAMICE_PARM01) |
369 |
WRITE(msgBuf,'(A)') |
370 |
& 'STREAMICE_READPARMS: read first param block' |
371 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
372 |
& SQUEEZE_RIGHT , 1) |
373 |
|
374 |
IF (TRIM(STREAMICEthickInit) .eq. "PARAM") THEN |
375 |
READ(UNIT=iUnit,NML=STREAMICE_PARM02) |
376 |
WRITE(msgBuf,'(A)') |
377 |
& 'STREAMICE_READPARMS: read second param block' |
378 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
379 |
& SQUEEZE_RIGHT , 1) |
380 |
ENDIF |
381 |
|
382 |
#ifdef ALLOW_STREAMICE_2DTRACER |
383 |
READ(UNIT=iUnit,NML=STREAMICE_PARMTRACER) |
384 |
WRITE(msgBuf,'(A)') |
385 |
& 'STREAMICE_READPARMS: read tracer param block' |
386 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
387 |
& SQUEEZE_RIGHT , 1) |
388 |
#endif |
389 |
|
390 |
#ifdef ALLOW_PETSC |
391 |
READ(UNIT=iUnit,NML=STREAMICE_PARMPETSC) |
392 |
WRITE(msgBuf,'(A)') |
393 |
& 'STREAMICE_READPARMS: read petsc param block' |
394 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
395 |
& SQUEEZE_RIGHT , 1) |
396 |
#endif |
397 |
|
398 |
#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) |
399 |
READ(UNIT=iUnit,NML=STREAMICE_PARMOAD) |
400 |
WRITE(msgBuf,'(A)') |
401 |
& 'STREAMICE_READPARMS: read oad parm block' |
402 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
403 |
& SQUEEZE_RIGHT , 1) |
404 |
#endif |
405 |
|
406 |
READ(UNIT=iUnit,NML=STREAMICE_PARM03) |
407 |
WRITE(msgBuf,'(A)') |
408 |
& 'STREAMICE_READPARMS: read third param block' |
409 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
410 |
& SQUEEZE_RIGHT , 1) |
411 |
CLOSE(iUnit) |
412 |
|
413 |
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
414 |
! |
415 |
! CALL OPEN_COPY_DATA_FILE( |
416 |
! I 'data.strmctrlflux', 'STREAMICE_READPARMS', |
417 |
! O iUnit, |
418 |
! I myThid ) |
419 |
! |
420 |
! READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL) |
421 |
! WRITE(msgBuf,'(A)') |
422 |
! & 'STREAMICE_READPARMS: read flux_ctrl param block' |
423 |
! CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
424 |
! & SQUEEZE_RIGHT , 1) |
425 |
! CLOSE(iUnit) |
426 |
!#endif |
427 |
|
428 |
streamice_nstep_velocity = NINT (streamice_vel_update / deltaT) |
429 |
|
430 |
C- Set Output type flags : |
431 |
|
432 |
#ifdef ALLOW_MNC |
433 |
IF (useMNC) THEN |
434 |
IF ( .NOT.outputTypesInclusive |
435 |
& .AND. STREAMICE_tave_mnc ) STREAMICE_tave_mdsio = .FALSE. |
436 |
IF ( .NOT.outputTypesInclusive |
437 |
& .AND. STREAMICE_dump_mnc ) STREAMICE_dump_mdsio = .FALSE. |
438 |
ENDIF |
439 |
#endif |
440 |
|
441 |
_END_MASTER(myThid) |
442 |
|
443 |
C-- Everyone else must wait for the parameters to be loaded |
444 |
_BARRIER |
445 |
|
446 |
#endif /* ALLOW_STREAMICE */ |
447 |
|
448 |
RETURN |
449 |
END |