/[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.13 - (show annotations) (download)
Tue Jun 30 11:20:05 2015 UTC (10 years ago) by dgoldberg
Branch: MAIN
CVS Tags: checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65t, checkpoint65u, checkpoint65n, checkpoint65o
Changes since 1.12: +8 -2 lines
firn correction for floatation condition and driving stress

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

  ViewVC Help
Powered by ViewVC 1.1.22