Back to home page

MITgcm

 
 

    


File indexing completed on 2023-10-26 05:10:52 UTC

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