1 |
\subsection{OBCS: Open boundary conditions for regional modeling} |
2 |
|
3 |
\label{sec:pkg:obcs} |
4 |
\begin{rawhtml} |
5 |
<!-- CMIREDIR:package_obcs: --> |
6 |
\end{rawhtml} |
7 |
|
8 |
Authors: |
9 |
Alistair Adcroft, Patrick Heimbach, Samar Katiwala, Martin Losch |
10 |
|
11 |
\subsubsection{Introduction |
12 |
\label{sec:pkg:obcs:intro}} |
13 |
|
14 |
|
15 |
|
16 |
%---------------------------------------------------------------------- |
17 |
|
18 |
\subsubsection{OBCS configuration and compiling |
19 |
\label{sec:pkg:obcs:comp}} |
20 |
|
21 |
As with all MITgcm packages, OBCS can be turned on or off |
22 |
at compile time |
23 |
% |
24 |
\begin{itemize} |
25 |
% |
26 |
\item |
27 |
using the \texttt{packages.conf} file by adding \texttt{obcs} to it, |
28 |
% |
29 |
\item |
30 |
or using \texttt{genmake2} adding |
31 |
\texttt{-enable=obcs} or \texttt{-disable=obcs} switches |
32 |
% |
33 |
\item |
34 |
\textit{Required packages and CPP options:} \\ |
35 |
% |
36 |
To alternatives are available for prescribing open boundary values, |
37 |
which differ in the way how OB's are treated in time: |
38 |
A simple time-management (e.g. constant in time, or cyclic with |
39 |
fixed fequency) is provided through |
40 |
S/R \texttt{obcs\_external\_fields\_load}. |
41 |
More sophisticated ``real-time'' (i.e. calendar time) management is |
42 |
available through \texttt{obcs\_prescribe\_read}. |
43 |
The latter case requires |
44 |
packages \texttt{cal} and \texttt{exf} to be enabled. |
45 |
% |
46 |
\end{itemize} |
47 |
(see also Section \ref{sec:buildingCode}). |
48 |
|
49 |
Parts of the OBCS code can be enabled or disabled at compile time |
50 |
via CPP preprocessor flags. These options are set in |
51 |
\texttt{OBCS\_OPTIONS.h}. Table \ref{tab:pkg:obcs:cpp} summarizes them. |
52 |
|
53 |
\begin{table}[!ht] |
54 |
\centering |
55 |
\label{tab:pkg:obcs:cpp} |
56 |
{\footnotesize |
57 |
\begin{tabular}{|l|l|} |
58 |
\hline |
59 |
\textbf{CPP option} & \textbf{Description} \\ |
60 |
\hline \hline |
61 |
\texttt{ALLOW\_OBCS\_NORTH} & |
62 |
enable Northern OB \\ |
63 |
\texttt{ALLOW\_OBCS\_SOUTH} & |
64 |
enable Southern OB \\ |
65 |
\texttt{ALLOW\_OBCS\_EAST} & |
66 |
enable Eastern OB \\ |
67 |
\texttt{ALLOW\_OBCS\_WEST} & |
68 |
enable Western OB \\ |
69 |
\hline |
70 |
\texttt{ALLOW\_OBCS\_PRESCRIBE} & |
71 |
enable code for prescribing OB's \\ |
72 |
\texttt{ALLOW\_OBCS\_SPONGE} & |
73 |
enable sponge layer code \\ |
74 |
\texttt{ALLOW\_OBCS\_BALANCE} & |
75 |
enable code for balancing transports through OB's \\ |
76 |
\texttt{ALLOW\_ORLANSKI} & |
77 |
enable Orlanski radiation conditions at OB's \\ |
78 |
\hline |
79 |
\end{tabular} |
80 |
} |
81 |
\caption{~} |
82 |
\end{table} |
83 |
|
84 |
|
85 |
%---------------------------------------------------------------------- |
86 |
|
87 |
\subsubsection{Run-time parameters |
88 |
\label{sec:pkg:obcs:runtime}} |
89 |
|
90 |
Run-time parameters are set in files |
91 |
\texttt{data.pkg}, \texttt{data.obcs}, and \texttt{data.exf} |
92 |
if ``real-time'' prescription is requested |
93 |
(i.e. package \texttt{exf} enabled). |
94 |
These parameter files are read in S/R |
95 |
\texttt{packages\_readparms.F}, \texttt{obcs\_readparms.F}, and |
96 |
\texttt{exf\_readparms.F}, respectively. |
97 |
Run-time parameters may be broken into 3 categories: |
98 |
(i) switching on/off the package at runtime, |
99 |
(ii) OBCS package flags and parameters, |
100 |
(iii) additional timing flags in \texttt{data.exf}, if selected. |
101 |
|
102 |
\paragraph{Enabling the package} |
103 |
~ \\ |
104 |
% |
105 |
The OBCS package is switched on at runtime by setting |
106 |
\texttt{useOBCS = .TRUE.} in \texttt{data.pkg}. |
107 |
|
108 |
\paragraph{Package flags and parameters} |
109 |
~ \\ |
110 |
% |
111 |
Table \ref{tab:pkg:obcs:runtime_flags} summarizes the |
112 |
runtime flags that are set in \texttt{data.obcs}, and |
113 |
their default values. |
114 |
|
115 |
\begin{table}[!ht] |
116 |
\centering |
117 |
{\footnotesize |
118 |
\begin{tabular}{|l|c|l|} |
119 |
\hline |
120 |
\textbf{Flag/parameter} & \textbf{default} & \textbf{Description} \\ |
121 |
\hline \hline |
122 |
\multicolumn{3}{|c|}{\textit{basic flags \& parameters} } \\ |
123 |
\hline |
124 |
OB\_Jnorth & 0 & |
125 |
Nx-vector of J-indices (w.r.t. Ny) of Northern OB |
126 |
at each I-position (w.r.t. Nx) \\ |
127 |
OB\_Jsouth & 0 & |
128 |
Nx-vector of J-indices (w.r.t. Ny) of Southern OB |
129 |
at each I-position (w.r.t. Nx) \\ |
130 |
OB\_Ieast & 0 & |
131 |
Ny-vector of I-indices (w.r.t. Nx) of Eastern OB |
132 |
at each J-position (w.r.t. Ny) \\ |
133 |
OB\_Iwest & 0 & |
134 |
Ny-vector of I-indices (w.r.t. Nx) of Western OB |
135 |
at each J-position (w.r.t. Ny) \\ |
136 |
useOBCSprescribe & \texttt{.FALSE.} & |
137 |
~ \\ |
138 |
useOBCSsponge & \texttt{.FALSE.} & |
139 |
~ \\ |
140 |
useOBCSbalance & \texttt{.FALSE.} & |
141 |
~ \\ |
142 |
OB\textbf{X}\textbf{y}File & ~ & |
143 |
file name of OB field \\ |
144 |
~ & ~ & |
145 |
\textbf{X}: \textbf{N}(orth), \textbf{S}(outh), |
146 |
\textbf{E}(ast), \textbf{W}(est) \\ |
147 |
~ & ~ & |
148 |
\textbf{y}: \textbf{t}(emperature), \textbf{s}(salinity), |
149 |
\textbf{u}(-velocity), \textbf{v}(-velocity) \\ |
150 |
\hline |
151 |
\multicolumn{3}{|c|}{\textit{Orlanski parameters} } \\ |
152 |
\hline |
153 |
cvelTimeScale & 2000 sec & |
154 |
averaging period for phase speed \\ |
155 |
CMAX & 0.45 m/s & |
156 |
maximum allowable phase speed-CFL for AB-II \\ |
157 |
CFIX & 0.8 m/s & |
158 |
fixed boundary phase speed \\ |
159 |
useFixedCEast & .FALSE. & |
160 |
~ \\ |
161 |
useFixedCWest & .FALSE. & |
162 |
~ \\ |
163 |
\hline |
164 |
\multicolumn{3}{|c|}{\textit{Sponge-layer parameters} } \\ |
165 |
\hline |
166 |
spongeThickness & 0 & |
167 |
sponge layer thickness (in \# grid points) \\ |
168 |
Urelaxobcsinner & 0 sec & |
169 |
relaxation time scale at the |
170 |
innermost sponge layer point of a meridional OB \\ |
171 |
Vrelaxobcsinner & 0 sec & |
172 |
relaxation time scale at the |
173 |
innermost sponge layer point of a zonal OB \\ |
174 |
Urelaxobcsbound & 0 sec & |
175 |
relaxation time scale at the |
176 |
outermost sponge layer point of a meridional OB \\ |
177 |
Vrelaxobcsbound & 0 sec & |
178 |
relaxation time scale at the |
179 |
outermost sponge layer point of a zonal OB \\ |
180 |
\hline |
181 |
\hline |
182 |
\end{tabular} |
183 |
} |
184 |
\caption{pkg OBCS run-time parameters} |
185 |
\label{tab:pkg:obcs:runtime_flags} |
186 |
\end{table} |
187 |
|
188 |
|
189 |
|
190 |
%---------------------------------------------------------------------- |
191 |
|
192 |
\subsubsection{Defining open boundary positions |
193 |
\label{sec:pkg:obcs:defining}} |
194 |
|
195 |
There are four open boundaries (OBs), a |
196 |
Northern, Southern, Eastern, and Western. |
197 |
All OB locations are specified by their absolute |
198 |
meridional (Northern/Southern) or zonal (Eastern/Western) indices. |
199 |
Thus, for each zonal position $i=1,\ldots,Nx$ a meridional index |
200 |
$j$ specifies the Northern/Southern OB position, |
201 |
and for each meridional position $j=1,\ldots,Ny$, a zonal index |
202 |
$i$ specifies the Eastern/Western OB position. |
203 |
For Northern/Southern OB this defines an $Nx$-dimensional |
204 |
``row'' array $\tt OB\_Jnorth(Ny)$ / $\tt OB\_Jsouth(Ny)$, |
205 |
and an $Ny$-dimenisonal |
206 |
``column'' array $\tt OB\_Ieast(Nx)$ / $\tt OB\_Iwest(Nx)$ |
207 |
Positions determined in this way allows Northern/Southern |
208 |
OBs to be at variable $j$ (or $y$) positions, and Eastern/Western |
209 |
OBs at variable $i$ (or $x$) positions. |
210 |
Here, indices refer to tracer points on the C-grid. |
211 |
A zero (0) element in $\tt OB\_I\ldots$, $\tt OB\_J\ldots$ |
212 |
means there is no corresponding OB in that column/row. |
213 |
For a Northern/Southern OB, the OB V point is to the South/North. |
214 |
For an Eastern/Western OB, the OB U point is to the West/East. |
215 |
|
216 |
\begin{verbatim} |
217 |
For example |
218 |
OB_Jnorth(3)=34 means that: |
219 |
T( 3 ,34) is a an OB point |
220 |
U(3:4,34) is a an OB point |
221 |
V( 4 ,34) is a an OB point |
222 |
while |
223 |
OB_Jsouth(3)=1 means that: |
224 |
T( 3 ,1) is a an OB point |
225 |
U(3:4,1) is a an OB point |
226 |
V( 4 ,2) is a an OB point |
227 |
\end{verbatim} |
228 |
|
229 |
For convenience, negative values for Jnorth/Ieast refer to |
230 |
points relative to the Northern/Eastern edges of the model |
231 |
eg. $\tt OB\_Jnorth(3)=-1$ means that the point $\tt (3,Ny)$ |
232 |
is a northern OB. |
233 |
|
234 |
\noindent |
235 |
\textsf{Add special comments for case \#define NONLIN\_FRSURF, |
236 |
see obcs\_ini\_fixed.F} |
237 |
|
238 |
%---------------------------------------------------------------------- |
239 |
|
240 |
\subsubsection{Equations and key routines |
241 |
\label{sec:pkg:obcs:equations}} |
242 |
|
243 |
\paragraph{OBCS\_READPARMS:} ~ \\ |
244 |
Set OB positions through arrays |
245 |
{\tt OB\_Jnorth(Ny), OB\_Jsouth(Ny), OB\_Ieast(Nx), OB\_Iwest(Nx)}, |
246 |
and runtime flags (see Table \ref{tab:pkg:obcs:runtime_flags}). |
247 |
|
248 |
\paragraph{OBCS\_CALC:} ~ \\ |
249 |
% |
250 |
Top-level routine for filling values to be applied at OB for |
251 |
$T,S,U,V,\eta$ into corresponding |
252 |
``slice'' arrays $(x,z)$, $(y,z)$ for each OB: |
253 |
$\tt OB[N/S/E/W][t/s/u/v]$; e.g. for salinity array at |
254 |
Southern OB, array name is $\tt OBSt$. |
255 |
Values filled are either |
256 |
% |
257 |
\begin{itemize} |
258 |
% |
259 |
\item |
260 |
constant vertical $T,S$ profiles as specified in file |
261 |
{\tt data} ({\tt tRef(Nr), sRef(Nr)}) with zero velocities $U,V$, |
262 |
% |
263 |
\item |
264 |
$T,S,U,V$ values determined via Orlanski radiation conditions |
265 |
(see below), |
266 |
% |
267 |
\item |
268 |
prescribed time-constant or time-varying fields (see below). |
269 |
% |
270 |
\end{itemize} |
271 |
|
272 |
|
273 |
\paragraph{ORLANSKI} ~ \\ |
274 |
% |
275 |
Orlanski radiation conditions \citep{orl:76} |
276 |
|
277 |
\paragraph{OBCS\_PRESCRIBE\_READ} Setting OB fields and updates \\ |
278 |
% |
279 |
~ |
280 |
|
281 |
\paragraph{OBCS\_BALANCE} ~ \\ |
282 |
% |
283 |
~ |
284 |
|
285 |
\paragraph{OBCS\_APPLY\_*:} ~ \\ |
286 |
~ |
287 |
|
288 |
\paragraph{OBCS\_SPONGE} Setting sponge layer characteristics \\ |
289 |
% |
290 |
~ |
291 |
|
292 |
\paragraph{OB's with nonlinear free surface} ~ \\ |
293 |
% |
294 |
~ |
295 |
|
296 |
|
297 |
%---------------------------------------------------------------------- |
298 |
|
299 |
\subsubsection{Flow chart |
300 |
\label{sec:pkg:obcs:flowchart}} |
301 |
|
302 |
|
303 |
{\footnotesize |
304 |
\begin{verbatim} |
305 |
|
306 |
C !CALLING SEQUENCE: |
307 |
c ... |
308 |
|
309 |
\end{verbatim} |
310 |
} |
311 |
|
312 |
%---------------------------------------------------------------------- |
313 |
|
314 |
\subsubsection{OBCS diagnostics |
315 |
\label{sec:pkg:obcs:diagnostics}} |
316 |
|
317 |
Diagnostics output is available via the diagnostics package |
318 |
(see Section \ref{sec:pkg:diagnostics}). |
319 |
Available output fields are summarized in |
320 |
Table \ref{tab:pkg:obcs:diagnostics}. |
321 |
|
322 |
\begin{table}[!ht] |
323 |
\centering |
324 |
\label{tab:pkg:obcs:diagnostics} |
325 |
{\footnotesize |
326 |
\begin{verbatim} |
327 |
------------------------------------------------------ |
328 |
<-Name->|Levs|grid|<-- Units -->|<- Tile (max=80c) |
329 |
------------------------------------------------------ |
330 |
|
331 |
\end{verbatim} |
332 |
} |
333 |
\caption{~} |
334 |
\end{table} |
335 |
|
336 |
%---------------------------------------------------------------------- |
337 |
|
338 |
\subsubsection{Reference experiments} |
339 |
|
340 |
|
341 |
|
342 |
%---------------------------------------------------------------------- |
343 |
|
344 |
\subsubsection{References} |
345 |
|
346 |
\subsubsection{Experiments and tutorials that use obcs} |
347 |
\label{sec:pkg:obcs:experiments} |
348 |
|
349 |
\begin{itemize} |
350 |
\item{Ocean experiment in exp4 verification directory. } |
351 |
\end{itemize} |
352 |
|