List of functions in OrthogonalSphericalShellGrids

OrthogonalSphericalShellGrids.TripolarGridType
TripolarGrid(arch::Distributed, FT::DataType = Float64; halo = (4, 4, 4), kwargs...)

Constructs a tripolar grid on a distributed architecture. A distributed tripolar grid is supported only on a Y-partitioning configuration, therefore, only splitting the j-direction is supported for the moment.

source
OrthogonalSphericalShellGrids.TripolarGridType
TripolarGrid(arch = CPU(), FT::DataType = Float64; 
                  size, 
                  southermost_latitude = -80, 
                  halo                 = (4, 4, 4), 
                  radius               = R_Earth, 
                  z                    = (0, 1),
                  north_poles_latitude = 45,
                  first_pole_longitude = 0)

Constructs a tripolar grid on a spherical shell. NOTE: due to the requirements of the folding at the north edge of the domain, size[1] should be an even number.

Positional Arguments

  • arch: The architecture to use for the grid. Default is CPU().
  • FT::DataType: The data type to use for the grid. Default is Float64.

Keyword Arguments

  • size: The number of cells in the (longitude, latitude, z) dimensions.
  • southermost_latitude: The southernmost Center latitude of the grid. Default is -80.
  • halo: The halo size in the (longitude, latitude, z) dimensions. Default is (4, 4, 4).
  • radius: The radius of the spherical shell. Default is R_Earth.
  • z: The z-coordinate range of the grid. Default is (0, 1).
  • first_pole_longitude: The longitude of the first `north'' singularity. The second singularity will be located atfirstpolelongitude + 180ᵒ`.
  • north_poles_latitude: The latitude of the ``north'' singularities.

Returns

An OrthogonalSphericalShellGrid object representing a tripolar grid on the sphere. The north singularities are located at

i = 1, j = Nφ and i = Nλ ÷ 2 + 1, j = Nλ

source
OrthogonalSphericalShellGrids.ZipperBoundaryConditionFunction
ZipperBoundaryCondition(sign = 1)

Create a zipper boundary condition specific to the TripolarGrid. A Zipper boundary condition is similar to a periodic boundary condition, but, instead of retrieving the value from the opposite boundary, it splits the boundary in two and retrieves the value from the opposite side of the boundary. It is possible to think of it as a periodic boundary over a folded domain.

When copying in halos, folded velocities need to switch sign, while tracers or similar fields do not.

Note: the Tripolar boundary condition is particular because the last grid point at the north edge is repeated for tracers. For this reason we do not start copying the halo from the last grid point but from the second to last grid point.

Example

Consider the northern edge of a tripolar grid where P indicates the j - location of the poles

                  P                         P
                  |            |            |            |            
 Ny (center) ->   u₁    c₁     u₂    c₂     u₃    c₃     u₄    c₄     
 Ny (face)   ->   |---- v₁ ----|---- v₂ ----|---- v₃ ----|---- v₄ ----
                                                      Nx    Nx
                                                    (face) (center)

The grid ends at Ny because it is periodic in nature, but, given the fold,

c₁ == c₄

and

c₂ == c₃

This is not the case for the v-velocity (or any field on the j-faces) where the last grid point is not repeated.

source
OrthogonalSphericalShellGrids._compute_tripolar_coordinates!Method
_compute_tripolar_coordinates!(λFF, φFF, λFC, φFC, λCF, φCF, λCC, φCC, 
                               λᶠᵃᵃ, λᶜᵃᵃ, φᵃᶠᵃ, φᵃᶜᵃ, 
                               first_pole_longitude,
                               focal_distance, Nλ)

Compute the tripolar coordinates for a given set of input parameters. This function follows the formulation described in Ross J. Murray, "Explicit Generation of Orthogonal Grids for Ocean Models", Journal of Computational Physics, Volume 126, Issue 2, 1996, Pages 251-273.

The tripolar grid is built as a set of cofocal ellipsed and perpendicular hyperbolae. The focal_distance argument is the distance from the center of the ellipses to the foci.

The family of ellipses obeys:

       x²          y²
   --------- + ---------  = 1
   a²cosh²(ψ)  a²sinh²(ψ)

While the family of perpendicular hyperbolae obey:

       x²          y²
   --------- + ---------  = 1
   a²cos²(λ)   a²sin²(λ)

Where a is the focal_distance to the center. λ is the longitudinal angle and ψ is the ``isometric latitude'' defined by Murray (1996) as satisfying:

    a sinh(ψ) = tand((90 - φ) / 2) 

The final (x, y) points that define the stereographic projection of the tripolar coordinates are given by:

    x = a * sinh(ψ) * cos(λ)
    y = a * sinh(ψ) * sin(λ)

for which it is possible to retrive the longitude and latitude by:

    λ = - 180 / π * atan(y / x)
    φ = 90 - 360 / π * atan(sqrt(y² + x²))
source