19 |
#include "PARAMS.h" |
#include "PARAMS.h" |
20 |
#include "STREAMICE.h" |
#include "STREAMICE.h" |
21 |
#include "STREAMICE_BDRY.h" |
#include "STREAMICE_BDRY.h" |
22 |
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
23 |
#include "STREAMICE_CTRL_FLUX.h" |
!#include "STREAMICE_CTRL_FLUX.h" |
24 |
#endif |
!#endif |
25 |
|
|
26 |
C !INPUT PARAMETERS: |
C !INPUT PARAMETERS: |
27 |
INTEGER myThid |
INTEGER myThid |
37 |
|
|
38 |
NAMELIST /STREAMICE_PARM01/ |
NAMELIST /STREAMICE_PARM01/ |
39 |
& streamice_density, streamice_density_ocean_avg, |
& streamice_density, streamice_density_ocean_avg, |
40 |
|
& streamice_density_firn, |
41 |
& B_glen_isothermal, n_glen, eps_glen_min, eps_u_min, |
& B_glen_isothermal, n_glen, eps_glen_min, eps_u_min, |
42 |
& C_basal_fric_const, n_basal_friction, |
& C_basal_fric_const, n_basal_friction, |
43 |
& streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol, |
& streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol, |
44 |
& streamice_nonlin_tol_fp, |
& streamice_nonlin_tol_fp, |
45 |
& streamice_max_cg_iter, streamice_max_nl_iter, |
& streamice_max_cg_iter, streamice_max_nl_iter, |
46 |
& STREAMICE_GL_regularize, |
& streamice_maxcgiter_cpl, streamice_maxnliter_cpl, |
47 |
& STREAMICEthickInit, |
& STREAMICEthickInit, |
48 |
& STREAMICEsigcoordInit, |
& STREAMICEsigcoordInit, |
49 |
& STREAMICEsigcoordFile, |
& STREAMICEsigcoordFile, |
50 |
& STREAMICEthickFile, |
& STREAMICEthickFile, |
51 |
& STREAMICEcalveMaskFile, |
& STREAMICEcalveMaskFile, |
52 |
& STREAMICEcostMaskFile, |
& STREAMICEcostMaskFile, |
|
& STREAMICEison, |
|
53 |
& STREAMICE_dump_mdsio, STREAMICE_tave_mdsio, |
& STREAMICE_dump_mdsio, STREAMICE_tave_mdsio, |
54 |
& STREAMICE_dump_mnc, STREAMICE_tave_mnc, |
& STREAMICE_dump_mnc, STREAMICE_tave_mnc, |
55 |
& STREAMICE_GL_regularize, STREAMICE_move_front, |
& STREAMICE_move_front, |
56 |
& STREAMICE_calve_to_mask, |
& STREAMICE_calve_to_mask, |
57 |
& STREAMICE_diagnostic_only, |
& STREAMICE_diagnostic_only, |
58 |
& STREAMICE_lower_cg_tol, |
& STREAMICE_lower_cg_tol, |
64 |
& STREAMICEBdotConfig, |
& STREAMICEBdotConfig, |
65 |
& STREAMICEbasalTracFile, |
& STREAMICEbasalTracFile, |
66 |
& STREAMICEBdotFile, |
& STREAMICEBdotFile, |
67 |
|
& STREAMICEBdotTimeDepFile, |
68 |
& STREAMICEvelOptimFile, |
& STREAMICEvelOptimFile, |
69 |
& STREAMICEtopogFile, |
& STREAMICEtopogFile, |
70 |
& STREAMICEhmaskFile, |
& STREAMICEhmaskFile, |
80 |
& STREAMICEvNormalStressFile, |
& STREAMICEvNormalStressFile, |
81 |
& STREAMICEuShearStressFile, |
& STREAMICEuShearStressFile, |
82 |
& STREAMICEvShearStressFile, |
& STREAMICEvShearStressFile, |
83 |
|
& STREAMICEuNormalTimeDepFile, |
84 |
|
& STREAMICEvNormalTimeDepFile, |
85 |
|
& STREAMICEuShearTimeDepFile, |
86 |
|
& STREAMICEvShearTimeDepFile, |
87 |
|
& STREAMICEuFluxTimeDepFile, STREAMICEvFluxTimeDepFile, |
88 |
& STREAMICEGlenConstFile, STREAMICEGlenConstConfig, |
& STREAMICEGlenConstFile, STREAMICEGlenConstConfig, |
89 |
& STREAMICE_ppm_driving_stress, |
& STREAMICE_ppm_driving_stress, |
90 |
& STREAMICE_h_ctrl_const_surf, |
& STREAMICE_h_ctrl_const_surf, |
93 |
& streamice_addl_backstress, |
& streamice_addl_backstress, |
94 |
& streamice_smooth_gl_width, |
& streamice_smooth_gl_width, |
95 |
& streamice_adot_uniform, |
& streamice_adot_uniform, |
96 |
& STREAMICE_ADV_SCHEME |
& 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 |
#ifdef ALLOW_STREAMICE_2DTRACER |
108 |
NAMELIST /STREAMICE_PARMTRACER/ |
NAMELIST /STREAMICE_PARMTRACER/ |
113 |
|
|
114 |
#ifdef ALLOW_PETSC |
#ifdef ALLOW_PETSC |
115 |
NAMELIST /STREAMICE_PARMPETSC/ |
NAMELIST /STREAMICE_PARMPETSC/ |
116 |
& PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE |
& PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE, |
117 |
|
& streamice_use_petsc |
118 |
#endif |
#endif |
119 |
|
|
120 |
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) |
121 |
NAMELIST /STREAMICE_PARMFLUXCTRL/ |
NAMELIST /STREAMICE_PARMOAD/ |
122 |
& n_fluxes, n_epochs, |
& streamice_nonlin_tol_adjoint |
123 |
& streamice_ctrl_flux_id, |
#ifdef ALLOW_PETSC |
124 |
& streamice_ctrl_flux_scaleVel |
& ,STREAMICE_OAD_petsc_reuse, |
125 |
|
& PETSC_PRECOND_OAD |
126 |
|
#endif |
127 |
#endif |
#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/ |
NAMELIST /STREAMICE_PARM02/ |
137 |
& shelf_max_draft, |
& shelf_max_draft, |
138 |
& shelf_min_draft, |
& shelf_min_draft, |
172 |
C- pkg STREAMICE is not used |
C- pkg STREAMICE is not used |
173 |
_BEGIN_MASTER(myThid) |
_BEGIN_MASTER(myThid) |
174 |
C- Track pkg activation status: |
C- Track pkg activation status: |
175 |
|
STREAMICEisOn = .FALSE. |
176 |
C print a (weak) warning if data.streamice is found |
C print a (weak) warning if data.streamice is found |
177 |
CALL PACKAGES_UNUSED_MSG( 'useStreamIce', ' ', ' ' ) |
CALL PACKAGES_UNUSED_MSG( 'useStreamIce', ' ', ' ' ) |
178 |
_END_MASTER(myThid) |
_END_MASTER(myThid) |
181 |
|
|
182 |
_BEGIN_MASTER(myThid) |
_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 |
C-- Default values for STREAMICE |
189 |
|
|
190 |
streamice_density = 917. |
streamice_density = 917. |
191 |
streamice_density_ocean_avg = 1024. |
streamice_density_ocean_avg = 1024. |
192 |
|
streamice_density_firn = streamice_density |
193 |
B_glen_isothermal = 9.461e-18 ! Pa (-1/3) a |
B_glen_isothermal = 9.461e-18 ! Pa (-1/3) a |
194 |
n_glen = 3. |
n_glen = 3. |
195 |
eps_glen_min = 1.0e-12 |
eps_glen_min = 1.0e-12 |
196 |
eps_u_min = 1.0e-6 |
eps_u_min = 1.0e-6 |
197 |
C_basal_fric_const = 31.71 ! Pa (m/a)-1n |
C_basal_fric_const = 31.71 ! Pa (m/a)-1n |
198 |
n_basal_friction = 1. |
n_basal_friction = 1. |
199 |
streamice_vel_update = 169200. ! seconds |
streamice_vel_update = deltaT ! seconds |
200 |
streamice_cg_tol = 1e-6 |
streamice_cg_tol = 1e-6 |
201 |
streamice_nonlin_tol = 1e-6 |
streamice_nonlin_tol = 1e-6 |
202 |
streamice_nonlin_tol_fp = 1.e-14 |
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 |
streamice_max_cg_iter = 2000 |
211 |
streamice_max_nl_iter = 100 |
streamice_max_nl_iter = 100 |
212 |
streamice_n_sub_regularize = 4 |
streamice_maxcgiter_cpl = 0 |
213 |
|
streamice_maxnliter_cpl = 0 |
214 |
|
! streamice_n_sub_regularize = 4 |
215 |
streamice_CFL_factor = .5 |
streamice_CFL_factor = .5 |
216 |
streamice_adjDump = 0. |
streamice_adjDump = 0. |
217 |
streamice_bg_surf_slope_x = .0 |
streamice_bg_surf_slope_x = .0 |
226 |
streamice_addl_backstress = 0.0 |
streamice_addl_backstress = 0.0 |
227 |
streamice_smooth_gl_width = 0.0 |
streamice_smooth_gl_width = 0.0 |
228 |
streamice_adot_uniform = 0.0 |
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' |
STREAMICEthickInit = 'FILE' |
237 |
STREAMICEthickFile = ' ' |
STREAMICEthickFile = ' ' |
238 |
STREAMICEcalveMaskFile = ' ' |
STREAMICEcalveMaskFile = ' ' |
241 |
STREAMICEbasalTracConfig = 'UNIFORM' |
STREAMICEbasalTracConfig = 'UNIFORM' |
242 |
STREAMICEBdotConfig = '' |
STREAMICEBdotConfig = '' |
243 |
STREAMICEBdotFile = '' |
STREAMICEBdotFile = '' |
244 |
|
STREAMICEBdotTimeDepFile = ' ' |
245 |
STREAMICEbasalTracFile = ' ' |
STREAMICEbasalTracFile = ' ' |
246 |
STREAMICEvelOptimFile = '' |
STREAMICEvelOptimFile = '' |
247 |
STREAMICEtopogFile = '' |
STREAMICEtopogFile = '' |
252 |
STREAMICEvNormalStressFile = '' |
STREAMICEvNormalStressFile = '' |
253 |
STREAMICEuShearStressFile = '' |
STREAMICEuShearStressFile = '' |
254 |
STREAMICEvShearStressFile = '' |
STREAMICEvShearStressFile = '' |
255 |
|
STREAMICEuNormalTimeDepFile = ' ' |
256 |
|
STREAMICEvNormalTimeDepFile = ' ' |
257 |
|
STREAMICEuShearTimeDepFile = ' ' |
258 |
|
STREAMICEvShearTimeDepFile = ' ' |
259 |
|
STREAMICEuFluxTimeDepFile = ' ' |
260 |
|
STREAMICEvFluxTimeDepFile = ' ' |
261 |
|
|
262 |
#ifdef ALLOW_STREAMICE_2DTRACER |
#ifdef ALLOW_STREAMICE_2DTRACER |
263 |
STREAMICETrac2DBCxFile = '' |
STREAMICETrac2DBCxFile = '' |
276 |
#ifdef ALLOW_PETSC |
#ifdef ALLOW_PETSC |
277 |
PETSC_PRECOND_TYPE = 'PCBJACOBI' |
PETSC_PRECOND_TYPE = 'PCBJACOBI' |
278 |
PETSC_SOLVER_TYPE = 'KSPCG' |
PETSC_SOLVER_TYPE = 'KSPCG' |
279 |
|
streamice_use_petsc = .true. |
280 |
#endif |
#endif |
281 |
STREAMICE_ADV_SCHEME = '' |
STREAMICE_ADV_SCHEME = '' |
282 |
|
|
283 |
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
284 |
n_fluxes = 0 |
! n_fluxes = 0 |
285 |
n_epochs = 0 |
! n_epochs = 0 |
286 |
DO iarr=1,n_fluxes_max |
! DO iarr=1,n_fluxes_max |
287 |
streamice_ctrl_flux_id(iarr) = 0 |
! streamice_ctrl_flux_id(iarr) = 0 |
288 |
DO tarr=1,n_epochs_max |
! DO tarr=1,n_epochs_max |
289 |
streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 |
! streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 |
290 |
ENDDO |
! ENDDO |
291 |
ENDDO |
! ENDDO |
292 |
#endif |
!#endif |
293 |
|
|
|
STREAMICEison = .TRUE. |
|
294 |
STREAMICE_tave_mdsio = .TRUE. |
STREAMICE_tave_mdsio = .TRUE. |
295 |
STREAMICE_dump_mdsio = .TRUE. |
STREAMICE_dump_mdsio = .TRUE. |
296 |
STREAMICE_dump_mnc = .FALSE. |
STREAMICE_dump_mnc = .FALSE. |
297 |
STREAMICE_tave_mnc = .FALSE. |
STREAMICE_tave_mnc = .FALSE. |
298 |
STREAMICE_GL_regularize = .FALSE. |
! STREAMICE_GL_regularize = .FALSE. |
299 |
STREAMICE_move_front = .FALSE. |
STREAMICE_move_front = .FALSE. |
300 |
STREAMICE_calve_to_mask = .FALSE. |
STREAMICE_calve_to_mask = .FALSE. |
301 |
! STREAMICE_geom_file_setup = .FALSE. |
! STREAMICE_geom_file_setup = .FALSE. |
302 |
! STREAMICE_construct_matrix = .TRUE. |
! STREAMICE_construct_matrix = .TRUE. |
303 |
STREAMICE_lower_cg_tol = .FALSE. |
STREAMICE_lower_cg_tol = .FALSE. |
304 |
STREAMICE_diagnostic_only = .FALSE. |
STREAMICE_diagnostic_only = .FALSE. |
305 |
|
#ifdef STREAMICE_FLOWLINE_BUTTRESS |
306 |
|
useStreamiceFlowlineButtr=.FALSE. |
307 |
|
#endif |
308 |
STREAMICE_ppm_driving_stress = .FALSE. |
STREAMICE_ppm_driving_stress = .FALSE. |
309 |
|
STREAMICE_chkfixedptconvergence = .true. |
310 |
|
STREAMICE_chkresidconvergence = .true. |
311 |
STREAMICE_h_ctrl_const_surf = .FALSE. |
STREAMICE_h_ctrl_const_surf = .FALSE. |
312 |
|
STREAMICE_allow_cpl = .false. |
313 |
! STREAMICE_hybrid_stress= .FALSE. |
! STREAMICE_hybrid_stress= .FALSE. |
314 |
|
|
315 |
min_x_noflow_NORTH = 0. |
min_x_noflow_NORTH = 0. |
395 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
396 |
#endif |
#endif |
397 |
|
|
398 |
READ(UNIT=iUnit,NML=STREAMICE_PARM03) |
#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) |
399 |
|
READ(UNIT=iUnit,NML=STREAMICE_PARMOAD) |
400 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
401 |
& 'STREAMICE_READPARMS: read third param block' |
& 'STREAMICE_READPARMS: read oad parm block' |
402 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
403 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
404 |
CLOSE(iUnit) |
#endif |
|
|
|
|
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
|
|
|
|
|
CALL OPEN_COPY_DATA_FILE( |
|
|
I 'data.strmctrlflux', 'STREAMICE_READPARMS', |
|
|
O iUnit, |
|
|
I myThid ) |
|
405 |
|
|
406 |
READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL) |
READ(UNIT=iUnit,NML=STREAMICE_PARM03) |
407 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
408 |
& 'STREAMICE_READPARMS: read flux_ctrl param block' |
& 'STREAMICE_READPARMS: read third param block' |
409 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
410 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
411 |
CLOSE(iUnit) |
CLOSE(iUnit) |
412 |
#endif |
|
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) |
streamice_nstep_velocity = NINT (streamice_vel_update / deltaT) |
429 |
|
|