/[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.4 by jahn, Fri Jul 29 18:36:38 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.\\
 rbcs\_ForcingPeriod=0 non-time-varying forcing, where the relax field  
 is only read in at the beginning of the run and kept constant  
 the rest of the run. Default is 0.  
 \\  
 $\bullet$  {\bf rbcsForcingOffset}: time offset of forcing fields (in seconds).  
 If the forcing fields are time averages over forcing periods,  
 then this must be set to the time at the beginning of the  
 first forcing period.  The fields will then be placed at time  
 rbcsForcingOffset+rbcsForcingPeriod/2 for interpolation.  Default is 0.  
 If you use snapshots and the first snapshot is at $t_1$, you need to set  
 \[  
   {\rm rbcsForcingOffset} = t_1 - {\rm rbcsForcingPeriod}/2  
 \]  
 (This used to be rbcsInIter and was in units of iterations.)\\  
52  $\bullet$  {\bf rbcsSingleTimeFiles}: true or false (default false),  $\bullet$  {\bf rbcsSingleTimeFiles}: true or false (default false),
53  if true, forcing fields are given 1 file per time labeled by iteration number.\\  if true, forcing fields are given 1 file per rbcsForcingPeriod.\\
54  $\bullet$  {\bf deltaTrbcs}: time step used to compute the iteration numbers  $\bullet$  {\bf deltaTrbcs}: time step used to compute the iteration numbers
55  for rbcsSingleTimeFiles=T.\\  for rbcsSingleTimeFiles=T.\\
56  $\bullet$  {\bf rbcsIter0}: shift in iteration numbers used to label files if  $\bullet$  {\bf rbcsIter0}: shift in iteration numbers used to label files if
57  rbcsSingleTimeFiles=T (default 0).  If the file for the first forcing period  rbcsSingleTimeFiles=T (default 0, see below for examples).\\
 (as specified by rbcsForcingOffset) has label $i_1$, you need to set  
 \[  
   {\rm rbcsIter0} = i_1 - {\rm rbcsForcingPeriod}/{\rm deltaTrbcs}  
 \]  
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 91  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 106  $\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  
   \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.  If you are not providing separate  
   files for each time (rbcsSingleTimeFiles=F), rbcsForcingOffset 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 rbcsForcingOffset${}=-$Period.  
   For other situations, see the description of rbcsForcingOffset above.  
   
 \item Cyclic Forcing:  
   \begin{quote}  
      rbcsForcingPeriod = period in seconds\\  
      rbcsForcingCycle = cycle in seconds  
   \end{quote}  
   The same comment as for non-cyclic forcing applies, but rbcsForcingOffset may now be  
   after the time of the first required record even with rbcsSingleTimeFiles=F, in which  
   case records from the end of the file will be used (via cyclicity).  
 \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 = iteration number of first file $-$ rbcsForcingPeriod/deltaTrbcs  
   \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 to it.  
   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}

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

  ViewVC Help
Powered by ViewVC 1.1.22