1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
|
|
|
4 |
C this needs changes |
C this needs changes |
5 |
|
|
6 |
#include "STREAMICE_OPTIONS.h" |
#include "STREAMICE_OPTIONS.h" |
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, |
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_move_front, |
& STREAMICE_move_front, |
73 |
& STREAMICEuFaceBdryFile, |
& STREAMICEuFaceBdryFile, |
74 |
& STREAMICEvFaceBdryFile, |
& STREAMICEvFaceBdryFile, |
75 |
& STREAMICEuDirichValsFile, |
& STREAMICEuDirichValsFile, |
76 |
& STREAMICEvDirichValsFile, |
& STREAMICEvDirichValsFile, |
77 |
& STREAMICEuMassFluxFile, |
& STREAMICEuMassFluxFile, |
78 |
& STREAMICEvMassFluxFile, |
& STREAMICEvMassFluxFile, |
79 |
& STREAMICEuNormalStressFile, |
& STREAMICEuNormalStressFile, |
80 |
& STREAMICEvNormalStressFile, |
& STREAMICEvNormalStressFile, |
81 |
& STREAMICEuShearStressFile, |
& STREAMICEuShearStressFile, |
84 |
& STREAMICEvNormalTimeDepFile, |
& STREAMICEvNormalTimeDepFile, |
85 |
& STREAMICEuShearTimeDepFile, |
& STREAMICEuShearTimeDepFile, |
86 |
& STREAMICEvShearTimeDepFile, |
& 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, |
91 |
& streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel, |
& streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel, |
92 |
& streamice_wgt_avthick, streamice_wgt_tikh, |
& streamice_wgt_avthick, streamice_wgt_tikh, |
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_firn_correction, |
97 |
|
& STREAMICE_apply_firn_correction, |
98 |
& STREAMICE_ADV_SCHEME, streamice_forcing_period, |
& STREAMICE_ADV_SCHEME, streamice_forcing_period, |
99 |
& STREAMICE_chkfixedptconvergence, |
& STREAMICE_chkfixedptconvergence, |
100 |
& STREAMICE_chkresidconvergence, |
& STREAMICE_chkresidconvergence, |
101 |
|
#ifdef STREAMICE_FLOWLINE_BUTTRESS |
102 |
|
& streamice_buttr_width, |
103 |
|
& useStreamiceFlowlineButtr, |
104 |
|
#endif |
105 |
& STREAMICE_allow_cpl |
& STREAMICE_allow_cpl |
106 |
|
|
107 |
#ifdef ALLOW_STREAMICE_2DTRACER |
#ifdef ALLOW_STREAMICE_2DTRACER |
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, |
166 |
& flux_bdry_val_WEST, flux_bdry_val_EAST, |
& flux_bdry_val_WEST, flux_bdry_val_EAST, |
167 |
& STREAMICE_NS_periodic, STREAMICE_EW_periodic |
& 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) |
_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 |
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_maxcgiter_cpl = 0 |
streamice_maxcgiter_cpl = 0 |
220 |
streamice_ky_b_init = 1. |
streamice_ky_b_init = 1. |
221 |
streamice_wgt_drift = 0. |
streamice_wgt_drift = 0. |
222 |
streamice_wgt_tikh = 0. |
streamice_wgt_tikh = 0. |
223 |
streamice_wgt_surf = 0. |
streamice_wgt_surf = 0. |
224 |
streamice_wgt_vel = 0. |
streamice_wgt_vel = 0. |
225 |
streamice_wgt_avthick = 0. |
streamice_wgt_avthick = 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 |
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 = ' ' |
256 |
STREAMICEvNormalTimeDepFile = ' ' |
STREAMICEvNormalTimeDepFile = ' ' |
257 |
STREAMICEuShearTimeDepFile = ' ' |
STREAMICEuShearTimeDepFile = ' ' |
258 |
STREAMICEvShearTimeDepFile = ' ' |
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. |
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. |
STREAMICE_chkfixedptconvergence = .true. |
310 |
STREAMICE_chkresidconvergence = .true. |
STREAMICE_chkresidconvergence = .true. |
354 |
flux_bdry_val_EAST = 0. |
flux_bdry_val_EAST = 0. |
355 |
|
|
356 |
STREAMICE_NS_periodic = .FALSE. |
STREAMICE_NS_periodic = .FALSE. |
357 |
STREAMICE_EW_periodic = .FALSE. |
STREAMICE_EW_periodic = .FALSE. |
358 |
|
|
359 |
WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice' |
WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice' |
360 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
395 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
396 |
#endif |
#endif |
397 |
|
|
398 |
|
#if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP)) |
399 |
READ(UNIT=iUnit,NML=STREAMICE_PARM03) |
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) |
|
#endif |
|
|
|
|
412 |
|
|
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 |
|
|
430 |
C- Set Output type flags : |
C- Set Output type flags : |
431 |
|
|
432 |
#ifdef ALLOW_MNC |
#ifdef ALLOW_MNC |
433 |
IF (useMNC) THEN |
IF (useMNC) THEN |
434 |
IF ( .NOT.outputTypesInclusive |
IF ( .NOT.outputTypesInclusive |