# Vertical S-coordinate

Vertical S-coordinate

ROMS has a generalized vertical, terrain-following, coordinate system. Currently, two vertical transformation equations, , are available which can support numerous vertical stretching 1D-functions when several constraints are satisfied.

## Transformation Equations

The following vertical coordinate transformations are available:

 $StartLayout 1st Row 1st Column z left-parenthesis x comma y comma sigma comma t right-parenthesis 2nd Column equals upper S left-parenthesis x comma y comma sigma right-parenthesis plus zeta left-parenthesis x comma y comma t right-parenthesis left-bracket 1 plus StartFraction upper S left-parenthesis x comma y comma sigma right-parenthesis Over h left-parenthesis x comma y right-parenthesis EndFraction right-bracket comma 2nd Row 1st Column upper S left-parenthesis x comma y comma sigma right-parenthesis 2nd Column equals h Subscript c Baseline sigma plus left-bracket h left-parenthesis x comma y right-parenthesis minus h Subscript c Baseline right-bracket upper C left-parenthesis sigma right-parenthesis EndLayout$ (1)

or

 $StartLayout 1st Row 1st Column z left-parenthesis x comma y comma sigma comma t right-parenthesis 2nd Column equals zeta left-parenthesis x comma y comma t right-parenthesis plus left-bracket zeta left-parenthesis x comma y comma t right-parenthesis plus h left-parenthesis x comma y right-parenthesis right-bracket upper S left-parenthesis x comma y comma sigma right-parenthesis comma 2nd Row 1st Column upper S left-parenthesis x comma y comma sigma right-parenthesis 2nd Column equals StartFraction h Subscript c Baseline sigma plus h left-parenthesis x comma y right-parenthesis upper C left-parenthesis sigma right-parenthesis Over h Subscript c Baseline plus h left-parenthesis x comma y right-parenthesis EndFraction EndLayout$ (2)

where is a nonlinear vertical transformation functional, is the time-varying free-surface, is the unperturbed water column thickness and corresponds to the ocean bottom, is a fractional vertical stretching coordinate ranging from , is a nondimensional, monotonic, vertical stretching function ranging from , and is a positive thickness controlling the stretching. In sediment applications, is changed at every time-step since it is affected by erosion and deposition processes.

Warning: We are now very strict about the value of    and other input vertical transformation parameters. Since the beginning of ROMS,    where   and    is the stretching parameter specified in ocean.in. Notice that it is not possible to build the vertical stretching coordinates when    and using transformation (1) because it yields   . This has been a legacy issue in ROMS for years, and you are either consistent with the previous set-up of your application or change the value of   in all input NetCDF files and ocean.in. Therefore, in new applications you need to be sure that  when using the transformation (1). Notice that this restriction is removed in transformation (2) and    can be any positive value. It works for both    or   . Again, we are now checking internally for all stretching parameters for consistency in all input NetCDF files that have such variables.

We find it convenient to define:

where are the vertical grid thicknesses. In ROMS, is computed discretely as since this leads to the vertical sum of being exactly the total water column thickness .

Transformation (1) has been available in ROMS since 1999. It is activated by setting Vtransform = 1 in ocean.in. Notice that,

In an undisturbed ocean state, corresponding to zero free-surface, . Shchepetkin and McWilliams (2005) denotes this transformation as an unperturbed coordinate system since all the depths are not affected by the displacements of the free-surface. This ensures that the vertical mass fluxes generated by a purely barotropic motion will vanish at every interface

Transformation (2) has been available in UCLA-ROMS since 2005. It is activated by setting Vtransform = 2 in ocean.in. Notice that,

which is different to the behavior of the original functional in (1). Shchepetkin (personal communication) points out that (2) offers several advantages:

• Regardless of the design of , it behaves like equally-spaced sigma-coordinates in shallow regions, where . This is advantageous because it avoids excessive resolution and associated CFL limitation is such areas.
• Near-surface refinement behaves more or less like geopotential coordinates in deep regions (level thicknesses, , do not depend or weakly depend on bathymetry), while near-bottom like sigma coordinates ( is roughly proportional to depth). This reduces the extreme r-factors near the bottom and reduces pressure gradient errors.
• The true sigma-coordinate system is recovered as . This is useful when configuring applications with flat bathymetry and uniform level thickness. Practically, you can achieve this by setting Tcline to 1.0d+16 in ocean.in. This will set . Although not necessary, we also recommend that you set and .

In an undisturbed ocean state, , transformation (2) yields the following unperturbed depths, ,

 $ModifyingAbove z With caret left-parenthesis x comma y comma sigma right-parenthesis identical-to h left-parenthesis x comma y right-parenthesis upper S left-parenthesis x comma y comma sigma right-parenthesis equals h left-parenthesis x comma y right-parenthesis left-bracket StartFraction h Subscript c Baseline sigma plus h left-parenthesis x comma y right-parenthesis upper C left-parenthesis sigma right-parenthesis Over h Subscript c Baseline plus h left-parenthesis x comma y right-parenthesis EndFraction right-bracket$ (3)

and

 $d ModifyingAbove z With caret equals d sigma h left-parenthesis x comma y right-parenthesis left-bracket StartFraction h Subscript c Baseline Over h Subscript c Baseline plus h left-parenthesis x comma y right-parenthesis EndFraction right-bracket$ (4)

As a consequence, the uppermost grid box retains very little dependency from bathymetry in deep areas, where . For example, if and changes from to , the uppermost grid box changes only by a factor of 1.08 (less than ).

## Vertical Stretching Functions

The above generic vertical transformation design facilitates numerous vertical stretching functions, . This function is defined in terms of several parameters which are specified in the standard input file, ocean.in.

Stretching Function Properties:

• is a dimensionless, nonlinear, monotonic function;
• is a continuous differentiable function, or a differentiable piecewise function with smooth transition;
• must be discretized in terms of the fractional stretched vertical coordinate ,

• must be constrained by , that is,

Available Stretching Functions:

1. Song and Haidvogel (1994) function available in ROMS since its beginning, Vstretching = 1. is defined as:
 $upper C left-parenthesis sigma right-parenthesis equals left-parenthesis 1 minus theta Subscript upper B Baseline right-parenthesis StartFraction hyperbolic sine left-parenthesis theta Subscript upper S Baseline sigma right-parenthesis Over hyperbolic sine theta Subscript upper S Baseline EndFraction plus theta Subscript upper B Baseline left-bracket StartFraction hyperbolic tangent left-bracket theta Subscript upper S Baseline left-parenthesis sigma plus one-half right-parenthesis right-bracket Over 2 hyperbolic tangent left-parenthesis one-half theta Subscript upper S Baseline right-parenthesis EndFraction minus one-half right-bracket$ (5)

where and are the surface and bottom control parameters. Their ranges are and , respectively. This function has the following features:

• It is infinitely differentiable in .
• The larger the value of , the more resolution is kept above .
• For , the resolution all goes to the surface as is increased.
• For , the resolution goes to both the surface and the bottom equally as is increased.
• For , there is a subtle mismatch in the discretization of the model equations, for instance in the horizontal viscosity term. We recommend that you stick with reasonable values of , say .
• Some applications turn out to be sensitive to the value of used.
2. A. Shchepetkin (2005) UCLA-ROMS deprecated function, Vstretching = 2. is defined as a piecewise function:
 $StartLayout 1st Row 1st Column upper C left-parenthesis sigma right-parenthesis 2nd Column equals mu upper C Subscript s u r Baseline left-parenthesis sigma right-parenthesis plus left-parenthesis 1 minus mu right-parenthesis upper C Subscript b o t Baseline left-parenthesis sigma right-parenthesis comma 2nd Row 1st Column Blank 3rd Row 1st Column upper C Subscript s u r Baseline left-parenthesis sigma right-parenthesis 2nd Column equals StartFraction 1 minus hyperbolic cosine left-parenthesis theta Subscript upper S Baseline sigma right-parenthesis Over hyperbolic cosine left-parenthesis theta Subscript upper S Baseline right-parenthesis minus 1 EndFraction comma for theta Subscript upper S Baseline greater-than 0 comma upper C Subscript b o t Baseline left-parenthesis sigma right-parenthesis equals StartFraction hyperbolic sine left-bracket theta Subscript upper B Baseline left-parenthesis sigma plus 1 right-parenthesis right-bracket Over hyperbolic sine left-parenthesis theta Subscript upper B Baseline right-parenthesis EndFraction minus 1 comma for theta Subscript upper B Baseline greater-than 0 comma 4th Row 1st Column Blank 5th Row 1st Column mu 2nd Column equals left-parenthesis sigma plus 1 right-parenthesis Superscript alpha Baseline left-bracket 1 plus StartFraction alpha Over beta EndFraction left-parenthesis 1 minus left-parenthesis sigma plus 1 right-parenthesis Superscript beta Baseline right-parenthesis right-bracket EndLayout$ (6)
This function is similar in meaning to the Song and Haidvogel (1994), but note that hyperbolic function in is instead of and
3. R. Geyer function for high bottom boundary layer resolution in relatively shallow applications, Vstretching = 3. is defined as a piecewise function:
 $StartLayout 1st Row 1st Column upper C left-parenthesis sigma right-parenthesis 2nd Column equals mu upper C Subscript b o t Baseline left-parenthesis sigma right-parenthesis plus left-parenthesis 1 minus mu right-parenthesis upper C Subscript s u r Baseline left-parenthesis sigma right-parenthesis comma 2nd Row 1st Column Blank 3rd Row 1st Column upper C Subscript s u r Baseline left-parenthesis sigma right-parenthesis 2nd Column equals minus StartFraction log left-bracket hyperbolic cosine left-parenthesis gamma abs left-parenthesis sigma right-parenthesis Superscript theta Super Subscript upper S Superscript Baseline right-bracket Over log left-bracket hyperbolic cosine left-parenthesis gamma right-parenthesis right-bracket EndFraction comma upper C Subscript b o t Baseline left-parenthesis sigma right-parenthesis equals StartFraction log left-bracket hyperbolic cosine left-parenthesis gamma left-parenthesis sigma plus 1 right-parenthesis Superscript theta Super Subscript upper B Superscript Baseline right-bracket Over log left-bracket hyperbolic cosine left-parenthesis gamma right-parenthesis right-bracket EndFraction minus 1 comma 4th Row 1st Column Blank 5th Row 1st Column mu 2nd Column equals one-half left-bracket 1 minus hyperbolic tangent left-parenthesis gamma left-parenthesis sigma plus one-half right-parenthesis right-parenthesis right-bracket EndLayout$ (7)
where the power exponents and are the surface and bottom control parameters specified in standard input file ocean.in, as before. Here, is a scale factor for all hyperbolic functions. Currently, . Typical values for the control parameters are:
 $theta Subscript upper S Baseline equals 0.65$ minimal increase of surface resolution $theta Subscript upper S Baseline equals 1.0$ significant surface amplification $theta Subscript upper B Baseline equals 0.58$ no bottom amplification $theta Subscript upper B Baseline equals 1.0$ significant bottom amplification $theta Subscript upper B Baseline equals 1.5$ good bottom resolution for gravity flows $theta Subscript upper B Baseline equals 3.0$ super-high bottom resolution

4. A. Shchepetkin (2010) UCLA-ROMS current function, Vstretching = 4. is defined as a continuous, double stretching function:

Surface refinement function:
 $upper C left-parenthesis sigma right-parenthesis equals StartFraction 1 minus hyperbolic cosine left-parenthesis theta Subscript upper S Baseline sigma right-parenthesis Over hyperbolic cosine left-parenthesis theta Subscript upper S Baseline right-parenthesis minus 1 EndFraction comma for theta Subscript upper S Baseline greater-than 0 comma upper C left-parenthesis sigma right-parenthesis equals minus sigma squared comma for theta Subscript upper S Baseline less-than-or-equal-to 0$ (8)

Bottom refinement function:

 $upper C left-parenthesis sigma right-parenthesis equals StartFraction exp left-parenthesis theta Subscript upper B Baseline upper C left-parenthesis sigma right-parenthesis right-parenthesis minus 1 Over 1 minus exp left-parenthesis minus theta Subscript upper B Baseline right-parenthesis EndFraction comma for theta Subscript upper B Baseline greater-than 0$ (9)

Notice that the bottom function (9) is the second stretching of an already stretched transform (8). The resulting stretching function is continuous with respect to and as their values approach zero. The range of meaningful values for and are:

However, users need to pay attention to extreme r-factor (rx1) values near the bottom.

Due to its functionality and properties Vtransform = 2 and Vstretching = 4 are now the default values for ROMS.

The above vertical transformations have been registered with the CF Conventions Committee and the NetCDF-Java group. We expect that it will take some time for the CF Committee to approve them. However, the NetCDF-Java is expected to be coded right away. Two new standard_name variable attributes: ocean_s_coordinate_g1 and ocean_s_coordinate_g2 have been assigned for transformations (1) and (2), respectively. The terms in the definition are associated with file variables by the formula_terms attribute as follows:

Transformation (1):

```       double s_rho(s_rho) ;
s_rho:long_name = "S-coordinate at RHO-points" ;
s_rho:valid_min = -1. ;
s_rho:valid_max = 0. ;
s_rho:positive = "up" ;
s_rho:standard_name = "ocean_s_coordinate_g1" ;
s_rho:formula_terms = "s: s_rho C: Cs_r eta: zeta depth: h depth_c: hc" ;
double s_w(s_w) ;
s_w:long_name = "S-coordinate at W-points" ;
s_w:valid_min = -1. ;
s_w:valid_max = 0. ;
s_w:positive = "up" ;
s_w:standard_name = "ocean_s_coordinate_g1" ;
s_w:formula_terms = "s: s_w C: Cs_w eta: zeta depth: h depth_c: hc" ;
```

Transformation (2):

```       double s_rho(s_rho) ;
s_rho:long_name = "S-coordinate at RHO-points" ;
s_rho:valid_min = -1. ;
s_rho:valid_max = 0. ;
s_rho:positive = "up" ;
s_rho:standard_name = "ocean_s_coordinate_g2" ;
s_rho:formula_terms = "s: s_rho C: Cs_r eta: zeta depth: h depth_c: hc" ;
double s_w(s_w) ;
s_w:long_name = "S-coordinate at W-points" ;
s_w:valid_min = -1. ;
s_w:valid_max = 0. ;
s_w:positive = "up" ;
s_w:standard_name = "ocean_s_coordinate_g2" ;
s_w:formula_terms = "s: s_w C: Cs_w eta: zeta depth: h depth_c: hc" ;
```

Notice that the formula_terms are identical for both transformations and are independent of the vertical stretching function used. This metadata conventions allows to process/visualize any NetCDF file generated by ROMS easily and correctly compute the associated vertical grid depths.

## Vertical Grid Examples

The following figures shows the -surfaces for both vertical transformations and available vertical stretching functions. These plots were generated in Matlab using the script scoord.m.

 Vtransform=1, Vstretching=1,   $theta Subscript upper S Baseline equals 7.0$, $theta Subscript upper B Baseline equals 0.1$, $upper N equals 30$ Vtransform=2, Vstretching=2,   $theta Subscript upper S Baseline equals 7.0$, $theta Subscript upper B Baseline equals 0.1$, $upper N equals 30$
 Vtransform=2, Vstretching=4,   $theta Subscript upper S Baseline equals 7.0$, $theta Subscript upper B Baseline equals 0.1$, $upper N equals 30$ Vtransform=2, Vstretching=4,   $theta Subscript upper S Baseline equals 6.5$, $theta Subscript upper B Baseline equals 2.5$, $upper N equals 30$
 Vtransform=1, Vstretching=1,   $theta Subscript upper S Baseline equals 7.0$, $theta Subscript upper B Baseline equals 0.1$, $upper N equals 20$ Vtransform=2, Vstretching=2,   $theta Subscript upper S Baseline equals 7.0$, $theta Subscript upper B Baseline equals 0.1$, $upper N equals 20$
 Vtransform=2, Vstretching=4,   $theta Subscript upper S Baseline equals 7.0$, $theta Subscript upper B Baseline equals 0.1$, $upper N equals 20$ Vtransform=2, Vstretching=4,   $theta Subscript upper S Baseline equals 6.5$, $theta Subscript upper B Baseline equals 2.0$, $upper N equals 20$
 Vtransform=1, Vstretching=1,   $theta Subscript upper S Baseline equals 1.0$, $theta Subscript upper B Baseline equals 3.0$, $upper N equals 20$ Vtransform=2, Vstretching=2,   $theta Subscript upper S Baseline equals 1.0$, $theta Subscript upper B Baseline equals 3.0$, $upper N equals 20$
 Vtransform=2, Vstretching=3,   $theta Subscript upper S Baseline equals 1.0$, $theta Subscript upper B Baseline equals 3.0$, $upper N equals 20$ Vtransform=2, Vstretching=4,   $theta Subscript upper S Baseline equals 1.0$, $theta Subscript upper B Baseline equals 4.0$, $upper N equals 20$