Back to home page

MITgcm

 
 

    


File indexing completed on 2024-11-30 06:11:02 UTC

view on githubraw file Latest commit 7bb5a8a1 on 2024-11-29 14:30:55 UTC
28d97917ae Alis*0001 CBOP
                0002 C !ROUTINE: GAD_OPTIONS.h
                0003 
                0004 C !INTERFACE:
6e23417f74 Jean*0005 C #include "GAD_OPTIONS.h"
28d97917ae Alis*0006 
                0007 C !DESCRIPTION:
                0008 C Contains CPP macros/flags for controlling optional features of package.
                0009 CEOP
                0010 
31566b6684 Alis*0011 C CPP options file for GAD (Generic Advection Diffusion) package
                0012 C Use this file for selecting options within the GAD package
                0013 
6d54cf9ca1 Ed H*0014 #ifndef GAD_OPTIONS_H
                0015 #define GAD_OPTIONS_H
                0016 #include "PACKAGES_CONFIG.h"
                0017 #include "CPP_OPTIONS.h"
                0018 
d6c8672c92 Jean*0019 #ifdef ALLOW_GENERIC_ADVDIFF
                0020 C     Package-specific Options & Macros go here
                0021 
7bb5a8a109 Jean*0022 C This flag selects the form of COSINE(lat) scaling of horizontal
                0023 C bi-harmonic diffusivity -- only on lat-lon grid.
                0024 C Setting this flag here only affects tracer diffusivity; to use it
                0025 C in the momentum equations it needs to be set in MOM_COMMON_OPTIONS.h
31566b6684 Alis*0026 #define COSINEMETH_III
                0027 
7bb5a8a109 Jean*0028 C This selects isotropic scaling of horizontal harmonic and bi-harmonic
                0029 C diffusivity when using the COSINE(lat) scaling -- only on lat-lon grid.
                0030 C Setting this flag here only affects tracer diffusivity; to use it
                0031 C in the momentum equations it needs to be set in MOM_COMMON_OPTIONS.h
0be6057084 Mart*0032 #undef ISOTROPIC_COS_SCALING
31566b6684 Alis*0033 
e454e319af Alis*0034 C As of checkpoint41, the inclusion of multi-dimensional advection
                0035 C introduces excessive recomputation/storage for the adjoint.
c63877c23d Alis*0036 C We can disable it here using CPP because run-time flags are insufficient.
d7ce0d34f8 Jean*0037 #undef DISABLE_MULTIDIM_ADVECTION
                0038 
d077f4a702 Jean*0039 C Use compressible flow method for multi-dim advection instead of old, less
                0040 C accurate jmc method. Note: option has no effect on SOM advection which
                0041 C always use compressible flow method.
                0042 #undef GAD_MULTIDIM_COMPRESSIBLE
                0043 
6e23417f74 Jean*0044 C This enable the use of 2nd-Order Moment advection scheme (Prather, 1986) for
                0045 C Temperature and Salinity ; due to large memory space (10 times more / tracer)
                0046 C requirement, by default, this part of the code is not compiled.
                0047 #undef GAD_ALLOW_TS_SOM_ADV
e454e319af Alis*0048 
f3f802a2e3 Oliv*0049 C Hack to get rid of negatives caused by Redi.  Works by restricting the
6e23417f74 Jean*0050 C outgoing flux (only contributions computed in gad_calc_rhs) for each cell
f3f802a2e3 Oliv*0051 C to be no more than the amount of tracer in the cell (see Smolarkiewicz
                0052 C MWR 1989 and Bott MWR 1989).
                0053 C The flux contributions computed in gad_calc_rhs which are affected by
                0054 C this hack are:
                0055 C - explicit diffusion, Redi and the non-local part of KPP
                0056 C - advection is affected only if multiDimAdvection=.FALSE.
                0057 C - vertical diffusion (including the diagonal contribution from GMRedi)
                0058 C   only if implicitDiffusion=.FALSE.
                0059 C - GM is affected only if GMREDI_AdvForm=.FALSE.
                0060 C
                0061 C The parameter SmolarkiewiczMaxFrac (defined in gad_init_fixed.F)
                0062 C specifies the maximal fraction of tracer that can leave a cell.
                0063 C By default it is 1.  This will prevent the tracer from going negative
                0064 C due to contributions from gad_calc_rhs alone.  In the presence of other
                0065 C contributions (or roundoff errors), it may be necessary to reduce this
                0066 C value to achieve strict positivity.
                0067 C
6e23417f74 Jean*0068 C This hack applies to all tracers except temperature and salinity!
c3cd6c250f Jean*0069 C Do not use with Adams-Bashforth (for ptracers)!
                0070 C Do not use with OBCS!
998cbd211e Oliv*0071 #undef  GAD_SMOLARKIEWICZ_HACK
                0072 
e454e319af Alis*0073 #else
                0074 
                0075 C If GAD is disabled then so is multi-dimensional advection
                0076 #define DISABLE_MULTIDIM_ADVECTION
31566b6684 Alis*0077 
d7ce0d34f8 Jean*0078 #endif /* ALLOW_GENERIC_ADVDIFF */
6d54cf9ca1 Ed H*0079 #endif /* GAD_OPTIONS_H */