Back to home page

MITgcm

 
 

    


File indexing completed on 2023-12-05 06:10:59 UTC

view on githubraw file Latest commit 143d9ce8 on 2023-12-04 15:35:20 UTC
7687abca03 Jean*0001 #ifndef SEAICE_OPTIONS_H
                0002 #define SEAICE_OPTIONS_H
                0003 #include "PACKAGES_CONFIG.h"
                0004 #include "CPP_OPTIONS.h"
                0005 
e1abec6573 Jean*0006 C     *==========================================================*
d6c8672c92 Jean*0007 C     | SEAICE_OPTIONS.h
                0008 C     | o CPP options file for sea ice package.
e1abec6573 Jean*0009 C     *==========================================================*
d6c8672c92 Jean*0010 C     | Use this file for selecting options within the sea ice
                0011 C     | package.
e1abec6573 Jean*0012 C     *==========================================================*
809c36b928 Patr*0013 
088cd56510 Jean*0014 #ifdef ALLOW_SEAICE
7687abca03 Jean*0015 C---  Package-specific Options & Macros go here
6d54cf9ca1 Ed H*0016 
cee16b76ae Dimi*0017 C--   Write "text-plots" of certain fields in STDOUT for debugging.
809c36b928 Patr*0018 #undef SEAICE_DEBUG
                0019 
cee16b76ae Dimi*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.
ae1fb66b64 Dimi*0025 #define SEAICE_EXTERNAL_FLUXES
cee16b76ae Dimi*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.
9311b8fad7 Jean*0032 c#define SEAICE_MULTICATEGORY
09510da3bb Dimi*0033 
72a15a6456 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 
840c7fba30 Gael*0038 C--   Since the missing sublimation term is now included
                0039 C     this flag is needed for backward compatibility
                0040 #undef SEAICE_DISABLE_SUBLIM
                0041 
9311b8fad7 Jean*0042 C--   Suspected missing term in coupled ocn-ice heat budget (to be confirmed)
                0043 #undef SEAICE_DISABLE_HEATCONSFIX
381adf77df Gael*0044 
9311b8fad7 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.
a98c4b8072 Ian *0049 #undef SEAICE_VARIABLE_SALINITY
fdfa8e151f Dimi*0050 
7687abca03 Jean*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.).
                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',
                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.
                0063 #undef SEAICE_GREASE
                0064 
1feb19e384 Gael*0065 C--   Tracers of ice and/or ice cover.
7687abca03 Jean*0066 #ifdef SEAICE_GREASE
                0067 C     SEAICE_GREASE code requires to define ALLOW_SITRACER
                0068 # define ALLOW_SITRACER
                0069 #else
                0070 # undef ALLOW_SITRACER
                0071 #endif
1feb19e384 Gael*0072 #ifdef ALLOW_SITRACER
7687abca03 Jean*0073 C-    To try avoid 'spontaneous generation' of tracer maxima by advdiff.
1feb19e384 Gael*0074 # define ALLOW_SITRACER_ADVCAP
1af566c09c mjlo*0075 
7687abca03 Jean*0076 C-    Include code to diagnose sea ice tracer budgets in
1af566c09c mjlo*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
7687abca03 Jean*0080 #endif /* ALLOW_SITRACER */
f61838dfc1 Torg*0081 
45315406aa Mart*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).
                0086 
b8665dacca Mart*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.
fd573688e6 Jean*0095 #define SEAICE_CGRID
53092bcb42 Mart*0096 
6e2f4e58fa Mart*0097 #ifdef SEAICE_CGRID
7687abca03 Jean*0098 C--   Options for the C-grid version only:
1af566c09c mjlo*0099 
2e05c0b826 Mart*0100 C     enable advection of sea ice momentum
                0101 # undef SEAICE_ALLOW_MOM_ADVECTION
1af566c09c mjlo*0102 
abc0754c97 Mart*0103 C     enable JFNK code by defining the following flag
                0104 # define SEAICE_ALLOW_JFNK
1af566c09c mjlo*0105 
1ac05d2425 Mart*0106 C     enable Krylov code by defining the following flag
                0107 # define SEAICE_ALLOW_KRYLOV
1af566c09c mjlo*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 
3156f625d5 Jean*0113 C     to reproduce old verification results for JFNK
                0114 # undef SEAICE_PRECOND_EXTRA_EXCHANGE
1af566c09c mjlo*0115 
f82b316546 Jean*0116 C     enable LSR to use global (multi-tile) tri-diagonal solver
                0117 # undef SEAICE_GLOBAL_3DIAG_SOLVER
1af566c09c mjlo*0118 
dadd13178c Mart*0119 C     enable EVP code by defining the following flag
a3cfd6ea00 Dimi*0120 # define SEAICE_ALLOW_EVP
                0121 # ifdef SEAICE_ALLOW_EVP
7687abca03 Jean*0122 C-    When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities
9311b8fad7 Jean*0123 C     from below and above in seaice_evp: not necessary, and not recommended
a3cfd6ea00 Dimi*0124 #  undef SEAICE_ALLOW_CLIPZETA
1af566c09c mjlo*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
7f06fdfc2d Mart*0132 # endif /* SEAICE_ALLOW_EVP */
1af566c09c mjlo*0133 
f3224168cd Mart*0134 C     smooth regularization (without max-function) of delta for
                0135 C     better differentiability
                0136 # undef SEAICE_DELTA_SMOOTHREG
1af566c09c mjlo*0137 
72a15a6456 Jean*0138 C     regularize zeta to zmax with a smooth tanh-function instead
abc0754c97 Mart*0139 C     of a min(zeta,zmax). This improves convergence of iterative
                0140 C     solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP
b8665dacca Mart*0141 # define SEAICE_ZETA_SMOOTHREG
1af566c09c mjlo*0142 
                0143 C--   Different yield curves within the VP rheology framework
dadd13178c Mart*0144 C     allow the truncated ellipse rheology (runtime flag SEAICEuseTEM)
a3cfd6ea00 Dimi*0145 # undef SEAICE_ALLOW_TEM
1af566c09c mjlo*0146 
c512e371cc drin*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 # undef SEAICE_ALLOW_MCS
1af566c09c mjlo*0151 
c512e371cc drin*0152 C     allow the use of Mohr Coulomb with elliptical plastic potential
                0153 C     (runtime flag SEAICEuseMCE)
                0154 # undef SEAICE_ALLOW_MCE
1af566c09c mjlo*0155 
c512e371cc drin*0156 C     allow the teardrop and parabolic lens  rheology
                0157 C     (runtime flag SEAICEuseTD and SEAICEusePL)
                0158 # undef SEAICE_ALLOW_TEARDROP
1af566c09c mjlo*0159 
                0160 C--   LSR solver settings
847799d97e Mart*0161 C     Use LSR vector code; not useful on non-vector machines, because it
                0162 C     slows down convergence considerably, but the extra iterations are
                0163 C     more than made up by the much faster code on vector machines. For
                0164 C     the only regularly test vector machine these flags a specified
                0165 C     in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment
                0166 C     them out here.
97d509b8e2 Mart*0167 # undef SEAICE_VECTORIZE_LSR
1af566c09c mjlo*0168 
97d509b8e2 Mart*0169 C     Use zebra-method (alternate lines) for line-successive-relaxation
                0170 C     This modification improves the convergence of the vector code
                0171 C     dramatically, so that is may actually be useful in general, but
                0172 C     that needs to be tested. Can be used without vectorization options.
d0d8254235 Mart*0173 # undef SEAICE_LSR_ZEBRA
1af566c09c mjlo*0174 
                0175 C     Include code to print residual of nonlinear outer loop of LSR
                0176 # undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE
                0177 
3156f625d5 Jean*0178 C     This flag is also required for an actual adjoint of seaice_lsr;
                0179 C     increases memory requirements a lot.
                0180 # undef SEAICE_LSR_ADJOINT_ITER
1af566c09c mjlo*0181 
d0d8254235 Mart*0182 C     Use parameterisation of grounding ice for a better representation
                0183 C     of fastice in shallow seas
                0184 # undef SEAICE_ALLOW_BOTTOMDRAG
1af566c09c mjlo*0185 
143d9ce879 Dami*0186 C     Allow using the flexible LSR solver, where the number of non-linear
                0187 C     iteration depends on the residual. Good for when a non-linear
                0188 C     convergence criterion must be satified
                0189 # undef SEAICE_ALLOW_LSR_FLEX
                0190 
45315406aa Mart*0191 #endif /* SEAICE_CGRID */
                0192 
                0193 #ifdef SEAICE_BGRID_DYNAMICS
7687abca03 Jean*0194 C--   Options for the B-grid version only:
                0195 
                0196 C-    By default for B-grid dynamics solver wind stress under sea-ice is
282e0c8db9 Mart*0197 C     set to the same value as it would be if there was no sea-ice.
                0198 C     Define following CPP flag for B-grid ice-ocean stress coupling.
a3cfd6ea00 Dimi*0199 # define SEAICE_BICE_STRESS
282e0c8db9 Mart*0200 
7687abca03 Jean*0201 C-    By default for B-grid dynamics solver surface tilt is obtained
282e0c8db9 Mart*0202 C     indirectly via geostrophic velocities. Define following CPP
                0203 C     in order to use ETAN instead.
a3cfd6ea00 Dimi*0204 # define EXPLICIT_SSH_SLOPE
1af566c09c mjlo*0205 
7687abca03 Jean*0206 C-    Defining this flag turns on FV-discretization of the B-grid LSOR solver.
9311b8fad7 Jean*0207 C     It is smoother and includes all metric terms, similar to C-grid solvers.
                0208 C     It is here for completeness, but its usefulness is unclear.
e1d2983c5b Mart*0209 # undef SEAICE_LSRBNEW
7687abca03 Jean*0210 
45315406aa Mart*0211 #endif /* SEAICE_BGRID_DYNAMICS */
6e2f4e58fa Mart*0212 
1af566c09c mjlo*0213 C--   Some regularisations
7687abca03 Jean*0214 C-    When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box
e1abec6573 Jean*0215 #undef SEAICE_CAP_ICELOAD
1af566c09c mjlo*0216 
7687abca03 Jean*0217 C-    When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s,
9311b8fad7 Jean*0218 C     not recommended
d37c75ccbc Mart*0219 #undef SEAICE_ALLOW_CLIPVELS
1af566c09c mjlo*0220 
7687abca03 Jean*0221 C-    When set cap the sublimation latent heat flux in solve4temp according
9311b8fad7 Jean*0222 C     to the available amount of ice+snow. Otherwise this term is treated
                0223 C     like all of the others -- residuals heat and fw stocks are passed to
                0224 C     the ocean at the end of seaice_growth in a conservative manner.
                0225 C     SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case.
840c7fba30 Gael*0226 #undef SEAICE_CAP_SUBLIM
c7cb92a732 Dimi*0227 
1af566c09c mjlo*0228 C--   AD flags
7687abca03 Jean*0229 C-    TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h;
1af566c09c mjlo*0230 C     it is unclear if this is ever needed.
                0231 #undef AUTODIFF_SOMETIMES_NEEDED
                0232 
7687abca03 Jean*0233 C-    Reset fields to zero to stabilise AD code of dynamics solver
1af566c09c mjlo*0234 C     (resulting in wrong gradients)
                0235 #undef SEAICE_DYN_STABLE_ADJOINT
                0236 
7687abca03 Jean*0237 C-    Another flag to simplify dependencies for TAF-generated AD-code
1af566c09c mjlo*0238 C     the thermodynamic part, mostly by resetting variables to zero
                0239 #undef SEAICE_MODIFY_GROWTH_ADJ
                0240 
7687abca03 Jean*0241 C-    Special seaice flag for AD testing
                0242 #undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING
                0243 
                0244 C--   Use the adjointable sea-ice thermodynamic model
                0245 C     in seaice_growth_adx.F instead of seaice_growth.F
a4e168e012 antn*0246 C     This options excludes more complex physics such
                0247 C     as sublimation, ITD, and frazil.
7687abca03 Jean*0248 #undef SEAICE_USE_GROWTH_ADX
                0249 
1af566c09c mjlo*0250 C--   These flags are not strictly AD-related but may help obtaining
7687abca03 Jean*0251 C     simpler AD-code:
                0252 C-    Do not compile code that resets AREA (or AREAITD) to a mininum value
1af566c09c mjlo*0253 C     of SEAICE_area_floor (=SIeps with default of 1e-5) if there is
                0254 C     some finite sea ice thickness
                0255 #undef DISABLE_AREA_FLOOR
                0256 
7687abca03 Jean*0257 C-    Do not compile growth/thermodynamics code (avoiding this code can
1af566c09c mjlo*0258 C     also be done by setting runtime parameter usePWthermodynamics=F)
                0259 #undef DISABLE_SEAICE_GROWTH
                0260 
7687abca03 Jean*0261 C-    Do not compile/use seaice-related obcs code when using obcs.
                0262 #undef DISABLE_SEAICE_OBCS
3156f625d5 Jean*0263 
9311b8fad7 Jean*0264 C--   Enable free drift code
f5ec4d1505 Gael*0265 #undef SEAICE_ALLOW_FREEDRIFT
                0266 
a51dd85d77 Gael*0267 C--   pkg/seaice cost functions compile flags
2b959ba38e Mart*0268 C-    Sea-ice volume (requires pkg/cost)
a51dd85d77 Gael*0269 #undef ALLOW_COST_ICE
2b959ba38e Mart*0270 #ifdef ALLOW_COST_ICE
                0271 C-    Enable template for sea-ice volume export in seaice_cost_export.F
                0272 C     (requires pkg/cost & ALLOW_COST_ICE defined)
                0273 # undef ALLOW_SEAICE_COST_EXPORT
                0274 #endif /* ALLOW_COST_ICE */
a51dd85d77 Gael*0275 
088cd56510 Jean*0276 #endif /* ALLOW_SEAICE */
6d54cf9ca1 Ed H*0277 #endif /* SEAICE_OPTIONS_H */