Back to home page

MITgcm

 
 

    


File indexing completed on 2025-11-22 06:08:47 UTC

view on githubraw file Latest commit feb7fa5d on 2025-11-21 15:45:20 UTC
5ca83cd8f7 Dani*0001 C---+----1--+-+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0002 
                0003 #ifdef ALLOW_STREAMICE
96b006450c dngo*0004 #ifdef ALLOW_STREAMICE_TC_COST
                0005 #include "STREAMICE_COST_SIZE.h"
                0006 #endif
5ca83cd8f7 Dani*0007 
bdd8102d3e Dani*0008 C     -------------------------- REAL PARAMS ---------------------------------------------------
5ca83cd8f7 Dani*0009 
07e785229e dngo*0010 C--   COMMON /STREAMICE_PARMS_R/ real valued parameters.
                0011 C     streamice_density           :: average ice density
                0012 C     streamice_density_ocean_avg :: average ocean density
                0013 C                                    determining ice floatation
                0014 C     B_glen_isothermal           :: (sqrt of) uniform ice stiffness
                0015 C                                    coefficient (Pa 1/2 yr 1/6)
0fbff46b46 dngo*0016 C     n_glen                      :: Glen s law exponent
07e785229e dngo*0017 C     eps_glen_min                :: min strain rate in ice viscosity
                0018 C     eps_u_min                   :: min velocity in nonlinear sliding
                0019 C                                    law
                0020 C     C_basal_fric_const          :: (sqrt of) coefficient in sliding
                0021 C                                    law (Pa 1/2 (m/yr) m/2)
                0022 C     n_basal_friction            :: exponent in basal sliding law
                0023 C                                    (tau = C u^n)
                0024 C     streamice_input_flux_unif -- to remove
                0025 C     streamice_vel_update        :: frequency of velocity solve (s) --
                0026 C                                    coupled ice-ocean only
                0027 C     streamice_cg_tol            :: conj gradient tolerance
                0028 C     streamice_nonlin_tol        :: nonlinear solver tolerance
                0029 C                                    (relative residual, unitless)
                0030 C     streamice_nonlin_tol_fp     :: fixed point nonlinear solver
                0031 C                                    tolerance(absolute change, m/a)
                0032 C     streamice_nonlin_tol_adjoint:: fixed-point error of adjoint
0fbff46b46 dngo*0033 C                                    iterative solve (absolute)
                0034 C     streamice_nonlin_tol_adjoint_rl
                0035 C                                 :: fixed-point error of adjoint
07e785229e dngo*0036 C                                    iterative solver (relative
                0037 C                                    reduction)
                0038 C  |  streamice_err_norm: the p-norm to find the error of the residual
                0039 C  |  or difference in the nonlin iteration
                0040 C  |  if less than 1, the sup-norm is used
                0041 C     streamice_CFL_factor        :: time step limiting factor
                0042 C     streamice_adjDump           :: write frequency (s) of adjoint
                0043 C                                    sensitivity fields
                0044 C     streamice_bg_surf_slope_x   :: uniform surface slope, x-dir
                0045 C     streamice_bg_surf_slope_y   :: uniform surface slope, y-dir
                0046 C     streamice_kx_b_init         :: x-wave number for periodically
                0047 C                                    initialised basal friction coeff
                0048 C     streamice_ky_b_init         :: y-wave number for periodically
                0049 C                                    initialised basal friction coeff
                0050 C     streamice_wgt_drift         :: cost function coefficient
                0051 C                                    of drift term
                0052 C     streamice_wgt_surf          :: cost function coefficient
                0053 C                                    of surface misfit term
                0054 C     streamice_wgt_avthick       :: cost function coefficient
                0055 C                                    of thickness misfit term
                0056 C     streamice_wgt_vel           :: cost function coefficient
                0057 C                                    of vel misfit term
96b006450c dngo*0058 C     streamice_wgt_vel_norm      :: cost function coefficient
                0059 C                                    of vel misfit normalised by obs. vel
                0060 C     streamice_wgt_tikh_beta     :: cost function coefficient
                0061 C                                    of sq gradient penalty for sliding param
                0062 C     streamice_wgt_tikh_bglen    :: cost function coefficient
                0063 C                                    of sq gradient penalty for stiffness
                0064 C     streamice_wgt_tikh_gen      :: cost function coefficient
                0065 C                                    of sq gradient penalty for generic ctrl
                0066 C     streamice_wgt_prior_bglen   :: cost function coefficient
                0067 C                                    of sq deviation from prior stiffness
                0068 C     streamice_wgt_prior_gen     :: cost function coefficient
                0069 C                                    of sq deviation from prior, generic ctrl
07e785229e dngo*0070 C     streamice_addl_backstress   -- to remove
                0071 C     streamice_smooth_gl_width   :: grounding line regularisation
                0072 C                                    width (m)
                0073 C     streamice_adot_uniform      :: uniform surface mass balance (m/yr)
                0074 C     streamice_buttr_width       :: effective width for parameterisation
                0075 C                                    of buttressing -- flowline mode only
                0076 C     streamice_firn_correction   :: air thickness in column (m)
                0077 C     streamice_density_firn      :: firn density in column
                0078 C     streamice_forcing_period    :: forcing freq (s)
96b006450c dngo*0079 C      FOLLOWING FOR STREAMICEBdotConfig='PARAM'
                0080 C     streamice_bdot_depth_nomelt :: pw linear depth-dependent melt param:
                0081 C                                    depth above which no melt
                0082 C     streamice_bdot_depth_maxmelt:: pw linear depth-dependent melt param:
                0083 C                                    depth below which const melt
                0084 C     streamice_bdot_maxmelt      :: pw linear depth-dependent melt param:
                0085 C                                    maximum melt rate
                0086 C     streamice_bdot_exp          :: pw linear depth-dependent melt param:
                0087 C                                    melt exponent
07e785229e dngo*0088 
887f427c62 Jean*0089       COMMON /STREAMICE_PARMS_R/
                0090      & streamice_density, streamice_density_ocean_avg,
5ca83cd8f7 Dani*0091      & B_glen_isothermal, n_glen, eps_glen_min, eps_u_min,
                0092      & C_basal_fric_const, n_basal_friction, streamice_input_flux_unif,
                0093      & streamice_vel_update, streamice_cg_tol, streamice_nonlin_tol,
bbd6229661 Dani*0094      & streamice_nonlin_tol_fp, streamice_err_norm,
887f427c62 Jean*0095      & streamice_CFL_factor, streamice_adjDump,
5ca83cd8f7 Dani*0096      & streamice_bg_surf_slope_x, streamice_bg_surf_slope_y,
                0097      & streamice_kx_b_init, streamice_ky_b_init,
                0098      & streamice_wgt_drift, streamice_wgt_surf,
887f427c62 Jean*0099      & streamice_wgt_avthick, streamice_wgt_vel,
96b006450c dngo*0100      & streamice_wgt_vel_norm,
                0101      & streamice_wgt_tikh_beta,
                0102      & streamice_wgt_tikh_bglen,
                0103      & streamice_wgt_tikh_gen,
                0104      & streamice_wgt_prior_bglen,
                0105      & streamice_wgt_prior_gen,
5ca83cd8f7 Dani*0106      & streamice_addl_backstress,
                0107      & streamice_smooth_gl_width,
52d1822301 Dani*0108      & streamice_adot_uniform,
96b006450c dngo*0109      & streamice_bdot_depth_nomelt,
                0110      & streamice_bdot_depth_maxmelt,
                0111      & streamice_bdot_maxmelt,
                0112      & streamice_bdot_exp,
1cb54b8236 Dani*0113 #ifdef STREAMICE_FLOWLINE_BUTTRESS
                0114      & streamice_buttr_width,
                0115 #endif
e4cfce0a6c Dani*0116      & streamice_firn_correction, streamice_density_firn,
52d1822301 Dani*0117      & streamice_forcing_period
                0118 
5ca83cd8f7 Dani*0119       _RL streamice_density, streamice_density_ocean_avg
                0120       _RL B_glen_isothermal, n_glen, eps_glen_min, eps_u_min
                0121       _RL C_basal_fric_const
887f427c62 Jean*0122       _RL n_basal_friction
5ca83cd8f7 Dani*0123       _RL streamice_input_flux_unif
887f427c62 Jean*0124       _RL streamice_vel_update
5ca83cd8f7 Dani*0125       _RL streamice_cg_tol, streamice_nonlin_tol
                0126       _RL streamice_nonlin_tol_fp
07e785229e dngo*0127       _RL streamice_err_norm
bbd6229661 Dani*0128 
5ca83cd8f7 Dani*0129       _RL streamice_CFL_factor
                0130       _RL streamice_adjDump
                0131       _RL streamice_bg_surf_slope_x, streamice_bg_surf_slope_y
                0132       _RL streamice_kx_b_init, streamice_ky_b_init
                0133       _RL streamice_wgt_drift, streamice_wgt_surf
                0134       _RL streamice_wgt_avthick, streamice_wgt_vel
96b006450c dngo*0135       _RL streamice_wgt_vel_norm
                0136       _RL streamice_wgt_tikh_beta, streamice_wgt_tikh_bglen,
                0137      &    streamice_wgt_tikh_gen
                0138       _RL streamice_wgt_prior_bglen, streamice_wgt_prior_gen
5ca83cd8f7 Dani*0139       _RL streamice_addl_backstress
                0140       _RL streamice_smooth_gl_width
780904ab2e Jean*0141       _RL streamice_adot_uniform
96b006450c dngo*0142       _RL streamice_bdot_depth_nomelt
                0143       _RL streamice_bdot_depth_maxmelt
                0144       _RL streamice_bdot_maxmelt
                0145       _RL streamice_bdot_exp
52d1822301 Dani*0146       _RL streamice_forcing_period
1cb54b8236 Dani*0147 #ifdef STREAMICE_FLOWLINE_BUTTRESS
                0148       _RL streamice_buttr_width
                0149 #endif
e4cfce0a6c Dani*0150       _RL streamice_firn_correction
                0151       _RL streamice_density_firn
52d1822301 Dani*0152 
5ca83cd8f7 Dani*0153 C     parms for parameterized initial thickness
                0154 C     SHELF_MAX_DRAFT: max thickness of ice in m
                0155 C     SHELF_MIN_DRAFT: min thickness of ice in m
                0156 C     SHELF_EDGE_POS: extent of ice shelf in (km?)
                0157 C     SHELF_SLOPE_SCALE: dist over which shelf slopes (km?)
                0158 C     SHELF_FLAT_WIDTH: width of flat shelf (km?)
                0159 C     also must be aware of units (m for cartesian, deg for curvilinear, m/deg for CYLINDRICAL POLAR)
                0160 C     FLOW_DIR: 1.0=west, 2.0=east, 3.0=south, 4.0=north
                0161 
                0162       COMMON /STREAMICE_H_INIT_R/
                0163      & shelf_max_draft,
                0164      & shelf_min_draft,
                0165      & shelf_edge_pos,
                0166      & shelf_slope_scale,
                0167      & shelf_flat_width,
                0168      & flow_dir
                0169       _RL shelf_max_draft
                0170       _RL shelf_min_draft
                0171       _RL shelf_edge_pos
                0172       _RL shelf_slope_scale
                0173       _RL shelf_flat_width
                0174       _RL flow_dir
                0175 
bdd8102d3e Dani*0176 C     -------------------------- INT PARAMS ---------------------------------------------------
07e785229e dngo*0177 C---+----1--+-+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
5ca83cd8f7 Dani*0178 
07e785229e dngo*0179 C--   COMMON /STREAMICE_PARMS_I/ int valued parameters.
                0180 C     streamice_max_cg_iter             :: max CG iterations
                0181 C     streamice_max_nl_iter             :: max nonlin iterations in
                0182 C                                          vel solve
                0183 C     streamice_maxcgiter_cpl           :: max CG iters, coupled mode
                0184 C     streamice_maxnliter_cpl           :: max NL iters, coupled mode
                0185 C     streamice_maxnliter_Petsc         :: max NL iters with PETSC
                0186 C                                          unavailable with OpenAD
                0187 C     streamice_smooth_thick_adjoint    :: facility to smooth adjoint
                0188 C                                          thickness sensitivity after
                0189 C                                          advect_thickness
                0190 C                                          0 -> no smoothing
                0191 C     streamice_petsc_pcfactorlevels    :: fill level of incomplete
                0192 C                                          cholesky preconditioner
                0193 C                                          for use with PETSC and
                0194 C                                          BLOCKJACOBI precond ONLY
96b006450c dngo*0195 C     streamice_vel_cost_timesteps      :: array of time steps where velocity misfit
                0196 C                                          is accumulated, expects files
                0197 C       [STREAMICEvelOptimTCBasename][timestep in 10 digit format][u/v/err].bin
                0198 C     streamice_surf_cost_timesteps     :: array of time steps where surface misfit
                0199 C                                          is accumulated, expects files
                0200 C       [STREAMICEsurfOptimTCBasename][timestep in 10 digit format][u/v/err].bin
07e785229e dngo*0201 
0fbff46b46 dngo*0202 #ifdef ALLOW_AUTODIFF_TAMC
                0203       INTEGER streamice_max_nl
                0204       PARAMETER ( streamice_max_nl = 100 )
                0205 #endif
5ca83cd8f7 Dani*0206 
                0207       COMMON /STREAMICE_PARMS_I/
                0208      &     streamice_max_cg_iter, streamice_max_nl_iter,
d2cdb9260d Dani*0209      &     streamice_vel_upd_counter, streamice_nstep_velocity,
07e785229e dngo*0210      &     streamice_maxcgiter_cpl, streamice_maxnliter_cpl,
                0211      &     streamice_maxnliter_Petsc, petscFlag,
                0212      &     streamice_petsc_pcfactorlevels
d82c08285f Dani*0213 #ifdef ALLOW_OPENAD
                0214      &     ,streamice_smooth_thick_adjoint
                0215 #endif
07e785229e dngo*0216 c     &     streamice_n_sub_regularize
d2cdb9260d Dani*0217 
5ca83cd8f7 Dani*0218       INTEGER streamice_max_cg_iter, streamice_max_nl_iter
                0219       INTEGER streamice_vel_upd_counter, streamice_nstep_velocity
d2cdb9260d Dani*0220       INTEGER streamice_maxcgiter_cpl, streamice_maxnliter_cpl
07e785229e dngo*0221       INTEGER streamice_maxnliter_Petsc, petscFlag
                0222       INTEGER streamice_petsc_pcfactorlevels
d82c08285f Dani*0223 #ifdef ALLOW_OPENAD
                0224       INTEGER streamice_smooth_thick_adjoint
                0225 #endif
07e785229e dngo*0226 c      INTEGER streamice_n_sub_regularize
5ca83cd8f7 Dani*0227 
feb7fa5d1e dngo*0228 #ifdef ALLOW_STREAMICE_FP_ADJ
95afe7199b Dani*0229       COMMON /STREAMICE_PARMS_I_OPENAD/
                0230      &     isinloop0, isinloop1, isinloop2
07e785229e dngo*0231 
95afe7199b Dani*0232       INTEGER isinloop0, isinloop1, isinloop2
                0233 
                0234 #endif
                0235 
96b006450c dngo*0236 #ifdef ALLOW_STREAMICE_TC_COST
                0237       COMMON /STREAMICE_PARMS_TC_CTRL/
                0238      &     streamice_vel_cost_timesteps,
                0239      &     streamice_surf_cost_timesteps
                0240 
                0241       INTEGER streamice_vel_cost_timesteps(streamiceMaxCostLevel)
                0242       INTEGER streamice_surf_cost_timesteps(streamiceMaxCostLevel)
                0243 #endif
                0244 
bdd8102d3e Dani*0245 C     -------------------------- CHAR PARAMS ---------------------------------------------------
5ca83cd8f7 Dani*0246 
07e785229e dngo*0247 C---+----1--+-+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0248 C--   COMMON /STREAMICE_PARMS_C/ char valued parameters.
                0249 C     STREAMICEthickInit          :: mode of thickness initialisation
                0250 C                                    FILE - via STREAMICEthickFile
                0251 C                                    PARAM - from STREAMICE_H_INIT_R
                0252 C                                            common block
                0253 C     STREAMICEcalveMaskFile      :: calving mask file
                0254 C     STREAMICEsigcoordInit          TO REMOVE
                0255 C     STREAMICEsigcoordFile          TO REMOVE
                0256 C     STREAMICEdelsigFile            TO REMOVE
                0257 C     STREAMICEbasalTracConfig    :: mode of sliding factor init
                0258 C                                    FILE - via STREAMICEbasalTracFile
                0259 C                                    UNIFORM - C_basal_fric_const
                0260 C                                    1DPERIODIC - varies in x-dir
                0261 C                                     via streamice_kx_b_init and
                0262 C                                     C_basal_fric_const
                0263 C                                    2DPERIODIC - varies in x- and
                0264 C                                     y-dirs via streamice_kx_b_init
                0265 C                                     and streamice_ky_b_init
0fbff46b46 dngo*0266 C     STREAMICEGlenConstConfig    :: mode of Glen s const init
07e785229e dngo*0267 C                                    FILE - via STREAMICEGlenConstFile
                0268 C                                    UNIFORM - B_glen_isothermal
                0269 C     STREAMICEBdotConfig         :: mode of ice-shelf melt rate init
                0270 C                                    FILE - via STREAMICEBdotFile
                0271 C                                    overridden in coupled mode
                0272 C     STREAMICEAdotConfig         :: mode of SMB init
                0273 C                                    FILE - via STREAMICEAdotFile
                0274 C                                    o/w streamice_adot_uniform
96b006450c dngo*0275 C     STREAMICEBglenCostMaskFile  :: prior values for Bglen in
                0276 C                                    transient or snapshot inversion
                0277 C     STREAMICEvelOptimSnapBasename
                0278 C                                 :: file prefix for obs velocities
                0279 C                                    in snapshot inversion, expects files
                0280 C        [STREAMICEvelOptimSnapBasename][u/v/err].bin
                0281 C     STREAMICEvelOptimTCBasename :: file prefix for obs velocities
                0282 C                                    in transient inversion, expects files
                0283 C       [STREAMICEvelOptimTCBasename][timestep in 10 digit format][u/v/err].bin
                0284 C     STREAMICEsurfOptimTCBasename :: file prefix for obs surf elev
                0285 C                                    in transient inversion, expects files
                0286 C       [STREAMICEsurfOptimTCBasename][timestep in 10 digit format][u/v/err].bin
07e785229e dngo*0287 C     STREAMICEtopogFile          :: bed topography (separate from
                0288 C                                    ocean bathy)
                0289 C     STREAMICEhmaskFile          :: ice mask file
                0290 C                                    see EXPLANATION OF MASKS below
                0291 C     STREAMICEHBCxFile           :: upstream thickness at x-boundaries
                0292 C                                    -- to be used only with inhomogen.
                0293 C                                    velocity condition
                0294 C     STREAMICEHBCyFile           :: upstream thickness at y-boundaries
                0295 C     STREAMICEuFaceBdryFile      :: streamice_ufacemask_bdry values
                0296 C                                    see EXPLANATION OF MASKS below
                0297 C     STREAMICEvFaceBdryFile      :: streamice_vfacemask_bdry values
                0298 C                                    see EXPLANATION OF MASKS below
                0299 C     STREAMICEuDirichValsFile    :: inhomogeneous x-vel dirich values
                0300 C                                    to be set only where bound mask=3
                0301 C                                    see EXPLANATION OF MASKS below
                0302 C     STREAMICEvDirichValsFile    :: inhomogeneous y-vel dirich values
                0303 C                                    to be set only where bound mask=3
                0304 C                                    see EXPLANATION OF MASKS below
                0305 C     STREAMICEuMassFluxFile      :: file to set u_flux_bdry_SI
                0306 C                                    see EXPLANATION OF MASKS below
                0307 C     STREAMICEvMassFluxFile      :: file to set v_flux_bdry_SI
                0308 C                                    see EXPLANATION OF MASKS below
96b006450c dngo*0309 C     STREAMICEBdotDepthFile      :: file giving a spatially dependent
                0310 C                                    depth below which const melt
                0311 C                                    when Bdot_config='PARAM'.
                0312 C                                    overrides streamice_bdot_depth_maxmelt
                0313 C     STREAMICEBdotMaxMeltFile    :: file giving a spatially dependent
                0314 C                                    max melt at depth
                0315 C                                    when Bdot_config='PARAM'
                0316 C                                    overrides streamice_bdot_maxmelt
                0317 C     BdotMaxMeltTimeDepFile      :: file giving a time and spatially dependent
                0318 C                                    max melt at depth
                0319 C                                    when Bdot_config='PARAM'
                0320 C                                    overrides streamice_bdot_maxmelt and
                0321 C                                    STREAMICEBdotMaxMeltFile
                0322 C     cfricTimeDepFile            :: file giving a time and spatially dependent
                0323 C                                    sliding param
                0324 C                                    when STREAMICEbasalTracConfig is 'FILE'
                0325 C                                    overrides STREAMICEbasaltracFile
                0326 C     bglenTimeDepFile            :: file giving a time and spatially dependent
                0327 C                                    rheology param (Bbar)
                0328 C                                    when STREAMICEGlenconstConfig='FILE'
                0329 C                                    overrides STREAMICEGlenConstFile
07e785229e dngo*0330 C
                0331 C     following give \gamma_sig and \gamma_tau factors as described
                0332 C     in appendix of
0fbff46b46 dngo*0333 C     Goldberg et al, 2015 -- Committed retreat of Smith, Pope, and
                0334 C                             Kohler Glaciers over the next 30 years
                0335 C                             inferred by transient model calibration
07e785229e dngo*0336 C     applied only where stress boundary condition applies
                0337 C
                0338 C     STREAMICEuNormalStressFile
                0339 C     STREAMICEvNormalStressFile
                0340 C     STREAMICEuShearStressFile
                0341 C     STREAMICEvShearStressFile
                0342 C
                0343 C     time-dependent versions of above fields updated on frequency
                0344 C      streamice_forcing_period
                0345 C
                0346 C     STREAMICEuNormalTimeDepFile
                0347 C     STREAMICEvNormalTimeDepFile
                0348 C     STREAMICEuShearTimeDepFile
                0349 C     STREAMICEvShearTimeDepFile
                0350 C     STREAMICEuFluxTimeDepFile
                0351 C     STREAMICEvFluxTimeDepFile
                0352 C     STREAMICEBdotTimeDepFile
                0353 C     STREAMICEcostMaskFile       :: mask to be used in "custom" cost
                0354 C                                    function
                0355 C     STREAMICE_ADV_SCHEME        :: DST3 -- 3rd order direct ST
                0356 C                                    o/w 2nd order flux limited
                0357 C     PETSC_SOLVER_TYPE           :: CG, BICG, GMRES
                0358 C       see https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/
                0359 C        default: CG
                0360 C     PETSC_PRECOND_TYPE          :: JACOBI -- a jacobi precond
                0361 C                                       (equiv to no petsc)
                0362 C                                    BLOCKJACOBI -- block incomplete
                0363 C                                       cholesky
                0364 C                                    GAMG -- Algebraic multigrid
                0365 C                                    MUMPS -- Direct
                0366 C                                    ILU -- incomplete ILU
                0367 C                                     (will not work in parallel)
                0368 C       see https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/
0fbff46b46 dngo*0369 C     STREAMICE_uvel_ext_file     :: x-velocity file to replace velocity calc
                0370 C     STREAMICE_vvel_ext_file     :: y-velocity file to replace velocity calc
07e785229e dngo*0371 
5ca83cd8f7 Dani*0372       CHARACTER*(MAX_LEN_FNAM) STREAMICEthickFile
                0373       CHARACTER*(MAX_LEN_FNAM) STREAMICEthickInit
                0374       CHARACTER*(MAX_LEN_FNAM) STREAMICEcalveMaskFile
                0375       CHARACTER*(MAX_LEN_FNAM) STREAMICEsigcoordInit
                0376       CHARACTER*(MAX_LEN_FNAM) STREAMICEsigcoordFile
                0377       CHARACTER*(MAX_LEN_FNAM) STREAMICEdelsigFile
                0378       CHARACTER*(MAX_LEN_FNAM) STREAMICEbasalTracConfig
                0379       CHARACTER*(MAX_LEN_FNAM) STREAMICEGlenConstConfig
0a8c8b23d7 Dani*0380       CHARACTER*(MAX_LEN_FNAM) STREAMICEBdotConfig
07e785229e dngo*0381       CHARACTER*(MAX_LEN_FNAM) STREAMICEAdotConfig
5ca83cd8f7 Dani*0382       CHARACTER*(MAX_LEN_FNAM) STREAMICEbasalTracFile
                0383       CHARACTER*(MAX_LEN_FNAM) STREAMICEGlenConstFile
0a8c8b23d7 Dani*0384       CHARACTER*(MAX_LEN_FNAM) STREAMICEBdotFile
07e785229e dngo*0385       CHARACTER*(MAX_LEN_FNAM) STREAMICEAdotFile
52d1822301 Dani*0386       CHARACTER*(MAX_LEN_FNAM) STREAMICEBdotTimeDepFile
5ca83cd8f7 Dani*0387       CHARACTER*(MAX_LEN_FNAM) STREAMICEtopogFile
                0388       CHARACTER*(MAX_LEN_FNAM) STREAMICEcostMaskFile
96b006450c dngo*0389       CHARACTER*(MAX_LEN_FNAM) STREAMICEBglenCostMaskFile
5ca83cd8f7 Dani*0390       CHARACTER*(MAX_LEN_FNAM) STREAMICE_ADV_SCHEME
96b006450c dngo*0391       CHARACTER*(MAX_LEN_FNAM) STREAMICEvelOptimSnapBasename
                0392       CHARACTER*(MAX_LEN_FNAM) STREAMICEvelOptimTCBasename
                0393       CHARACTER*(MAX_LEN_FNAM) STREAMICEsurfOptimTCBasename
                0394       CHARACTER*(MAX_LEN_FNAM) STREAMICEBdotDepthFile
                0395       CHARACTER*(MAX_LEN_FNAM) STREAMICEBdotMaxMeltFile
887f427c62 Jean*0396 
07e785229e dngo*0397 C     THE FOLLOWING FILENAMES ARE FOR SPECIFYING IRREGULAR DOMAIN GEOMETRIES
                0398 C     (i.e. boundaries that do not conform with rectangular walls)
5ca83cd8f7 Dani*0399       CHARACTER*(MAX_LEN_FNAM) STREAMICEhmaskFile
                0400       CHARACTER*(MAX_LEN_FNAM) STREAMICEHBCxFile
                0401       CHARACTER*(MAX_LEN_FNAM) STREAMICEHBCyFile
                0402       CHARACTER*(MAX_LEN_FNAM) STREAMICEuFaceBdryFile
                0403       CHARACTER*(MAX_LEN_FNAM) STREAMICEvFaceBdryFile
                0404       CHARACTER*(MAX_LEN_FNAM) STREAMICEuDirichValsFile
                0405       CHARACTER*(MAX_LEN_FNAM) STREAMICEvDirichValsFile
bdd8102d3e Dani*0406       CHARACTER*(MAX_LEN_FNAM) STREAMICEuMassFluxFile
                0407       CHARACTER*(MAX_LEN_FNAM) STREAMICEvMassFluxFile
                0408 
07e785229e dngo*0409 C     THE FOLLOWING FILENAMES ARE FOR SPECIFYING buttressing along calving fronts
bdd8102d3e Dani*0410       CHARACTER*(MAX_LEN_FNAM) STREAMICEuNormalStressFile
                0411       CHARACTER*(MAX_LEN_FNAM) STREAMICEvNormalStressFile
                0412       CHARACTER*(MAX_LEN_FNAM) STREAMICEuShearStressFile
                0413       CHARACTER*(MAX_LEN_FNAM) STREAMICEvShearStressFile
52d1822301 Dani*0414       CHARACTER*(MAX_LEN_FNAM) STREAMICEuNormalTimeDepFile
                0415       CHARACTER*(MAX_LEN_FNAM) STREAMICEvNormalTimeDepFile
                0416       CHARACTER*(MAX_LEN_FNAM) STREAMICEuShearTimeDepFile
                0417       CHARACTER*(MAX_LEN_FNAM) STREAMICEvShearTimeDepFile
5ca83cd8f7 Dani*0418 
2a16ced2f5 Dani*0419       CHARACTER*(MAX_LEN_FNAM) STREAMICEuFluxTimeDepFile
                0420       CHARACTER*(MAX_LEN_FNAM) STREAMICEvFluxTimeDepFile
                0421 
96b006450c dngo*0422       CHARACTER*(MAX_LEN_FNAM) bdotMaxmeltTimeDepFile
                0423       CHARACTER*(MAX_LEN_FNAM) bglenTimeDepFile
                0424       CHARACTER*(MAX_LEN_FNAM) cfricTimeDepFile
                0425 
0fbff46b46 dngo*0426       CHARACTER*(MAX_LEN_FNAM) STREAMICE_uvel_ext_file
                0427       CHARACTER*(MAX_LEN_FNAM) STREAMICE_vvel_ext_file
                0428 
5ca83cd8f7 Dani*0429 #ifdef ALLOW_PETSC
07e785229e dngo*0430 c     CHARACTER PARAMS FOR PETSC
5ca83cd8f7 Dani*0431       CHARACTER*(MAX_LEN_FNAM) PETSC_SOLVER_TYPE
                0432       CHARACTER*(MAX_LEN_FNAM) PETSC_PRECOND_TYPE
                0433 #endif
887f427c62 Jean*0434 
5ca83cd8f7 Dani*0435 #ifdef ALLOW_STREAMICE_2DTRACER
07e785229e dngo*0436 c     CHARACTER PARAMS FOR TRACER
5ca83cd8f7 Dani*0437       CHARACTER*(MAX_LEN_FNAM) STREAMICETrac2DBCxFile
                0438       CHARACTER*(MAX_LEN_FNAM) STREAMICETrac2DBCyFile
                0439       CHARACTER*(MAX_LEN_FNAM) STREAMICETrac2DinitFile
                0440 #endif
887f427c62 Jean*0441 
                0442       COMMON /STREAMICE_PARM_C/
5ca83cd8f7 Dani*0443      &     STREAMICEthickInit,
                0444      &     STREAMICEthickFile,
                0445      &     STREAMICEcalveMaskFile,
                0446      &     STREAMICEsigcoordInit,
                0447      &     STREAMICEsigcoordFile,
                0448      &     STREAMICEdelsigFile,
                0449      &     STREAMICEbasalTracConfig,
0a8c8b23d7 Dani*0450      &     STREAMICEBdotConfig,
07e785229e dngo*0451      &     STREAMICEAdotConfig,
5ca83cd8f7 Dani*0452      &     STREAMICEbasalTracFile,
96b006450c dngo*0453      &     STREAMICEvelOptimSnapBasename,
                0454      &     STREAMICEvelOptimTCBasename,
                0455      &     STREAMICEsurfOptimTCBasename,
5ca83cd8f7 Dani*0456      &     STREAMICEtopogFile,
                0457      &     STREAMICEhmaskFile,
                0458      &     STREAMICEHBCxFile,
                0459      &     STREAMICEHBCyFile,
                0460      &     STREAMICEuFaceBdryFile,
                0461      &     STREAMICEvFaceBdryFile,
                0462      &     STREAMICEuDirichValsFile,
                0463      &     STREAMICEvDirichValsFile,
bdd8102d3e Dani*0464      &     STREAMICEuMassFluxFile,
                0465      &     STREAMICEvMassFluxFile,
                0466      &     STREAMICEuNormalStressFile,
                0467      &     STREAMICEvNormalStressFile,
                0468      &     STREAMICEuShearStressFile,
                0469      &     STREAMICEvShearStressFile,
52d1822301 Dani*0470      &     STREAMICEuNormalTimeDepFile,
                0471      &     STREAMICEvNormalTimeDepFile,
                0472      &     STREAMICEuShearTimeDepFile,
                0473      &     STREAMICEvShearTimeDepFile,
07e785229e dngo*0474      &     STREAMICEuFluxTimeDepFile,
                0475      &     STREAMICEvFluxTimeDepFile,
5ca83cd8f7 Dani*0476      &     STREAMICEGlenConstFile,
0a8c8b23d7 Dani*0477      &     STREAMICEBdotFile,
07e785229e dngo*0478      &     STREAMICEAdotFile,
52d1822301 Dani*0479      &     STREAMICEBdotTimeDepFile,
5ca83cd8f7 Dani*0480      &     STREAMICEGlenConstConfig,
96b006450c dngo*0481      &     STREAMICEBglenCostMaskFile,
5ca83cd8f7 Dani*0482      &     STREAMICEcostMaskFile,
0fbff46b46 dngo*0483      &     STREAMICE_ADV_SCHEME,
                0484      &     STREAMICE_uvel_ext_file,
96b006450c dngo*0485      &     STREAMICE_vvel_ext_file,
                0486      &     STREAMICEBdotDepthFile,
                0487      &     STREAMICEBdotMaxMeltFile,
                0488      &     bdotMaxmeltTimeDepFile,
                0489      &     bglenTimeDepFile,
                0490      &     cfricTimeDepFile
5ca83cd8f7 Dani*0491 
                0492 #ifdef ALLOW_PETSC
                0493       COMMON /PETSC_PARM_C/
                0494      &     PETSC_SOLVER_TYPE,
                0495      &     PETSC_PRECOND_TYPE
                0496 #endif
                0497 
                0498 #ifdef ALLOW_STREAMICE_2DTRACER
                0499       COMMON /STREAMICE_TRAC2D_C/
                0500      &     STREAMICETrac2DBCxFile,
                0501      &     STREAMICETrac2DBCyFile,
                0502      &     STREAMICETrac2DinitFile
                0503 #endif
887f427c62 Jean*0504 
bdd8102d3e Dani*0505 C     -------------------------- LOGICAL PARAMS ---------------------------------------------------
5ca83cd8f7 Dani*0506 
07e785229e dngo*0507 C---+----1--+-+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0508 C--   COMMON /STREAMICE_PARMS_L/ bool valued parameters.
                0509 C     to remove:
                0510 C     STREAMICEison
                0511 C     STREAMICE_dump_mdsio
                0512 C     STREAMICE_dump_mnc
                0513 C     STREAMICE_tave_mnc
                0514 C     STREAMICE_dump_mnc
                0515 C     STREAMICE_construct_matrix
                0516 C     STREAMICE_h_ctrl_const_surf
                0517 
                0518 C     STREAMICE_move_front            :: advance ice-shelf front
                0519 C     STREAMICE_calve_to_mask         :: do not advance front past
                0520 C                                        streamice_calve_mask
                0521 C     STREAMICE_lower_cg_tol          :: lower CG tolerance
                0522 C                                        when NL error is lowered
                0523 C                                        by factor of .5e2
                0524 C     STREAMICE_diagnostic_only       :: do not update thickness
                0525 C                                     :: or any other timedep flds
                0526 C     STREAMICE_ppm_driving_stress    :: use partial parabolic method
                0527 C                                        to reconstruct surf slope
                0528 C     STREAMICE_alt_driving_stress    :: use finite difference based
                0529 C                                        driving stress
                0530 C                                        (overrides above option)
                0531 C     STREAMICE_chkfixedptconvergence :: terminate velocity iteration
                0532 C                                         based on fp_error
                0533 C     STREAMICE_chkresidconvergence   :: terminate velocity iteration
                0534 C                                        based on residual error
                0535 C     STREAMICE_allow_cpl             :: enable streamice-ocean
                0536 C                                        coupling
                0537 C     STREAMICE_use_petsc
                0538 C     STREAMICE_apply_firn_correction
                0539 C     STREAMICE_allow_reg_coulomb     :: rather than using power-law
                0540 C                                        sliding, implements
                0541 C                                        "regularised coulomb"
                0542 C                                        sliding law
                0543 C        Asay-Davis et al (2016), Geosci. Model Dev.,
0fbff46b46 dngo*0544 C     "Experimental design for three interrelated marine ice sheet..."
                0545 C     (eqn 11)
                0546 C     STREAMICE_use_log_ctrl          :: fields C_basal_friction
                0547 C                                        and Bglen (and initialisation
                0548 C                                        values) given as the
                0549 C                                        *logarithm* of physical values
                0550 C                                        (if false, sqrt is used)
                0551 C     STREAMICE_vel_ext           :: impose velocity with external files
                0552 C     STREAMICE_vel_ext_cgrid     :: impose velocity with external files on C grid
                0553 C                                 ::  (over-rides STREAMICE_vel_ext)
96b006450c dngo*0554 C     STREAMICE_do_snapshot_cost  :: accumulate snapshot cost function at
                0555 C                                    final time step
                0556 C     STREAMICE_do_timedep_cost   :: accumulate cost at specified time steps
                0557 C     STREAMICE_do_verification_cost
                0558 C                                 :: do cost for verification test
                0559 C     STREAMICE_do_vaf_cost       :: do cost for volume above floatation
                0560 C     STREAMICE_shelf_dhdt_ctrl   :: option to apply surface elevation constraint to
                0561 C                                    floating ice in cost function
07e785229e dngo*0562 
5ca83cd8f7 Dani*0563       LOGICAL STREAMICEison
                0564       LOGICAL STREAMICE_dump_mdsio
                0565       LOGICAL STREAMICE_tave_mdsio
                0566       LOGICAL STREAMICE_dump_mnc
                0567       LOGICAL STREAMICE_tave_mnc
f3f31151db Dani*0568       LOGICAL STREAMICE_move_front
5ca83cd8f7 Dani*0569       LOGICAL STREAMICE_calve_to_mask
                0570       LOGICAL STREAMICE_construct_matrix
                0571       LOGICAL STREAMICE_lower_cg_tol
                0572       LOGICAL STREAMICE_diagnostic_only
                0573       LOGICAL STREAMICE_ppm_driving_stress
                0574       LOGICAL STREAMICE_h_ctrl_const_surf
d2cdb9260d Dani*0575       LOGICAL STREAMICE_chkfixedptconvergence
                0576       LOGICAL STREAMICE_chkresidconvergence
                0577       LOGICAL STREAMICE_allow_cpl
18a089944d Dani*0578       LOGICAL STREAMICE_use_petsc
e4cfce0a6c Dani*0579       LOGICAL STREAMICE_apply_firn_correction
29d9814714 Dani*0580       LOGICAL STREAMICE_alt_driving_stress
07e785229e dngo*0581       LOGICAL STREAMICE_allow_reg_coulomb
0fbff46b46 dngo*0582       LOGICAL STREAMICE_use_log_ctrl
                0583       LOGICAL STREAMICE_vel_ext
                0584       LOGICAL STREAMICE_vel_ext_cgrid
96b006450c dngo*0585       LOGICAL STREAMICE_do_snapshot_cost
                0586       LOGICAL STREAMICE_do_timedep_cost
                0587       LOGICAL STREAMICE_do_verification_cost
                0588       LOGICAL STREAMICE_do_vaf_cost
                0589       LOGICAL STREAMICE_shelf_dhdt_ctrl
1cb54b8236 Dani*0590 #ifdef STREAMICE_FLOWLINE_BUTTRESS
                0591       LOGICAL useStreamiceFlowlineButtr
                0592 #endif
887f427c62 Jean*0593 
                0594 C     The following parameters specify periodic boundary conditions.
5ca83cd8f7 Dani*0595 C     For now this will completely override all other boundary conditions
                0596 C     and apply to the entire boundary
                0597 
                0598       LOGICAL STREAMICE_NS_periodic
                0599       LOGICAL STREAMICE_EW_periodic
887f427c62 Jean*0600 
5ca83cd8f7 Dani*0601 C      LOGICAL STREAMICE_hybrid_stress
887f427c62 Jean*0602 
5ca83cd8f7 Dani*0603       COMMON /STREAMICE_PARM_L/
                0604      & STREAMICEison,
                0605      & STREAMICE_dump_mdsio, STREAMICE_tave_mdsio,
                0606      & STREAMICE_dump_mnc, STREAMICE_tave_mnc,
f3f31151db Dani*0607      & STREAMICE_move_front,
5ca83cd8f7 Dani*0608      & STREAMICE_calve_to_mask,
                0609      & STREAMICE_construct_matrix,
                0610      & STREAMICE_lower_cg_tol,
                0611      & STREAMICE_NS_periodic, STREAMICE_EW_periodic,
                0612      & STREAMICE_diagnostic_only,
                0613      & STREAMICE_ppm_driving_stress,
d2cdb9260d Dani*0614      & STREAMICE_h_ctrl_const_surf,
                0615      & STREAMICE_chkfixedptconvergence,
                0616      & STREAMICE_chkresidconvergence,
e4cfce0a6c Dani*0617      & STREAMICE_allow_cpl, streamice_use_petsc,
a5e2b23c00 Dani*0618      & STREAMICE_alt_driving_stress,
07e785229e dngo*0619      & STREAMICE_allow_reg_coulomb,
0fbff46b46 dngo*0620      & STREAMICE_vel_ext,
                0621      & STREAMICE_vel_ext_cgrid,
                0622      & STREAMICE_use_log_ctrl,
96b006450c dngo*0623      & STREAMICE_do_snapshot_cost,
                0624      & STREAMICE_do_verification_cost,
                0625      & STREAMICE_do_vaf_cost,
                0626      & STREAMICE_do_timedep_cost,
                0627      & STREAMICE_shelf_dhdt_ctrl,
1cb54b8236 Dani*0628 #ifdef STREAMICE_FLOWLINE_BUTTRESS
                0629      & useStreamiceFlowlineButtr,
                0630 #endif
e4cfce0a6c Dani*0631      & STREAMICE_apply_firn_correction
5ca83cd8f7 Dani*0632 
bdd8102d3e Dani*0633 C     -------------------------- AND NOW ARRAYS ---------------------------------------------------
5ca83cd8f7 Dani*0634 
                0635 C     EXPLANATION OF MASKS
                0636 
780904ab2e Jean*0637 C     STREAMICE_hmask           VALUES  1=ice-covered cell
5ca83cd8f7 Dani*0638 C                                       2=partially ice-covered cell (no dynamics)
                0639 C                                       0=ice-free cell (for now, it means the cell
                0640 C                                                           is treated as an open-ocean cell
                0641 C                                                           that ice shelf can flow into)
                0642 C                                       -1=outside computational domain; will not change
                0643 C
887f427c62 Jean*0644 C     STREAMICE_umask           VALUES  1=degree of freedom;
5ca83cd8f7 Dani*0645 C                                       0=homogeneous dirich condition
                0646 C                                       3=inhomogeneous dirich condition
                0647 
                0648 C     STREAMICE_vmask           similar to umask
                0649 
887f427c62 Jean*0650 C     STREAMICE_ufacemask       VALUES  -1=unset,
                0651 C                                       0=no-flow boundary,
5ca83cd8f7 Dani*0652 C                                       1=no-stress bdry
887f427c62 Jean*0653 C                                       2=stress bdry condition,
5ca83cd8f7 Dani*0654 C                                       3=inhomogeneous dirichlet boundary,
                0655 C                                       4=flux boundary: at these faces a flux will be specified by u_flux_bdry_SI
887f427c62 Jean*0656 C
5ca83cd8f7 Dani*0657 C     STREAMICE_vfacemask       similar to ufacemask
                0658 C     STREAMICE_ufacemask_bdry  field initialized at the beginning of simulation
                0659 C                               specified all ufacemask values except for calving front
                0660 C                               CONSTANT FOR A SIMULATION (ie not changes after streamice_init_fixed)
887f427c62 Jean*0661 C     STREAMICE_vfacemask_bdry  CONSTANT FOR A SIMULATION
5ca83cd8f7 Dani*0662 C     STREAMICE_calve_mask      specified allowed extent of ice shelf
c8fca1659b Jean*0663 C                                (should be integer, but do not know howvi sre to read ints from file)
5ca83cd8f7 Dani*0664 C                               not necessarily used, but CONSTANT FOR A SIMULATION
                0665 C     STREAMICE_float_cond      will only be used if partial floatation is implemented
                0666 
                0667 C     Short arrays (e.g. masks)
                0668       COMMON /STREAMICE_FIELDS_RS/
                0669      &     STREAMICE_hmask,
                0670      &     STREAMICE_umask,
                0671      &     STREAMICE_vmask,
                0672      &     STREAMICE_ufacemask,
                0673      &     STREAMICE_vfacemask,
                0674      &     STREAMICE_ufacemask_bdry,
                0675      &     STREAMICE_vfacemask_bdry,
                0676      &     STREAMICE_float_cond,
                0677      &     STREAMICE_calve_mask,
                0678      &     STREAMICE_ctrl_mask,
                0679      &     STREAMICE_cost_mask
                0680       _RS STREAMICE_hmask (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0681       _RS STREAMICE_umask (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0682       _RS STREAMICE_vmask (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0683       _RS STREAMICE_ufacemask
5ca83cd8f7 Dani*0684      &  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0685       _RS STREAMICE_vfacemask
5ca83cd8f7 Dani*0686      &  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0687       _RS STREAMICE_ufacemask_bdry
5ca83cd8f7 Dani*0688      &  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0689       _RS STREAMICE_vfacemask_bdry
5ca83cd8f7 Dani*0690      &  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0691       _RS STREAMICE_float_cond
                0692      &  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0693       _RS STREAMICE_calve_mask
5ca83cd8f7 Dani*0694      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0695       _RS STREAMICE_ctrl_mask
5ca83cd8f7 Dani*0696      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
887f427c62 Jean*0697       _RS STREAMICE_cost_mask
5ca83cd8f7 Dani*0698      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0699 
5ca83cd8f7 Dani*0700 C    NOTES :
                0701 C     STREAMICE_ufacemask_bdry, STREAMICE_vfacemask_bdry ARE CONSTANT (FIXED)
                0702 C     STREAMICE_hmask IS PART OF **STATE**
                0703 C     All other masks are updated within a timestep BASED ON STREAMICE_hmask
                0704 
887f427c62 Jean*0705 C    Number of quadrature points are hardcoded.. could turn into a CPP macro
5ca83cd8f7 Dani*0706 
                0707 C    REAL ARRAYS
                0708 
887f427c62 Jean*0709       COMMON /STREAMICE_FIELDS_RL/
5ca83cd8f7 Dani*0710      &     H_streamice,
                0711      &     U_streamice,
                0712      &     V_streamice,
                0713      &     visc_streamice,
                0714      &     tau_beta_eff_streamice,
                0715      &     float_frac_streamice,
                0716      &     base_el_streamice,
                0717      &     surf_el_streamice,
                0718      &     area_shelf_streamice,
                0719      &     mass_ice_streamice,
                0720      &     u_flux_bdry_SI,
                0721      &     v_flux_bdry_SI,
                0722      &     h_ubdry_values_SI,
                0723      &     h_vbdry_values_SI,
                0724      &     u_bdry_values_SI,
                0725      &     v_bdry_values_SI,
                0726      &     STREAMICE_dummy_array,
96b006450c dngo*0727      &     C_basal_friction, C_basal_fric_init,
5957a7447e Mart*0728      &     B_glen, B_glen_init, B_glen0
                0729 
                0730 C     Spit common block, because it lead to memory problem on some
                0731 C     platform/compiler combinations (e.g. PowerBook with MacOS and
                0732 C     gfortran)
                0733       COMMON /STREAMICE_FIELDS_RL_2/
                0734      &     BDOT_streamice, ADOT_streamice,BDOT_pert,ADOT_pert,
96b006450c dngo*0735      &     streamice_bdot_depth_maxmelt_v, streamice_bdot_maxmelt_v,
5ca83cd8f7 Dani*0736      &     streamice_sigma_coord, streamice_delsigma,
95afe7199b Dani*0737      &     H_streamice_prev,
0fbff46b46 dngo*0738      &     u_new_si, v_new_si, streamice_u_tavg, streamice_v_tavg,
                0739      &     u_streamice_ext, v_streamice_ext
5ca83cd8f7 Dani*0740 
2a16ced2f5 Dani*0741 #ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0742       COMMON /STREAMICE_FLUX_CONTROL/
                0743      &      u_flux_bdry_pert,
                0744      &      v_flux_bdry_pert
                0745 #endif
                0746 
bdd8102d3e Dani*0747 #ifdef STREAMICE_STRESS_BOUNDARY_CONTROL
                0748       COMMON /STREAMICE_STRESS_BOUNDARY/
780904ab2e Jean*0749      &      streamice_u_normal_pert,
bdd8102d3e Dani*0750      &      streamice_v_normal_pert,
                0751      &      streamice_u_shear_pert,
                0752      &      streamice_v_shear_pert,
780904ab2e Jean*0753      &      streamice_u_normal_stress,
bdd8102d3e Dani*0754      &      streamice_v_normal_stress,
                0755      &      streamice_u_shear_stress,
                0756      &      streamice_v_shear_stress
                0757 #endif
                0758 
5ca83cd8f7 Dani*0759 #ifdef STREAMICE_HYBRID_STRESS
887f427c62 Jean*0760       COMMON /STREAMICE_HYBRID/
5ca83cd8f7 Dani*0761      &     streamice_taubx, streamice_tauby,
                0762      &     streamice_u_surf, streamice_v_surf,
bdd8102d3e Dani*0763      &     streamice_u_bed, streamice_v_bed,
5ca83cd8f7 Dani*0764      &     visc_streamice_full, streamice_omega, streamice_basal_geom,
887f427c62 Jean*0765      &     streamice_vert_shear_uz, streamice_vert_shear_vz
5ca83cd8f7 Dani*0766 #endif
                0767 
52d1822301 Dani*0768 #ifdef ALLOW_STREAMICE_TIMEDEP_FORCING
                0769       COMMON /STREAMICE_TIMEDEP_FORCE/
                0770      &      bdot_streamice0,
96b006450c dngo*0771      &      bdot_streamice1,
                0772      &      streamice_bdot_maxmelt0, streamice_bdot_maxmelt1,
                0773      &      streamice_bglen0, streamice_bglen1,
                0774      &      streamice_beta0, streamice_beta1
52d1822301 Dani*0775 #ifdef STREAMICE_STRESS_BOUNDARY_CONTROL
                0776      &      ,streamice_u_normal_stress0,
780904ab2e Jean*0777      &      streamice_u_normal_stress1,
52d1822301 Dani*0778      &      streamice_v_normal_stress0,
                0779      &      streamice_v_normal_stress1,
                0780      &      streamice_u_shear_stress0,
                0781      &      streamice_u_shear_stress1,
                0782      &      streamice_v_shear_stress0,
                0783      &      streamice_v_shear_stress1
780904ab2e Jean*0784 #endif
2a16ced2f5 Dani*0785 #ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0786      &      ,u_flux_bdry_SI_0,
                0787      &      u_flux_bdry_SI_1,
                0788      &      v_flux_bdry_SI_0,
                0789      &      v_flux_bdry_SI_1
                0790 #endif
52d1822301 Dani*0791 #endif
                0792 
5ca83cd8f7 Dani*0793 #ifdef ALLOW_STREAMICE_2DTRACER
                0794       COMMON /STREAMICE_TRAC2D_FIELDS_RL/
                0795      &     trac2d_ubdry_values_SI,
                0796      &     trac2d_vbdry_values_SI,
                0797      &     trac2d
                0798 #ifdef STREAMICE_TRACER_AB
                0799       COMMON /STREAMICE_TRAC2D_AB_RL/
                0800      &     GAD_trac_2d
                0801 #endif
                0802 #endif
                0803 
                0804 #ifdef USE_ALT_RLOW
887f427c62 Jean*0805       COMMON /STREAMICE_RLOW/
5ca83cd8f7 Dani*0806      &     R_low_si
                0807 #endif
                0808 
                0809       _RL H_streamice           (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0810       _RL U_streamice           (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0811       _RL V_streamice           (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0812       _RL visc_streamice        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0813       _RL tau_beta_eff_streamice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0814       _RL float_frac_streamice  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0815       _RL surf_el_streamice     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0816       _RL base_el_streamice     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0817       _RL area_shelf_streamice  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0818       _RL mass_ice_streamice    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0819       _RL u_flux_bdry_SI    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0820       _RL v_flux_bdry_SI    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0821       _RL h_ubdry_values_SI    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0822       _RL h_vbdry_values_SI    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0823       _RL u_bdry_values_SI    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0824       _RL v_bdry_values_SI    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0fbff46b46 dngo*0825       _RL c_basal_friction    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96b006450c dngo*0826       _RL c_basal_fric_init   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0fbff46b46 dngo*0827       _RL u_streamice_ext     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0828       _RL v_streamice_ext     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
7493c1d2cc Patr*0829 C      _RL A_glen    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
bdd8102d3e Dani*0830 #ifdef STREAMICE_3D_GLEN_CONST
                0831       _RL B_glen    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0832 #else
5ca83cd8f7 Dani*0833       _RL B_glen    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
bdd8102d3e Dani*0834 #endif
96b006450c dngo*0835       _RL B_glen_init    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0836       _RL B_glen0        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
5ca83cd8f7 Dani*0837       _RL streamice_sigma_coord (Nr)
887f427c62 Jean*0838       _RL streamice_delsigma (Nr)
5ca83cd8f7 Dani*0839 
                0840 #ifdef USE_ALT_RLOW
                0841       _RL R_low_si    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0842 #endif
                0843 
887f427c62 Jean*0844 C     The following arrays are used for the hybrid stress balance
                0845 #ifdef STREAMICE_HYBRID_STRESS
5ca83cd8f7 Dani*0846       _RL streamice_taubx (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0847       _RL streamice_u_surf (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0848       _RL streamice_v_surf (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
bdd8102d3e Dani*0849       _RL streamice_u_bed (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0850       _RL streamice_v_bed (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0851       _RL streamice_tauby (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
5ca83cd8f7 Dani*0852       _RL streamice_omega (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0853       _RL streamice_basal_geom
5ca83cd8f7 Dani*0854      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0855       _RL visc_streamice_full
5ca83cd8f7 Dani*0856      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0857       _RL streamice_vert_shear_uz (Nr)
                0858       _RL streamice_vert_shear_vz (Nr)
887f427c62 Jean*0859 #endif
                0860 
5ca83cd8f7 Dani*0861 #ifdef ALLOW_STREAMICE_2DTRACER
887f427c62 Jean*0862       _RL trac2d_ubdry_values_SI
5ca83cd8f7 Dani*0863      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0864       _RL trac2d_vbdry_values_SI
5ca83cd8f7 Dani*0865      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0866       _RL trac2d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0867 #ifdef STREAMICE_TRACER_AB
                0868       _RL GAD_trac_2d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0869 #endif
                0870 #endif
887f427c62 Jean*0871 
bdd8102d3e Dani*0872 #ifdef STREAMICE_STRESS_BOUNDARY_CONTROL
                0873       _RL streamice_u_normal_stress
                0874      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0875       _RL streamice_v_normal_stress
                0876      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0877       _RL streamice_u_shear_stress
                0878      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0879       _RL streamice_v_shear_stress
                0880      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0881       _RL streamice_u_normal_pert
                0882      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0883       _RL streamice_v_normal_pert
                0884      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0885       _RL streamice_u_shear_pert
                0886      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0887       _RL streamice_v_shear_pert
                0888      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0889 #endif
                0890 
2a16ced2f5 Dani*0891 #ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0892       _RL u_flux_bdry_pert
                0893      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0894       _RL v_flux_bdry_pert
                0895      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0896 #endif
                0897 
5ca83cd8f7 Dani*0898       _RL ADOT_streamice (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
07e785229e dngo*0899 C  IMPORTANT: MELT RATE IN METERS PER YEAR
                0900 C  POSITIVE WHERE MELTING
5ca83cd8f7 Dani*0901       _RL BDOT_streamice (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96b006450c dngo*0902       _RL streamice_bdot_depth_maxmelt_v
                0903      &                   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0904       _RL streamice_bdot_maxmelt_v
                0905      &                   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
bdd8102d3e Dani*0906       _RL BDOT_pert (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0fbff46b46 dngo*0907       _RL ADOT_pert (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
5ca83cd8f7 Dani*0908       _RL H_streamice_prev (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
95afe7199b Dani*0909       _RL v_new_si (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0910       _RL u_new_si (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
5ca83cd8f7 Dani*0911       _RL STREAMICE_dummy_array (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0fbff46b46 dngo*0912       _RL streamice_u_tavg (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0913       _RL streamice_v_tavg (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
887f427c62 Jean*0914 
52d1822301 Dani*0915 #ifdef ALLOW_STREAMICE_TIMEDEP_FORCING
                0916 #ifdef STREAMICE_STRESS_BOUNDARY_CONTROL
780904ab2e Jean*0917       _RL streamice_u_normal_stress0
52d1822301 Dani*0918      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
780904ab2e Jean*0919       _RL streamice_u_normal_stress1
52d1822301 Dani*0920      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0921       _RL streamice_v_normal_stress0
                0922      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0923       _RL streamice_v_normal_stress1
                0924      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0925       _RL streamice_u_shear_stress0
                0926      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0927       _RL streamice_u_shear_stress1
                0928      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0929       _RL streamice_v_shear_stress0
                0930      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0931       _RL streamice_v_shear_stress1
                0932      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
780904ab2e Jean*0933 #endif
2a16ced2f5 Dani*0934 #ifdef ALLOW_STREAMICE_FLUX_CONTROL
                0935       _RL u_flux_bdry_SI_0
                0936      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0937       _RL v_flux_bdry_SI_0
                0938      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0939       _RL u_flux_bdry_SI_1
                0940      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0941       _RL v_flux_bdry_SI_1
                0942      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0943 #endif
52d1822301 Dani*0944       _RL bdot_streamice0
                0945      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0946       _RL bdot_streamice1
                0947      &   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96b006450c dngo*0948       _RL streamice_bdot_maxmelt0
                0949      &    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0950       _RL streamice_bdot_maxmelt1
                0951      &    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0952       _RL streamice_bglen0    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0953       _RL streamice_bglen1    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0954       _RL streamice_beta0     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0955       _RL streamice_beta1     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
52d1822301 Dani*0956 #endif
                0957 
5ca83cd8f7 Dani*0958       COMMON /STREAMICE_COST_RL/
bdd8102d3e Dani*0959      &       cost_func1_streamice,
                0960      &       cost_vel_streamice,
96b006450c dngo*0961      &       cost_surf_streamice,
                0962      &       cost_smooth_fric_streamice,
                0963      &       cost_smooth_glen_streamice,
feb7fa5d1e dngo*0964      &       cost_smooth_bdotmelt_streamice,
96b006450c dngo*0965      &       cost_prior_streamice
5ca83cd8f7 Dani*0966       _RL cost_func1_streamice(nSx,nSy)
bdd8102d3e Dani*0967       _RL cost_vel_streamice(nSx,nSy)
                0968       _RL cost_surf_streamice(nSx,nSy)
96b006450c dngo*0969       _RL cost_smooth_fric_streamice(nSx,nSy)
                0970       _RL cost_smooth_glen_streamice(nSx,nSy)
feb7fa5d1e dngo*0971       _RL cost_smooth_bdotmelt_streamice(nSx,nSy)
96b006450c dngo*0972       _RL cost_prior_streamice(nSx,nSy)
887f427c62 Jean*0973 
5ca83cd8f7 Dani*0974 C    NOTES :
                0975 C      REAL ARRAYS THAT COMPRISE "STATE":
                0976 C       H_streamice,
                0977 C       U_streamice,
                0978 C       V_streamice,
                0979 C       visc_streamice,
                0980 C       tau_beta_eff_streamice,
                0981 C       area_shelf_streamice
c8fca1659b Jean*0982 C       (and do not forget STREAMICE_hmask)
887f427c62 Jean*0983 C
5ca83cd8f7 Dani*0984 C       visc & tau are now calculated based on U,V in streamice_vel_solve
887f427c62 Jean*0985 C        but with Hybdrid stress formulation they will become part of
5ca83cd8f7 Dani*0986 C        velocity initial guess, so they are kept
                0987 
                0988 #ifdef ALLOW_PETSC
                0989       COMMON /STREAMICE_PETSC_DOFS_COMMON/
                0990      &      streamice_petsc_dofs_u,
                0991      &      streamice_petsc_dofs_v,
                0992      &      n_dofs_process
                0993       _RS streamice_petsc_dofs_u
                0994      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0995       _RS streamice_petsc_dofs_v
                0996      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0997       INTEGER n_dofs_process (0:nPx*nPy-1)
                0998 #endif
887f427c62 Jean*0999 
feb7fa5d1e dngo*1000 #if (defined(ALLOW_STREAMICE_FP_ADJ) && defined(ALLOW_OPENAD))
                1001       COMMON /STREAMICE_PHISTAGE_ADARRS/
95afe7199b Dani*1002      &      U_streamice_dvals,
07e785229e dngo*1003      &      V_streamice_dvals
95afe7199b Dani*1004       _RL U_streamice_dvals
                1005      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                1006       _RL V_streamice_dvals
                1007      & (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
feb7fa5d1e dngo*1008 #endif
07e785229e dngo*1009 
feb7fa5d1e dngo*1010 #ifdef ALLOW_STREAMICE_FP_ADJ
95afe7199b Dani*1011 #ifdef STREAMICE_HYBRID_STRESS
feb7fa5d1e dngo*1012 
                1013       COMMON /STREAMICE_PHISTAGE_ADARRS_HYBRID/
95afe7199b Dani*1014      & taubx_new_si, tauby_new_si,
                1015      & visc_full_new_si
feb7fa5d1e dngo*1016 #ifdef ALLOW_OPENAD
                1017      & ,taubx_dvals, tauby_dvals,
                1018      & visc_full_dvals,
                1019 #endif
95afe7199b Dani*1020       _RL taubx_new_si (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                1021       _RL tauby_new_si (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                1022       _RL visc_full_new_si (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
feb7fa5d1e dngo*1023 #ifdef ALLOW_OPENAD
                1024       _RL tauby_dvals (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                1025       _RL taubx_dvals (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
95afe7199b Dani*1026       _RL visc_full_dvals (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                1027 #endif
feb7fa5d1e dngo*1028 
                1029 #endif
07e785229e dngo*1030 #endif
95afe7199b Dani*1031 
5ca83cd8f7 Dani*1032 #endif /* ALLOW_STREAMICE */
                1033 
                1034 CEH3 ;;; Local Variables: ***
                1035 CEH3 ;;; mode:fortran ***
                1036 CEH3 ;;; End: ***