1 |
molod |
1.4 |
\subsection {GCHEM Package} |
2 |
edhill |
1.2 |
\label{sec:pkg:gchem} |
3 |
|
|
\begin{rawhtml} |
4 |
|
|
<!-- CMIREDIR:package_gchem: --> |
5 |
|
|
\end{rawhtml} |
6 |
edhill |
1.1 |
|
7 |
molod |
1.4 |
\subsubsection {Introduction} |
8 |
edhill |
1.1 |
This package has been developed as interface to the PTRACERS package. |
9 |
|
|
The purpose is to provide a structure where various (any) |
10 |
|
|
tracer experiments can be added to the code. |
11 |
|
|
For instance there are placeholders for routines |
12 |
|
|
to read in parameters needed for any tracer experiments, a routine |
13 |
|
|
to read in extra fields required for the tracer code, routines |
14 |
|
|
for either external forcing or internal interactions between tracers |
15 |
|
|
and routines for additional diagnostics relating to the tracers. |
16 |
|
|
Note that the gchem package itself is only a means to call |
17 |
|
|
the subroutines used by specific biogeochemical experiments, |
18 |
|
|
and does not "do" anything on its own. |
19 |
|
|
|
20 |
stephd |
1.9 |
There are two examples: {\bf cfc} which looks at 2 tracers with a |
21 |
|
|
simple external forcing and {\bf dic} with 4,5 or 6 tracers |
22 |
|
|
whose tendency terms |
23 |
edhill |
1.1 |
are related to one another. We will discuss these here only as |
24 |
|
|
how they provide examples to use this package. |
25 |
|
|
|
26 |
|
|
|
27 |
molod |
1.4 |
\subsubsection {Key subroutines and parameters} |
28 |
edhill |
1.1 |
|
29 |
|
|
\noindent |
30 |
|
|
{{\bf FRAMEWORK}} \\ |
31 |
stephd |
1.9 |
The different biogeochemistry frameworks (e.g. cfc of dic) |
32 |
|
|
are specified in the packages\_conf file. |
33 |
edhill |
1.1 |
{\it GCHEM\_OPTIONS.h} includes the compiler options to be used |
34 |
stephd |
1.9 |
in any experiment. |
35 |
|
|
An important compiler option is |
36 |
mlosch |
1.3 |
\#define GCHEM\_SEPARATE\_FORCING which determined |
37 |
edhill |
1.1 |
how and when the tracer forcing is applied (see discussion |
38 |
stephd |
1.9 |
on Forcing below). See section on dic for some additional |
39 |
|
|
flags that can be set for that experiment. |
40 |
edhill |
1.1 |
There are further runtime parameters |
41 |
|
|
set in {\it data.gchem} and kept in common block {\it GCHEM.h}. |
42 |
|
|
These runtime options include:\\ |
43 |
stephd |
1.9 |
$\bullet$ Parameters to set the timing for periodic forcing files to |
44 |
|
|
be loaded are: {\it gchem\_ForcingPeriod}, {\it gchem\_ForcingCycle}. |
45 |
|
|
The former is how often to load, the latter is how often to cycle |
46 |
|
|
through those fields (eg. period couple be monthly and cycle one year). |
47 |
|
|
This is used in {\it dic} and {\it cfc}, with gchem\_ForcingPeriod=0 |
48 |
|
|
meaning no periodic forcing. |
49 |
stephd |
1.10 |
\\ |
50 |
edhill |
1.1 |
$\bullet$ {\bf nsubtime} is the integer number of extra timesteps |
51 |
|
|
required by the tracer experiment. This will give a timestep |
52 |
|
|
of {\bf deltaTtracer}$/${\bf nsubtime} for the dependencies |
53 |
|
|
between tracers. The default is one. |
54 |
|
|
\\ |
55 |
|
|
$\bullet$ File names - these are several filenames than can be read in |
56 |
|
|
for external fields needed in the tracer forcing - for instance |
57 |
|
|
wind speed is needed in both DIC and CFC packages to calculate |
58 |
|
|
the air-sea exchange of gases. Not all file names will be used |
59 |
|
|
for every tracer experiment. |
60 |
stephd |
1.9 |
\\ |
61 |
|
|
$\bullet$ {\bf gchem\_int\_*} are variable names for run-time set integer numbers. (Currently 1 through 5). |
62 |
|
|
\\ |
63 |
|
|
$\bullet$ {\bf gchem\_rl\_*} are variable names for run-time set real numbers. (Currently 1 through 5). |
64 |
stephd |
1.10 |
\\ |
65 |
stephd |
1.9 |
$\bullet$ Note that the old {\bf tIter0} has been replaced by {\bf PTRACERS\_Iter0} which is |
66 |
|
|
set in data.ptracers instead. |
67 |
edhill |
1.1 |
|
68 |
|
|
\vspace{.5cm} |
69 |
|
|
|
70 |
|
|
\noindent |
71 |
|
|
{{\bf INITIALIZATION}}\\ |
72 |
|
|
The values set at runtime in data.gchem are read in |
73 |
|
|
using {\it gchem\_readparms.F} which is called from |
74 |
|
|
packages\_readparms.F. This will include any external |
75 |
|
|
forcing files that will be needed by the tracer experiment. |
76 |
|
|
|
77 |
|
|
There are two routine used to initialize parameters and fields |
78 |
|
|
needed by the experiment packages. These are |
79 |
mlosch |
1.3 |
{\it gchem\_init\_fixed.F} which is called from \textit{packages\_init\_fixed.F}, and |
80 |
edhill |
1.1 |
{\it gchem\_init\_vari.F} called from |
81 |
|
|
packages\_init\_variable.F. The first should |
82 |
|
|
be used to call a subroutine specific to the tracer experiment |
83 |
|
|
which sets fixed parameters, the second should call a subroutine |
84 |
|
|
specific to the tracer experiment |
85 |
|
|
which sets (or initializes) time fields that will vary with time. |
86 |
|
|
|
87 |
|
|
\vspace{.5cm} |
88 |
|
|
|
89 |
|
|
|
90 |
|
|
\noindent |
91 |
|
|
{{\bf LOADING FIELDS}}\\ |
92 |
|
|
External forcing fields used by the tracer experiment are read |
93 |
|
|
in by a subroutine (specific to the tracer experiment) called from |
94 |
mlosch |
1.3 |
{\it gchem\_fields\_load.F}. This latter is called from \textit{forward\_step.F}. |
95 |
edhill |
1.1 |
|
96 |
|
|
\vspace{.5cm} |
97 |
|
|
|
98 |
|
|
|
99 |
|
|
\noindent |
100 |
|
|
{{\bf FORCING}}\\ |
101 |
|
|
Tracer fields are advected-and-diffused by the ptracer package. |
102 |
|
|
Additional changes (e.g. surface forcing or interactions |
103 |
|
|
between tracers) to these fields are taken care of by the gchem |
104 |
|
|
interface. For tracers that are essentially passive (e.g. CFC's) |
105 |
|
|
but may have some surface boundary conditions |
106 |
|
|
this can easily be done within the regular tracer timestep. In this case |
107 |
mlosch |
1.3 |
{\it gchem\_calc\_tendency.F} is called from {\it forward\_step.F}, where the |
108 |
|
|
reactive (as opposed to the advective diffusive) tendencies are computed. |
109 |
|
|
These tendencies, stored on the 3D field \textbf{gchemTendency}, are added to |
110 |
|
|
the passive tracer tendencies \textbf{gPtr} in {\it gchem\_add\_tendency.F}, |
111 |
|
|
which is called from {\it ptracers\_forcing.F}. |
112 |
edhill |
1.1 |
For tracers with more complicated dependencies on each other, |
113 |
|
|
and especially tracers which require a smaller timestep than |
114 |
|
|
deltaTtracer, it will be easier to use {\it gchem\_forcing\_sep.F} |
115 |
|
|
which is called from forward\_step.F. There is a |
116 |
|
|
compiler option set in {\it GCHEM\_OPTIONS.h} that determines |
117 |
mlosch |
1.3 |
which method is used: \#define GCHEM\_SEPARATE\_FORCING |
118 |
edhill |
1.1 |
does the latter where tracers are forced separately from the |
119 |
mlosch |
1.3 |
advection-diffusion code, and \#undef GCHEM\_SEPARATE\_FORCING |
120 |
edhill |
1.1 |
includes the forcing in the regular timestepping. |
121 |
|
|
|
122 |
|
|
\vspace{.5cm} |
123 |
|
|
|
124 |
|
|
\noindent |
125 |
|
|
{{\bf DIAGNOSTICS}}\\ |
126 |
mlosch |
1.3 |
This package also also used the passive tracer routine {\it ptracers\_monitor.F} |
127 |
|
|
which prints out tracer statistics |
128 |
|
|
as often as the model dynamic statistic diagnostics (dynsys) are written (or |
129 |
|
|
as prescribed by the runtime flag \textbf{PTRACERS\_monitorFreq}, set in {\it data.ptracers}). |
130 |
edhill |
1.1 |
There is also a placeholder for any tracer experiment |
131 |
|
|
specific diagnostics to be calculated and printed to files. |
132 |
|
|
This is done in {\it gchem\_diags.F}. For instance the time average CO2 |
133 |
|
|
air-sea fluxes, and sea surface pH (among others) are written |
134 |
mlosch |
1.3 |
out by {\it dic\_biotic\_diags.F} which is called from {\it gchem\_diags.F}. |
135 |
edhill |
1.1 |
|
136 |
edhill |
1.6 |
\subsubsection{GCHEM Diagnostics} |
137 |
molod |
1.5 |
\label{sec:pkg:gchem:diagnostics} |
138 |
|
|
|
139 |
stephd |
1.9 |
These diagnostics are particularly for the {\bf dic} package. |
140 |
|
|
|
141 |
edhill |
1.7 |
{\footnotesize |
142 |
molod |
1.5 |
\begin{verbatim} |
143 |
|
|
|
144 |
|
|
------------------------------------------------------------------------ |
145 |
|
|
<-Name->|Levs|<-parsing code->|<-- Units -->|<- Tile (max=80c) |
146 |
|
|
------------------------------------------------------------------------ |
147 |
|
|
DICBIOA | 15 |SM P MR |mol/m3/sec |Biological Productivity (mol/m3/s) |
148 |
|
|
DICCARB | 15 |SM P MR |mol eq/m3/sec |Carbonate chg-biol prod and remin (mol eq/m3/s) |
149 |
|
|
DICTFLX | 1 |SM P L1 |mol/m3/sec |Tendency of DIC due to air-sea exch (mol/m3/s) |
150 |
|
|
DICOFLX | 1 |SM P L1 |mol/m3/sec |Tendency of O2 due to air-sea exch (mol/m3/s) |
151 |
|
|
DICCFLX | 1 |SM P L1 |mol/m2/sec |Flux of CO2 - air-sea exch (mol/m2/s) |
152 |
|
|
DICPCO2 | 1 |SM P M1 |atm |Partial Pressure of CO2 (atm) |
153 |
|
|
DICPHAV | 1 |SM P M1 |dimensionless |pH (dimensionless) |
154 |
|
|
\end{verbatim} |
155 |
edhill |
1.7 |
} |
156 |
molod |
1.5 |
|
157 |
molod |
1.4 |
\subsubsection{Do's and Don'ts} |
158 |
edhill |
1.1 |
|
159 |
mlosch |
1.3 |
The pkg ptracer is required with use with this pkg. Also, as usual, the |
160 |
|
|
runtime flag \textbf{useGCHEM} must be set to \textbf{.TRUE.} in \textbf{data.pkg}. |
161 |
|
|
By itself, gchem pkg will read in \textbf{data.gchem} and will |
162 |
|
|
write out gchem diagnostics. It requires tracer experiment |
163 |
edhill |
1.1 |
specific calls to do anything else (for instance the calls |
164 |
|
|
to dic and cfc pkgs). |
165 |
|
|
|
166 |
molod |
1.4 |
\subsubsection{Reference Material} |
167 |
edhill |
1.1 |
|
168 |
molod |
1.8 |
\subsubsection{Experiments and tutorials that use gchem} |
169 |
|
|
\label{sec:pkg:gchem:experiments} |
170 |
|
|
|
171 |
|
|
\begin{itemize} |
172 |
stephd |
1.9 |
\item{Global Ocean biogeochemical tutorial, in tutorial\_global\_oce\_biogeo verification directory, |
173 |
|
|
described in section \ref{sect:eg-biogeochem_tutorial} uses gchem and dic } |
174 |
|
|
|
175 |
|
|
\item{Global Ocean cfc tutorial, in tutorial\_cfc\_offline verification directory, |
176 |
|
|
uses gchem and cfc (and offline) described in \ref{sect:eg-cfc_offline} } |
177 |
|
|
|
178 |
|
|
\item{Global Ocean online cfc example in cfc\_example verification directory, |
179 |
|
|
uses gchem and cfc} |
180 |
|
|
|
181 |
|
|
|
182 |
|
|
|
183 |
molod |
1.8 |
\end{itemize} |
184 |
|
|
|