The generic_advdiff package contains high-level subroutines to solve the advection-diffusion equation of any tracer, either active (potential temperature, salinity or water vapor) or passive (see pkg/ptracer). (see also Section 2.16 and Section 2.17).

## 8.2.1.1. Introduction¶

Package “generic_advdiff” provides a common set of routines for calculating advective/diffusive fluxes for tracers (cell centered quantities on a C-grid).

Many different advection schemes are available: the standard centered second order, centered fourth order and upwind biased third order schemes are known as linear methods and require some stable time-stepping method such as Adams-Bashforth. Alternatives such as flux-limited schemes are stable in the forward sense and are best combined with the multi-dimensional method provided in gad_advection.

## 8.2.1.2. Key subroutines, parameters and files¶

There are two high-level routines:

• GAD_CALC_RHS calculates all fluxes at time level “n” and is used for the standard linear schemes. This must be used in conjuction with Adams–Bashforth time stepping. Diffusive and parameterized fluxes are always calculated here.

CPP Flag Name

Default

Description

COSINEMETH_III

#define

sets the implementation form of $$\cos{\varphi}$$ scaling of bi-harmonic terms for tracer diffusivity (note, in pkg/generic_advdiff routines the definition set here overrides whether this is defined in model/inc/CPP_OPTIONS.h, where the setting affects viscous term calculations)

ISOTROPIC_COS_SCALING

#undef

selects isotropic scaling of harmonic and bi-harmonic terms when using the $$\cos{\varphi}$$ scaling (note, in pkg/generic_advdiff routines the definition set here overrides whether this is defined in model/inc/CPP_OPTIONS.h, where the setting affects viscous term calculations)

#undef

disables compilation of multi-dim. advection code

#undef

use compressible flow method for multi-dim advection instead of older, less accurate method; note option has no effect on SOM advection which always uses compressible flow method

#undef

enable the use of 2nd-order moment advection scheme (Prather 1986 [Pra86]) for temp. and salinity

#undef

enables hack to get rid of negatives caused by Redi, see Smolarkiewicz (1989) [Smo89] (for ptracers, except temp and salinity)

------------------------------------------------------------------------
<-Name->|Levs|<-parsing code->|<--  Units   -->|<- Tile (max=80c)
------------------------------------------------------------------------
DFrE_TH | 15 |WM      LR      |degC.m^3/s      |Vertical Diffusive Flux of Pot.Temperature (Explicit part)
DIFx_TH | 15 |UU   090MR      |degC.m^3/s      |Zonal      Diffusive Flux of Pot.Temperature
DIFy_TH | 15 |VV   089MR      |degC.m^3/s      |Meridional Diffusive Flux of Pot.Temperature
DFrI_TH | 15 |WM      LR      |degC.m^3/s      |Vertical Diffusive Flux of Pot.Temperature (Implicit part)