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