Back to home page

MITgcm

 
 

    


File indexing completed on 2023-09-21 05:10:52 UTC

view on githubraw file Latest commit 96b00645 on 2023-09-20 15:15:14 UTC
5ca83cd8f7 Dani*0001 C this needs changes
                0002 
                0003 #include "STREAMICE_OPTIONS.h"
96b006450c dngo*0004 #ifdef ALLOW_COST
                0005 # include "COST_OPTIONS.h"
                0006 #endif
5ca83cd8f7 Dani*0007 
                0008 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0009 CBOP 0
                0010       SUBROUTINE STREAMICE_READPARMS( myThid )
                0011 
                0012 C     !DESCRIPTION:
                0013 C     Initialize STREAMICE variables and constants.
                0014 
                0015 C     !USES:
                0016       IMPLICIT NONE
                0017 #include "SIZE.h"
                0018 #include "EEPARAMS.h"
                0019 #include "PARAMS.h"
                0020 #include "STREAMICE.h"
                0021 #include "STREAMICE_BDRY.h"
07e785229e dngo*0022 c#ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0023 c#include "STREAMICE_CTRL_FLUX.h"
                0024 c#endif
5ca83cd8f7 Dani*0025 
                0026 C     !INPUT PARAMETERS:
                0027       INTEGER myThid
                0028 CEOP
                0029 
                0030 #ifdef ALLOW_STREAMICE
                0031 C     !LOCAL VARIABLES:
                0032 C     msgBuf     :: Informational/error message buffer
                0033 C     iUnit      :: Work variable for IO unit number
                0034       CHARACTER*(MAX_LEN_MBUF) msgBuf
07e785229e dngo*0035       INTEGER iUnit
96b006450c dngo*0036 # ifdef ALLOW_STREAMICE_TC_COST
                0037       INTEGER iarr
                0038 # endif
                0039 
                0040 c      _RL streamice_bdot_depth_nomelt
                0041 c      _RL streamice_bdot_depth_maxmelt
                0042 c      _RL streamice_bdot_maxmelt
5ca83cd8f7 Dani*0043 
                0044       NAMELIST /STREAMICE_PARM01/
                0045      &     streamice_density, streamice_density_ocean_avg,
e4cfce0a6c Dani*0046      &     streamice_density_firn,
5ca83cd8f7 Dani*0047      &     B_glen_isothermal, n_glen, eps_glen_min, eps_u_min,
02e2d7ff52 Jean*0048      &     C_basal_fric_const, n_basal_friction,
5ca83cd8f7 Dani*0049      &     streamice_vel_update,streamice_cg_tol,streamice_nonlin_tol,
bbd6229661 Dani*0050      &     streamice_nonlin_tol_fp, streamice_err_norm,
5ca83cd8f7 Dani*0051      &     streamice_max_cg_iter, streamice_max_nl_iter,
d2cdb9260d Dani*0052      &     streamice_maxcgiter_cpl, streamice_maxnliter_cpl,
5ca83cd8f7 Dani*0053      &     STREAMICEthickInit,
                0054      &     STREAMICEsigcoordInit,
                0055      &     STREAMICEsigcoordFile,
                0056      &     STREAMICEthickFile,
                0057      &     STREAMICEcalveMaskFile,
                0058      &     STREAMICEcostMaskFile,
                0059      &     STREAMICE_dump_mdsio, STREAMICE_tave_mdsio,
                0060      &     STREAMICE_dump_mnc, STREAMICE_tave_mnc,
f3f31151db Dani*0061      &     STREAMICE_move_front,
5ca83cd8f7 Dani*0062      &     STREAMICE_calve_to_mask,
                0063      &     STREAMICE_diagnostic_only,
                0064      &     STREAMICE_lower_cg_tol,
                0065      &     streamice_CFL_factor,
                0066      &     streamice_adjDump,
                0067      &     streamice_bg_surf_slope_x, streamice_bg_surf_slope_y,
                0068      &     streamice_kx_b_init, streamice_ky_b_init,
                0069      &     STREAMICEbasalTracConfig,
0a8c8b23d7 Dani*0070      &     STREAMICEBdotConfig,
07e785229e dngo*0071      &     STREAMICEAdotConfig,
5ca83cd8f7 Dani*0072      &     STREAMICEbasalTracFile,
0a8c8b23d7 Dani*0073      &     STREAMICEBdotFile,
07e785229e dngo*0074      &     STREAMICEAdotFile,
52d1822301 Dani*0075      &     STREAMICEBdotTimeDepFile,
96b006450c dngo*0076      &     streamice_bdot_depth_nomelt,
                0077      &     streamice_bdot_depth_maxmelt,
                0078      &     streamice_bdot_maxmelt,
                0079      &     streamice_bdot_exp,
5ca83cd8f7 Dani*0080      &     STREAMICEtopogFile,
                0081      &     STREAMICEhmaskFile,
                0082      &     STREAMICEHBCyFile,
                0083      &     STREAMICEHBCxFile,
                0084      &     STREAMICEuFaceBdryFile,
                0085      &     STREAMICEvFaceBdryFile,
                0086      &     STREAMICEuDirichValsFile,
02e2d7ff52 Jean*0087      &     STREAMICEvDirichValsFile,
                0088      &     STREAMICEuMassFluxFile,
                0089      &     STREAMICEvMassFluxFile,
7924606b84 Dani*0090      &     STREAMICEuNormalStressFile,
                0091      &     STREAMICEvNormalStressFile,
                0092      &     STREAMICEuShearStressFile,
                0093      &     STREAMICEvShearStressFile,
52d1822301 Dani*0094      &     STREAMICEuNormalTimeDepFile,
                0095      &     STREAMICEvNormalTimeDepFile,
                0096      &     STREAMICEuShearTimeDepFile,
                0097      &     STREAMICEvShearTimeDepFile,
2a16ced2f5 Dani*0098      &     STREAMICEuFluxTimeDepFile, STREAMICEvFluxTimeDepFile,
96b006450c dngo*0099      &     bdotMaxmeltTimeDepFile,
                0100      &     bglenTimeDepFile,
                0101      &     cfricTimeDepFile,
5ca83cd8f7 Dani*0102      &     STREAMICEGlenConstFile, STREAMICEGlenConstConfig,
                0103      &     STREAMICE_ppm_driving_stress,
                0104      &     STREAMICE_h_ctrl_const_surf,
                0105      &     streamice_addl_backstress,
                0106      &     streamice_smooth_gl_width,
                0107      &     streamice_adot_uniform,
e4cfce0a6c Dani*0108      &     streamice_firn_correction,
                0109      &     STREAMICE_apply_firn_correction,
d2cdb9260d Dani*0110      &     STREAMICE_ADV_SCHEME, streamice_forcing_period,
                0111      &     STREAMICE_chkfixedptconvergence,
                0112      &     STREAMICE_chkresidconvergence,
29d9814714 Dani*0113      &     STREAMICE_alt_driving_stress,
07e785229e dngo*0114      &     STREAMICE_allow_reg_coulomb,
0fbff46b46 dngo*0115      &     STREAMICE_use_log_ctrl,
                0116      &     STREAMICE_vel_ext,
                0117      &     STREAMICE_vel_ext_cgrid,
                0118      &     STREAMICE_uvel_ext_file,
                0119      &     STREAMICE_vvel_ext_file,
96b006450c dngo*0120      &     STREAMICEBdotDepthFile,
                0121      &     STREAMICEBdotMaxMeltFile,
                0122      &      STREAMICE_shelf_dhdt_ctrl,
1cb54b8236 Dani*0123 #ifdef STREAMICE_FLOWLINE_BUTTRESS
                0124      &     streamice_buttr_width,
                0125      &     useStreamiceFlowlineButtr,
                0126 #endif
d2cdb9260d Dani*0127      &     STREAMICE_allow_cpl
d82c08285f Dani*0128 #ifdef ALLOW_OPENAD
                0129      &     ,streamice_smooth_thick_adjoint
                0130 #endif
5ca83cd8f7 Dani*0131 
                0132 #ifdef ALLOW_STREAMICE_2DTRACER
                0133       NAMELIST /STREAMICE_PARMTRACER/
                0134      &     STREAMICETrac2DBCxFile,
                0135      &     STREAMICETrac2DBCyFile,
                0136      &     STREAMICETrac2DINITFile
                0137 #endif
                0138 
                0139 #ifdef ALLOW_PETSC
                0140       NAMELIST /STREAMICE_PARMPETSC/
07e785229e dngo*0141      &     PETSC_PRECOND_TYPE, PETSC_SOLVER_TYPE,
                0142      &     streamice_use_petsc, streamice_maxnliter_petsc,
                0143      &     streamice_petsc_pcfactorlevels
5ca83cd8f7 Dani*0144 #endif
                0145 
729bb43bca Dani*0146 #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
07e785229e dngo*0147       NAMELIST /STREAMICE_PARMOAD/
0fbff46b46 dngo*0148      &     streamice_nonlin_tol_adjoint,
                0149      &     streamice_nonlin_tol_adjoint_rl
729bb43bca Dani*0150 #ifdef ALLOW_PETSC
07e785229e dngo*0151      &     ,STREAMICE_OAD_petsc_reuse,
729bb43bca Dani*0152      &     PETSC_PRECOND_OAD
                0153 #endif
                0154 #endif
                0155 
96b006450c dngo*0156 #ifdef ALLOW_COST_STREAMICE
                0157       NAMELIST /STREAMICE_COST/
                0158      &     STREAMICEvelOptimSnapBasename,
                0159      &     STREAMICEvelOptimTCBasename,
                0160      &     STREAMICEsurfOptimTCBasename,
                0161      &     STREAMICEBglenCostMaskFile,
                0162      &     streamice_wgt_drift,
                0163      &     streamice_wgt_vel,
                0164      &     streamice_wgt_vel_norm,
                0165      &     streamice_wgt_surf,
                0166      &     streamice_wgt_tikh_beta,
                0167      &     streamice_wgt_tikh_bglen,
                0168      &     streamice_wgt_tikh_gen,
                0169      &     streamice_wgt_prior_bglen,
                0170      &     streamice_wgt_prior_gen,
                0171      &     STREAMICE_do_snapshot_cost,
                0172      &     STREAMICE_do_timedep_cost,
                0173      &     STREAMICE_do_verification_cost,
                0174      &     STREAMICE_do_vaf_cost
                0175 #ifdef ALLOW_STREAMICE_TC_COST
                0176      &     ,streamice_vel_cost_timesteps,
                0177      &     streamice_surf_cost_timesteps
                0178 #endif
                0179 #endif
                0180 
07e785229e dngo*0181 c#ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0182 c      NAMELIST /STREAMICE_PARMFLUXCTRL/
                0183 c     &     n_fluxes, n_epochs,
                0184 c     &     streamice_ctrl_flux_id,
                0185 c     &     streamice_ctrl_flux_scaleVel
                0186 c#endif
5ca83cd8f7 Dani*0187 
                0188       NAMELIST /STREAMICE_PARM02/
                0189      &     shelf_max_draft,
                0190      &     shelf_min_draft,
                0191      &     shelf_edge_pos,
                0192      &     shelf_slope_scale,
                0193      &     shelf_flat_width,
                0194      &     flow_dir
                0195 
                0196       NAMELIST /STREAMICE_PARM03/
                0197      &     min_x_noflow_NORTH, max_x_noflow_NORTH,
                0198      &     min_x_noflow_SOUTH, max_x_noflow_SOUTH,
                0199      &     min_y_noflow_WEST, max_y_noflow_WEST,
                0200      &     min_y_noflow_EAST, max_y_noflow_EAST,
                0201      &     min_x_noStress_NORTH, max_x_noStress_NORTH,
                0202      &     min_x_noStress_SOUTH, max_x_noStress_SOUTH,
                0203      &     min_y_noStress_WEST, max_y_noStress_WEST,
                0204      &     min_y_noStress_EAST, max_y_noStress_EAST,
                0205      &     min_x_FluxBdry_NORTH, max_x_FluxBdry_NORTH,
                0206      &     min_x_FluxBdry_SOUTH, max_x_FluxBdry_SOUTH,
                0207      &     min_y_FluxBdry_WEST, max_y_FluxBdry_WEST,
                0208      &     min_y_FluxBdry_EAST, max_y_FluxBdry_EAST,
                0209      &     min_x_Dirich_NORTH, max_x_Dirich_NORTH,
                0210      &     min_x_Dirich_SOUTH, max_x_Dirich_SOUTH,
                0211      &     min_y_Dirich_WEST, max_y_Dirich_WEST,
                0212      &     min_y_Dirich_EAST, max_y_Dirich_EAST,
                0213      &     min_x_CFBC_NORTH, max_x_CFBC_NORTH,
                0214      &     min_x_CFBC_SOUTH, max_x_CFBC_SOUTH,
                0215      &     min_y_CFBC_WEST, max_y_CFBC_WEST,
                0216      &     min_y_CFBC_EAST, max_y_CFBC_EAST,
                0217      &     flux_bdry_val_SOUTH, flux_bdry_val_NORTH,
                0218      &     flux_bdry_val_WEST, flux_bdry_val_EAST,
                0219      &     STREAMICE_NS_periodic, STREAMICE_EW_periodic
                0220 
02e2d7ff52 Jean*0221 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0222 
                0223       IF ( .NOT.useStreamIce ) THEN
                0224 C-    pkg STREAMICE is not used
                0225         _BEGIN_MASTER(myThid)
                0226 C-    Track pkg activation status:
                0227          STREAMICEisOn = .FALSE.
                0228 C     print a (weak) warning if data.streamice is found
                0229          CALL PACKAGES_UNUSED_MSG( 'useStreamIce', ' ', ' ' )
                0230         _END_MASTER(myThid)
                0231         RETURN
                0232       ENDIF
                0233 
5ca83cd8f7 Dani*0234       _BEGIN_MASTER(myThid)
                0235 
02e2d7ff52 Jean*0236 C This routine has been called by the main model so we set our
                0237 C internal flag to indicate we are in business
                0238       STREAMICEisOn = .TRUE.
                0239 
5ca83cd8f7 Dani*0240 C--   Default values for STREAMICE
                0241 
02e2d7ff52 Jean*0242       streamice_density = 917.
5ca83cd8f7 Dani*0243       streamice_density_ocean_avg = 1024.
07e785229e dngo*0244       streamice_density_firn = streamice_density
5ca83cd8f7 Dani*0245       B_glen_isothermal = 9.461e-18   !  Pa (-1/3) a
                0246       n_glen = 3.
                0247       eps_glen_min = 1.0e-12
                0248       eps_u_min = 1.0e-6
                0249       C_basal_fric_const = 31.71 ! Pa (m/a)-1n
07e785229e dngo*0250       n_basal_friction = -1.
d2cdb9260d Dani*0251       streamice_vel_update = deltaT ! seconds
5ca83cd8f7 Dani*0252       streamice_cg_tol = 1e-6
                0253       streamice_nonlin_tol = 1e-6
                0254       streamice_nonlin_tol_fp = 1.e-14
bbd6229661 Dani*0255       streamice_err_norm = 0.
95afe7199b Dani*0256 #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
                0257       streamice_nonlin_tol_adjoint = 1.e-14
0fbff46b46 dngo*0258       streamice_nonlin_tol_adjoint_rl = 1.e-14
729bb43bca Dani*0259 #ifdef ALLOW_PETSC
                0260       PETSC_PRECOND_OAD = 'MUMPS'
                0261       STREAMICE_OAD_petsc_reuse =.false.
                0262 #endif
95afe7199b Dani*0263 #endif
5ca83cd8f7 Dani*0264       streamice_max_cg_iter = 2000
                0265       streamice_max_nl_iter = 100
07e785229e dngo*0266       streamice_maxnliter_petsc = -1
d2cdb9260d Dani*0267       streamice_maxcgiter_cpl = 0
                0268       streamice_maxnliter_cpl = 0
07e785229e dngo*0269       streamice_petsc_pcfactorlevels = 0
d82c08285f Dani*0270 #ifdef ALLOW_OPENAD
                0271       streamice_smooth_thick_adjoint = 0
                0272 #endif
07e785229e dngo*0273 c      streamice_n_sub_regularize = 4
5ca83cd8f7 Dani*0274       streamice_CFL_factor = .5
                0275       streamice_adjDump = 0.
                0276       streamice_bg_surf_slope_x = .0
                0277       streamice_bg_surf_slope_y = 0.
                0278       streamice_kx_b_init = 1.
                0279       streamice_ky_b_init = 1.
                0280       streamice_addl_backstress = 0.0
                0281       streamice_smooth_gl_width = 0.0
                0282       streamice_adot_uniform = 0.0
52d1822301 Dani*0283       streamice_forcing_period = 0
e4cfce0a6c Dani*0284       streamice_firn_correction = 0.
96b006450c dngo*0285       streamice_bdot_depth_nomelt = 0.
                0286       streamice_bdot_depth_maxmelt = 0.
                0287       streamice_bdot_maxmelt = 0.
                0288       streamice_bdot_exp = 1.
                0289 
1cb54b8236 Dani*0290 #ifdef STREAMICE_FLOWLINE_BUTTRESS
                0291       streamice_buttr_width = 1000000000.
                0292 #endif
e4cfce0a6c Dani*0293       STREAMICE_apply_firn_correction = .false.
07e785229e dngo*0294 
5ca83cd8f7 Dani*0295       STREAMICEthickInit = 'FILE'
                0296       STREAMICEthickFile = ' '
                0297       STREAMICEcalveMaskFile = ' '
                0298       STREAMICEsigcoordInit = 'UNIFORM'
                0299       STREAMICEsigcoordFile = ' '
                0300       STREAMICEbasalTracConfig = 'UNIFORM'
0a8c8b23d7 Dani*0301       STREAMICEBdotConfig = ''
07e785229e dngo*0302       STREAMICEAdotConfig = ''
0a8c8b23d7 Dani*0303       STREAMICEBdotFile = ''
07e785229e dngo*0304       STREAMICEAdotFile = ''
52d1822301 Dani*0305       STREAMICEBdotTimeDepFile = ' '
5ca83cd8f7 Dani*0306       STREAMICEbasalTracFile = ' '
                0307       STREAMICEtopogFile = ''
                0308       STREAMICEhmaskFile = ''
                0309       STREAMICEHBCyFile = ''
                0310       STREAMICEHBCxFile = ''
7924606b84 Dani*0311       STREAMICEuNormalStressFile = ''
                0312       STREAMICEvNormalStressFile = ''
                0313       STREAMICEuShearStressFile = ''
                0314       STREAMICEvShearStressFile = ''
52d1822301 Dani*0315       STREAMICEuNormalTimeDepFile = ' '
                0316       STREAMICEvNormalTimeDepFile = ' '
                0317       STREAMICEuShearTimeDepFile = ' '
                0318       STREAMICEvShearTimeDepFile = ' '
2a16ced2f5 Dani*0319       STREAMICEuFluxTimeDepFile = ' '
                0320       STREAMICEvFluxTimeDepFile = ' '
0fbff46b46 dngo*0321       STREAMICE_vvel_ext_file = ' '
                0322       STREAMICE_uvel_ext_file = ' '
96b006450c dngo*0323       bdotMaxmeltTimeDepFile = ' '
                0324       bglenTimeDepFile = ' '
                0325       cfricTimeDepFile = ' '
7924606b84 Dani*0326 
5ca83cd8f7 Dani*0327 #ifdef ALLOW_STREAMICE_2DTRACER
                0328       STREAMICETrac2DBCxFile = ''
                0329       STREAMICETrac2DBCyFile = ''
                0330       STREAMICETrac2DInitFile = ''
                0331 #endif
                0332       STREAMICEuFaceBdryFile = ''
                0333       STREAMICEvFaceBdryFile = ''
                0334       STREAMICEuDirichValsFile = ''
                0335       STREAMICEvDirichValsFile = ''
7924606b84 Dani*0336       STREAMICEuMassFluxFile = ''
                0337       STREAMICEvMassFluxFile = ''
5ca83cd8f7 Dani*0338       STREAMICEGlenConstFile = ''
                0339       STREAMICEcostMaskFile = ''
                0340       STREAMICEGlenConstConfig = 'UNIFORM'
                0341 #ifdef ALLOW_PETSC
                0342       PETSC_PRECOND_TYPE = 'PCBJACOBI'
                0343       PETSC_SOLVER_TYPE = 'KSPCG'
8a34959769 dngo*0344       streamice_use_petsc = .false.
5ca83cd8f7 Dani*0345 #endif
                0346       STREAMICE_ADV_SCHEME = ''
96b006450c dngo*0347       STREAMICEBdotDepthFile = ''
                0348       STREAMICEBdotMaxMeltFile = ''
5ca83cd8f7 Dani*0349 
07e785229e dngo*0350 c#ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0351 c      n_fluxes = 0
                0352 c      n_epochs = 0
                0353 c      DO iarr=1,n_fluxes_max
                0354 c       streamice_ctrl_flux_id(iarr) = 0
                0355 c       DO tarr=1,n_epochs_max
                0356 c        streamice_ctrl_flux_scaleVel(iarr,tarr) = 0. _d 0
                0357 c       ENDDO
                0358 c      ENDDO
                0359 c#endif
5ca83cd8f7 Dani*0360 
                0361       STREAMICE_tave_mdsio = .TRUE.
                0362       STREAMICE_dump_mdsio = .TRUE.
02e2d7ff52 Jean*0363       STREAMICE_dump_mnc = .FALSE.
5ca83cd8f7 Dani*0364       STREAMICE_tave_mnc = .FALSE.
07e785229e dngo*0365 c      STREAMICE_GL_regularize = .FALSE.
5ca83cd8f7 Dani*0366       STREAMICE_move_front = .FALSE.
                0367       STREAMICE_calve_to_mask = .FALSE.
07e785229e dngo*0368 c       STREAMICE_geom_file_setup = .FALSE.
                0369 c      STREAMICE_construct_matrix = .TRUE.
5ca83cd8f7 Dani*0370       STREAMICE_lower_cg_tol = .FALSE.
                0371       STREAMICE_diagnostic_only = .FALSE.
1cb54b8236 Dani*0372 #ifdef STREAMICE_FLOWLINE_BUTTRESS
                0373       useStreamiceFlowlineButtr=.FALSE.
                0374 #endif
5ca83cd8f7 Dani*0375       STREAMICE_ppm_driving_stress = .FALSE.
d2cdb9260d Dani*0376       STREAMICE_chkfixedptconvergence = .true.
                0377       STREAMICE_chkresidconvergence = .true.
29d9814714 Dani*0378       STREAMICE_alt_driving_stress = .FALSE.
07e785229e dngo*0379       STREAMICE_allow_reg_coulomb = .FALSE.
5ca83cd8f7 Dani*0380       STREAMICE_h_ctrl_const_surf = .FALSE.
96b006450c dngo*0381       STREAMICE_shelf_dhdt_ctrl = .FALSE.
d2cdb9260d Dani*0382       STREAMICE_allow_cpl = .false.
0fbff46b46 dngo*0383       STREAMICE_use_log_ctrl = .false.
                0384       STREAMICE_vel_ext = .FALSE.
                0385       STREAMICE_vel_ext_cgrid = .FALSE.
07e785229e dngo*0386 c       STREAMICE_hybrid_stress= .FALSE.
5ca83cd8f7 Dani*0387 
96b006450c dngo*0388       STREAMICEvelOptimSnapBasename = ''
                0389       STREAMICEvelOptimTCBasename = ''
                0390       STREAMICEsurfOptimTCBasename = ''
                0391       STREAMICEBglenCostMaskFile = ''
                0392       streamice_wgt_drift = 0.
                0393       streamice_wgt_tikh_beta = 0.
                0394       streamice_wgt_vel_norm = 0.
                0395       streamice_wgt_tikh_bglen = 0.
                0396       streamice_wgt_tikh_gen = 0.
                0397       streamice_wgt_prior_bglen = 0.
                0398       streamice_wgt_prior_gen = 0.
                0399       STREAMICE_do_snapshot_cost = .false.
                0400       STREAMICE_do_timedep_cost = .false.
                0401       STREAMICE_do_verification_cost = .false.
                0402       STREAMICE_do_vaf_cost = .false.
                0403 #ifdef ALLOW_STREAMICE_TC_COST
                0404       do iarr = 1, streamiceMaxCostLevel
                0405        streamice_vel_cost_timesteps(iarr) = -1
                0406        streamice_surf_cost_timesteps(iarr) = -1
                0407       enddo
                0408 #endif
                0409 
5ca83cd8f7 Dani*0410       min_x_noflow_NORTH = 0.
                0411       max_x_noflow_NORTH = 0.
                0412       min_x_noflow_SOUTH = 0.
                0413       max_x_noflow_SOUTH = 0.
                0414       min_y_noflow_WEST = 0.
                0415       max_y_noflow_WEST = 0.
                0416       min_y_noflow_EAST = 0.
                0417       max_y_noflow_EAST = 0.
                0418       min_x_noStress_NORTH = 0.
                0419       max_x_noStress_NORTH = 0.
                0420       min_x_noStress_SOUTH = 0.
                0421       max_x_noStress_SOUTH = 0.
                0422       min_y_noStress_WEST = 0.
                0423       max_y_noStress_WEST = 0.
                0424       min_y_noStress_EAST = 0.
                0425       max_y_noStress_EAST = 0.
                0426       min_x_FluxBdry_NORTH = 0.
                0427       max_x_FluxBdry_NORTH = 0.
                0428       min_x_FluxBdry_SOUTH = 0.
                0429       max_x_FluxBdry_SOUTH = 0.
                0430       min_y_FluxBdry_WEST = 0.
                0431       max_y_FluxBdry_WEST = 0.
                0432       min_y_FluxBdry_EAST = 0.
                0433       max_y_FluxBdry_EAST = 0.
                0434       min_x_Dirich_NORTH = 0.
                0435       max_x_Dirich_NORTH = 0.
                0436       min_x_Dirich_SOUTH = 0.
                0437       max_x_Dirich_SOUTH = 0.
                0438       min_y_Dirich_WEST = 0.
                0439       max_y_Dirich_WEST = 0.
                0440       min_y_Dirich_EAST = 0.
                0441       max_y_Dirich_EAST = 0.
                0442       min_y_CFBC_WEST = 0.
                0443       max_y_CFBC_WEST = 0.
                0444       min_y_CFBC_EAST = 0.
                0445       max_y_CFBC_EAST = 0.
                0446       flux_bdry_val_SOUTH = 0.
                0447       flux_bdry_val_NORTH = 0.
                0448       flux_bdry_val_WEST = 0.
                0449       flux_bdry_val_EAST = 0.
                0450 
                0451       STREAMICE_NS_periodic = .FALSE.
02e2d7ff52 Jean*0452       STREAMICE_EW_periodic = .FALSE.
5ca83cd8f7 Dani*0453 
                0454       WRITE(msgBuf,'(A)') 'STREAMICE_READPARMS: opening data.streamice'
                0455       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0456      &                    SQUEEZE_RIGHT , 1)
                0457       CALL OPEN_COPY_DATA_FILE(
                0458      I                     'data.streamice', 'STREAMICE_READPARMS',
                0459      O                     iUnit,
                0460      I                     myThid )
                0461 
                0462 C     Read parameters from open data file
                0463       READ(UNIT=iUnit,NML=STREAMICE_PARM01)
                0464       WRITE(msgBuf,'(A)')
                0465      &    'STREAMICE_READPARMS: read first param block'
                0466       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0467      &    SQUEEZE_RIGHT , 1)
                0468 
                0469       IF (TRIM(STREAMICEthickInit) .eq. "PARAM") THEN
                0470        READ(UNIT=iUnit,NML=STREAMICE_PARM02)
                0471         WRITE(msgBuf,'(A)')
                0472      &    'STREAMICE_READPARMS: read second param block'
                0473        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0474      &    SQUEEZE_RIGHT , 1)
                0475       ENDIF
                0476 
                0477 #ifdef ALLOW_STREAMICE_2DTRACER
                0478       READ(UNIT=iUnit,NML=STREAMICE_PARMTRACER)
                0479       WRITE(msgBuf,'(A)')
                0480      &    'STREAMICE_READPARMS: read tracer param block'
                0481       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0482      &    SQUEEZE_RIGHT , 1)
                0483 #endif
                0484 
                0485 #ifdef ALLOW_PETSC
                0486       READ(UNIT=iUnit,NML=STREAMICE_PARMPETSC)
                0487       WRITE(msgBuf,'(A)')
                0488      &    'STREAMICE_READPARMS: read petsc param block'
                0489       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0490      &    SQUEEZE_RIGHT , 1)
                0491 #endif
                0492 
729bb43bca Dani*0493 #if (defined (ALLOW_OPENAD) && defined (ALLOW_STREAMICE_OAD_FP))
                0494       READ(UNIT=iUnit,NML=STREAMICE_PARMOAD)
                0495       WRITE(msgBuf,'(A)')
                0496      &    'STREAMICE_READPARMS: read oad parm block'
                0497       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0498      &    SQUEEZE_RIGHT , 1)
                0499 #endif
                0500 
96b006450c dngo*0501 #if (defined (ALLOW_COST_STREAMICE))
                0502 
                0503       READ(UNIT=iUnit,NML=STREAMICE_COST)
                0504       WRITE(msgBuf,'(A)')
                0505      &    'STREAMICE_READPARMS: read cost param block'
                0506       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0507      &    SQUEEZE_RIGHT , 1)
                0508 #endif
                0509 
                0510 #ifndef STREAMICE_GEOM_FILE_SETUP
5ca83cd8f7 Dani*0511       READ(UNIT=iUnit,NML=STREAMICE_PARM03)
                0512       WRITE(msgBuf,'(A)')
96b006450c dngo*0513      &    'STREAMICE_READPARMS: read bound condn block'
5ca83cd8f7 Dani*0514       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0515      &    SQUEEZE_RIGHT , 1)
96b006450c dngo*0516 #endif
7a77863887 Mart*0517 #ifdef SINGLE_DISK_IO
5ca83cd8f7 Dani*0518       CLOSE(iUnit)
7a77863887 Mart*0519 #else
                0520       CLOSE(iUnit,STATUS='DELETE')
                0521 #endif /* SINGLE_DISK_IO */
5ca83cd8f7 Dani*0522 
07e785229e dngo*0523 c#ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0524 c
                0525 c      CALL OPEN_COPY_DATA_FILE(
                0526 c     I                     'data.strmctrlflux', 'STREAMICE_READPARMS',
                0527 c     O                     iUnit,
                0528 c     I                     myThid )
                0529 c
                0530 c      READ(UNIT=iUnit,NML=STREAMICE_PARMFLUXCTRL)
                0531 c      WRITE(msgBuf,'(A)')
                0532 c     &    'STREAMICE_READPARMS: read flux_ctrl param block'
                0533 c      CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0534 c     &    SQUEEZE_RIGHT , 1)
                0535 c#ifdef SINGLE_DISK_IO
                0536 c      CLOSE(iUnit)
                0537 c#else
                0538 c      CLOSE(iUnit,STATUS='DELETE')
                0539 c#endif /* SINGLE_DISK_IO */
                0540 c#endif
5ca83cd8f7 Dani*0541 
                0542       streamice_nstep_velocity = NINT (streamice_vel_update / deltaT)
                0543 
                0544 C-    Set Output type flags :
02e2d7ff52 Jean*0545 
5ca83cd8f7 Dani*0546 #ifdef ALLOW_MNC
                0547       IF (useMNC) THEN
                0548         IF ( .NOT.outputTypesInclusive
                0549      &       .AND. STREAMICE_tave_mnc ) STREAMICE_tave_mdsio = .FALSE.
                0550         IF ( .NOT.outputTypesInclusive
                0551      &       .AND. STREAMICE_dump_mnc ) STREAMICE_dump_mdsio = .FALSE.
                0552       ENDIF
                0553 #endif
                0554 
07e785229e dngo*0555 #ifdef ALLOW_PETSC
                0556       IF (streamice_maxnliter_petsc.eq.-1) then
                0557        streamice_maxnliter_petsc = streamice_max_nl_iter
                0558       ENDIF
                0559 #endif
                0560 
5ca83cd8f7 Dani*0561       _END_MASTER(myThid)
                0562 
                0563 C--   Everyone else must wait for the parameters to be loaded
                0564       _BARRIER
                0565 
                0566 #endif /* ALLOW_STREAMICE */
                0567 
                0568       RETURN
                0569       END