Back to home page

MITgcm

 
 

    


File indexing completed on 2023-08-04 05:11:10 UTC

view on githubraw file Latest commit 45315406 on 2023-08-03 16:50:12 UTC
45315406aa Mart*0001 #ifndef SEAICE_OPTIONS_H
                0002 #define SEAICE_OPTIONS_H
                0003 #include "PACKAGES_CONFIG.h"
                0004 #include "CPP_OPTIONS.h"
                0005 
a589927d63 Jean*0006 C     *==========================================================*
                0007 C     | SEAICE_OPTIONS.h
                0008 C     | o CPP options file for sea ice package.
                0009 C     *==========================================================*
                0010 C     | Use this file for selecting options within the sea ice
                0011 C     | package.
                0012 C     *==========================================================*
8f749e3979 Ian *0013 
a589927d63 Jean*0014 #ifdef ALLOW_SEAICE
45315406aa Mart*0015 C---  Package-specific Options & Macros go here
a589927d63 Jean*0016 
8f749e3979 Ian *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.
                0032 c#define SEAICE_MULTICATEGORY
d7dd676598 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
                0040 #define SEAICE_DISABLE_SUBLIM
                0041 
d7dd676598 Jean*0042 C--   Suspected missing term in coupled ocn-ice heat budget (to be confirmed)
a5a1e2e43f Gael*0043 #define SEAICE_DISABLE_HEATCONSFIX
                0044 
d7dd676598 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.
                0049 #define SEAICE_VARIABLE_SALINITY
                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 #define 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.
                0095 #undef SEAICE_CGRID
8f749e3979 Ian *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 
d7dd676598 Jean*0103 C     enable JFNK code by defining the following flag
                0104 # define SEAICE_ALLOW_JFNK
45315406aa Mart*0105 
b8665dacca Mart*0106 C     enable Krylov code by defining the following flag
                0107 # undef 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
                0114 # undef SEAICE_PRECOND_EXTRA_EXCHANGE
                0115 
94e16c6a45 Dimi*0116 C     enable LSR to use global (multi-tile) tri-diagonal solver
                0117 # undef SEAICE_GLOBAL_3DIAG_SOLVER
45315406aa Mart*0118 
d7dd676598 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
d7dd676598 Jean*0123 C     from below and above in seaice_evp: not necessary, and not recommended
                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 
d7dd676598 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
f753d18056 Jean*0141 # undef SEAICE_ZETA_SMOOTHREG
45315406aa Mart*0142 
                0143 C--   Different yield curves within the VP rheology framework
d7dd676598 Jean*0144 C     allow the truncated ellipse rheology (runtime flag SEAICEuseTEM)
                0145 # undef 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 # undef SEAICE_ALLOW_MCS
                0151 
                0152 C     allow the use of Mohr Coulomb with elliptical plastic potential
                0153 C     (runtime flag SEAICEuseMCE)
                0154 # undef SEAICE_ALLOW_MCE
                0155 
                0156 C     allow the teardrop and parabolic lens  rheology
                0157 C     (runtime flag SEAICEuseTD and SEAICEusePL)
                0158 # undef SEAICE_ALLOW_TEARDROP
                0159 
                0160 C--   LSR solver settings
b8665dacca 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.
                0167 # undef SEAICE_VECTORIZE_LSR
45315406aa Mart*0168 
b8665dacca 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.
                0173 # undef SEAICE_LSR_ZEBRA
45315406aa Mart*0174 
                0175 C     Include code to print residual of nonlinear outer loop of LSR
                0176 # undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE
                0177 
                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
                0181 
b8665dacca Mart*0182 C     Use parameterisation of grounding ice for a better representation
                0183 C     of fastice in shallow seas
                0184 # undef SEAICE_ALLOW_BOTTOMDRAG
45315406aa Mart*0185 
                0186 #endif /* SEAICE_CGRID */
                0187 
                0188 #ifdef SEAICE_BGRID_DYNAMICS
                0189 C--   Options for the B-grid version only:
                0190 
                0191 C-    By default for B-grid dynamics solver wind stress under sea-ice is
d7dd676598 Jean*0192 C     set to the same value as it would be if there was no sea-ice.
                0193 C     Define following CPP flag for B-grid ice-ocean stress coupling.
                0194 # define SEAICE_BICE_STRESS
                0195 
45315406aa Mart*0196 C-    By default for B-grid dynamics solver surface tilt is obtained
d7dd676598 Jean*0197 C     indirectly via geostrophic velocities. Define following CPP
                0198 C     in order to use ETAN instead.
                0199 # define EXPLICIT_SSH_SLOPE
45315406aa Mart*0200 
                0201 C-    Defining this flag turns on FV-discretization of the B-grid LSOR solver.
d7dd676598 Jean*0202 C     It is smoother and includes all metric terms, similar to C-grid solvers.
                0203 C     It is here for completeness, but its usefulness is unclear.
                0204 # undef SEAICE_LSRBNEW
8f749e3979 Ian *0205 
45315406aa Mart*0206 #endif /* SEAICE_BGRID_DYNAMICS */
                0207 
                0208 C--   Some regularisations
                0209 C-    When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box
d7dd676598 Jean*0210 #undef SEAICE_CAP_ICELOAD
45315406aa Mart*0211 
                0212 C-    When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s,
d7dd676598 Jean*0213 C     not recommended
                0214 #undef SEAICE_ALLOW_CLIPVELS
45315406aa Mart*0215 
                0216 C-    When set cap the sublimation latent heat flux in solve4temp according
d7dd676598 Jean*0217 C     to the available amount of ice+snow. Otherwise this term is treated
                0218 C     like all of the others -- residuals heat and fw stocks are passed to
                0219 C     the ocean at the end of seaice_growth in a conservative manner.
                0220 C     SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case.
                0221 #undef SEAICE_CAP_SUBLIM
                0222 
45315406aa Mart*0223 C--   AD flags
                0224 C-    TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h;
                0225 C     it is unclear if this is ever needed.
                0226 #undef AUTODIFF_SOMETIMES_NEEDED
                0227 
                0228 C-    Reset fields to zero to stabilise AD code of dynamics solver
                0229 C     (resulting in wrong gradients)
                0230 #undef SEAICE_DYN_STABLE_ADJOINT
                0231 
                0232 C-    Another flag to simplify dependencies for TAF-generated AD-code
                0233 C     the thermodynamic part, mostly by resetting variables to zero
                0234 #undef SEAICE_MODIFY_GROWTH_ADJ
                0235 
                0236 C-    Special seaice flag for AD testing
                0237 #undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING
                0238 
                0239 C--   Use the adjointable sea-ice thermodynamic model
                0240 C     in seaice_growth_adx.F instead of seaice_growth.F
                0241 C     This options excludes more complex physics such
                0242 C     as sublimation, ITD, and frazil.
                0243 #undef SEAICE_USE_GROWTH_ADX
                0244 
                0245 C--   These flags are not strictly AD-related but may help obtaining
                0246 C     simpler AD-code:
                0247 C-    Do not compile code that resets AREA (or AREAITD) to a mininum value
                0248 C     of SEAICE_area_floor (=SIeps with default of 1e-5) if there is
                0249 C     some finite sea ice thickness
                0250 #undef DISABLE_AREA_FLOOR
                0251 
                0252 C-    Do not compile growth/thermodynamics code (avoiding this code can
                0253 C     also be done by setting runtime parameter usePWthermodynamics=F)
                0254 #undef DISABLE_SEAICE_GROWTH
                0255 
                0256 C-    Do not compile/use seaice-related obcs code when using obcs.
                0257 #undef DISABLE_SEAICE_OBCS
                0258 
d7dd676598 Jean*0259 C--   Enable free drift code
                0260 #undef SEAICE_ALLOW_FREEDRIFT
                0261 
b8665dacca Mart*0262 C--   pkg/seaice cost functions compile flags
45315406aa Mart*0263 C-    Sea-ice volume (requires pkg/cost)
b8665dacca Mart*0264 #undef ALLOW_COST_ICE
45315406aa Mart*0265 #ifdef ALLOW_COST_ICE
                0266 C-    Enable template for sea-ice volume export in seaice_cost_export.F
                0267 C     (requires pkg/cost & ALLOW_COST_ICE defined)
                0268 # undef ALLOW_SEAICE_COST_EXPORT
                0269 #endif /* ALLOW_COST_ICE */
b8665dacca Mart*0270 
a589927d63 Jean*0271 #endif /* ALLOW_SEAICE */
8f749e3979 Ian *0272 #endif /* SEAICE_OPTIONS_H */