Continuous: separation of scales
The separation of scales is, in continuous space, conveniently introduced
using spherical harmonics. Assume that elevation (above sea level) is a
smooth continuous function, in which case it can be represented by a
convergent expansion of spherical harmonic functions of the form
h(λ,θ)=∑m=-∞∞∑n=|m|∞ψm,nYm,n(λ,θ),
e.g., where λ and θ are longitude and
latitude, respectively, and ψm,n are the spherical harmonic coefficients.
Each spherical harmonic function is given in terms of the associated Legendre
polynomial Pm,n(θ):
Ym,n=Pm,n(θ)eimλ,
where m is the zonal wave number and m-|n| is the number of zeros between
the poles and can therefore be interpreted as meridional wave number.
For the separation of scales the spherical harmonic expansion is truncated at
wave number M,
h(M)(λ,θ)=∑m=-MM∑n=|m|Mψm,n(M)Ym,n(λ,θ),
where a triangular truncation, which provides a uniform spatial resolution
over the entire sphere, is used.
Let h(tgt)(λ,θ) be a continuous representation of the
elevation containing the spatial scales of the target grid. We do not write
h(tgt)(λ,θ) explicitly in terms of spherical harmonics as the
target grid may be variable resolution and therefore contain different
spatial scales in different parts of the domain.
For each target grid cell Ωk, k=1,…,Nt, where Nt is the
number of target grid cells, define the variances
VarΩk(tms)=∬Ωkh(M)(λ,θ)-h(λ,θ)2cos(θ)dλdθ,VarΩk(gwd)=∬Ωkh(tgt)(λ,θ)-h(M)(λ,θ)2cos(θ)dλdθ.
Thus VarΩk(tms) is the variance of elevation on scales
below wave number M and VarΩk(gwd) is the variance of
elevation on scales larger than wave number M and below the target grid
scale.
Discrete: separation of scales
The separation of scales is done through the use of a quasi-isotropic
gnonomic cubed-sphere grid in a two-step regridding procedure: binning from
source grid Λ to intermediate grid A (separation of scales) and
then rigorously remapping variables to the target grid Ω.
Any quasi-uniform spherical grid could, in theory, be used for the separation
of scales or, given the discontinuous/fractal nature of topography, a more
rigorous scale separation method such as wavelets or other techniques could
have been used. It is noted that the separation of scales through an
intermediate grid does not correspond exactly to a spectral transform
truncation (used in the previous section). The intent is to approximately
eliminate scales below what can be resolved on the intermediate grid. For
reasons that will become clear, we have chosen to use a gnomonic cubed-sphere
grid (see Fig. ) resulting from an equiangular gnomonic
(central) projection,
x=rtanαandy=rtanβ;α,β∈-π4,π4,
where α and β are central angles in each
coordinate direction, r=R/3 and R is the radius of the Earth. A
point on the sphere is identified with the three-element vector (x,y,ν),
where ν is the panel index. Hence the physical domain S (sphere) is
represented by the gnomonic (central) projection of the cubed-sphere faces,
Ω(ν)=[-1,1]2, ν=1,2,…,6, and the non-overlapping panel
domains Ω(ν) span the entire sphere:
S=⋃ν=16Ω(ν). The cube edges, however, are
discontinuous. Note that any straight line on the gnomonic projection
(x,y,ν) corresponds to a great-circle arc on the sphere. In the
discretized scheme we let the number of cells along a coordinate axis be
Nc so that the total number of cells in the global domain is 6×Nc2. The grid lines are separated by the same angle Δα=Δβ=π2Nc in each coordinate direction.
For notational simplicity the cubed-sphere cells are identified with one
index i, and the relationship between i and (icube, jcube, ν) is given
by
i=icube+(jcube-1)Nc+(ν-1)Nc2,
where (icube, jcube)∈[1,…,Nc]2 and ν∈[1,2,…,6]. In terms of central angles (α,β) the cubed-sphere
grid cell i is defined as
Ai=[(icube-1)Δα-π4,icubeΔα-π4]×[(jcube-1)Δβ-π4,jcubeΔβ-π4],
and ΔAi denotes the associated spherical area. A formula for the
spherical area ΔAi of a grid cell on the gnomonic cubed-sphere grid
can be found in Appendix C of (note that Eq. C3 is missing
arccos on the right-hand side). A quasi-uniform approximately 3000 m
resolution is obtained by using Nc=3000, which results in a scale
separation of roughly 6000 m (based on a simple “2Δx assumption”).
For more details on the construction of the gnomonic grid see, for example,
.
Step 1: raw elevation data to intermediate cubed-sphere grid (Λ→A)
The raw elevation data are provided on a geoid such as the World Geodetic
System 1984 (WGS84) ellipsoid, whose center is located at the Earth's center.
Latitude and longitude locations use the WGS84 geodetic datum. Similarly,
elevation above sea level is defined as the deviation from the WGS84 geoid or
WGM96 (Earth Geopotential Model 1996) geoid for newer data sets. Global
weather/climate models typically assume that Earth is a sphere, so the
elevations at a certain latitude–longitude pair on the geoid are taken to be
the same on the sphere. The consequences of this approximation in the context
of limited-area models are discussed in and in the context
of shallow-water experiments in . Derivation of the
equations of motion in more accurate coordinates is starting to emerge in the
literature e.g.,.
The “raw” elevation data are usually from a digital elevation model (DEM)
such as the GTOPO30, a 30 arcsec global data set from the United States
Geological Survey USGS; defined on an approximately 1 km
regular latitude–longitude grid. Several newer, more accurate, and locally
higher resolution elevation data sets are available such as GMTED2010
Global Multi-Resolution Terrain Elevation Data 2010;,
GLOBE and the NASA Shuttle Radar Topographic Mission (SRTM) DEM
data . The SRTM data, however, are only near-global (up to
60∘ north and south). Here we use GTOPO30 and GMTED2010. The GTOPO30
data come in 33 tiles (separate files) in 16 bit binary format. Fortran code
is provided to convert the data into one NetCDF file. Even though the
elevation is stored as integers, the size of the NetCDF file is 7 GB. The
GTOPO file contains height h and land fraction LANDFRAC (for the
mathematical operations below we use f to refer to land fraction). The
GMTED2010 data do not contain LANDFRAC, so the land fraction is obtained from
Moderate Resolution Imaging Spectroradiometer (MODIS) 1 km land–water mask
data downloaded from
ftp://landsc1.nascom.nasa.gov/pub/outgoing/c6_dem/.
The centers of the regular latitude–longitude grid cells for the “raw”
topographic data are denoted
(λilon,θjlat), ilon=1,…,nlon, jlat=1,…,nlat. For the data sets
used here nlon=43 200 and nlat=21 600. As for the
cubed sphere, we use one index j to reference the grid cells,
j=ilon+(jlat-1)×nlon,j∈[1,…,Nr],
where Nr=nlon×nlat. The spherical area of grid cell Λj is
denoted ΔΛj and the average elevation in cell j is given by
hΛj(raw).
These data are binned to the cubed-sphere intermediate grid by identifying in
which gnomonic cubed-sphere grid cell (λilon,θjlat) is
located. Due to the “Cartesian-like” structure of the cubed-sphere grid, the
search algorithm is straightforward following :
Transform (λilon,θilat) coordinate to Cartesian coordinates (x,y,z):x=cos(λilon)cos(θjlat),y=sin(λilon)cos(θjlat),z=sin(θilat).
Locate which cubed-sphere panel (λilon,θilat) is located on through a “coordinate maximality” algorithm, i.e., letpm=max|x|,|y|,|z|,then if
pm =|x| and x>0, then (λilon,θilat) is on
ν=1;
pm =|y| and y>0, then (λilon,θilat) is on
ν=2;
pm =|x| and x<0, then (λilon,θilat) is on
ν=3;
pm =|y| and y<0, then (λilon,θilat) is on
ν=4;
pm =|z| and z≤0, then (λilon,θilat) is located on the bottom panel,
ν=5;
pm =|z| and z>0, then (λilon,θilat) is located on the top panel, ν=6.
Given the panel number the associated central angles (α,β) are given by
ν=1: (α,β)=arctanxz,arctanyz;
ν=2: (α,β)=arctan-xy,arctanzy;
ν=3: (α,β)=arctan-y-x,arctany-x;
ν=4: (α,β)=arctanx-y,arctanz-y;
ν=5: (α,β)=arctany-z,arctanx-z;
ν=6: (α,β)=arctanyz,arctan-xz.
The indices of the cubed-sphere cell in which the center of the latitude–longitude grid cell is located are given byicube=CEILINGα+π4Δα,jcube=CEILINGβ+π4Δβ,where the CEILING(⋅) function returns the smallest integer not
less than the argument.
The set of indices for which center points of regular latitude–longitude
grid cells are located in gnomonic cubed-sphere cell Ai is denoted
Si. Note that, since the raw data sets are
higher resolution, the cubed-sphere Si is guaranteed to be
non-empty. Through this binning process the approximate average elevation in
cubed-sphere cell i becomes
h‾Ai(cube)=1ΔAi∑j∈SihΓj(raw)ΔΛj.
When h‾Ai(cube) is known we can compute the sub-grid
variance on the intermediate cubed-sphere grid A:
VarAi(tms)=1ΔAi∑j∈Sih‾Ai(cube)-hΓj(raw)2ΔΛj.
The land fraction is also binned to the intermediate cubed-sphere grid,
f‾Ai(cube)=1ΔAi∑j∈SifΓj(raw)ΔΛj.
An example of a non-convex control volume in variable-resolution
CAM-SE. Vertices are filled circles and they are connected with straight
lines.
To remain consistent with previous GTOPO30-based topography generation
software for CAM, all land fractions south of 79∘ S are set to 1
for topography data based on GTOPO30, which effectively extends the land for
the Ross Ice Shelf. There are eight types of masks in the MODIS data: shallow
ocean, land, shoreline, shallow inland water, ephemeral water, deep inland
water, moderate ocean, and deep ocean. Here we set all masks to 0 except
land, shoreline and ephemeral water, which are set to 1. For topography data
based on MODIS, no further alternations are made to the land fraction.
The binning process is straightforward since the cubed-sphere grid is
essentially an equidistant Cartesian grid on each panel in terms of the
central angle coordinates. This step could be replaced by rigorous remapping
in terms of overlap areas between the regular latitude–longitude grid and the
cubed-sphere grid using the geometrically exact algorithm of
optimized for the regular latitude–longitude and gnomonic
cubed-sphere grid pair or the more general remapping algorithms such as SCRIP
and .
Step 2: cubed-sphere grid to target grid (A→Ω)
Schematic of the notation used to define the overlap between target
grid cell Ωk (red polygon) and high-resolution cubed-sphere grid cell
Aℓ (Cartesian-like grid in figure). The overlap area,
Ωkℓ=Ωk∩Aℓ, is shaded with a cross-hatch pattern
in the figure.
The cell-averaged values of elevation and sub-grid-scale variances
(VarΩ(tms) and VarΩ(gwd)) on the target
grid are computed by rigorously remapping the variables from the cubed-sphere
grid to the target grid. As for step 1 of the algorithm, several methods
could be used such as SCRIP and . The latter has the
advantage of more accurately representing both small- and great-circle arc
sides of the control volumes, whereas SCRIP approximates cells' sides in
latitude–longitude space. Here the remapping is performed using CSLAM
(Conservative Semi-LAgrangian Multi-tracer transport scheme) technology
, which approximates the cell sides with great-circle arcs.
That said, the algorithm can still operate on grids where the control volumes
do not consist of great-circle arcs, such as regular latitude–longitude grids
where the control volume sides parallel with latitudes are small-circle arcs,
but there will be an additional truncation error in the geometric
approximation to the control volumes. It is possible to use large parts of
the CSLAM technology since the source grid is a gnomonic cubed-sphere grid;
hence, instead of remapping between the gnomonic cubed-sphere grid and a
deformed Lagrangian grid, as done in CSLAM transport, the remapping is from
the gnomonic cubed-sphere grid to any target grid constructed from
great-circle arcs (the target grid “plays the role” of the Lagrangian
grid). However, a couple of modifications were made to the CSLAM search
algorithm. First of all, the target grid cells can have an arbitrary number
of vertices, whereas the CSLAM transport search algorithm assumes that the
target grid consists of quadrilaterals and the number of overlap areas is
determined by the deformation of the transporting velocity field. In the case
of the remapping needed in this application, the target grid consists of
polygons with any number of vertices and the search is not constrained by the
physical relation between regular and deformed upstream quadrilaterals.
Secondly, the CSLAM search algorithm for transport assumes that the target
grid cells are convex, which is not necessarily the case for target grids. The
CSLAM search algorithm has been modified to support non-convex cells that
are, for example, encountered in variable-resolution CAM-SE (see
Fig. ); essentially that means that any target grid cell
may cross a gnonomic isoline (source grid line) more than twice.
Let the target grid consist of Nt grid cells Ωk, k=1,…,Nt with associated spherical area ΔΩk. The
search algorithm for CSLAM is used to identify overlap areas between the
target grid cell Ωk and the cubed-sphere grid cells Aℓ,
ℓ=1,…,Nc. Denote the overlap area between Ωk and
Aℓ
Ωkℓ=Ωk∩Aℓ,
(see Fig. ) and let Lk denote the set of indices
for which Ωk∩Aℓ, ℓ=1,…,Nc is non-empty.
Surface geopotential Φs (upper left), SGH (upper
right), SGH30 (lower left) and LANDFRAC (lower right) for CAM-SE NE30NP4
resolution (“16×” smoothing)). The data are plotted on the native
grid. NCL scripts to create this figure are released with the software source
code.
(a) Idealized topography 1000+1000⋅cos(2π⋅x/300)+100⋅sin(2π/20) for -150 km <x< 150 km (thin
black line), topography averaged in 50 km grid boxes (thick black line), and
topography smoothed with boxcar smoother using a 500 km window (thick blue
line). (b) Deviation of topography from 50 km grid-box mean (thin
black line), and deviations from 500 km boxcar-smoothed topography (thin
blue line).
Note that the computation of overlap areas Ωkℓ is facilitated by
the “Cartesian” layout of the equiangular cubed-sphere grid in
computational space. The target grid vertex locations within the cubed-sphere
source grid are computed by first locating which panel the vertices are on
(using the “coordinate maximality” algorithm Eq. ), and their
locations thereafter trivially result when the vertex coordinates are
converted into the particular panels equiangular coordinates
(Eqs. and ). The overlap areas are computed by
finding intersection between the (x,y) gnomonic isolines (“Cartesian”
layout) and the target grid cell sides. Since topographic variables are
computed just once for each horizontal grid resolution, computational
performance is less critical. On a standard laptop even high-resolution
(e.g., 25 km) grid overlaps are computed on the order of minutes
irrespective of the target grid topology (Voronoi, cubed sphere, etc.).
The average elevation and variance used for TMS in target grid cell k are
respectively given by
h‾Ωk(tgt,raw)=1ΔΩk∑ℓ∈Lkh‾Aℓ(cube)ΔΩkℓ,Var‾Ωk(tms)=1ΔΩk∑ℓ∈LkVar‾Ωℓ(tms)ΔΩkℓ.
The variance of the cubed-sphere data h‾(cube)
with respect to the target grid cell average values
h‾(tgt,raw) is given by
Var‾Ωk(gwd,raw)=1ΔΩk∑ℓ∈Lkh‾Ωk(tgt,raw)-h‾Aℓ(cube)2ΔΩkℓ.
The appended superscript “raw” in h‾(tgt,raw) and
Var‾(gwd,raw) refers to the fact that the elevation and GWD
variance is based on unsmoothed elevation. As mentioned in the Introduction,
the elevation (for models based on terrain-following coordinates) is usually smoothed – i.e., the highest wave numbers are removed.
This smoothed elevation is denoted
h‾(tgt,smooth).
After smoothing the target grid elevation, the sub-grid-scale
variance for GWD could be recomputed as the smoothing operation will add
energy to the smallest wavelengths:
Var‾Ωk(gwd,smooth)=1ΔΩk∑ℓ∈Lkh‾Ωk(tgt,smooth)-h‾Aℓ(cube)2ΔΩkℓ.
See discussion on the difference between using
Var‾(gwd,raw) or
h‾(tgt,smooth) in Sect. . The smoothing
of elevation is discussed in some detail in the next section.
Smoothing of elevation hΩ(tgt) (if applicable)
As discussed in the Introduction, mapping the elevation to the target grid without further filtering to
remove the highest wave numbers usually leads to excessive spurious noise in
the simulations when using terrain-following coordinates.
Non-terrain-following coordinates such as the η coordinates
and z coordinates using shaved cells or cut cells
do not require filtering of topography. For
models that do require topography smoothing, there seems to be no
standardized procedure, for example a test case suite, to objectively select
the level of smoothing and the filtering method. The amount of smoothing
necessary to remove spurious noise in, for example, vertical velocity depends
on the amount of inherent or explicit numerical diffusion in the dynamical
core e.g.,. It may be considered important that the
topographic smoothing is done with discrete operators consistent with the
dynamical core.
While it is necessary to smooth topography to remove spurious grid-scale
noise, it potentially introduces two problems. Filtering will typically raise
ocean points near step topography to non-zero elevation. Perhaps the most
striking example is the Andes mountain range, which extends one or two grid
cells into the Pacific after the filtering operation
(Fig. ). Ocean and land points are treated
separately in weather/climate models, so raised sea points may potentially be
problematic. Secondly, the filtering will generally reduce the height of
local topographic maxima, and given the importance of barrier heights in
atmospheric dynamics, this could be a problem for the global angular momentum
budget and could fundamentally change the flow (unless a parameterization for
blocking is used). To capture more of the barrier effect (blocking), two
approaches have been put forward in the literature to deepen valleys and
increase peak heights while filtering out small scales: envelope topography adjusts the surface height with sub-grid-scale topographic
variance . Loosely speaking, the otherwise
smoothed peak heights are raised. This process may perturb the average
surface height. Alternatively, one may use silhouette averaging
. A similar approach, but implemented
as variational filtering, is taken in ; this method also
imposes additional constraints such as enforcing zero elevation over ocean
masks.
Difference between Var(gwd,smooth) and
Var(gwd,raw) for CAM-SE NE30NP4, where the
smoothed PHIS is the “16×” configuration.
The difference between GMTED2010 and GTOPO30 (left) elevation (in m)
and (right) SGH30 (in m), respectively, on the intermediate 3 km
cubed-sphere grid.
The difference between GMTED2010 and GTOPO30 topographic variables
for CAM-FV at approximately 1∘ resolution.
As there is no standard procedure for smoothing topography, we leave it up to
the user to smooth the raw topography h‾(tgt,raw). The
smoothed topography is referred to as h‾(tgt,smooth).