/[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.16 - (show annotations) (download)
Thu Oct 20 15:22:53 2016 UTC (7 years, 7 months ago) by dgoldberg
Branch: MAIN
Changes since 1.15: +3 -1 lines
add option to calculate driving stress by pure finite difference of surface el

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

  ViewVC Help
Powered by ViewVC 1.1.22