/[MITgcm]/manual/s_phys_pkgs/text/rbcs.tex
ViewVC logotype

Diff of /manual/s_phys_pkgs/text/rbcs.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by jahn, Tue Jan 18 20:38:16 2011 UTC revision 1.5 by jahn, Tue Mar 4 20:20:48 2014 UTC
# Line 30  each of these Line 30  each of these
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:  $\bullet$ {\bf rbcsForcingCycle}: repeat cycle of forcing fields (in seconds),
47  $\bullet$ {\bf rbcsForcingPeriod}, {\bf rbcsForcingCycle}: timing of  zero means non-cyclic forcing.\\
48  fields to relax to.  $\bullet$  {\bf rbcsForcingOffset}: time offset of forcing fields
49  The former is how often to load, the latter is how often to cycle  (in seconds, default 0); this is relative to time averages starting at
50  through those fields (eg. period could be monthly and cycle one year).  $t=0$, i.e., the first forcing record/file is placed at
51  rbcs\_ForcingCycle=0 means non-cyclic forcing, and  ${\rm rbcsForcingOffset+rbcsForcingPeriod}/2$; see below for examples.\\
52  rbcs\_ForcingPeriod=0 non-time-varying forcing, where the relax field  $\bullet$  {\bf rbcsSingleTimeFiles}: true or false (default false),
53  is only read in at the beginning of the run and kept constant  if true, forcing fields are given 1 file per rbcsForcingPeriod.\\
54  the rest of the run. Default is 0.  $\bullet$  {\bf deltaTrbcs}: time step used to compute the iteration numbers
55  \\  for rbcsSingleTimeFiles=T.\\
56  $\bullet$  {\bf rbcsForcingOffset}: if you want to offset rbcs forcing  $\bullet$  {\bf rbcsIter0}: shift in iteration numbers used to label files if
57  timing. This is the time at the beginning of the first forcing period  rbcsSingleTimeFiles=T (default 0, see below for examples).\\
 (in seconds).  Default is 0.  (This used to be rbcsInIter and was in  
 units of iterations.)\\  
 $\bullet$  {\bf rbcsSingleTimeFiles}: if true, relax fields are given  
 1 file per time labeled by iteration number.\\  
 $\bullet$  {\bf deltaTrbcs}: time step used to compute iteration numbers  
 for rbcsSingleTimeFiles.\\  
 $\bullet$  {\bf rbcsIter0}: rbcsSingleTimeFiles iteration number  
 corresponding to rbcsForcingOffset.\\  
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
# Line 72  ptracers to set true\\ Line 62  ptracers to set true\\
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,
# Line 81  Need a file for each irbc. 1=temperature Line 71  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}
# Line 96  $\bullet$ {\bf tauRelaxPTR(iTrc)}: relax Line 88  $\bullet$ {\bf tauRelaxPTR(iTrc)}: relax
88  $\bullet$ {\bf relaxPtracerFile(iTrc)}: file with relax  $\bullet$ {\bf relaxPtracerFile(iTrc)}: file with relax
89  fields.\\  fields.\\
90    
 \noindent  
 Typical ways of specifying timing of relaxation fields:  
 \begin{enumerate}  
 \item Constant-in-time forcing:  
   \begin{quote}  
      rbcsForcingPeriod = 0  
   \end{quote}  
   One field is read and used for all times.  Use this to emulate the result of  
   rbcsForcingCycle=0 before 2010-11-10.  
   
 \item Non-cyclic time-varying forcing:  
   \begin{quote}  
      rbcsForcingPeriod = period in seconds\\  
      rbcsForcingCycle = 0\\  
      rbcsForcingOffset = beginning of first forcing period in seconds (default 0)  
   \end{quote}  
   When starting the run at time 0 (as usually the case), a period with center before  
   or at time 0 is needed for time interpolation, hence Offset needs to be negative.  
   For aligned periods (one period starting at time 0) and one extra record before  
   time 0 (and ending at time 0), set Offset=-Period.  
   
   This option makes most sense with rbcsSingleTimeFiles=T (see below), but may be  
   used with either setting.  
   
 \item Cyclic Forcing:  
   \begin{quote}  
      rbcsForcingPeriod = period in seconds\\  
      rbcsForcingCycle = cycle in seconds\\  
      rbcsForcingOffset = beginning of first forcing period in seconds (default 0)  
   \end{quote}  
   Here Offset may be at or after the start time (actually starttime-period/2),  
   in which case records from the end of the cycle are used for missing records at  
   the beginning (via cyclicity).  Not very nice, but works.  
   
   This is the traditional way used with rbcsSingleTimeFiles=F, but again may be  
   used with either setting.  
 \end{enumerate}  
91    
92  \noindent  \subsubsection{Timing of relaxation forcing fields}
 Ways to organize the files:  
 \begin{enumerate}  
 \item One big file with many time records:  
   \begin{quote}  
      rbcsSingleTimeFiles = .False.  
   \end{quote}  
   All time records are in one big file.  
   
 \item A separate file for each time:  
   \begin{quote}  
      rbcsSingleTimeFiles = .True.\\  
      deltaTrbcs = time step used to generate forcing files\\  
      rbcsIter0 = forcing file iteration number corresponding to rbcsForcingOffset  
   \end{quote}  
   The rbcs field for each time needed is in a separate file, labeled by the  
   iteration number at the end of the forcing period.  If a different timestep  
   was used for generating the files (and the file names), set deltaTrbcs.  
   If there is a shift in time, set rbcsIter0.  
 \end{enumerate}  
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}
# Line 164  Ways to organize the files: Line 173  Ways to organize the files:
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}

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22