Back to home page

MITgcm

 
 

    


File indexing completed on 2024-11-30 06:12:07 UTC

view on githubraw file Latest commit 7bb5a8a1 on 2024-11-29 14:30:55 UTC
b4daa24319 Shre*0001 CBOP
                0002 C !ROUTINE: GAD_OPTIONS.h
                0003 
                0004 C !INTERFACE:
                0005 C #include "GAD_OPTIONS.h"
                0006 
                0007 C !DESCRIPTION:
                0008 C Contains CPP macros/flags for controlling optional features of package.
                0009 CEOP
                0010 
                0011 C CPP options file for GAD (Generic Advection Diffusion) package
                0012 C Use this file for selecting options within the GAD package
                0013 
                0014 #ifndef GAD_OPTIONS_H
                0015 #define GAD_OPTIONS_H
                0016 #include "PACKAGES_CONFIG.h"
                0017 #include "CPP_OPTIONS.h"
                0018 
                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
b4daa24319 Shre*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
b4daa24319 Shre*0032 #undef ISOTROPIC_COS_SCALING
                0033 
                0034 C As of checkpoint41, the inclusion of multi-dimensional advection
                0035 C introduces excessive recomputation/storage for the adjoint.
                0036 C We can disable it here using CPP because run-time flags are insufficient.
                0037 #undef DISABLE_MULTIDIM_ADVECTION
                0038 
                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 
                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 #define GAD_ALLOW_TS_SOM_ADV
                0048 
                0049 C Hack to get rid of negatives caused by Redi.  Works by restricting the
                0050 C outgoing flux (only contributions computed in gad_calc_rhs) for each cell
                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
                0068 C This hack applies to all tracers except temperature and salinity!
                0069 C Do not use with Adams-Bashforth (for ptracers)!
                0070 C Do not use with OBCS!
                0071 #undef  GAD_SMOLARKIEWICZ_HACK
                0072 
                0073 #else
                0074 
                0075 C If GAD is disabled then so is multi-dimensional advection
                0076 #define DISABLE_MULTIDIM_ADVECTION
                0077 
                0078 #endif /* ALLOW_GENERIC_ADVDIFF */
                0079 #endif /* GAD_OPTIONS_H */