1 |
dgoldberg |
1.1 |
C $Header: /u/gcmpack/MITgcm/verification/bottom_ctrl_5x5/code_ad/GAD_OPTIONS.h,v 1.3 2013/03/04 18:41:16 jmc Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
CBOP |
5 |
|
|
C !ROUTINE: GAD_OPTIONS.h |
6 |
|
|
|
7 |
|
|
C !INTERFACE: |
8 |
|
|
C #include "GAD_OPTIONS.h" |
9 |
|
|
|
10 |
|
|
C !DESCRIPTION: |
11 |
|
|
C Contains CPP macros/flags for controlling optional features of package. |
12 |
|
|
CEOP |
13 |
|
|
|
14 |
|
|
C CPP options file for GAD (Generic Advection Diffusion) package |
15 |
|
|
C Use this file for selecting options within the GAD package |
16 |
|
|
|
17 |
|
|
#ifndef GAD_OPTIONS_H |
18 |
|
|
#define GAD_OPTIONS_H |
19 |
|
|
#include "PACKAGES_CONFIG.h" |
20 |
|
|
#include "CPP_OPTIONS.h" |
21 |
|
|
|
22 |
|
|
#ifdef ALLOW_GENERIC_ADVDIFF |
23 |
|
|
C Package-specific Options & Macros go here |
24 |
|
|
|
25 |
|
|
C This flag selects the form of COSINE(lat) scaling of bi-harmonic term. |
26 |
|
|
C *only for use on a lat-lon grid* |
27 |
|
|
C Setting this flag here only affects the bi-harmonic tracer terms; to |
28 |
|
|
C use COSINEMETH_III in the momentum equations set it CPP_OPTIONS.h |
29 |
|
|
|
30 |
|
|
C Following compilation that worked |
31 |
|
|
C#undef COSINEMETH_III |
32 |
|
|
#define COSINEMETH_III |
33 |
|
|
|
34 |
|
|
C This selects isotropic scaling of harmonic and bi-harmonic term when |
35 |
|
|
C using the COSINE(lat) scaling. |
36 |
|
|
C Setting this flag here only affects the tracer diffusion terms; to |
37 |
|
|
C use ISOTROPIC_COS_SCALING of the horizontal viscosity terms in the |
38 |
|
|
C momentum equations set it CPP_OPTIONS.h; the following line |
39 |
|
|
C even overrides setting the flag in CPP_OPTIONS.h |
40 |
|
|
#undef ISOTROPIC_COS_SCALING |
41 |
|
|
|
42 |
|
|
C As of checkpoint41, the inclusion of multi-dimensional advection |
43 |
|
|
C introduces excessive recomputation/storage for the adjoint. |
44 |
|
|
C We can disable it here using CPP because run-time flags are insufficient. |
45 |
|
|
C Following compilation that worked |
46 |
|
|
Cdefine DISABLE_MULTIDIM_ADVECTION |
47 |
|
|
#undef DISABLE_MULTIDIM_ADVECTION |
48 |
|
|
|
49 |
|
|
C Use compressible flow method for multi-dim advection instead of old, less |
50 |
|
|
C accurate jmc method. Note: option has no effect on SOM advection which |
51 |
|
|
C always use compressible flow method. |
52 |
|
|
#undef GAD_MULTIDIM_COMPRESSIBLE |
53 |
|
|
|
54 |
|
|
C This enable the use of 2nd-Order Moment advection scheme (Prather, 1986) for |
55 |
|
|
C Temperature and Salinity ; due to large memory space (10 times more / tracer) |
56 |
|
|
C requirement, by default, this part of the code is not compiled. |
57 |
|
|
#undef GAD_ALLOW_TS_SOM_ADV |
58 |
|
|
|
59 |
|
|
C Hack to get rid of negatives caused by Redi. Works by restricting the |
60 |
|
|
C outgoing flux (only contributions computed in gad_calc_rhs) for each cell |
61 |
|
|
C to be no more than the amount of tracer in the cell (see Smolarkiewicz |
62 |
|
|
C MWR 1989 and Bott MWR 1989). |
63 |
|
|
C The flux contributions computed in gad_calc_rhs which are affected by |
64 |
|
|
C this hack are: |
65 |
|
|
C - explicit diffusion, Redi and the non-local part of KPP |
66 |
|
|
C - advection is affected only if multiDimAdvection=.FALSE. |
67 |
|
|
C - vertical diffusion (including the diagonal contribution from GMRedi) |
68 |
|
|
C only if implicitDiffusion=.FALSE. |
69 |
|
|
C - GM is affected only if GMREDI_AdvForm=.FALSE. |
70 |
|
|
C |
71 |
|
|
C The parameter SmolarkiewiczMaxFrac (defined in gad_init_fixed.F) |
72 |
|
|
C specifies the maximal fraction of tracer that can leave a cell. |
73 |
|
|
C By default it is 1. This will prevent the tracer from going negative |
74 |
|
|
C due to contributions from gad_calc_rhs alone. In the presence of other |
75 |
|
|
C contributions (or roundoff errors), it may be necessary to reduce this |
76 |
|
|
C value to achieve strict positivity. |
77 |
|
|
C |
78 |
|
|
C This hack applies to all tracers except temperature and salinity! |
79 |
|
|
C Do not use with Adams-Bashforth (for ptracers)! |
80 |
|
|
C Do not use with OBCS! |
81 |
|
|
#undef GAD_SMOLARKIEWICZ_HACK |
82 |
|
|
|
83 |
|
|
#else |
84 |
|
|
|
85 |
|
|
C If GAD is disabled then so is multi-dimensional advection |
86 |
|
|
#define DISABLE_MULTIDIM_ADVECTION |
87 |
|
|
|
88 |
|
|
#endif /* ALLOW_GENERIC_ADVDIFF */ |
89 |
|
|
#endif /* GAD_OPTIONS_H */ |