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

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

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

revision 1.6 by mlosch, Fri Feb 25 17:26:17 2011 UTC revision 1.18 by mlosch, Wed Jun 15 13:40:53 2016 UTC
# Line 11  Alistair Adcroft, Patrick Heimbach, Sama Line 11  Alistair Adcroft, Patrick Heimbach, Sama
11  \subsubsection{Introduction  \subsubsection{Introduction
12  \label{sec:pkg:obcs:intro}}  \label{sec:pkg:obcs:intro}}
13    
14    The OBCS-package is fundamental to regional ocean modelling with the
15    MITgcm, but there are so many details to be considered in
16    regional ocean modelling that this package cannot accomodate all
17    imaginable and possible options. Therefore, for a regional simulation
18    with very particular details, it is recommended to familiarize oneself
19    not only with the compile- and runtime-options of this package, but
20    also with the code itself. In many cases it will be necessary to adapt
21    the obcs-code (in particular \code{S/R OBCS\_CALC}) to the application
22    in question; in these cases the obcs-package (together with the
23    rbcs-package, section \ref{sec:pkg:rbcs}) is a very
24    useful infrastructure for implementing special regional models.
25    
26  %----------------------------------------------------------------------  %----------------------------------------------------------------------
27    
# Line 95  Run-time parameters are set in files Line 105  Run-time parameters are set in files
105  \code{data.pkg}, \code{data.obcs}, and \code{data.exf}  \code{data.pkg}, \code{data.obcs}, and \code{data.exf}
106  if ``real-time'' prescription is requested  if ``real-time'' prescription is requested
107  (i.e. package \code{exf} enabled).  (i.e. package \code{exf} enabled).
108  These parameter files are read in S/R  vThese parameter files are read in S/R
109  \code{packages\_readparms.F}, \code{obcs\_readparms.F}, and  \code{packages\_readparms.F}, \code{obcs\_readparms.F}, and
110  \code{exf\_readparms.F}, respectively.  \code{exf\_readparms.F}, respectively.
111  Run-time parameters may be broken into 3 categories:  Run-time parameters may be broken into 3 categories:
# Line 143  their default values. Line 153  their default values.
153             ~ \\             ~ \\
154          useOBCSbalance & \code{.FALSE.} &          useOBCSbalance & \code{.FALSE.} &
155             ~ \\             ~ \\
156               OBCS\_balanceFacN/S/E/W & 1 & factor(s) determining the details
157               of the balaning code \\
158          useOrlanskiNorth/South/EastWest & \code{.FALSE.} &          useOrlanskiNorth/South/EastWest & \code{.FALSE.} &
159             turn on Orlanski boundary conditions for individual boundary\\             turn on Orlanski boundary conditions for individual boundary\\
160          useStevensNorth/South/EastWest & \code{.FALSE.} &          useStevensNorth/South/EastWest & \code{.FALSE.} &
# Line 221  $j$ specifies the Northern/Southern OB p Line 233  $j$ specifies the Northern/Southern OB p
233  and for each meridional position $j=1,\ldots,N_y$, a zonal index  and for each meridional position $j=1,\ldots,N_y$, a zonal index
234  $i$ specifies the Eastern/Western OB position.  $i$ specifies the Eastern/Western OB position.
235  For Northern/Southern OB this defines an $N_x$-dimensional  For Northern/Southern OB this defines an $N_x$-dimensional
236  ``row'' array $\tt OB\_Jnorth(Ny)$ / $\tt OB\_Jsouth(Ny)$,  ``row'' array $\tt OB\_Jnorth(Nx)$ / $\tt OB\_Jsouth(Nx)$,
237  and an $N_y$-dimenisonal  and an $N_y$-dimenisonal
238  ``column'' array $\tt OB\_Ieast(Nx)$ / $\tt OB\_Iwest(Nx)$.  ``column'' array $\tt OB\_Ieast(Ny)$ / $\tt OB\_Iwest(Ny)$.
239  Positions determined in this way allows Northern/Southern  Positions determined in this way allows Northern/Southern
240  OBs to be at variable $j$ (or $y$) positions, and Eastern/Western  OBs to be at variable $j$ (or $y$) positions, and Eastern/Western
241  OBs at variable $i$ (or $x$) positions.  OBs at variable $i$ (or $x$) positions.
# Line 232  A zero (0) element in $\tt OB\_I\ldots$, Line 244  A zero (0) element in $\tt OB\_I\ldots$,
244  means there is no corresponding OB in that column/row.  means there is no corresponding OB in that column/row.
245  For a Northern/Southern OB, the OB V point is to the South/North.  For a Northern/Southern OB, the OB V point is to the South/North.
246  For an Eastern/Western OB, the OB U point is to the West/East.  For an Eastern/Western OB, the OB U point is to the West/East.
247    For example,
248  \begin{verbatim}  \begin{tabbing}
249   For example    \code{OB\_Jnorth(3)=34} \=  means that:  \= \\
250       OB_Jnorth(3)=34  means that:    \> \code{T(3,34)} \> is a an OB point  \\
251            T( 3 ,34) is a an OB point    \> \code{U(3,34)} \> is a an OB point \\
252            U(3:4,34) is a an OB point    \> \code{V(3,34)} \> is a an OB point \\
253            V( 4 ,34) is a an OB point    \code{OB\_Jsouth(3)=1} \> means that: \\
254   while    \> \code{T(3,1)} \> is a an OB point \\
255       OB_Jsouth(3)=1  means that:    \> \code{U(3,1)} \> is a an OB point \\
256            T( 3 ,1) is a an OB point    \> \code{V(3,2)} \> is a an OB point \\
257            U(3:4,1) is a an OB point    \code{OB\_Ieast(10)=69} \>  means that:  \>  \\
258            V( 4 ,2) is a an OB point    \> \code{T(69,10)} \> is a an OB point \\
259  \end{verbatim}    \> \code{U(69,10)} \> is a an OB point \\
260      \> \code{V(69,10)} \> is a an OB point \\
261  For convenience, negative values for Jnorth/Ieast refer to    \code{OB\_Iwest(10)=1} \>  means that:  \>  \\
262      \> \code{T(1,10)} \> is a an OB point \\
263      \> \code{U(2,10)} \> is a an OB point \\
264      \> \code{V(1,10)} \> is a an OB point
265    \end{tabbing}
266    For convenience, negative values for \code{Jnorth}/\code{Ieast} refer to
267  points relative to the Northern/Eastern edges of the model  points relative to the Northern/Eastern edges of the model
268  eg. $\tt OB\_Jnorth(3)=-1$  means that the point $\tt (3,Ny)$  eg. $\tt OB\_Jnorth(3)=-1$  means that the point $\tt (3,Ny)$
269  is a northern OB.  is a northern OB.
270    
271    \noindent\textbf{Simple examples:} For a model grid with $ N_{x}\times
272    N_{y} = 120\times144$ horizontal grid points with four open boundaries
273    along the four egdes of the domain, the simplest way of specifying the
274    boundary points in \code{data.obcs} is:
275    \begin{verbatim}
276      OB_Ieast = 144*-1,
277    # or OB_Ieast = 144*120,
278      OB_Iwest = 144*1,
279      OB_Jnorth = 120*-1,
280    # or OB_Jnorth = 120*144,
281      OB_Jsouth = 120*1,
282    \end{verbatim}
283    If only the first $50$ grid points of the southern boundary are
284    boundary points:
285    \begin{verbatim}
286      OB_Jsouth(1:50) = 50*1,
287    \end{verbatim}
288    
289  \noindent  \noindent
290  \textsf{Add special comments for case \#define NONLIN\_FRSURF,  \textsf{Add special comments for case \#define NONLIN\_FRSURF,
291  see obcs\_ini\_fixed.F}  see obcs\_ini\_fixed.F}
# Line 262  see obcs\_ini\_fixed.F} Line 297  see obcs\_ini\_fixed.F}
297    
298  \paragraph{OBCS\_READPARMS:} ~ \\  \paragraph{OBCS\_READPARMS:} ~ \\
299  Set OB positions through arrays  Set OB positions through arrays
300  {\tt OB\_Jnorth(Ny), OB\_Jsouth(Ny), OB\_Ieast(Nx), OB\_Iwest(Nx)},  {\tt OB\_Jnorth(Nx), OB\_Jsouth(Nx), OB\_Ieast(Ny), OB\_Iwest(Ny)},
301  and runtime flags (see Table \ref{tab:pkg:obcs:runtime_flags}).  and runtime flags (see Table \ref{tab:pkg:obcs:runtime_flags}).
302    
303  \paragraph{OBCS\_CALC:} ~ \\  \paragraph{OBCS\_CALC:} ~ \\
# Line 291  prescribed time-constant or time-varying Line 326  prescribed time-constant or time-varying
326  use prescribed boundary fields to compute Stevens boundary conditions.  use prescribed boundary fields to compute Stevens boundary conditions.
327  \end{itemize}  \end{itemize}
328    
   
329  \paragraph{ORLANSKI:} ~ \\  \paragraph{ORLANSKI:} ~ \\
330  %  %
331  Orlanski radiation conditions \citep{orl:76}, examples can be found in  Orlanski radiation conditions \citep{orl:76}, examples can be found in
# Line 317  open boundary: Line 351  open boundary:
351  \item If non-hydrostatic dynamics are used  \item If non-hydrostatic dynamics are used
352    (\ref{sec:non-hydrostatic}), additional files    (\ref{sec:non-hydrostatic}), additional files
353    \code{OB[N/S/E/W]wFile} for the vertical velocity $w$ with    \code{OB[N/S/E/W]wFile} for the vertical velocity $w$ with
354    dimensions $(N_{x/y}\times N_r\times\mbox{time levels})$ may be    dimensions $(N_{x/y}\times N_r\times\mbox{time levels})$ can be
355    specified.    specified.
356  \item If \code{useSEAICE=.TRUE.} then additional files  \item If \code{useSEAICE=.TRUE.} then additional files
357    \code{OB[N/S/E/W][a,h,sl,sn,uice,vice]} for sea ice area, thickness    \code{OB[N/S/E/W][a,h,sl,sn,uice,vice]} for sea ice area, thickness
358    (\code{HEFF}), seaice salinity, snow and ice velocities    (\code{HEFF}), seaice salinity, snow and ice velocities
359    $(N_{x/y}\times\mbox{time levels})$ may be specified.    $(N_{x/y}\times\mbox{time levels})$ can be specified.
360  \end{itemize}  \end{itemize}
361  When the \code{exf}-package is used, the time levels are controlled  As in \code{S/R external\_fields\_load} or the \code{exf}-package, the
362  for each boundary separately in the same way as the \code{exf}-fields  code reads two time levels for each variable, e.g.\ \code{OBNu0} and
363  in \code{data.exf}, namelist \code{EXF\_NML\_OBCS}. The runtime flags  \code{OBNu1}, and interpolates linearly between these time levels to
364    obtain the value \code{OBNu} at the current model time (step). When the
365    \code{exf}-package is used, the time levels are controlled for each
366    boundary separately in the same way as the \code{exf}-fields in
367    \code{data.exf}, namelist \code{EXF\_NML\_OBCS}. The runtime flags
368  follow the above naming conventions, e.g. for the western boundary the  follow the above naming conventions, e.g. for the western boundary the
369  corresponding flags are \code{OBCWstartdate1/2} and  corresponding flags are \code{OBCWstartdate1/2} and
370  \code{OBCWperiod}. Sea-ice boundary values are controlled separately  \code{OBCWperiod}. Sea-ice boundary values are controlled separately
371  with \code{siobWstartdate1/2} and \code{siobWperiod}.  with \code{siobWstartdate1/2} and \code{siobWperiod}.  When the
372  When the \code{exf}-package is not used, the time levels are  \code{exf}-package is not used, the time levels are controlled by the
373  controlled by the runtime flags \code{externForcingPeriod} and  runtime flags \code{externForcingPeriod} and \code{externForcingCycle}
374  \code{externForcingCycle} in \code{data}, see \code{verification/exp4}  in \code{data}, see \code{verification/exp4} for an example.
 for an example.  
375    
376  \paragraph{OBCS\_CALC\_STEVENS:} ~ \\  \paragraph{OBCS\_CALC\_STEVENS:} ~ \\
377  (THE IMPLEMENTATION OF THESE BOUNDARY CONDITIONS IS NOT COMPLETE. SO  (THE IMPLEMENTATION OF THESE BOUNDARY CONDITIONS IS NOT
378  FAR ONLY EASTERN AND WESTERN BOUNDARIES ARE SUPPORTED.) \\  COMPLETE. PASSIVE TRACERS, SEA ICE AND NON-LINEAR FREE SURFACE ARE NOT
379    SUPPORTED PROPERLY.) \\
380  The boundary conditions following \citet{stevens:90} require the  The boundary conditions following \citet{stevens:90} require the
381  vertically averaged normal velocity (originally specified as a stream  vertically averaged normal velocity (originally specified as a stream
382  function along the open boundary) $\bar{u}_{ob}$ and the tracer fields  function along the open boundary) $\bar{u}_{ob}$ and the tracer fields
383  $\chi_{ob}$ (note: passive tracers are currently not implemented and  $\chi_{ob}$ (note: passive tracers are currently not implemented and
384  the code stops when package \code{ptracers} is used together with this  the code stops when package \code{ptracers} is used together with this
385  option). Currently, the code vertically averages the normal velocity  option). Currently, the code vertically averages the normal velocity
386  as specified. From these prescribed values the code computes the  as specified in \code{OB[E,W]u} or \code{OB[N,S]v}. From these
387  boundary values for the next timestep $n+1$ as follows (as an  prescribed values the code computes the boundary values for the next
388  example, we use the notation for an eastern or western boundary):  timestep $n+1$ as follows (as an example, we use the notation for an
389    eastern or western boundary):
390  \begin{itemize}  \begin{itemize}
391  \item $u^{n+1}(y,z) = \bar{u}_{ob}(y) + u'(y,z)$, where $u_{n}'$ is the  \item $u^{n+1}(y,z) = \bar{u}_{ob}(y) + (u')^{n}(y,z)$, where
392    deviation from the vertically averaged velocity one grid point    $(u')^{n}$ is the deviation from the vertically averaged velocity at
393    inward from the boundary.    timestep $n$ on the boundary. $(u')^{n}$ is computed in the previous
394      time step $n$ from the intermediate velocity $u^*$ prior to the
395      correction step (see section \ref{sec:time_stepping}, e.g.,
396      eq.\,(\ref{eq:ustar-backward-free-surface})).
397      % and~(\ref{eq:vstar-backward-free-surface})).
398      (This velocity is not
399      available at the beginning of the next time step $n+1$, when
400      S/R~OBCS\_CALC/OBCS\_CALC\_STEVENS are called, therefore it needs to
401      be saved in S/R~DYNAMICS by calling S/R~OBCS\_SAVE\_UV\_N and also
402      stored in a separate restart files
403      \verb+pickup_stevens[N/S/E/W].${iteration}.data+)
404    %  Define CPP-flag OBCS\_STEVENS\_USE\_INTERIOR\_VELOCITY to use the
405    %  velocity one grid point inward from the boundary.
406  \item If $u^{n+1}$ is directed into the model domain, the boudary  \item If $u^{n+1}$ is directed into the model domain, the boudary
407    value for tracer $\chi$ is restored to the prescribed values:    value for tracer $\chi$ is restored to the prescribed values:
408    \[\chi^{n+1} =   \chi^{n} + \frac{\Delta{t}}{\tau_\chi} (\chi_{ob} -    \[\chi^{n+1} =   \chi^{n} + \frac{\Delta{t}}{\tau_\chi} (\chi_{ob} -
409    \chi^{n}),\] where $\tau_\chi$ is the relaxation time    \chi^{n}),\] where $\tau_\chi$ is the relaxation time
410    scale \texttt{T/SrelaxStevens}.    scale \texttt{T/SrelaxStevens}. The new $\chi^{n+1}$ is then subject
411  \item If $u^{n+1}$ is directed out of the model domain, the tracer is    to the advection by $u^{n+1}$.
412    advected out of the domain with $u^{n+1}+c$, where $c$ is a phase  \item If $u^{n+1}$ is directed out of the model domain, the tracer
413    velocity estimated as    $\chi^{n+1}$ on the boundary at timestep $n+1$ is estimated from
414    $\frac{1}{2}\frac{\partial\chi}{\partial{t}}/\frac{\partial\chi}{\partial{x}}$.    advection out of the domain with $u^{n+1}+c$, where $c$ is
415      a phase velocity estimated as
416      $\frac{1}{2}\frac{\partial\chi}{\partial{t}}/\frac{\partial\chi}{\partial{x}}$. The
417      numerical scheme is (as an example for an eastern boundary):
418      \[\chi_{i_{b},j,k}^{n+1} =   \chi_{i_{b},j,k}^{n} + \Delta{t}
419      (u^{n+1}+c)_{i_{b},j,k}\frac{\chi_{i_{b},j,k}^{n}
420        - \chi_{i_{b}-1,j,k}^{n}}{\Delta{x}_{i_{b},j}^{C}}\mbox{, if }u_{i_{b},j,k}^{n+1}>0,
421      \] where $i_{b}$ is the boundary index.\\
422    For test purposes, the phase velocity contribution or the entire    For test purposes, the phase velocity contribution or the entire
423    advection can    advection can be turned off by setting the corresponding parameters
   be turned off by setting the corresponding parameters  
424    \texttt{useStevensPhaseVel} and \texttt{useStevensAdvection} to    \texttt{useStevensPhaseVel} and \texttt{useStevensAdvection} to
425    \texttt{.FALSE.}.\end{itemize} See \citet{stevens:90} for details.    \texttt{.FALSE.}.
426    \end{itemize}
427    See \citet{stevens:90} for details. With this boundary condition
428    specifying the exact net transport across the open boundary is simple,
429    so that balancing the flow with (S/R~OBCS\_BALANCE\_FLOW, see next
430    paragraph) is usually not necessary.
431    
432    \paragraph{OBCS\_BALANCE\_FLOW:} ~ \\
433    %
434    When turned on (\code{ALLOW\_OBCS\_BALANCE}
435    defined in \code{OBCS\_OPTIONS.h} and \code{useOBCSbalance=.true.} in
436    \code{data.obcs/OBCS\_PARM01}), this routine balances the net flow
437    across the open boundaries. By default the net flow across the
438    boundaries is computed and all normal velocities on boundaries are
439    adjusted to obtain zero net inflow.
440    
441    This behavior can be controlled with the runtime flags
442    \code{OBCS\_balanceFacN/S/E/W}. The values of these flags determine
443    how the net inflow is redistributed as small correction velocities
444    between the individual sections. A value ``\code{-1}'' balances an
445    individual boundary, values $>0$ determine the relative size of the
446    correction. For example, the values
447    \begin{tabbing}
448     \code{OBCS\_balanceFacE}\code{ = 1.,} \\
449     \code{OBCS\_balanceFacW}\code{ = -1.,} \\
450     \code{OBCS\_balanceFacN}\code{ = 2.,} \\
451     \code{OBCS\_balanceFacS}\code{ = 0.,}
452    \end{tabbing}
453    make the model
454    \begin{itemize}
455    \item correct Western \code{OBWu} by substracting a uniform velocity to
456    ensure zero net transport through the Western open boundary;
457    \item correct Eastern and Northern normal flow, with the Northern
458      velocity correction two times larger than the Eastern correction, but
459      \emph{not} the Southern normal flow, to ensure that the total inflow through
460      East, Northern, and Southern open boundary is balanced.
461    \end{itemize}
462    
463  \paragraph{OBCS\_BALANCE} ~ \\  The old method of balancing the net flow for all sections individually
464  %  can be recovered by setting all flags to -1. Then the normal
465  ~  velocities across each of the four boundaries are modified separately,
466    so that the net volume transport across \emph{each} boundary is
467    zero. For example, for the western boundary at $i=i_{b}$, the modified
468    velocity is:
469    \[
470    u(y,z) - \int_{\mbox{western boundary}}u\,dy\,dz \approx OBNu(j,k) - \sum_{j,k}
471    OBNu(j,k) h_{w}(i_{b},j,k)\Delta{y_G(i_{b},j)}\Delta{z(k)}.
472    \]
473    This also ensures a net total inflow of zero through all boundaries,
474    but this combination of flags is \emph{not} useful if you want to
475    simulate, say, a sector of the Southern Ocean with a strong ACC
476    entering through the western and leaving through the eastern boundary,
477    because the value of ``\code{-1}'' for these flags will make sure that
478    the strong inflow is removed. Clearly, gobal balancing with
479    \code{OBCS\_balanceFacE/W/N/S} $\ge0$ is the preferred method.
480    
481  \paragraph{OBCS\_APPLY\_*:} ~ \\  \paragraph{OBCS\_APPLY\_*:} ~ \\
482  ~  ~
483    
484  \paragraph{OBCS\_SPONGE} Setting sponge layer characteristics \\  \paragraph{OBCS\_SPONGE:} ~ \\
485  %  %
486  ~  The sponge layer code (turned on with \code{ALLOW\_OBCS\_SPONGE} and
487    \code{useOBCSsponge}) adds a relaxation term to the right-hand-side of
488    the momentum and tracer equations. The variables are relaxed towards
489    the boundary values with a relaxation time scale that increases
490    linearly with distance from the boundary
491    \[
492    G_{\chi}^{\mbox{(sponge)}} =
493    - \frac{\chi - [( L - \delta{L} ) \chi_{BC} + \delta{L}\chi]/L}
494    {[(L-\delta{L})\tau_{b}+\delta{L}\tau_{i}]/L}
495    = - \frac{\chi - [( 1 - l ) \chi_{BC} + l\chi]}
496    {[(1-l)\tau_{b}+l\tau_{i}]}
497    \]
498    where $\chi$ is the model variable (U/V/T/S) in the interior,
499    $\chi_{BC}$ the boundary value, $L$ the thickness of the sponge layer
500    (runtime parameter \code{spongeThickness} in number of grid points),
501    $\delta{L}\in[0,L]$ ($\frac{\delta{L}}{L}=l\in[0,1]$) the distance from the boundary (also in grid points), and
502    $\tau_{b}$ (runtime parameters \code{Urelaxobcsbound} and
503    \code{Vrelaxobcsbound}) and $\tau_{i}$ (runtime parameters
504    \code{Urelaxobcsinner} and \code{Vrelaxobcsinner}) the relaxation time
505    scales on the boundary and at the interior termination of the sponge
506    layer. The parameters \code{Urelaxobcsbound/inner} set the relaxation
507    time scales for the Eastern and Western boundaries,
508    \code{Vrelaxobcsbound/inner} for the Northern and Southern boundaries.
509    
510  \paragraph{OB's with nonlinear free surface} ~ \\  \paragraph{OB's with nonlinear free surface} ~ \\
511  %  %
# Line 425  Table \ref{tab:pkg:obcs:diagnostics}. Line 554  Table \ref{tab:pkg:obcs:diagnostics}.
554  %----------------------------------------------------------------------  %----------------------------------------------------------------------
555    
556  \subsubsection{Reference experiments}  \subsubsection{Reference experiments}
557    In the directory \code{verifcation}, the following experiments use
558    \code{obcs}:
559    \begin{itemize}
560    \item \code{exp4}: box with 4 open boundaries, simulating flow over a
561      Gaussian bump based on \citet{adcroft:97}, also tests
562      Stevens-boundary conditions;
563    \item \code{dome}: based on the project ``Dynamics of Overflow Mixing
564      and Entrainment''
565      (\url{http://www.rsmas.miami.edu/personal/tamay/DOME/dome.html}), uses
566      Orlanski-BCs;
567    \item \code{internal\_wave}: uses a heavily modified \code{S/R~OBCS\_CALC}
568    \item \code{seaice\_obcs}: simple example who to use the sea-ice
569      related code, based on \code{lab\_sea};
570    \item \code{tutorial\_plume\_on\_slope}: uses Orlanski-BCs, see also
571      section~\ref{sec:eg-gravityplume}.
572    \end{itemize}
573    
574    
575    
# Line 436  Table \ref{tab:pkg:obcs:diagnostics}. Line 581  Table \ref{tab:pkg:obcs:diagnostics}.
581  \label{sec:pkg:obcs:experiments}  \label{sec:pkg:obcs:experiments}
582    
583  \begin{itemize}  \begin{itemize}
584  \item{Ocean experiment in exp4 verification directory. }  \item \code{tutorial\_plume\_on\_slope} (section~\ref{sec:eg-gravityplume})
585  \end{itemize}  \end{itemize}
586    
587    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.22