Back to home page

MITgcm

 
 

    


File indexing completed on 2023-12-05 06:11:32 UTC

view on githubraw file Latest commit 143d9ce8 on 2023-12-04 15:35:20 UTC
45315406aa Mart*0001 #ifndef SEAICE_OPTIONS_H
                0002 #define SEAICE_OPTIONS_H
                0003 #include "PACKAGES_CONFIG.h"
                0004 #include "CPP_OPTIONS.h"
                0005 
12a4c43673 Jean*0006 C     *==========================================================*
a589927d63 Jean*0007 C     | SEAICE_OPTIONS.h
                0008 C     | o CPP options file for sea ice package.
12a4c43673 Jean*0009 C     *==========================================================*
a589927d63 Jean*0010 C     | Use this file for selecting options within the sea ice
                0011 C     | package.
12a4c43673 Jean*0012 C     *==========================================================*
5041945476 Patr*0013 
a589927d63 Jean*0014 #ifdef ALLOW_SEAICE
45315406aa Mart*0015 C---  Package-specific Options & Macros go here
a589927d63 Jean*0016 
5041945476 Patr*0017 C--   Write "text-plots" of certain fields in STDOUT for debugging.
                0018 #undef SEAICE_DEBUG
                0019 
                0020 C--   By default, the sea-ice package uses its own integrated bulk
                0021 C     formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over
                0022 C     open-ocean.  When this flag is set, these variables are computed
                0023 C     in a separate external package, for example, pkg/exf, and then
                0024 C     modified for sea-ice effects by pkg/seaice.
                0025 #define SEAICE_EXTERNAL_FLUXES
                0026 
94e16c6a45 Dimi*0027 C--   This CPP flag has been retired.  The number of ice categories
                0028 C     used to solve for seaice flux is now specified by run-time
                0029 C     parameter SEAICE_multDim.
                0030 C     Note: be aware of pickup_seaice.* compatibility issues when
                0031 C     restarting a simulation with a different number of categories.
a5f07bdb14 Jean*0032 c#define SEAICE_MULTICATEGORY
12a4c43673 Jean*0033 
f753d18056 Jean*0034 C--   run with sea Ice Thickness Distribution (ITD);
                0035 C     set number of categories (nITD) in SEAICE_SIZE.h
                0036 #undef SEAICE_ITD
                0037 
a43c1638b9 Gael*0038 C--   Since the missing sublimation term is now included
                0039 C     this flag is needed for backward compatibility
a5f07bdb14 Jean*0040 #undef SEAICE_DISABLE_SUBLIM
a43c1638b9 Gael*0041 
948a90f6b0 Jean*0042 C--   Suspected missing term in coupled ocn-ice heat budget (to be confirmed)
a5f07bdb14 Jean*0043 #undef SEAICE_DISABLE_HEATCONSFIX
782ce2393a Gael*0044 
948a90f6b0 Jean*0045 C--   Default is constant seaice salinity (SEAICE_salt0); Define the following
                0046 C     flag to consider (space & time) variable salinity: advected and forming
                0047 C     seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity.
                0048 C- Note: SItracer also offers an alternative way to handle variable salinity.
7324891894 Ian *0049 #undef SEAICE_VARIABLE_SALINITY
12a4c43673 Jean*0050 
45315406aa Mart*0051 C--   Enable grease ice parameterization (requires to define ALLOW_SITRACER):
                0052 C     The grease ice parameterization delays formation of solid sea ice from
                0053 C     frazil ice by a time constant and provides a dynamic calculation of the
                0054 C     initial solid sea ice thickness HO as a function of winds, currents and
                0055 C     available grease ice volume. Grease ice does not significantly reduce heat
                0056 C     loss from the ocean in winter and area covered by grease is thus handled
                0057 C     like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.).
b8665dacca Mart*0058 C     Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice
                0059 C     then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction',
45315406aa Mart*0060 C     with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to
                0061 C     yield grease ice volume. Additionally, the actual grease ice layer
                0062 C     thickness (diagnostic SIgrsLT) can be saved.
b8665dacca Mart*0063 #undef SEAICE_GREASE
45315406aa Mart*0064 
                0065 C--   Tracers of ice and/or ice cover.
b8665dacca Mart*0066 #ifdef SEAICE_GREASE
45315406aa Mart*0067 C     SEAICE_GREASE code requires to define ALLOW_SITRACER
b8665dacca Mart*0068 # define ALLOW_SITRACER
45315406aa Mart*0069 #else
                0070 # undef ALLOW_SITRACER
b8665dacca Mart*0071 #endif
45315406aa Mart*0072 #ifdef ALLOW_SITRACER
                0073 C-    To try avoid 'spontaneous generation' of tracer maxima by advdiff.
                0074 # define ALLOW_SITRACER_ADVCAP
                0075 
                0076 C-    Include code to diagnose sea ice tracer budgets in
                0077 C     seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are
                0078 C     computed the "call diagnostics_fill" statement is commented out.
                0079 # undef ALLOW_SITRACER_DEBUG_DIAG
                0080 #endif /* ALLOW_SITRACER */
                0081 
                0082 C--   Allow sea-ice dynamic code. These options are provided so that,
                0083 C     if turned off (#undef), to compile (and process with TAF) only the
                0084 C     the thermodynamics component of the code. Note that, if needed,
                0085 C     sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F).
b8665dacca Mart*0086 
                0087 C--   Historically, the seaice model was discretized on a B-Grid. This
45315406aa Mart*0088 C     discretization should still work but it is not longer actively
                0089 C     tested and supported. Define this flag to compile it. It cannot be
                0090 C     defined together with SEAICE_CGRID
                0091 #undef SEAICE_BGRID_DYNAMICS
                0092 
                0093 C--   The following flag should always be set in order to use C the
                0094 C--   operational C-grid discretization.
a5f07bdb14 Jean*0095 #define SEAICE_CGRID
12a4c43673 Jean*0096 
                0097 #ifdef SEAICE_CGRID
45315406aa Mart*0098 C--   Options for the C-grid version only:
                0099 
b8665dacca Mart*0100 C     enable advection of sea ice momentum
                0101 # undef SEAICE_ALLOW_MOM_ADVECTION
45315406aa Mart*0102 
948a90f6b0 Jean*0103 C     enable JFNK code by defining the following flag
                0104 # define SEAICE_ALLOW_JFNK
45315406aa Mart*0105 
bd50c599b7 Mart*0106 C     enable Krylov code by defining the following flag
                0107 # define SEAICE_ALLOW_KRYLOV
45315406aa Mart*0108 
                0109 C--   Use a different order when mapping 2D velocity arrays to 1D vector
                0110 C     before passing it to FGMRES.
                0111 # undef SEAICE_JFNK_MAP_REORDER
                0112 
                0113 C     to reproduce old verification results for JFNK
867c3333f8 Mart*0114 # define SEAICE_PRECOND_EXTRA_EXCHANGE
45315406aa Mart*0115 
144d580169 Jean*0116 C     enable LSR to use global (multi-tile) tri-diagonal solver
                0117 # define SEAICE_GLOBAL_3DIAG_SOLVER
45315406aa Mart*0118 
12a4c43673 Jean*0119 C     enable EVP code by defining the following flag
                0120 # define SEAICE_ALLOW_EVP
                0121 # ifdef SEAICE_ALLOW_EVP
45315406aa Mart*0122 C-    When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities
948a90f6b0 Jean*0123 C     from below and above in seaice_evp: not necessary, and not recommended
12a4c43673 Jean*0124 #  undef SEAICE_ALLOW_CLIPZETA
45315406aa Mart*0125 
                0126 C     Include code to avoid underflows in EVP-code (copied from CICE).
                0127 C     Many compilers can handle this more efficiently with the help of a flag.
                0128 #  undef SEAICE_EVP_ELIMINATE_UNDERFLOWS
                0129 
                0130 C     Include code to print residual of EVP iteration for debugging/diagnostics
                0131 #  undef ALLOW_SEAICE_EVP_RESIDUAL
f753d18056 Jean*0132 # endif /* SEAICE_ALLOW_EVP */
45315406aa Mart*0133 
b8665dacca Mart*0134 C     smooth regularization (without max-function) of delta for
                0135 C     better differentiability
                0136 # undef SEAICE_DELTA_SMOOTHREG
45315406aa Mart*0137 
948a90f6b0 Jean*0138 C     regularize zeta to zmax with a smooth tanh-function instead
                0139 C     of a min(zeta,zmax). This improves convergence of iterative
                0140 C     solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP
c57f610977 Mart*0141 # define SEAICE_ZETA_SMOOTHREG
45315406aa Mart*0142 
                0143 C--   Different yield curves within the VP rheology framework
12a4c43673 Jean*0144 C     allow the truncated ellipse rheology (runtime flag SEAICEuseTEM)
c512e371cc drin*0145 # define SEAICE_ALLOW_TEM
45315406aa Mart*0146 
                0147 C     allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS)
                0148 C     as defined in (Ip 1991) /!\ This is known to give unstable results,
                0149 C     use with caution
                0150 # define SEAICE_ALLOW_MCS
                0151 
                0152 CMLC     or the modified coulombic rheology
                0153 CMLC     allow the use of the Mohr Coulomb rheology (runtime flag
                0154 CMLC     SEAICEuseFULLMC) as defined in (Ip 1991) /!\ This is known
                0155 CMLC     to give unstable results, use with caution
                0156 CML# define SEAICE_ALLOW_FULLMC
                0157 
c512e371cc drin*0158 C     allow the use of Mohr Coulomb with elliptical plastic potential
                0159 C     (runtime flag SEAICEuseMCE)
                0160 # define SEAICE_ALLOW_MCE
45315406aa Mart*0161 
                0162 C     allow the teardrop and parabolic lens  rheology
                0163 C     (runtime flag SEAICEuseTD and SEAICEusePL)
c512e371cc drin*0164 # define SEAICE_ALLOW_TEARDROP
45315406aa Mart*0165 
                0166 C--   LSR solver settings
b8665dacca Mart*0167 C     Use LSR vector code; not useful on non-vector machines, because it
                0168 C     slows down convergence considerably, but the extra iterations are
                0169 C     more than made up by the much faster code on vector machines. For
                0170 C     the only regularly test vector machine these flags a specified
                0171 C     in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment
                0172 C     them out here.
0bc0e1960a Mart*0173 # undef SEAICE_VECTORIZE_LSR
45315406aa Mart*0174 
b8665dacca Mart*0175 C     Use zebra-method (alternate lines) for line-successive-relaxation
                0176 C     This modification improves the convergence of the vector code
                0177 C     dramatically, so that is may actually be useful in general, but
                0178 C     that needs to be tested. Can be used without vectorization options.
0bc0e1960a Mart*0179 # undef SEAICE_LSR_ZEBRA
45315406aa Mart*0180 
                0181 C     Include code to print residual of nonlinear outer loop of LSR
                0182 # undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE
                0183 
                0184 C     This flag is also required for an actual adjoint of seaice_lsr;
                0185 C     increases memory requirements a lot.
                0186 # undef SEAICE_LSR_ADJOINT_ITER
                0187 
b8665dacca Mart*0188 C     Use parameterisation of grounding ice for a better representation
                0189 C     of fastice in shallow seas
                0190 # undef SEAICE_ALLOW_BOTTOMDRAG
45315406aa Mart*0191 
143d9ce879 Dami*0192 C     Allow using the flexible LSR solver, where the number of non-linear
                0193 C     iteration depends on the residual. Good for when a non-linear
                0194 C     convergence criterion must be satified
                0195 # define SEAICE_ALLOW_LSR_FLEX
                0196 
45315406aa Mart*0197 #endif /* SEAICE_CGRID */
                0198 
                0199 #ifdef SEAICE_BGRID_DYNAMICS
                0200 C--   Options for the B-grid version only:
                0201 
                0202 C-    By default for B-grid dynamics solver wind stress under sea-ice is
12a4c43673 Jean*0203 C     set to the same value as it would be if there was no sea-ice.
                0204 C     Define following CPP flag for B-grid ice-ocean stress coupling.
                0205 # define SEAICE_BICE_STRESS
                0206 
45315406aa Mart*0207 C-    By default for B-grid dynamics solver surface tilt is obtained
12a4c43673 Jean*0208 C     indirectly via geostrophic velocities. Define following CPP
                0209 C     in order to use ETAN instead.
                0210 # define EXPLICIT_SSH_SLOPE
45315406aa Mart*0211 
                0212 C-    Defining this flag turns on FV-discretization of the B-grid LSOR solver.
948a90f6b0 Jean*0213 C     It is smoother and includes all metric terms, similar to C-grid solvers.
                0214 C     It is here for completeness, but its usefulness is unclear.
a589927d63 Jean*0215 # undef SEAICE_LSRBNEW
12a4c43673 Jean*0216 
45315406aa Mart*0217 #endif /* SEAICE_BGRID_DYNAMICS */
                0218 
                0219 C--   Some regularisations
                0220 C-    When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box
12a4c43673 Jean*0221 #undef SEAICE_CAP_ICELOAD
45315406aa Mart*0222 
                0223 C-    When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s,
948a90f6b0 Jean*0224 C     not recommended
12a4c43673 Jean*0225 #undef SEAICE_ALLOW_CLIPVELS
45315406aa Mart*0226 
                0227 C-    When set cap the sublimation latent heat flux in solve4temp according
948a90f6b0 Jean*0228 C     to the available amount of ice+snow. Otherwise this term is treated
                0229 C     like all of the others -- residuals heat and fw stocks are passed to
                0230 C     the ocean at the end of seaice_growth in a conservative manner.
                0231 C     SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case.
                0232 #undef SEAICE_CAP_SUBLIM
                0233 
45315406aa Mart*0234 C--   AD flags
                0235 C-    TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h;
                0236 C     it is unclear if this is ever needed.
                0237 #undef AUTODIFF_SOMETIMES_NEEDED
                0238 
                0239 C-    Reset fields to zero to stabilise AD code of dynamics solver
                0240 C     (resulting in wrong gradients)
                0241 #undef SEAICE_DYN_STABLE_ADJOINT
                0242 
                0243 C-    Another flag to simplify dependencies for TAF-generated AD-code
                0244 C     the thermodynamic part, mostly by resetting variables to zero
                0245 #undef SEAICE_MODIFY_GROWTH_ADJ
                0246 
                0247 C-    Special seaice flag for AD testing
                0248 #undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING
                0249 
4dd39c50d9 Mart*0250 C--   Use the adjointable sea-ice thermodynamic model
                0251 C     in seaice_growth_adx.F instead of seaice_growth.F
45315406aa Mart*0252 C     This options excludes more complex physics such
                0253 C     as sublimation, ITD, and frazil.
4dd39c50d9 Mart*0254 #undef SEAICE_USE_GROWTH_ADX
                0255 
45315406aa Mart*0256 C--   These flags are not strictly AD-related but may help obtaining
                0257 C     simpler AD-code:
                0258 C-    Do not compile code that resets AREA (or AREAITD) to a mininum value
                0259 C     of SEAICE_area_floor (=SIeps with default of 1e-5) if there is
                0260 C     some finite sea ice thickness
                0261 #undef DISABLE_AREA_FLOOR
                0262 
                0263 C-    Do not compile growth/thermodynamics code (avoiding this code can
                0264 C     also be done by setting runtime parameter usePWthermodynamics=F)
                0265 #undef DISABLE_SEAICE_GROWTH
                0266 
                0267 C-    Do not compile/use seaice-related obcs code when using obcs.
                0268 #undef DISABLE_SEAICE_OBCS
                0269 
948a90f6b0 Jean*0270 C--   Enable free drift code
a5f07bdb14 Jean*0271 #define SEAICE_ALLOW_FREEDRIFT
5041945476 Patr*0272 
b8665dacca Mart*0273 C--   pkg/seaice cost functions compile flags
45315406aa Mart*0274 C-    Sea-ice volume (requires pkg/cost)
b8665dacca Mart*0275 #undef ALLOW_COST_ICE
45315406aa Mart*0276 #ifdef ALLOW_COST_ICE
                0277 C-    Enable template for sea-ice volume export in seaice_cost_export.F
                0278 C     (requires pkg/cost & ALLOW_COST_ICE defined)
                0279 # undef ALLOW_SEAICE_COST_EXPORT
                0280 #endif /* ALLOW_COST_ICE */
b8665dacca Mart*0281 
a589927d63 Jean*0282 #endif /* ALLOW_SEAICE */
5041945476 Patr*0283 #endif /* SEAICE_OPTIONS_H */