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 |
38 |
NAMELIST /STREAMICE_PARM01/ |
NAMELIST /STREAMICE_PARM01/ |
39 |
& streamice_density, streamice_density_ocean_avg, |
& streamice_density, streamice_density_ocean_avg, |
40 |
& B_glen_isothermal, n_glen, eps_glen_min, eps_u_min, |
& B_glen_isothermal, n_glen, eps_glen_min, eps_u_min, |
41 |
& C_basal_fric_const, n_basal_friction, |
& C_basal_fric_const, n_basal_friction, |
42 |
& streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol, |
& streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol, |
43 |
& streamice_nonlin_tol_fp, |
& streamice_nonlin_tol_fp, |
44 |
& streamice_max_cg_iter, streamice_max_nl_iter, |
& streamice_max_cg_iter, streamice_max_nl_iter, |
45 |
& STREAMICE_GL_regularize, |
& streamice_maxcgiter_cpl, streamice_maxnliter_cpl, |
46 |
& STREAMICEthickInit, |
& STREAMICEthickInit, |
47 |
& STREAMICEsigcoordInit, |
& STREAMICEsigcoordInit, |
48 |
& STREAMICEsigcoordFile, |
& STREAMICEsigcoordFile, |
49 |
& STREAMICEthickFile, |
& STREAMICEthickFile, |
50 |
& STREAMICEcalveMaskFile, |
& STREAMICEcalveMaskFile, |
51 |
& STREAMICEcostMaskFile, |
& STREAMICEcostMaskFile, |
|
& STREAMICEison, |
|
52 |
& STREAMICE_dump_mdsio, STREAMICE_tave_mdsio, |
& STREAMICE_dump_mdsio, STREAMICE_tave_mdsio, |
53 |
& STREAMICE_dump_mnc, STREAMICE_tave_mnc, |
& STREAMICE_dump_mnc, STREAMICE_tave_mnc, |
54 |
& STREAMICE_GL_regularize, STREAMICE_move_front, |
& STREAMICE_move_front, |
55 |
& STREAMICE_calve_to_mask, |
& STREAMICE_calve_to_mask, |
56 |
& STREAMICE_diagnostic_only, |
& STREAMICE_diagnostic_only, |
57 |
& STREAMICE_lower_cg_tol, |
& STREAMICE_lower_cg_tol, |
63 |
& STREAMICEBdotConfig, |
& STREAMICEBdotConfig, |
64 |
& STREAMICEbasalTracFile, |
& STREAMICEbasalTracFile, |
65 |
& STREAMICEBdotFile, |
& STREAMICEBdotFile, |
66 |
|
& STREAMICEBdotTimeDepFile, |
67 |
& STREAMICEvelOptimFile, |
& STREAMICEvelOptimFile, |
68 |
& STREAMICEtopogFile, |
& STREAMICEtopogFile, |
69 |
& STREAMICEhmaskFile, |
& STREAMICEhmaskFile, |
72 |
& STREAMICEuFaceBdryFile, |
& STREAMICEuFaceBdryFile, |
73 |
& STREAMICEvFaceBdryFile, |
& STREAMICEvFaceBdryFile, |
74 |
& STREAMICEuDirichValsFile, |
& STREAMICEuDirichValsFile, |
75 |
& STREAMICEvDirichValsFile, |
& STREAMICEvDirichValsFile, |
76 |
|
& STREAMICEuMassFluxFile, |
77 |
|
& STREAMICEvMassFluxFile, |
78 |
|
& STREAMICEuNormalStressFile, |
79 |
|
& STREAMICEvNormalStressFile, |
80 |
|
& STREAMICEuShearStressFile, |
81 |
|
& STREAMICEvShearStressFile, |
82 |
|
& STREAMICEuNormalTimeDepFile, |
83 |
|
& STREAMICEvNormalTimeDepFile, |
84 |
|
& STREAMICEuShearTimeDepFile, |
85 |
|
& STREAMICEvShearTimeDepFile, |
86 |
|
& STREAMICEuFluxTimeDepFile, STREAMICEvFluxTimeDepFile, |
87 |
& STREAMICEGlenConstFile, STREAMICEGlenConstConfig, |
& STREAMICEGlenConstFile, STREAMICEGlenConstConfig, |
88 |
& STREAMICE_ppm_driving_stress, |
& STREAMICE_ppm_driving_stress, |
89 |
& STREAMICE_h_ctrl_const_surf, |
& STREAMICE_h_ctrl_const_surf, |
90 |
& streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel, |
& streamice_wgt_drift,streamice_wgt_surf,streamice_wgt_vel, |
91 |
& streamice_wgt_avthick, streamice_wgt_tikh, |
& streamice_wgt_avthick, streamice_wgt_tikh, |
92 |
& streamice_addl_backstress, |
& streamice_addl_backstress, |
93 |
& streamice_smooth_gl_width, |
& streamice_smooth_gl_width, |
94 |
& streamice_adot_uniform, |
& streamice_adot_uniform, |
95 |
& STREAMICE_ADV_SCHEME |
& STREAMICE_ADV_SCHEME, streamice_forcing_period, |
96 |
|
& STREAMICE_chkfixedptconvergence, |
97 |
|
& STREAMICE_chkresidconvergence, |
98 |
|
& STREAMICE_allow_cpl |
99 |
|
|
100 |
#ifdef ALLOW_STREAMICE_2DTRACER |
#ifdef ALLOW_STREAMICE_2DTRACER |
101 |
NAMELIST /STREAMICE_PARMTRACER/ |
NAMELIST /STREAMICE_PARMTRACER/ |
106 |
|
|
107 |
#ifdef ALLOW_PETSC |
#ifdef ALLOW_PETSC |
108 |
NAMELIST /STREAMICE_PARMPETSC/ |
NAMELIST /STREAMICE_PARMPETSC/ |
109 |
& PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE |
& PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE, |
110 |
#endif |
& streamice_use_petsc |
|
|
|
|
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
|
|
NAMELIST /STREAMICE_PARMFLUXCTRL/ |
|
|
& n_fluxes, n_epochs, |
|
|
& streamice_ctrl_flux_id, |
|
|
& streamice_ctrl_flux_scaleVel |
|
111 |
#endif |
#endif |
112 |
|
|
113 |
|
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
114 |
|
! NAMELIST /STREAMICE_PARMFLUXCTRL/ |
115 |
|
! & n_fluxes, n_epochs, |
116 |
|
! & streamice_ctrl_flux_id, |
117 |
|
! & streamice_ctrl_flux_scaleVel |
118 |
|
!#endif |
119 |
|
|
120 |
NAMELIST /STREAMICE_PARM02/ |
NAMELIST /STREAMICE_PARM02/ |
121 |
& shelf_max_draft, |
& shelf_max_draft, |
150 |
& flux_bdry_val_WEST, flux_bdry_val_EAST, |
& flux_bdry_val_WEST, flux_bdry_val_EAST, |
151 |
& STREAMICE_NS_periodic, STREAMICE_EW_periodic |
& STREAMICE_NS_periodic, STREAMICE_EW_periodic |
152 |
|
|
153 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
154 |
|
|
155 |
|
IF ( .NOT.useStreamIce ) THEN |
156 |
|
C- pkg STREAMICE is not used |
157 |
|
_BEGIN_MASTER(myThid) |
158 |
|
C- Track pkg activation status: |
159 |
|
STREAMICEisOn = .FALSE. |
160 |
|
C print a (weak) warning if data.streamice is found |
161 |
|
CALL PACKAGES_UNUSED_MSG( 'useStreamIce', ' ', ' ' ) |
162 |
|
_END_MASTER(myThid) |
163 |
|
RETURN |
164 |
|
ENDIF |
165 |
|
|
166 |
_BEGIN_MASTER(myThid) |
_BEGIN_MASTER(myThid) |
167 |
|
|
168 |
|
C This routine has been called by the main model so we set our |
169 |
|
C internal flag to indicate we are in business |
170 |
|
STREAMICEisOn = .TRUE. |
171 |
|
|
172 |
C-- Default values for STREAMICE |
C-- Default values for STREAMICE |
173 |
|
|
174 |
streamice_density = 917. |
streamice_density = 917. |
175 |
streamice_density_ocean_avg = 1024. |
streamice_density_ocean_avg = 1024. |
176 |
B_glen_isothermal = 9.461e-18 ! Pa (-1/3) a |
B_glen_isothermal = 9.461e-18 ! Pa (-1/3) a |
177 |
n_glen = 3. |
n_glen = 3. |
179 |
eps_u_min = 1.0e-6 |
eps_u_min = 1.0e-6 |
180 |
C_basal_fric_const = 31.71 ! Pa (m/a)-1n |
C_basal_fric_const = 31.71 ! Pa (m/a)-1n |
181 |
n_basal_friction = 1. |
n_basal_friction = 1. |
182 |
streamice_vel_update = 169200. ! seconds |
streamice_vel_update = deltaT ! seconds |
183 |
streamice_cg_tol = 1e-6 |
streamice_cg_tol = 1e-6 |
184 |
streamice_nonlin_tol = 1e-6 |
streamice_nonlin_tol = 1e-6 |
185 |
streamice_nonlin_tol_fp = 1.e-14 |
streamice_nonlin_tol_fp = 1.e-14 |
186 |
streamice_max_cg_iter = 2000 |
streamice_max_cg_iter = 2000 |
187 |
streamice_max_nl_iter = 100 |
streamice_max_nl_iter = 100 |
188 |
streamice_n_sub_regularize = 4 |
streamice_maxcgiter_cpl = 0 |
189 |
|
streamice_maxnliter_cpl = 0 |
190 |
|
! streamice_n_sub_regularize = 4 |
191 |
streamice_CFL_factor = .5 |
streamice_CFL_factor = .5 |
192 |
streamice_adjDump = 0. |
streamice_adjDump = 0. |
193 |
streamice_bg_surf_slope_x = .0 |
streamice_bg_surf_slope_x = .0 |
196 |
streamice_ky_b_init = 1. |
streamice_ky_b_init = 1. |
197 |
streamice_wgt_drift = 0. |
streamice_wgt_drift = 0. |
198 |
streamice_wgt_tikh = 0. |
streamice_wgt_tikh = 0. |
199 |
streamice_wgt_surf = 0. |
streamice_wgt_surf = 0. |
200 |
streamice_wgt_vel = 0. |
streamice_wgt_vel = 0. |
201 |
streamice_wgt_avthick = 0. |
streamice_wgt_avthick = 0. |
202 |
streamice_addl_backstress = 0.0 |
streamice_addl_backstress = 0.0 |
203 |
streamice_smooth_gl_width = 0.0 |
streamice_smooth_gl_width = 0.0 |
204 |
streamice_adot_uniform = 0.0 |
streamice_adot_uniform = 0.0 |
205 |
|
streamice_forcing_period = 0 |
206 |
|
|
207 |
STREAMICEthickInit = 'FILE' |
STREAMICEthickInit = 'FILE' |
208 |
STREAMICEthickFile = ' ' |
STREAMICEthickFile = ' ' |
212 |
STREAMICEbasalTracConfig = 'UNIFORM' |
STREAMICEbasalTracConfig = 'UNIFORM' |
213 |
STREAMICEBdotConfig = '' |
STREAMICEBdotConfig = '' |
214 |
STREAMICEBdotFile = '' |
STREAMICEBdotFile = '' |
215 |
|
STREAMICEBdotTimeDepFile = ' ' |
216 |
STREAMICEbasalTracFile = ' ' |
STREAMICEbasalTracFile = ' ' |
217 |
STREAMICEvelOptimFile = '' |
STREAMICEvelOptimFile = '' |
218 |
STREAMICEtopogFile = '' |
STREAMICEtopogFile = '' |
219 |
STREAMICEhmaskFile = '' |
STREAMICEhmaskFile = '' |
220 |
STREAMICEHBCyFile = '' |
STREAMICEHBCyFile = '' |
221 |
STREAMICEHBCxFile = '' |
STREAMICEHBCxFile = '' |
222 |
|
STREAMICEuNormalStressFile = '' |
223 |
|
STREAMICEvNormalStressFile = '' |
224 |
|
STREAMICEuShearStressFile = '' |
225 |
|
STREAMICEvShearStressFile = '' |
226 |
|
STREAMICEuNormalTimeDepFile = ' ' |
227 |
|
STREAMICEvNormalTimeDepFile = ' ' |
228 |
|
STREAMICEuShearTimeDepFile = ' ' |
229 |
|
STREAMICEvShearTimeDepFile = ' ' |
230 |
|
STREAMICEuFluxTimeDepFile = ' ' |
231 |
|
STREAMICEvFluxTimeDepFile = ' ' |
232 |
|
|
233 |
#ifdef ALLOW_STREAMICE_2DTRACER |
#ifdef ALLOW_STREAMICE_2DTRACER |
234 |
STREAMICETrac2DBCxFile = '' |
STREAMICETrac2DBCxFile = '' |
235 |
STREAMICETrac2DBCyFile = '' |
STREAMICETrac2DBCyFile = '' |
239 |
STREAMICEvFaceBdryFile = '' |
STREAMICEvFaceBdryFile = '' |
240 |
STREAMICEuDirichValsFile = '' |
STREAMICEuDirichValsFile = '' |
241 |
STREAMICEvDirichValsFile = '' |
STREAMICEvDirichValsFile = '' |
242 |
|
STREAMICEuMassFluxFile = '' |
243 |
|
STREAMICEvMassFluxFile = '' |
244 |
STREAMICEGlenConstFile = '' |
STREAMICEGlenConstFile = '' |
245 |
STREAMICEcostMaskFile = '' |
STREAMICEcostMaskFile = '' |
246 |
STREAMICEGlenConstConfig = 'UNIFORM' |
STREAMICEGlenConstConfig = 'UNIFORM' |
247 |
#ifdef ALLOW_PETSC |
#ifdef ALLOW_PETSC |
248 |
PETSC_PRECOND_TYPE = 'PCBJACOBI' |
PETSC_PRECOND_TYPE = 'PCBJACOBI' |
249 |
PETSC_SOLVER_TYPE = 'KSPCG' |
PETSC_SOLVER_TYPE = 'KSPCG' |
250 |
|
streamice_use_petsc = .true. |
251 |
#endif |
#endif |
252 |
STREAMICE_ADV_SCHEME = '' |
STREAMICE_ADV_SCHEME = '' |
253 |
|
|
254 |
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
255 |
n_fluxes = 0 |
! n_fluxes = 0 |
256 |
n_epochs = 0 |
! n_epochs = 0 |
257 |
DO iarr=1,n_fluxes_max |
! DO iarr=1,n_fluxes_max |
258 |
streamice_ctrl_flux_id(iarr) = 0 |
! streamice_ctrl_flux_id(iarr) = 0 |
259 |
DO tarr=1,n_epochs_max |
! DO tarr=1,n_epochs_max |
260 |
streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 |
! streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0 |
261 |
ENDDO |
! ENDDO |
262 |
ENDDO |
! ENDDO |
263 |
#endif |
!#endif |
264 |
|
|
|
STREAMICEison = .TRUE. |
|
265 |
STREAMICE_tave_mdsio = .TRUE. |
STREAMICE_tave_mdsio = .TRUE. |
266 |
STREAMICE_dump_mdsio = .TRUE. |
STREAMICE_dump_mdsio = .TRUE. |
267 |
STREAMICE_dump_mnc = .FALSE. |
STREAMICE_dump_mnc = .FALSE. |
268 |
STREAMICE_tave_mnc = .FALSE. |
STREAMICE_tave_mnc = .FALSE. |
269 |
STREAMICE_GL_regularize = .FALSE. |
! STREAMICE_GL_regularize = .FALSE. |
270 |
STREAMICE_move_front = .FALSE. |
STREAMICE_move_front = .FALSE. |
271 |
STREAMICE_calve_to_mask = .FALSE. |
STREAMICE_calve_to_mask = .FALSE. |
272 |
! STREAMICE_geom_file_setup = .FALSE. |
! STREAMICE_geom_file_setup = .FALSE. |
274 |
STREAMICE_lower_cg_tol = .FALSE. |
STREAMICE_lower_cg_tol = .FALSE. |
275 |
STREAMICE_diagnostic_only = .FALSE. |
STREAMICE_diagnostic_only = .FALSE. |
276 |
STREAMICE_ppm_driving_stress = .FALSE. |
STREAMICE_ppm_driving_stress = .FALSE. |
277 |
|
STREAMICE_chkfixedptconvergence = .true. |
278 |
|
STREAMICE_chkresidconvergence = .true. |
279 |
STREAMICE_h_ctrl_const_surf = .FALSE. |
STREAMICE_h_ctrl_const_surf = .FALSE. |
280 |
|
STREAMICE_allow_cpl = .false. |
281 |
! STREAMICE_hybrid_stress= .FALSE. |
! STREAMICE_hybrid_stress= .FALSE. |
282 |
|
|
283 |
min_x_noflow_NORTH = 0. |
min_x_noflow_NORTH = 0. |
322 |
flux_bdry_val_EAST = 0. |
flux_bdry_val_EAST = 0. |
323 |
|
|
324 |
STREAMICE_NS_periodic = .FALSE. |
STREAMICE_NS_periodic = .FALSE. |
325 |
STREAMICE_EW_periodic = .FALSE. |
STREAMICE_EW_periodic = .FALSE. |
326 |
|
|
327 |
WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice' |
WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice' |
328 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
363 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
364 |
#endif |
#endif |
365 |
|
|
|
|
|
366 |
READ(UNIT=iUnit,NML=STREAMICE_PARM03) |
READ(UNIT=iUnit,NML=STREAMICE_PARM03) |
367 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
368 |
& 'STREAMICE_READPARMS: read third param block' |
& 'STREAMICE_READPARMS: read third param block' |
370 |
& SQUEEZE_RIGHT , 1) |
& SQUEEZE_RIGHT , 1) |
371 |
CLOSE(iUnit) |
CLOSE(iUnit) |
372 |
|
|
373 |
|
!#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
374 |
#ifdef ALLOW_STREAMICE_FLUX_CONTROL |
! |
375 |
|
! CALL OPEN_COPY_DATA_FILE( |
376 |
CALL OPEN_COPY_DATA_FILE( |
! I 'data.strmctrlflux', 'STREAMICE_READPARMS', |
377 |
I 'data.strmctrlflux', 'STREAMICE_READPARMS', |
! O iUnit, |
378 |
O iUnit, |
! I myThid ) |
379 |
I myThid ) |
! |
380 |
|
! READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL) |
381 |
|
! WRITE(msgBuf,'(A)') |
382 |
READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL) |
! & 'STREAMICE_READPARMS: read flux_ctrl param block' |
383 |
WRITE(msgBuf,'(A)') |
! CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
384 |
& 'STREAMICE_READPARMS: read flux_ctrl param block' |
! & SQUEEZE_RIGHT , 1) |
385 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
! CLOSE(iUnit) |
386 |
& SQUEEZE_RIGHT , 1) |
!#endif |
|
CLOSE(iUnit) |
|
|
#endif |
|
|
|
|
|
|
|
387 |
|
|
388 |
streamice_nstep_velocity = NINT (streamice_vel_update / deltaT) |
streamice_nstep_velocity = NINT (streamice_vel_update / deltaT) |
389 |
|
|
390 |
C- Set Output type flags : |
C- Set Output type flags : |
391 |
|
|
392 |
#ifdef ALLOW_MNC |
#ifdef ALLOW_MNC |
393 |
IF (useMNC) THEN |
IF (useMNC) THEN |
394 |
IF ( .NOT.outputTypesInclusive |
IF ( .NOT.outputTypesInclusive |