30 |
can be relaxed or not and can have its own timescale |
can be relaxed or not and can have its own timescale |
31 |
$\tau_T$. These are set in data.rbcs (see below). |
$\tau_T$. These are set in data.rbcs (see below). |
32 |
|
|
33 |
|
|
34 |
\subsubsection {Key subroutines and parameters} |
\subsubsection {Key subroutines and parameters} |
35 |
|
|
36 |
The only change need in the code might be in {RBCS.H}, for |
The only compile-time parameter you are likely to have to change is in {RBCS.h}, |
37 |
PARAMETER(maskLEN = 3 ), if you need more than 3 |
the number of masks, PARAMETER(maskLEN = 3 ), see below. |
|
masks (see below). |
|
38 |
|
|
39 |
\vspace{.5cm} |
The runtime parameters are set in {\it data.rbcs}: |
40 |
|
|
41 |
|
\vspace{.5cm} |
42 |
\noindent |
\noindent |
|
There are runtime parameters |
|
|
set in {\it data.rbcs}:\\ |
|
|
These runtime options include\\ |
|
43 |
Set in {RBCS\_PARM01}:\\ |
Set in {RBCS\_PARM01}:\\ |
44 |
$\bullet$ Parameters to set the timing for periodic fields to |
$\bullet$ {\bf rbcsForcingPeriod}: time interval between forcing fields |
45 |
relax to are to |
(in seconds), zero means constant-in-time forcing.\\ |
46 |
be loaded are: {\it rbcs\_ForcingPeriod}, {\it rbcs\_ForcingCycle}. |
$\bullet$ {\bf rbcsForcingCycle}: repeat cycle of forcing fields (in seconds), |
47 |
The former is how often to load, the latter is how often to cycle |
zero means non-cyclic forcing.\\ |
48 |
through those fields (eg. period couple be monthly and cycle one year). |
$\bullet$ {\bf rbcsForcingOffset}: time offset of forcing fields |
49 |
rbcs\_ForcingCycle=0 meaning no periodic forcing, and the relax field |
(in seconds, default 0); this is relative to time averages starting at |
50 |
is only read in at the beginning of the run and kept constant |
$t=0$, i.e., the first forcing record/file is placed at |
51 |
the rest of the run. Default is 0. |
${\rm rbcsForcingOffset+rbcsForcingPeriod}/2$; see below for examples.\\ |
52 |
\\ |
$\bullet$ {\bf rbcsSingleTimeFiles}: true or false (default false), |
53 |
$\bullet$ {\bf rbcsIniter}: if you want to offset rbcs forcing |
if true, forcing fields are given 1 file per rbcsForcingPeriod.\\ |
54 |
timing. Default is nIter0.\\ |
$\bullet$ {\bf deltaTrbcs}: time step used to compute the iteration numbers |
55 |
|
for rbcsSingleTimeFiles=T.\\ |
56 |
|
$\bullet$ {\bf rbcsIter0}: shift in iteration numbers used to label files if |
57 |
|
rbcsSingleTimeFiles=T (default 0, see below for examples).\\ |
58 |
$\bullet$ {\bf useRBCtemp}: true or false (default false)\\ |
$\bullet$ {\bf useRBCtemp}: true or false (default false)\\ |
59 |
$\bullet$ {\bf useRBCsalt}: true or false (default false)\\ |
$\bullet$ {\bf useRBCsalt}: true or false (default false)\\ |
60 |
$\bullet$ {\bf useRBCptracers}: true or false (default false), must be using |
$\bullet$ {\bf useRBCptracers}: true or false (default false), must be using |
62 |
$\bullet$ {\bf tauRelaxT}: timescale in seconds of relaxing |
$\bullet$ {\bf tauRelaxT}: timescale in seconds of relaxing |
63 |
in temperature ($\tau_T$ in equation above). |
in temperature ($\tau_T$ in equation above). |
64 |
Where mask is 1, relax rate will be |
Where mask is 1, relax rate will be |
65 |
1/tauRelaxT. Default is 1. |
1/tauRelaxT. Default is 1.\\ |
66 |
$\bullet$ {\bf tauRelaxS}: same for salinity. |
$\bullet$ {\bf tauRelaxS}: same for salinity.\\ |
67 |
$\bullet$ {\bf relaxMaskFile(irbc)}: filename of 3-D file |
$\bullet$ {\bf relaxMaskFile(irbc)}: filename of 3-D file |
68 |
with mask ($M_{rbc}$ in equation above. |
with mask ($M_{rbc}$ in equation above. |
69 |
Need a file for each irbc. 1=temperature, |
Need a file for each irbc. 1=temperature, |
71 |
end (see maskLEN) are less than the number tracers, then |
end (see maskLEN) are less than the number tracers, then |
72 |
relaxMaskFile(maskLEN) is used for all remaining ptracers.\\ |
relaxMaskFile(maskLEN) is used for all remaining ptracers.\\ |
73 |
$\bullet$ {\bf relaxTFile}: name of file where temperatures |
$\bullet$ {\bf relaxTFile}: name of file where temperatures |
74 |
that need to be realxed to ($T_{rbc}$ in equation above) |
that need to be relaxed to ($T_{rbc}$ in equation above) |
75 |
are stored. Need 3-D fields to |
are stored. The file must contain 3-D records to match the model domain. |
76 |
match model domain, and as many entries as given by |
If rbcsSingleTimeFiles=F, it must have one record for each forcing period. |
77 |
rbcsForcingPeriod and rbcsForcingCycle.\\ |
If T, there must be a separate file for each period and a 10-digit iteration |
78 |
|
number is appended to the file name (see Table~\ref{tab:pkg:rbcs:timing} |
79 |
|
and examples below).\\ |
80 |
$\bullet$ {\bf relaxSFile}: same for salinity.\\ |
$\bullet$ {\bf relaxSFile}: same for salinity.\\ |
81 |
|
|
82 |
\vspace{.5cm} |
\vspace{.5cm} |
89 |
fields.\\ |
fields.\\ |
90 |
|
|
91 |
|
|
92 |
|
\subsubsection{Timing of relaxation forcing fields} |
93 |
|
|
94 |
|
For constant-in-time relaxation, set rbcsForcingPeriod=0. |
95 |
|
For time-varying relaxation, Table~\ref{tab:pkg:rbcs:timing} illustrates the |
96 |
|
relation between model time and forcing fields (either records in |
97 |
|
one big file or, for rbcsSingleTimeFiles=T, individual files labeled with an |
98 |
|
iteration number). With rbcsSingleTimeFiles=T, this is the same as in the |
99 |
|
offline package, except that the forcing offset is in seconds. |
100 |
|
\newcommand{\dtr}{\Delta t_{\text{rbcs}}}% |
101 |
|
\begin{table} |
102 |
|
\centering |
103 |
|
\begin{tabular}{|l|l|l|c|} |
104 |
|
\hline |
105 |
|
& |
106 |
|
\multicolumn{2}{|c|}{rbcsSingleTimeFiles = T} & |
107 |
|
F \\ |
108 |
|
& |
109 |
|
\textbf{$c=0$} & |
110 |
|
\textbf{$c\ne0$} & |
111 |
|
\textbf{$c\ne0$} |
112 |
|
\\ \hline |
113 |
|
\textbf{model time} & |
114 |
|
\textbf{file number} & |
115 |
|
\textbf{file number} & |
116 |
|
\textbf{record} \\ |
117 |
|
\hline \hline |
118 |
|
$t_0 - p/2$ & $i_0$ & $i_0 + c/\dtr$ & $c/p$ \\ \hline |
119 |
|
$t_0 + p/2$ & $i_0 + p/\dtr$ & $i_0 + p/\dtr$ & $1$ \\ \hline |
120 |
|
$t_0 + p + p/2$ & $i_0 + 2 p/\dtr$ & $i_0 + 2 p/\dtr$ & $2$ \\ \hline |
121 |
|
\dots & \dots & \dots & \dots \\ \hline |
122 |
|
$t_0 + c - p/2$ & \dots & $i_0 + c/\dtr$ & $c/p$ \\ \hline |
123 |
|
\dots & \dots & \dots & \dots \\ \hline |
124 |
|
\end{tabular} |
125 |
|
\qquad |
126 |
|
\begin{tabular}{c@{${}={}$}l} |
127 |
|
\multicolumn{2}{l}{} \\[4ex] |
128 |
|
\multicolumn{2}{l}{where} \\[1ex] |
129 |
|
$p$ & rbcsForcingPeriod \\ |
130 |
|
$c$ & rbcsForcingCycle \\ |
131 |
|
$t_0$ & rbcsForcingOffset \\ |
132 |
|
$i_0$ & rbcsIter0 \\ |
133 |
|
$\dtr$ & deltaTrbcs \\ |
134 |
|
\end{tabular}\\[3ex] |
135 |
|
\caption{Timing of relaxation forcing fields.} |
136 |
|
\label{tab:pkg:rbcs:timing} |
137 |
|
\end{table} |
138 |
|
|
139 |
|
|
140 |
|
\subsubsection{Example 1: forcing with time averages starting at $t=0$} |
141 |
|
|
142 |
|
\paragraph{Cyclic data in a single file.} Set rbcsSingleTimeFiles=F and |
143 |
|
rbcsForcingOffset=0, and the model will start by interpolating the last and first |
144 |
|
records of rbcs data, placed at $-p/2$ and $p/2$, resp., as appropriate for fields |
145 |
|
averaged over the time intervals $[-p, 0]$ and $[0, p]$. |
146 |
|
|
147 |
|
\paragraph{Non-cyclic data, multiple files.} Set rbcsForcingCycle=0 and |
148 |
|
rbcsSingleTimeFiles=T. With rbcsForcingOffset=0, rbcsIter0=0 and |
149 |
|
deltaTrbcs=rbcsForcingPeriod, the model would then start by interpolating data from |
150 |
|
files relax*File.0000000000.data and relax*File.0000000001.data, \dots, |
151 |
|
again placed at $-p/2$ and $p/2$. |
152 |
|
|
153 |
|
|
154 |
|
\subsubsection{Example 2: forcing with snapshots starting at $t=0$} |
155 |
|
|
156 |
|
\paragraph{Cyclic data in a single file.} Set rbcsSingleTimeFiles=F and |
157 |
|
rbcsForcingOffset=$-p/2$, and the model will start forcing with the first |
158 |
|
record at $t=0$. |
159 |
|
|
160 |
|
\paragraph{Non-cyclic data, multiple files.} Set rbcsForcingCycle=0 and |
161 |
|
rbcsSingleTimeFiles=T. In this case, it is more natural to set |
162 |
|
rbcsForcingOffset=$+p/2$. |
163 |
|
With rbcsIter0=0 and deltaTrbcs=rbcsForcingPeriod, the model would then start |
164 |
|
with data from files relax*File.0000000000.data at $t=0$. |
165 |
|
It would then proceed to interpolate between this file and files |
166 |
|
relax*File.0000000001.data at $t={}$rbcsForcingPeriod. |
167 |
|
|
168 |
|
|
169 |
\subsubsection{Do's and Don'ts} |
\subsubsection{Do's and Don'ts} |
170 |
|
|
171 |
\subsubsection{Reference Material} |
\subsubsection{Reference Material} |
173 |
\subsubsection{Experiments and tutorials that use rbcs} |
\subsubsection{Experiments and tutorials that use rbcs} |
174 |
\label{sec:pkg:rbcs:experiments} |
\label{sec:pkg:rbcs:experiments} |
175 |
|
|
176 |
|
In the directory \code{verifcation}, the following experiments use |
177 |
|
\code{rbcs}: |
178 |
|
\begin{itemize} |
179 |
|
\item \code{exp4}: box with 4 open boundaries, simulating flow over a |
180 |
|
Gaussian bump based on \citet{adcroft:97}. |
181 |
|
\end{itemize} |
182 |
|
|
183 |
|
|
184 |
|
|
185 |
\end{itemize} |
%%% \end{itemize} |
186 |
|
|