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