/[MITgcm]/MITgcm/pkg/streamice/streamice_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/streamice/streamice_readparms.F

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


Revision 1.15 - (show annotations) (download)
Fri Mar 18 19:18:29 2016 UTC (9 years, 3 months ago) by dgoldberg
Branch: MAIN
CVS Tags: checkpoint66a, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65v, checkpoint65w
Changes since 1.14: +3 -2 lines
allow for differing error norms in nonlinear iteration

1 C $Header: /u/gcmpack/MITgcm/pkg/streamice/streamice_readparms.F,v 1.14 2016/03/17 20:15:43 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, streamice_err_norm,
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 streamice_err_norm = 0.
204 #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
205 streamice_nonlin_tol_adjoint = 1.e-14
206 #ifdef ALLOW_PETSC
207 PETSC_PRECOND_OAD = 'MUMPS'
208 STREAMICE_OAD_petsc_reuse =.false.
209 #endif
210 #endif
211 streamice_max_cg_iter = 2000
212 streamice_max_nl_iter = 100
213 streamice_maxcgiter_cpl = 0
214 streamice_maxnliter_cpl = 0
215 ! streamice_n_sub_regularize = 4
216 streamice_CFL_factor = .5
217 streamice_adjDump = 0.
218 streamice_bg_surf_slope_x = .0
219 streamice_bg_surf_slope_y = 0.
220 streamice_kx_b_init = 1.
221 streamice_ky_b_init = 1.
222 streamice_wgt_drift = 0.
223 streamice_wgt_tikh = 0.
224 streamice_wgt_surf = 0.
225 streamice_wgt_vel = 0.
226 streamice_wgt_avthick = 0.
227 streamice_addl_backstress = 0.0
228 streamice_smooth_gl_width = 0.0
229 streamice_adot_uniform = 0.0
230 streamice_forcing_period = 0
231 streamice_firn_correction = 0.
232 #ifdef STREAMICE_FLOWLINE_BUTTRESS
233 streamice_buttr_width = 1000000000.
234 #endif
235 STREAMICE_apply_firn_correction = .false.
236
237 STREAMICEthickInit = 'FILE'
238 STREAMICEthickFile = ' '
239 STREAMICEcalveMaskFile = ' '
240 STREAMICEsigcoordInit = 'UNIFORM'
241 STREAMICEsigcoordFile = ' '
242 STREAMICEbasalTracConfig = 'UNIFORM'
243 STREAMICEBdotConfig = ''
244 STREAMICEBdotFile = ''
245 STREAMICEBdotTimeDepFile = ' '
246 STREAMICEbasalTracFile = ' '
247 STREAMICEvelOptimFile = ''
248 STREAMICEtopogFile = ''
249 STREAMICEhmaskFile = ''
250 STREAMICEHBCyFile = ''
251 STREAMICEHBCxFile = ''
252 STREAMICEuNormalStressFile = ''
253 STREAMICEvNormalStressFile = ''
254 STREAMICEuShearStressFile = ''
255 STREAMICEvShearStressFile = ''
256 STREAMICEuNormalTimeDepFile = ' '
257 STREAMICEvNormalTimeDepFile = ' '
258 STREAMICEuShearTimeDepFile = ' '
259 STREAMICEvShearTimeDepFile = ' '
260 STREAMICEuFluxTimeDepFile = ' '
261 STREAMICEvFluxTimeDepFile = ' '
262
263 #ifdef ALLOW_STREAMICE_2DTRACER
264 STREAMICETrac2DBCxFile = ''
265 STREAMICETrac2DBCyFile = ''
266 STREAMICETrac2DInitFile = ''
267 #endif
268 STREAMICEuFaceBdryFile = ''
269 STREAMICEvFaceBdryFile = ''
270 STREAMICEuDirichValsFile = ''
271 STREAMICEvDirichValsFile = ''
272 STREAMICEuMassFluxFile = ''
273 STREAMICEvMassFluxFile = ''
274 STREAMICEGlenConstFile = ''
275 STREAMICEcostMaskFile = ''
276 STREAMICEGlenConstConfig = 'UNIFORM'
277 #ifdef ALLOW_PETSC
278 PETSC_PRECOND_TYPE = 'PCBJACOBI'
279 PETSC_SOLVER_TYPE = 'KSPCG'
280 streamice_use_petsc = .true.
281 #endif
282 STREAMICE_ADV_SCHEME = ''
283
284 !#ifdef ALLOW_STREAMICE_FLUX_CONTROL
285 ! n_fluxes = 0
286 ! n_epochs = 0
287 ! DO iarr=1,n_fluxes_max
288 ! streamice_ctrl_flux_id(iarr) = 0
289 ! DO tarr=1,n_epochs_max
290 ! streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0
291 ! ENDDO
292 ! ENDDO
293 !#endif
294
295 STREAMICE_tave_mdsio = .TRUE.
296 STREAMICE_dump_mdsio = .TRUE.
297 STREAMICE_dump_mnc = .FALSE.
298 STREAMICE_tave_mnc = .FALSE.
299 ! STREAMICE_GL_regularize = .FALSE.
300 STREAMICE_move_front = .FALSE.
301 STREAMICE_calve_to_mask = .FALSE.
302 ! STREAMICE_geom_file_setup = .FALSE.
303 ! STREAMICE_construct_matrix = .TRUE.
304 STREAMICE_lower_cg_tol = .FALSE.
305 STREAMICE_diagnostic_only = .FALSE.
306 #ifdef STREAMICE_FLOWLINE_BUTTRESS
307 useStreamiceFlowlineButtr=.FALSE.
308 #endif
309 STREAMICE_ppm_driving_stress = .FALSE.
310 STREAMICE_chkfixedptconvergence = .true.
311 STREAMICE_chkresidconvergence = .true.
312 STREAMICE_h_ctrl_const_surf = .FALSE.
313 STREAMICE_allow_cpl = .false.
314 ! STREAMICE_hybrid_stress= .FALSE.
315
316 min_x_noflow_NORTH = 0.
317 max_x_noflow_NORTH = 0.
318 min_x_noflow_SOUTH = 0.
319 max_x_noflow_SOUTH = 0.
320 min_y_noflow_WEST = 0.
321 max_y_noflow_WEST = 0.
322 min_y_noflow_EAST = 0.
323 max_y_noflow_EAST = 0.
324 min_x_noStress_NORTH = 0.
325 max_x_noStress_NORTH = 0.
326 min_x_noStress_SOUTH = 0.
327 max_x_noStress_SOUTH = 0.
328 min_y_noStress_WEST = 0.
329 max_y_noStress_WEST = 0.
330 min_y_noStress_EAST = 0.
331 max_y_noStress_EAST = 0.
332 min_x_FluxBdry_NORTH = 0.
333 max_x_FluxBdry_NORTH = 0.
334 min_x_FluxBdry_SOUTH = 0.
335 max_x_FluxBdry_SOUTH = 0.
336 min_y_FluxBdry_WEST = 0.
337 max_y_FluxBdry_WEST = 0.
338 min_y_FluxBdry_EAST = 0.
339 max_y_FluxBdry_EAST = 0.
340 min_x_Dirich_NORTH = 0.
341 max_x_Dirich_NORTH = 0.
342 min_x_Dirich_SOUTH = 0.
343 max_x_Dirich_SOUTH = 0.
344 min_y_Dirich_WEST = 0.
345 max_y_Dirich_WEST = 0.
346 min_y_Dirich_EAST = 0.
347 max_y_Dirich_EAST = 0.
348 min_y_CFBC_WEST = 0.
349 max_y_CFBC_WEST = 0.
350 min_y_CFBC_EAST = 0.
351 max_y_CFBC_EAST = 0.
352 flux_bdry_val_SOUTH = 0.
353 flux_bdry_val_NORTH = 0.
354 flux_bdry_val_WEST = 0.
355 flux_bdry_val_EAST = 0.
356
357 STREAMICE_NS_periodic = .FALSE.
358 STREAMICE_EW_periodic = .FALSE.
359
360 WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice'
361 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
362 & SQUEEZE_RIGHT , 1)
363 CALL OPEN_COPY_DATA_FILE(
364 I 'data.streamice', 'STREAMICE_READPARMS',
365 O iUnit,
366 I myThid )
367
368 C Read parameters from open data file
369 READ(UNIT=iUnit,NML=STREAMICE_PARM01)
370 WRITE(msgBuf,'(A)')
371 & 'STREAMICE_READPARMS: read first param block'
372 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
373 & SQUEEZE_RIGHT , 1)
374
375 IF (TRIM(STREAMICEthickInit) .eq. "PARAM") THEN
376 READ(UNIT=iUnit,NML=STREAMICE_PARM02)
377 WRITE(msgBuf,'(A)')
378 & 'STREAMICE_READPARMS: read second param block'
379 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
380 & SQUEEZE_RIGHT , 1)
381 ENDIF
382
383 #ifdef ALLOW_STREAMICE_2DTRACER
384 READ(UNIT=iUnit,NML=STREAMICE_PARMTRACER)
385 WRITE(msgBuf,'(A)')
386 & 'STREAMICE_READPARMS: read tracer param block'
387 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
388 & SQUEEZE_RIGHT , 1)
389 #endif
390
391 #ifdef ALLOW_PETSC
392 READ(UNIT=iUnit,NML=STREAMICE_PARMPETSC)
393 WRITE(msgBuf,'(A)')
394 & 'STREAMICE_READPARMS: read petsc param block'
395 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
396 & SQUEEZE_RIGHT , 1)
397 #endif
398
399 #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
400 READ(UNIT=iUnit,NML=STREAMICE_PARMOAD)
401 WRITE(msgBuf,'(A)')
402 & 'STREAMICE_READPARMS: read oad parm block'
403 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
404 & SQUEEZE_RIGHT , 1)
405 #endif
406
407 READ(UNIT=iUnit,NML=STREAMICE_PARM03)
408 WRITE(msgBuf,'(A)')
409 & 'STREAMICE_READPARMS: read third param block'
410 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
411 & SQUEEZE_RIGHT , 1)
412 CLOSE(iUnit)
413
414 !#ifdef ALLOW_STREAMICE_FLUX_CONTROL
415 !
416 ! CALL OPEN_COPY_DATA_FILE(
417 ! I 'data.strmctrlflux', 'STREAMICE_READPARMS',
418 ! O iUnit,
419 ! I myThid )
420 !
421 ! READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL)
422 ! WRITE(msgBuf,'(A)')
423 ! & 'STREAMICE_READPARMS: read flux_ctrl param block'
424 ! CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
425 ! & SQUEEZE_RIGHT , 1)
426 ! CLOSE(iUnit)
427 !#endif
428
429 streamice_nstep_velocity = NINT (streamice_vel_update / deltaT)
430
431 C- Set Output type flags :
432
433 #ifdef ALLOW_MNC
434 IF (useMNC) THEN
435 IF ( .NOT.outputTypesInclusive
436 & .AND. STREAMICE_tave_mnc ) STREAMICE_tave_mdsio = .FALSE.
437 IF ( .NOT.outputTypesInclusive
438 & .AND. STREAMICE_dump_mnc ) STREAMICE_dump_mdsio = .FALSE.
439 ENDIF
440 #endif
441
442 _END_MASTER(myThid)
443
444 C-- Everyone else must wait for the parameters to be loaded
445 _BARRIER
446
447 #endif /* ALLOW_STREAMICE */
448
449 RETURN
450 END

  ViewVC Help
Powered by ViewVC 1.1.22