grid_tools  1.10.0
pesg Module Reference

Suite of routines to perform the 2-parameter family of Extended Schmidt Gnomonic (ESG) regional grid mappings, and to optimize the the two parameters, A and K, of those mappings for a given rectangular domain's principal (median) semi-arcs with respect to a domain-averaged measure of distortion. More...

Data Types

interface  bestesg_geo
 
interface  bestesg_map
 
interface  gaulegh
 
interface  get_edges
 
interface  get_meanq
 
interface  get_qofv
 
interface  get_qx
 
interface  gtoxm_ak_dd
 
interface  gtoxm_ak_rr
 
interface  guessak_geo
 
interface  guessak_map
 
interface  hgrid_ak
 
interface  hgrid_ak_dc
 
interface  hgrid_ak_dd
 
interface  hgrid_ak_rc
 
interface  hgrid_ak_rr
 
interface  xctoxm_ak
 
interface  xctoxs
 
interface  xmtog_ak_dd
 
interface  xmtog_ak_rr
 
interface  xmtoxc_ak
 
interface  xmtoxt
 
interface  xstoxc
 
interface  xstoxt
 
interface  xttoxm
 
interface  xttoxs
 
interface  zmtozt
 
interface  zttozm
 

Functions/Subroutines

subroutine, public bestesg_geo (lam, garcx, garcy, a, k, marcx, marcy, q, ff)
 Get the best Extended Schmidt Gnomonic parameter, (a,k), for the given geographical half-spans, garcx and garcy, as well as the corresponding map-space half-spans, garcx and garcy (in degrees) and the quality diagnostic, Q(lam) for this optimal parameter choice. More...
 
subroutine, public bestesg_map (lam, marcx, marcy, a, k, garcx, garcy, q, ff)
 Get the best Extended Schmidt Gnomonic parameter, (a,k), for the given map-coordinate half-spans, marcx and marcy, as well as the corresponding geographical half-spans, garcx and garcy (in degrees) and the quality diagnostic, Q(lam) for this optimal parameter choice. More...
 
subroutine gaulegh (m, x, w)
 This Gauss-Legendre quadrature integrates exactly any even polynomial up to degree m*4-2 in the half-interval [0,1]. More...
 
subroutine, public get_edges (arcx, arcy, edgex, edgey)
 For angles (degrees) of the arcs spanning the halfwidths between the region's center and its x and y edges, get the two cartesian vectors that represent the locations of these edge midpoints in the positive x and y directions. More...
 
subroutine get_meanqd (ngh, lam, xg, wg, ak, ma, q, qdak, qdma, ga, gadak, gadma, ff)
 For a parameter vector, ak and a map-space domain-parameter vector, ma, return the lambda-parameterized quality diagnostic, Q, and the geographic domain-parameter vector ga. More...
 
subroutine get_meanqs (n, ngh, lam, xg, wg, aks, mas, qs, ff)
 Like getmeanqd, except for n different values, aks, of ak and n different values, mas of ma, and without any of the derivatives. More...
 
subroutine get_qofv (lam, v1, v2, v3, v4, q)
 The quadratic quantity Q depends linearly on v1 and v4 (which are already quadratic diagnostics of EL) and quadratically on v2 and v3 (which are linear diagnostics of EL). More...
 
subroutine get_qofvd (lam, v2, v3, v1d, v2d, v3d, v4d, qd)
 Like get_qofv, but for (only) the 2-vector derivatives of Q. More...
 
subroutine get_qsofvs (n, lam, v1s, v2s, v3s, v4s, qs)
 General util to convert value. More...
 
subroutine get_qx (j0, v1, v2, v3, v4)
 From a jacobian matrix, j0, get a sufficient set of v. More...
 
subroutine get_qxd (j0, j0d, v1, v2, v3, v4, v1d, v2d, v3d, v4d)
 From a jacobian matrix, j0, and its derivative, j0d, get a sufficient set of v. More...
 
subroutine gtoxm_ak_dd_g (A, K, pdlat, pdlon, pdazi, delx, dely, dlat, dlon, xm, ff)
 Like gtoxm_ak_rr_g, except lat, lon, azimuth, are expressed in degrees. More...
 
subroutine gtoxm_ak_dd_m (A, K, pdlat, pdlon, pdazi, dlat, dlon, xm, ff)
 Like gtoxm_ak_rr_m, except lat, lon, azimuth, are expressed in degrees. More...
 
subroutine gtoxm_ak_rr_g (A, K, plat, plon, pazi, delx, dely, lat, lon, xm, ff)
 Given the map specification (angles in radians), the grid spacing (in map-space units) and the sample lat-lon (in radian), return the the image in map space in a 2-vector in grid units. More...
 
subroutine gtoxm_ak_rr_m (A, K, plat, plon, pazi, lat, lon, xm, ff)
 Given the map specification (angles in radians), the grid spacing (in map-space units) and the sample lat-lon (in radian), return the the image in map space in a 2-vector in grid units. More...
 
subroutine guessak_geo (asp, arc, ak)
 Given an aspect ratio, asp<=1, and major semi-axis, arc, in geographical (degree) units measured along the rectangle's median, return a first guess for the parameter vector, ak, approximately optimal for the domain of the given dimensions. More...
 
subroutine guessak_map (asp, tmarcx, ak)
 Given an aspect ratio, asp<=1, and major semi-axis, arc, in map-space nondimensional units, return a first guess for the parameter vector, ak, approximately optimal for the domain of the given dimensions. More...
 
subroutine, public hgrid_ak (lx, ly, nx, ny, a, k, plat, plon, pazi, re, delxre, delyre, glat, glon, garea, ff)
 Like hgrid_ak_rr_c except the argument list includes the earth radius, re, and this is used to express the map-space grid increments in the dimensional units, delxre, delyre on entry, and to express the grid cell areas, garea, in dimensional units upon return. More...
 
subroutine hgrid_ak_c (lx, ly, nx, ny, a, k, plat, plon, pazi, re, delxre, delyre, glat, glon, garea, dx, dy, dangle_dx, dangle_dy, ff)
 Like hgrid_ak_rr_c except the argument list includes the earth radius, re, and this is used to express the map-space grid increments in the dimensional units, delxre, delyre on entry, and to express the grid cell areas, garea, and the x- and y- grid steps, dx and dy, in dimensional units upon return. More...
 
subroutine, public hgrid_ak_dc (lx, ly, nx, ny, a, k, pdlat, pdlon, pdazi, delx, dely, xc, xcd, garea, ff)
 Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (pdlat,pdlon) and twisted about this center by an azimuth angle of pdazi counterclockwise (these angles in degrees). More...
 
subroutine, public hgrid_ak_dd (lx, ly, nx, ny, a, k, pdlat, pdlon, pdazi, delx, dely, gdlat, gdlon, garea, ff)
 Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (pdlat,pdlon) and twisted about this center by an azimuth angle of pdazi counterclockwise (these angles in degrees). More...
 
subroutine hgrid_ak_dd_c (lx, ly, nx, ny, a, k, pdlat, pdlon, pdazi, delx, dely, gdlat, gdlon, garea, dx, dy, dangle_dx, dangle_dy, ff)
 Like hgrid_ak_rr_c, except all the angle arguments (but not delx,dely) are in degrees instead of radians. More...
 
subroutine, public hgrid_ak_rc (lx, ly, nx, ny, A, K, plat, plon, pazi, delx, dely, xc, xcd, garea, ff)
 Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (plat,plon) and twisted about this center by an azimuth angle of pazi counterclockwise (these angles in radians). More...
 
subroutine, public hgrid_ak_rr (lx, ly, nx, ny, A, K, plat, plon, pazi, delx, dely, glat, glon, garea, ff)
 Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (plat,plon) and twisted about this center by an azimuth angle of pazi counterclockwise (these angles in radians). More...
 
subroutine hgrid_ak_rr_c (lx, ly, nx, ny, a, k, plat, plon, pazi, delx, dely, glat, glon, garea, dx, dy, angle_dx, angle_dy, ff)
 Use a and k as the parameters of an extended Schmidt-transformed gnomonic (ESG) mapping centered at (plat,plon) and twisted about this center by an azimuth angle of pazi counterclockwise (these angles in radians). More...
 
subroutine, public xctoxm_ak (a, k, xc, xm, ff)
 Inverse mapping of xmtoxc_ak. More...
 
subroutine xctoxs (xc, xs)
 Inverse of xstoxc. More...
 
subroutine xmtog_ak_dd_g (A, K, pdlat, pdlon, pdazi, delx, dely, xm, dlat, dlon, ff)
 Like xmtog_ak_rr_g, except lat, lon, azimuth, are expressed in degrees. More...
 
subroutine xmtog_ak_dd_m (A, K, pdlat, pdlon, pdazi, xm, dlat, dlon, ff)
 Like xmtog_ak_rr_m, except lat, lon, azimuth, are expressed in degrees. More...
 
subroutine xmtog_ak_rr_g (A, K, plat, plon, pazi, delx, dely, xm, lat, lon, ff)
 For an ESG map with parameters, (A,K), and geographical orientation, given by plon,plat,pazi (radians), and given a point in grid-space units as the 2-vector, xm, return the geographical coordinates, lat, lon, (radians) of this point. More...
 
subroutine xmtog_ak_rr_m (A, K, plat, plon, pazi, xm, lat, lon, ff)
 Given the ESG map specified by parameters (A,K) and geographical center and orientation, plat,plon,pazi (radians), and a position, in map-space coordinates given by the 2-vector, xm, return the geographical coordinates, lat and lon (radians). More...
 
subroutine, public xmtoxc_ak (a, k, xm, xc, xcd, ff)
 Assuming the A-K parameterization of the Extended Schmidt-transformed Gnomonic (ESG) mapping, and given a map-space 2-vector, xm, find the corresponding cartesian unit 3-vector and its derivative wrt xm, jacobian matrix, xcd. More...
 
subroutine xmtoxc_vak (ak, xm, xc, xcd, ff)
 Assuming the vector AK parameterization of the Extended Schmidt-transformed Gnomonic (ESG) mapping with parameter vector, and given a map-space 2-vector, xm, find the corresponding cartesian unit 3-vector and its derivative wrt xm, the Jacobian matrix, xcd. More...
 
subroutine xmtoxc_vak1 (ak, xm, xc, xcd, xc1, xcd1, ff)
 Like xmtoxc_vak, _ak, but also return derivatives wrt ak. More...
 
subroutine xmtoxt (a, xm, xt, xtd, ff)
 Like zmtozt, but for 2-vector xm and xt, and 2*2 diagonal Jacobian xtd. More...
 
subroutine xmtoxt1 (a, xm, xt, xtd, xt1, xtd1, ff)
 Like zmtozt1, but for 2-vector xm and xt, and 2*2 diagonal Jacobian xtd Also, the derivatives, wrt a, of these quantities. More...
 
subroutine xstoxc (xs, xc, xcd)
 Standard transformation from polar stereographic map coordinates, xs, to cartesian, xc, assuming the projection axis is polar. More...
 
subroutine xstoxc1 (xs, xc, xcd, xcdd)
 Standard transformation from polar stereographic map coordinates, xs, to cartesian, xc, assuming the projection axis is polar. More...
 
subroutine xstoxt (k, xs, xt, ff)
 Inverse of xttoxs. More...
 
subroutine xttoxm (a, xt, xm, ff)
 Inverse of xmtoxt. More...
 
subroutine xttoxs (k, xt, xs, xsd, ff)
 Scaled gnomonic plane xt to standard stereographic plane xs. More...
 
subroutine xttoxs1 (k, xt, xs, xsd, xsdd, xs1, xsd1, ff)
 Like xttoxs, but also, return the derivatives, wrt K, of xs and xsd. More...
 
subroutine zmtozt (a, zm, zt, ztd, ff)
 Evaluate the function, zt = tan(sqrt(A)*z)/sqrt(A), and its derivative, ztd, for positive and negative A and for the limiting case, A –> 0. More...
 
subroutine zmtozt1 (a, zm, zt, ztd, zt1, ztd1, ff)
 Like zmtozt, but also, get the derivative with respect to a, zt1 of zt, and ztd1 of ztd. More...
 
subroutine zttozm (a, zt, zm, ff)
 Inverse of zmtozt. More...
 

Detailed Description

Suite of routines to perform the 2-parameter family of Extended Schmidt Gnomonic (ESG) regional grid mappings, and to optimize the the two parameters, A and K, of those mappings for a given rectangular domain's principal (median) semi-arcs with respect to a domain-averaged measure of distortion.

This criterion is itself endowed with a parameter, lam (for "lambda" in [0,1) ) which gives weight to additional weight areal inhomogeneities instead of treating all distortion components equally.

Author
R. J. Purser

Function/Subroutine Documentation

◆ bestesg_geo()

subroutine, public pesg::bestesg_geo ( real(dp), intent(in)  lam,
real(dp), intent(in)  garcx,
real(dp), intent(in)  garcy,
real(dp), intent(out)  a,
real(dp), intent(out)  k,
real(dp), intent(out)  marcx,
real(dp), intent(out)  marcy,
real(dp), intent(out)  q,
logical, intent(out)  ff 
)

Get the best Extended Schmidt Gnomonic parameter, (a,k), for the given geographical half-spans, garcx and garcy, as well as the corresponding map-space half-spans, garcx and garcy (in degrees) and the quality diagnostic, Q(lam) for this optimal parameter choice.

If this process fails for any reason, the failure is alerted by a raised flag, FF, and the other output arguments must then be taken to be meaningless.

The diagnostic Q measures the variance over the domain of a local measure of grid distortion. A logarithmic measure of local grid deformation is give by L=log(J^t.J)/2, where J is the mapping Jacobian matrix, dX/dx, where X is the cartesian unit 3-vector representation of the image of the mapping of the map-coordinate 2-vector, x. The Frobenius squared-norm, Trace(L*L), of L is the basis for the simplest (lam=0) definition of the variance of L, but (Trace(L))**2 is another. Here, we weight both contributions, by lam and (1-lam) respectively, with 0 <= lam <1, to compute the variance Q(lam,a,k), and search for the (a,k) that minimizes this Q.

The domain averages are computed by double Gauss-Legendre quadrature (i.e., in both the x and y directions), but restricted to a mere quadrant of the domain (since bilateral symmetry pertains across both domain medians, yielding a domain mean L that is strictly diagonal.

Parameters
[in]lam
[in]garcxmap-space half-spans
[in]garcymap-space half-spans
[out]aExtended Schmidt Gnomonic parameter
[out]kExtended Schmidt Gnomonic parameter
[out]marcx
[out]marcy
[out]q
[out]fffailure flag
Author
R. J. Purser

Definition at line 903 of file pesg.f90.

References pietc::ms18, pietc::ms36, pietc::ms54, pietc::ms72, pietc::o5, pietc::s18, pietc::s36, pietc::s54, pietc::s72, and pietc::u5.

◆ bestesg_map()

subroutine, public pesg::bestesg_map ( real(dp), intent(in)  lam,
real(dp), intent(in)  marcx,
real(dp), intent(in)  marcy,
real(dp), intent(out)  a,
real(dp), intent(out)  k,
real(dp), intent(out)  garcx,
real(dp), intent(out)  garcy,
real(dp), intent(out)  q,
logical, intent(out)  ff 
)

Get the best Extended Schmidt Gnomonic parameter, (a,k), for the given map-coordinate half-spans, marcx and marcy, as well as the corresponding geographical half-spans, garcx and garcy (in degrees) and the quality diagnostic, Q(lam) for this optimal parameter choice.

If this process fails for any reason, the failure is alerted by a raised flag, FF, and the other output arguments must then be taken to be meaningless.

The diagnostic Q measures the variance over the domain of a local measure of grid distortion. A logarithmic measure of local grid deformation is give by L=log(J^t.J)/2, where J is the mapping Jacobian matrix, dX/dx, where X is the cartesian unit 3-vector representation of the image of the mapping of the map-coordinate 2-vector, x. The Frobenius squared-norm, Trace(L*L), of L is the basis for the simplest (lam=0) definition of the variance of L, but (Trace(L))**2 is another. Here, we weight both contributions, by lam and (1-lam) respectively, with 0 <= lam <1, to compute the variance Q(lam,a,k), and search for the (a,k) that minimizes this Q.

The domain averages are computed by double Gauss-Legendre quadrature (i.e., in both the x and y directions), but restricted to a mere quadrant of the domain (since bilateral symmetry pertains across both domain medians, yielding a domain mean L that is strictly diagonal.

Parameters
[in]lam
[in]marcxmap-coordinate half-spans
[in]marcymap-coordinate half-spans
[out]aExtended Schmidt Gnomonic parameter
[out]kExtended Schmidt Gnomonic parameter
[out]garcxgeographical half-spans
[out]garcygeographical half-spans
[out]q
[out]fffailure flag
Author
R. J. Purser

Definition at line 1073 of file pesg.f90.

References pietc::ms18, pietc::ms36, pietc::ms54, pietc::ms72, pietc::o5, pietc::s18, pietc::s36, pietc::s54, pietc::s72, and pietc::u5.

◆ gaulegh()

subroutine pesg::gaulegh ( integer(spi), intent(in)  m,
real(dp), dimension(m), intent(out)  x,
real(dp), dimension(m), intent(out)  w 
)
private

This Gauss-Legendre quadrature integrates exactly any even polynomial up to degree m*4-2 in the half-interval [0,1].

This code is liberally adapted from the algorithm given in Press et al., Numerical Recipes.

Parameters
mnumber of nodes in half-interval
xnodes and weights
wnodes and weights
Author
R. J. Purser

Definition at line 1852 of file pesg.f90.

References pietc::pih, pietc::u0, pietc::u1, and pietc::u2.

◆ get_edges()

subroutine, public pesg::get_edges ( real(dp), intent(in)  arcx,
real(dp), intent(in)  arcy,
real(dp), dimension(3), intent(out)  edgex,
real(dp), dimension(3), intent(out)  edgey 
)

For angles (degrees) of the arcs spanning the halfwidths between the region's center and its x and y edges, get the two cartesian vectors that represent the locations of these edge midpoints in the positive x and y directions.

Parameters
[in]arcxCenter-relative angle (degrees) of edge midpoint in +x
[in]arcyCenter-relative angle (degrees) of edge midpoint in +y
[out]edgexregion's +x edge midpoint as cartesian unit 3-vector
[out]edgeyregion's +y edge midpoint as cartesian unit 3-vector
Author
R. J. Purser

Definition at line 489 of file pesg.f90.

References pietc::dtor, and pietc::u0.

◆ get_meanqd()

subroutine pesg::get_meanqd ( integer(spi), intent(in)  ngh,
real(dp), intent(in)  lam,
real(dp), dimension(ngh), intent(in)  xg,
real(dp), dimension(ngh), intent(in)  wg,
real(dp), dimension(2), intent(in)  ak,
real(dp), dimension(2), intent(in)  ma,
real(dp), intent(out)  q,
real(dp), dimension(2), intent(out)  qdak,
real(dp), dimension(2), intent(out)  qdma,
real(dp), dimension(2), intent(out)  ga,
real(dp), dimension(2,2), intent(out)  gadak,
real(dp), dimension(2,2), intent(out)  gadma,
logical, intent(out)  ff 
)

For a parameter vector, ak and a map-space domain-parameter vector, ma, return the lambda-parameterized quality diagnostic, Q, and the geographic domain-parameter vector ga.

Lambda is given by lam <1. Also, return the derivatives, qdak and qdma, of Q wrt ak and ma, and the derivatives gadak and gadma, of ga wrt ak and ma.

The domain averages of Q are accurately computed by bi-Gauss-Legendre quadrature over the positive quadrant of the domain (exploiting the symmetry) of the four constituent terms, v1, v2, v3, v4, from which the mean Q is computed using a quadratic formula of these constituents. The number of Gauss points in eaxh half-interval is ngh, and the nodes themselves are, in proportion to the half-interval, at xg. the normalized gauss weights are wg.

If a failure occurs, colmputations cease immediately and a failure flag, FF, is raised on return.

Parameters
[in]ngh
[in]lamLambda
[in]xg
[in]wg
[in]akparameter vector
[in]mamap-space domain-parameter vector
[out]qlambda-parameterized quality diagnostic
[out]qdakderivatives value
[out]qdmaderivatives value
[out]gageographic domain-parameter vector
[out]gadak
[out]gadma
[out]fferror flag
Author
R. J. Purser

Definition at line 604 of file pesg.f90.

References pietc::rtod, and pietc::u0.

◆ get_meanqs()

subroutine pesg::get_meanqs ( integer(spi), intent(in)  n,
integer(spi), intent(in)  ngh,
real(dp), intent(in)  lam,
real(dp), dimension(ngh), intent(in)  xg,
real(dp), dimension(ngh), intent(in)  wg,
real(dp), dimension(2,n), intent(in)  aks,
real(dp), dimension(2,n), intent(in)  mas,
real(dp), dimension(n), intent(out)  qs,
logical, intent(out)  ff 
)
private

Like getmeanqd, except for n different values, aks, of ak and n different values, mas of ma, and without any of the derivatives.

Parameters
[in]n
[in]ngh
[in]lam
[in]xg
[in]wg
[in]aks
[in]mas
[out]qs
[out]ff
Author
R. J. Purser

Definition at line 682 of file pesg.f90.

References pietc::u0.

◆ get_qofv()

subroutine pesg::get_qofv ( real(dp), intent(in)  lam,
real(dp), intent(in)  v1,
real(dp), intent(in)  v2,
real(dp), intent(in)  v3,
real(dp), intent(in)  v4,
real(dp), intent(out)  q 
)
private

The quadratic quantity Q depends linearly on v1 and v4 (which are already quadratic diagnostics of EL) and quadratically on v2 and v3 (which are linear diagnostics of EL).

EL = (1/2)log(G), where G=J^T.J, J the jacobian.

Parameters
[in]lam
[in]v1quadratic diagnostics of EL
[in]v2linear diagnostics of EL
[in]v3linear diagnostics of EL
[in]v4quadratic diagnostics of EL
[out]qquadratic quantity
Author
R. J. Purser

Definition at line 729 of file pesg.f90.

References pietc::u1.

◆ get_qofvd()

subroutine pesg::get_qofvd ( real(dp), intent(in)  lam,
real(dp), intent(in)  v2,
real(dp), intent(in)  v3,
real(dp), dimension(2), intent(in)  v1d,
real(dp), dimension(2), intent(in)  v2d,
real(dp), dimension(2), intent(in)  v3d,
real(dp), dimension(2), intent(in)  v4d,
real(dp), dimension(2), intent(out)  qd 
)
private

Like get_qofv, but for (only) the 2-vector derivatives of Q.

Note that the quadratic diagnostics v1 and v4 do not participate in this formula.

Parameters
[in]lam
[in]v2
[in]v3
[in]v1d
[in]v2d
[in]v3d
[in]v4d
[out]qd
Author
R. J. Purser

Definition at line 751 of file pesg.f90.

References pietc::u1, and pietc::u2.

◆ get_qsofvs()

subroutine pesg::get_qsofvs ( integer(spi), intent(in)  n,
real(dp), intent(in)  lam,
real(dp), dimension(n), intent(in)  v1s,
real(dp), dimension(n), intent(in)  v2s,
real(dp), dimension(n), intent(in)  v3s,
real(dp), dimension(n), intent(in)  v4s,
real(dp), dimension(n), intent(out)  qs 
)
private

General util to convert value.

Parameters
[in]n
[in]lam
[in]v1s
[in]v2s
[in]v3s
[in]v4s
[out]qs
Author
R. J. Purser

Definition at line 771 of file pesg.f90.

References pietc::u1.

◆ get_qx()

subroutine pesg::get_qx ( real(dp), dimension(3,2), intent(in)  j0,
real(dp), intent(out)  v1,
real(dp), intent(out)  v2,
real(dp), intent(out)  v3,
real(dp), intent(out)  v4 
)
private

From a jacobian matrix, j0, get a sufficient set of v.

. diagnostics such that, from averages of these v, we can later compute the collective variance of Q(lam) that they imply for any choice of the "lambda" parameter, lam. Note that v1 and v4 are quadratic diagnostics of EL, while v2 and v3 are linear.

Parameters
[in]j0jacobian matrix
[out]v1quadratic diagnostics of EL
[out]v2linear diagnostics of EL
[out]v3linear diagnostics of EL
[out]v4quadratic diagnostics of EL
Author
R. J. Purser

Definition at line 512 of file pesg.f90.

References pietc::o2, and pietc::u2.

◆ get_qxd()

subroutine pesg::get_qxd ( real(dp), dimension(3,2), intent(in)  j0,
real(dp), dimension(3,2,2), intent(in)  j0d,
real(dp), intent(out)  v1,
real(dp), intent(out)  v2,
real(dp), intent(out)  v3,
real(dp), intent(out)  v4,
real(dp), dimension(2), intent(out)  v1d,
real(dp), dimension(2), intent(out)  v2d,
real(dp), dimension(2), intent(out)  v3d,
real(dp), dimension(2), intent(out)  v4d 
)

From a jacobian matrix, j0, and its derivative, j0d, get a sufficient set of v.

. diagnostics such that, from average of these diagnostics, we can later compute the collective variance of Q and its derivative.

Parameters
[in]j0jacobian matrix
[in]j0dderivative of j0
[in]v1
[in]v2
[in]v3
[in]v4
[in]v1d
[in]v2d
[in]v3d
[in]v4d
Author
R. J. Purser

Definition at line 542 of file pesg.f90.

References pietc::o2, pietc::u0, and pietc::u2.

◆ gtoxm_ak_dd_g()

subroutine pesg::gtoxm_ak_dd_g ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  pdlat,
real(dp), intent(in)  pdlon,
real(dp), intent(in)  pdazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), intent(in)  dlat,
real(dp), intent(in)  dlon,
real(dp), dimension(2), intent(out)  xm,
logical, intent(out)  ff 
)
private

Like gtoxm_ak_rr_g, except lat, lon, azimuth, are expressed in degrees.

Parameters
[in]aparameter of the ESG mapping
[in]kparameter of the ESG mapping
[in]pdlatdegrees latitude defining mapping projection center
[in]pdlondegrees longitude defining mapping projection center
[in]pdaziAzimuth of mapping orientation at its center
[in]delxcentral x-spacing of the grid in radians
[in]delycentral y-spacing of the grid in radians
[in]dlatdegrees latitude of a point to be mapped
[in]dlondegrees longitude of a point to be mapped
[out]xm2-vector image of the point in center-relative grid units
[out]fffailure flag
Author
R. J. Purser

Definition at line 1984 of file pesg.f90.

References pietc::dtor, and gtoxm_ak_rr_g().

◆ gtoxm_ak_dd_m()

subroutine pesg::gtoxm_ak_dd_m ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  pdlat,
real(dp), intent(in)  pdlon,
real(dp), intent(in)  pdazi,
real(dp), intent(in)  dlat,
real(dp), intent(in)  dlon,
real(dp), dimension(2), intent(out)  xm,
logical, intent(out)  ff 
)
private

Like gtoxm_ak_rr_m, except lat, lon, azimuth, are expressed in degrees.

Parameters
[in]aparameter of the ESG mapping
[in]kparameter of the ESG mapping
[in]pdlatdegrees latitude defining mapping center
[in]pdlondegrees longitude defining mapping center
[in]pdaziAzimuth of mapping orientation at its center
[in]dlatdegrees latitude of point to be mapped
[in]dlondegrees longitude of point to be mapped
[out]xm2-vector center-relative map space image of the point
[out]fffailure flag
Author
R. J. Purser

Definition at line 1955 of file pesg.f90.

References pietc::dtor, and gtoxm_ak_rr_m().

◆ gtoxm_ak_rr_g()

subroutine pesg::gtoxm_ak_rr_g ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), intent(in)  lat,
real(dp), intent(in)  lon,
real(dp), dimension(2), intent(out)  xm,
logical, intent(out)  ff 
)

Given the map specification (angles in radians), the grid spacing (in map-space units) and the sample lat-lon (in radian), return the the image in map space in a 2-vector in grid units.

If the transformation is invalid, return a .true. failure flag.

Parameters
[in]aparameter of the ESG mapping
[in]kparameter of the ESG mapping
[in]platradians latitude defining mapping projection center
[in]plonradians longitude defining mapping projection center
[in]paziAzimuth of mapping orientation at its center
[in]delxcentral x-spacing of the grid in radians
[in]delycentral y-spacing of the grid in radians
[in]latradians latitude of a point to be mapped
[in]lonradians longitude of a point to be mapped
[out]xm2-vector map space image in center-relative grid units
[out]fffailure flag
Author
R. J. Purser

Definition at line 1933 of file pesg.f90.

References gtoxm_ak_rr_m().

Referenced by gtoxm_ak_dd_g().

◆ gtoxm_ak_rr_m()

subroutine pesg::gtoxm_ak_rr_m ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  lat,
real(dp), intent(in)  lon,
real(dp), dimension(2), intent(out)  xm,
logical, intent(out)  ff 
)
private

Given the map specification (angles in radians), the grid spacing (in map-space units) and the sample lat-lon (in radian), return the the image in map space in a 2-vector in grid units.

If the transformation is invalid, return a .true. failure flag.

Parameters
[in]aparameters of an ESG mapping
[in]kparameters of an ESG mapping
[in]platradians latitude defining mapping projection center
[in]plonradians longitude defining mapping projection center
[in]paziAximuth of mapping orientation at its center
[in]latradians latitude of a point to be mapped
[in]lonradians longitude of a point to be mapped
[out]xm2-vector center-relative map-space image of mapped point
[out]fffailure flag
Author
R. J. Purser

Definition at line 1888 of file pesg.f90.

References pietc::u0, and pietc::u1.

Referenced by gtoxm_ak_dd_m(), and gtoxm_ak_rr_g().

◆ guessak_geo()

subroutine pesg::guessak_geo ( real(dp), intent(in)  asp,
real(dp), intent(in)  arc,
real(dp), dimension(2), intent(out)  ak 
)
private

Given an aspect ratio, asp<=1, and major semi-axis, arc, in geographical (degree) units measured along the rectangle's median, return a first guess for the parameter vector, ak, approximately optimal for the domain of the given dimensions.

Parameters
aspaspect ratio of intended domain
arcmajor semi-axis angle in degrees for intended domain
akfirst guess of the parameter vector
Author
R. J. Purser

Definition at line 809 of file pesg.f90.

◆ guessak_map()

subroutine pesg::guessak_map ( real(dp), intent(in)  asp,
real(dp), intent(in)  tmarcx,
real(dp), dimension(2), intent(out)  ak 
)
private

Given an aspect ratio, asp<=1, and major semi-axis, arc, in map-space nondimensional units, return a first guess for the parameter vector, ak, approximately optimal for the domain of the given dimensions.

Parameters
[in]aspaspect ratio
[in]tmarcx
[out]akfirst guess for the parameter vector
Author
R. J. Purser

Definition at line 791 of file pesg.f90.

References pietc::rtod.

◆ hgrid_ak()

subroutine, public pesg::hgrid_ak ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  re,
real(dp), intent(in)  delxre,
real(dp), intent(in)  delyre,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glat,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glon,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
logical, intent(out)  ff 
)

Like hgrid_ak_rr_c except the argument list includes the earth radius, re, and this is used to express the map-space grid increments in the dimensional units, delxre, delyre on entry, and to express the grid cell areas, garea, in dimensional units upon return.

The gridded lats and lons, glat and glon, remain in radians.

Parameters
[in]lxcenter-relative x grid index for left edge of the domain
[in]lycenter-relative y grid index for lower edge of the domain
[in]nxnumbers of the grid spaces in x
[in]nynumbers of the grid spaces in y
[in]aparameters of an ESG mapping
[in]kparameters of an ESG mapping
[in]platradians latitude of the projection center of the mapping
[in]plonradians longitude of the projection center of the mapping
[in]paziAzimuth of map orientation at its center
[in]reearth radius
[in]delxremap-space grid increments in the dimensional units
[in]delyremap-space grid increments in the dimensional units
[out]glatgrid points for latitude
[out]glongrid points for longitude
[out]gareaarray of grid-cell areas in dimensional units
[out]fffailure flag
Author
R. J. Purser

Definition at line 1766 of file pesg.f90.

◆ hgrid_ak_c()

subroutine pesg::hgrid_ak_c ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  re,
real(dp), intent(in)  delxre,
real(dp), intent(in)  delyre,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glat,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glon,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny ), intent(out)  dx,
real(dp), dimension(lx:lx+nx ,ly:ly+ny-1), intent(out)  dy,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  dangle_dx,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  dangle_dy,
logical, intent(out)  ff 
)
private

Like hgrid_ak_rr_c except the argument list includes the earth radius, re, and this is used to express the map-space grid increments in the dimensional units, delxre, delyre on entry, and to express the grid cell areas, garea, and the x- and y- grid steps, dx and dy, in dimensional units upon return.

The gridded lats and lons, glat and glon, remain in radians. Also, in order for the argument list to remain compatible with an earlier version of this routine, the relative rotations of the steps, dangle_dx and dangle_dy, are returned as degrees instead of radians (all other angles in the argument list, i.e., plat,plon,pazi,glat,glon, remain radians).

Parameters
[in]lxcenter-relative x grid index for left edge of the domain
[in]lycenter-relative y grid index for lower edge of the domain
[in]nxnumber of grid spaces in x
[in]nynumber of grid spaces in y
[in]aExtended Schmidt Gnomonic parameter
[in]kExtended Schmidt Gnomonic parameter
[in]platlatitude of projection center of the mapping (radians)
[in]plonlongitude of projection center of the mapping (radians)
[in]paziAzimuth of map orientation at its center (radians)
[in]reearth radius in dimensional length units
[in]delxremap-space grid increments in the dimensional units
[in]delyremap-space grid increments in the dimensional units
[out]glatgridded lats (radians)
[out]glongridded lons (radians)
[out]gareagrid cell areas in dimensional units
[out]dxx- grid steps in dimensional units
[out]dyy- grid steps in dimensional units
[out]dangle_dxazimuth rotations of the steps dx (in degrees)
[out]dangle_dyazimuth rotations of the steps dy (in degrees)
[out]fffailure flag
Author
R. J. Purser

Definition at line 1818 of file pesg.f90.

References hgrid_ak_rr_c(), and pietc::rtod.

◆ hgrid_ak_dc()

subroutine, public pesg::hgrid_ak_dc ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), intent(in)  pdlat,
real(dp), intent(in)  pdlon,
real(dp), intent(in)  pdazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(3, lx:lx+nx ,ly:ly+ny ), intent(out)  xc,
real(dp), dimension(3,2,lx:lx+nx ,ly:ly+ny ), intent(out)  xcd,
real(dp), dimension( lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
logical, intent(out)  ff 
)

Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (pdlat,pdlon) and twisted about this center by an azimuth angle of pdazi counterclockwise (these angles in degrees).

Like hgrid_ak_rx, return the grid points' cartesians xc and Jacobian matrices, xcd. Garea, the area of each grid cell, is also returned as in hgrid_ak_rx, and a failure flag, ff, raised when a failure occurs anywhere in these calculations.

Parameters
[in]lxcenter-relative x grid index for left edge of the domain
[in]lycenter-relative y grid index for lower edge of the domain
[in]nxnumbers of the grid spaces in x
[in]nynumbers of the grid spaces in y
[in]aparameters of an ESG mapping
[in]kparameters of an ESG mapping
[in]pdlatdegrees latitude of the projection center of the mapping
[in]pdlondegrees longitude of the projection center of the mapping
[in]pdaziazimuth of the orientation of the mapping at its center
[in]delxcentral x-spacing of the grid in radians
[in]delycentral y-spacing of the grid in radians
[out]xcgrid points' earth-centered unit cartesians
[out]xcdJacobian matrices, d(xc)/d(xm)
[out]gareaarray of grid-cell areas (steradians)
[out]fffailure flag
Author
R. J. Purser

Definition at line 1724 of file pesg.f90.

References pietc::dtor.

◆ hgrid_ak_dd()

subroutine, public pesg::hgrid_ak_dd ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), intent(in)  pdlat,
real(dp), intent(in)  pdlon,
real(dp), intent(in)  pdazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  gdlat,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  gdlon,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
logical, intent(out)  ff 
)

Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (pdlat,pdlon) and twisted about this center by an azimuth angle of pdazi counterclockwise (these angles in degrees).

Like hgrid_ak_rr, return the grid points' lats and lons, except that here the angles are returned in degrees. Garea, the area of each grid cell, is returned as in hgrid_ak_rr, and a failure flag, ff, raised when a failure occurs anywhere in these calculations.

Parameters
[in]lxcenter-relative x grid index for left edge of the domain
[in]lycenter-relative y grid index for lower edge of the domain
[in]nxnumber of the grid spaces in x
[in]nynumber of the grid spaces in y
[in]aparameter of an ESG mapping
[in]kparameter of an ESG mapping
[in]pdlatdegrees latitude of the projection center of mapping
[in]pdlondegrees longitude of the projection center of mapping
[in]pdazidegrees azimuth of orientation of mapping at its center
[in]delxcentral x-spacing of the grid (in radians)
[in]delycentral y-spacing of the grid (in radians)
[out]gdlatarray of grid point latitudes (in degrees)
[out]gdlonarray of grid point longitudes (in dgrees)
[out]gareaarray of grid cell areas (in steradians)
[out]fffailure flag
Author
R. J. Purser

Definition at line 1630 of file pesg.f90.

References pietc::dtor, and pietc::rtod.

◆ hgrid_ak_dd_c()

subroutine pesg::hgrid_ak_dd_c ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), intent(in)  pdlat,
real(dp), intent(in)  pdlon,
real(dp), intent(in)  pdazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  gdlat,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  gdlon,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny ), intent(out)  dx,
real(dp), dimension(lx:lx+nx ,ly:ly+ny-1), intent(out)  dy,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  dangle_dx,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  dangle_dy,
logical, intent(out)  ff 
)
private

Like hgrid_ak_rr_c, except all the angle arguments (but not delx,dely) are in degrees instead of radians.

Parameters
[in]lxcenter-relative x grid index for left edge of the domain
[in]lycenter-relative y grid index for lower edge of the domain
[in]nxnumbers of the grid spaces in x
[in]nynumbers of the grid spaces in y
[in]aparameters of an ESG mapping
[in]kparameters of an ESG mapping
[in]pdlatlatitude defining projection center of the mapping
[in]pdlonlongitude defining projection center of the mapping
[in]pdaziazimuth of the orientation of the mapping at its center
[in]delxcentral x-spacing of the grid (in radians)
[in]delycentral y-spacing of the grid (in radians)
[out]gdlatarray of grid point degree-latitudes
[out]gdlonarray of grid point degree-longitudes
[out]gareaarray of grid-cell areas (steradians)
[out]dxstep sizes of the grid-cell edges in x (earth radius=1 unit)
[out]dystep sizes of the grid-cell edges in y (earth radius=1 unit)
[out]dangle_dxazimuth rotation of the x grid steps, dx (degrees)
[out]dangle_dyazimuth rotation of the y grid steps, dy (degrees)
[out]fffailure flag
Author
R. J. Purser

Definition at line 1673 of file pesg.f90.

References pietc::dtor, hgrid_ak_rr_c(), and pietc::rtod.

◆ hgrid_ak_rc()

subroutine, public pesg::hgrid_ak_rc ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(3, lx:lx+nx ,ly:ly+ny ), intent(out)  xc,
real(dp), dimension(3,2,lx:lx+nx ,ly:ly+ny ), intent(out)  xcd,
real(dp), dimension( lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
logical, intent(out)  ff 
)

Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (plat,plon) and twisted about this center by an azimuth angle of pazi counterclockwise (these angles in radians).

Assume the radius of the earth is unity, and using the central mapping point as the coordinate origin, set up the grid with central x-spacing delx and y-spacing dely. The grid index location of the left-lower corner of the domain is (lx,ly) (typically both NEGATIVE). The numbers of the grid spaces in x and y directions are nx and ny. (Note that, for a centered rectangular grid lx and ly are negative and, in magnitude, half the values of nx and ny respectively.) Return the unit cartesian vectors xc of the grid points and their jacobian matrices xcd wrt the map coordinates, and return a rectangular array, garea, of dimensions nx-1 by ny-1, that contains the areas of each of the grid cells

If all goes well, return a lowered failure flag, ff=.false. . But if, for some reason, it is not possible to complete this task, return the raised failure flag, ff=.TRUE. .

Parameters
lxcenter-relative x grid index for left edge of the domain
lycenter-relative y grid index for lower edge of the domain
nxnumbers of the grid spaces in x
nynumbers of the grid spaces in y
aparameters of the ESG mapping centered at (plat,plon)
kparameters of the ESG mapping centered at (plat,plon)
platlatitude of the projection center of the mapping (radians)
plonlongitude of the projection center of the mapping (radians)
paziazimuth of orientation of mapping at its center
delxcentral x-spacing of the grid (in radians)
delycentral y-spacing of the grid (in radians)
xcEarth-centered unit cartesian 3-vectors at each grid point
xcdJacobian matrices, d(xc)/d(xm), at each grid point
garearectangular array of grid-cell areas (steradians)
fffailure flag
Author
R. J. Purser

Definition at line 1541 of file pesg.f90.

References pietc::u0, and pietc::u1.

◆ hgrid_ak_rr()

subroutine, public pesg::hgrid_ak_rr ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glat,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glon,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
logical, intent(out)  ff 
)

Use a and k as the parameters of an Extended Schmidt-transformed Gnomonic (ESG) mapping centered at (plat,plon) and twisted about this center by an azimuth angle of pazi counterclockwise (these angles in radians).

Assume the radius of the earth is unity, and using the central mapping point as the coordinate origin, set up the grid with central x-spacing delx and y-spacing dely. The grid index location of the left-lower corner of the domain is (lx,ly) (typically both NEGATIVE). The numbers of the grid spaces in x and y directions are nx and ny. (Note that, for a centered rectangular grid lx and ly are negative and, in magnitude, half the values of nx and ny respectively.) Return the latitude and longitude, in radians again, of the grid points thus defined in the arrays, glat and glon, and return a rectangular array, garea, of dimensions nx-1 by ny-1, that contains the areas of each of the grid cells

If all goes well, return a lowered failure flag, ff=.false. . But if, for some reason, it is not possible to complete this task, return the raised failure flag, ff=.TRUE. .

Parameters
[in]lxcenter-relative grid index in x of left edge of the domain
[in]lycenter-relative grid index in y of lower edge of the domain
[in]nxnumber of grid spaces in x
[in]nynumber of grid spaces in y
[in]Aparameter of the ESG mapping centered at (plat,plon)
[in]Kparameter of the ESG mapping centered at (plat,plon)
[in]platlatitude of projection center of mapping (radians)
[in]plonlongitude of projection center of mapping (radians)
[in]paziazimuth of orientation of mapping at its center
[in]delxcentral x-spacing of the grid (radians)
[in]delycentral y-spacing of the grid (radians)
[out]glatgrid points' latitudes
[out]glongrid points' longitudes
[out]gareaarray of grid-cell areas (steradians)
[out]fffailure flag
Author
R. J. Purser

Definition at line 1221 of file pesg.f90.

References pietc::u0, and pietc::u1.

◆ hgrid_ak_rr_c()

subroutine pesg::hgrid_ak_rr_c ( integer(spi), intent(in)  lx,
integer(spi), intent(in)  ly,
integer(spi), intent(in)  nx,
integer(spi), intent(in)  ny,
real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glat,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  glon,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny-1), intent(out)  garea,
real(dp), dimension(lx:lx+nx-1,ly:ly+ny ), intent(out)  dx,
real(dp), dimension(lx:lx+nx ,ly:ly+ny-1), intent(out)  dy,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  angle_dx,
real(dp), dimension(lx:lx+nx ,ly:ly+ny ), intent(out)  angle_dy,
logical, intent(out)  ff 
)

Use a and k as the parameters of an extended Schmidt-transformed gnomonic (ESG) mapping centered at (plat,plon) and twisted about this center by an azimuth angle of pazi counterclockwise (these angles in radians).

Using the central mapping point as the coordinate origin, set up the grid with central x-spacing delx and y-spacing dely in nondimensional units, (i.e., as if the earth had unit radius) and with the location of the left- lower corner of the grid at center-relative grid index pair, (lx,ly) and with the number of the grid spaces in x and y directions given by nx and ny. (Note that, for a centered rectangular grid lx and ly are negative and, in magnitude, half the values of nx and ny respectively.) Return the latitude and longitude, again, in radians, of the grid pts thus defined in the arrays, glat and glon; return a rectangular array, garea, of dimensions nx-1 by ny-1, that contains the areas of each of the grid cells in nondimensional "steradian" units.

In this version, these grid cell areas are computed by 2D integrating the scalar jacobian of the transformation, using a 4th-order centered scheme. The estimated grid steps, dx and dy, are returned at the grid cell edges, using the same 4th-order scheme to integrate the 1D projected jacobian. The angles, relative to local east and north, are returned respectively as angle_dx and angle_dy at grid cell corners, in radians counterclockwise.

if all goes well, return a .FALSE. failure flag, ff. If, for some reason, it is not possible to complete this task, return the failure flag as .TRUE.

Parameters
[in]lxcenter-relative x grid index for left edge of the domain
[in]lycenter-relative y grid index for lower edge of the domain
[in]nxnumbers of the grid spaces in x
[in]nynumbers of the grid spaces in y
[in]aExtended Schmidt Gnomonic parameter
[in]kExtended Schmidt Gnomonic parameter
[in]platlatitude of the projection center of the mapping (radians)
[in]plonlongitude of the projection center of the mapping (radians)
[in]paziazimuth of the orientation of the mapping at its center
[in]delxcentral x-spacing of the grid (radians)
[in]delycentral y-spacing of the grid (radians)
[out]glatgrid points' latitudes (radians)
[out]glongrid points' longitudes (radians)
[out]gareaarray of grid-cell areas (steradians)
[out]dxgrid steps in x at grid cell edges (radians)
[out]dygrid steps in y at grid cell edges (radians)
[out]angle_dxx angles relative to local east (radians)
[out]angle_dyy angles relative to local north (radians)
[out]fffailure flag
Author
R. J. Purser

Definition at line 1338 of file pesg.f90.

References pietc::u0, and pietc::u1.

Referenced by hgrid_ak_c(), and hgrid_ak_dd_c().

◆ xctoxm_ak()

subroutine, public pesg::xctoxm_ak ( real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), dimension(3), intent(in)  xc,
real(dp), dimension(2), intent(out)  xm,
logical, intent(out)  ff 
)

Inverse mapping of xmtoxc_ak.

That is, go from given cartesian unit 3-vector, xc, to map coordinate 2-vector xm (or return a raised failure flag, FF, if the attempt fails).

Parameters
[in]aESG mapping parameter for line spacing profile
[in]kESG mapping parameter for Gauss curvature in Schmidt mapping
[in]xcEarth-centered cartesian unit 3-vector
[out]xm2-vector map coordinate
[out]ffFailure flag
Author
R. J. Purser

Definition at line 466 of file pesg.f90.

References pietc::f.

◆ xctoxs()

subroutine pesg::xctoxs ( real(dp), dimension(3), intent(in)  xc,
real(dp), dimension(2), intent(out)  xs 
)
private

Inverse of xstoxc.

I.e., cartesians to stereographic.

Parameters
[in]xcEarth-centered cartesian unit 3-vector
[out]xsStereographic map coordinates
Author
R. J. Purser

Definition at line 68 of file pesg.f90.

References pietc::u1.

◆ xmtog_ak_dd_g()

subroutine pesg::xmtog_ak_dd_g ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  pdlat,
real(dp), intent(in)  pdlon,
real(dp), intent(in)  pdazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(2), intent(in)  xm,
real(dp), intent(out)  dlat,
real(dp), intent(out)  dlon,
logical, intent(out)  ff 
)

Like xmtog_ak_rr_g, except lat, lon, azimuth, are expressed in degrees.

Parameters
[in]aparameters of an ESG mapping
[in]kparameters of an ESG mapping
[in]pdlatdegrees latitude of projection center of the mapping
[in]pdlondegrees longitude of projection center of the mapping
[in]pdaziAzimuth of the mapping orientation about its center
[in]delxcentral x-spacing of the grid in radians
[in]delycentral y-spacing of the grid in radians
[in]xmmap coordinates, in grid units, of a point to be mapped
[out]dlatdegrees latitude of the point
[out]dlondegrees longitude of the point
[out]fffailure flag
Author
R. J. Purser

Definition at line 2118 of file pesg.f90.

References pietc::dtor, pietc::rtod, and xmtog_ak_rr_m().

◆ xmtog_ak_dd_m()

subroutine pesg::xmtog_ak_dd_m ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  pdlat,
real(dp), intent(in)  pdlon,
real(dp), intent(in)  pdazi,
real(dp), dimension(2), intent(in)  xm,
real(dp), intent(out)  dlat,
real(dp), intent(out)  dlon,
logical, intent(out)  ff 
)
private

Like xmtog_ak_rr_m, except lat, lon, azimuth, are expressed in degrees.

Parameters
[in]aparameters of the ESG mapping
[in]kparameters of the ESG mapping
[in]pdlatdegrees latitude of the projection center of the mapping
[in]pdlondegrees longitude of the projection center of the mapping
[in]pdaziAzimuth of the orientation of the mapping at its center
[in]xmmap space 2-vector coordinates of a point
[out]dlatdegrees latitude of the point
[out]dlondegrees longitude of the point
[out]fffailure flag
Author
R. J. Purser

Definition at line 2087 of file pesg.f90.

References pietc::dtor, pietc::rtod, and xmtog_ak_rr_m().

◆ xmtog_ak_rr_g()

subroutine pesg::xmtog_ak_rr_g ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), intent(in)  delx,
real(dp), intent(in)  dely,
real(dp), dimension(2), intent(in)  xm,
real(dp), intent(out)  lat,
real(dp), intent(out)  lon,
logical, intent(out)  ff 
)

For an ESG map with parameters, (A,K), and geographical orientation, given by plon,plat,pazi (radians), and given a point in grid-space units as the 2-vector, xm, return the geographical coordinates, lat, lon, (radians) of this point.

If instead the transformation is invalid for any reason, then return the raised failure flag, FF=.true.

Parameters
[in]aparameters of the ESG mapping
[in]kparameters of the ESG mapping
[in]platradians latitude of the projection center of the mapping
[in]plonradians longitude of the projection center of the mapping
[in]paziAzimuth of the orientation of the mapping at its center
[in]delxcentral x-spacing of the grid in radians
[in]delycentral y-spacing grid point in radians
[in]xmgrid-space 2-vector coordinates of a point to be mapped
[out]latradians latitude of the point
[out]lonradians longitude of the point
[out]fffailure flag
Author
R. J. Purser

Definition at line 2063 of file pesg.f90.

References xmtog_ak_rr_m().

◆ xmtog_ak_rr_m()

subroutine pesg::xmtog_ak_rr_m ( real(dp), intent(in)  A,
real(dp), intent(in)  K,
real(dp), intent(in)  plat,
real(dp), intent(in)  plon,
real(dp), intent(in)  pazi,
real(dp), dimension(2), intent(in)  xm,
real(dp), intent(out)  lat,
real(dp), intent(out)  lon,
logical, intent(out)  ff 
)
private

Given the ESG map specified by parameters (A,K) and geographical center and orientation, plat,plon,pazi (radians), and a position, in map-space coordinates given by the 2-vector, xm, return the geographical coordinates, lat and lon (radians).

If the transformation is invalid for any reason, return instead with a raised failure flag, FF= .true.

Parameters
[in]aparameter of an ESG mapping
[in]kparameter of an ESG mapping
[in]platradians latitude of the projection center of the mapping
[in]plonradians longitude of the projection center of the mapping
[in]paziAzimuth of orientation of the mapping at its center
[in]xmcenter-relative 2-vector map space coordinates of a point
[out]latradians latitude of the point
[out]lonradians longitude of the point
[out]fffailure flag
Author
R. J. Purser

Definition at line 2015 of file pesg.f90.

References pietc::u0, and pietc::u1.

Referenced by xmtog_ak_dd_g(), xmtog_ak_dd_m(), and xmtog_ak_rr_g().

◆ xmtoxc_ak()

subroutine, public pesg::xmtoxc_ak ( real(dp), intent(in)  a,
real(dp), intent(in)  k,
real(dp), dimension(2), intent(in)  xm,
real(dp), dimension(3), intent(out)  xc,
real(dp), dimension(3,2), intent(out)  xcd,
logical, intent(out)  ff 
)

Assuming the A-K parameterization of the Extended Schmidt-transformed Gnomonic (ESG) mapping, and given a map-space 2-vector, xm, find the corresponding cartesian unit 3-vector and its derivative wrt xm, jacobian matrix, xcd.

If for any reason the mapping cannot be done, return a raised failure flag, FF.

Parameters
[in]aESG mapping parameter for line spacing profile
[in]kESG mapping parameter for Gauss curvature in Schmidt mapping
[in]xmmap-space 2-vector
[out]xcEarth-centered cartesian unit 3-vector
[out]xcdJacobian matrix, d(xc)/d(xm)
[out]ffFailure flag
Author
R. J. Purser

Definition at line 440 of file pesg.f90.

◆ xmtoxc_vak()

subroutine pesg::xmtoxc_vak ( real(dp), dimension(2), intent(in)  ak,
real(dp), dimension(2), intent(in)  xm,
real(dp), dimension(3), intent(out)  xc,
real(dp), dimension(3,2), intent(out)  xcd,
logical, intent(out)  ff 
)

Assuming the vector AK parameterization of the Extended Schmidt-transformed Gnomonic (ESG) mapping with parameter vector, and given a map-space 2-vector, xm, find the corresponding cartesian unit 3-vector and its derivative wrt xm, the Jacobian matrix, xcd.

If for any reason the mapping cannot be done, return a raised failure flag,z FF.

Parameters
[in]ak2-vector parameterization of the ESG mapping
[in]xm2-vector of map plane coordinates
[out]xcEarth-centered cartesian unit 3-vector
[out]xcdJacobian, d(xc)/d(xm)
[out]ffFailure flag
Author
R. J. Purser

Definition at line 381 of file pesg.f90.

◆ xmtoxc_vak1()

subroutine pesg::xmtoxc_vak1 ( real(dp), dimension(2), intent(in)  ak,
real(dp), dimension(2), intent(in)  xm,
real(dp), dimension(3), intent(out)  xc,
real(dp), dimension(3,2), intent(out)  xcd,
real(dp), dimension(3,2), intent(out)  xc1,
real(dp), dimension(3,2,2), intent(out)  xcd1,
logical, intent(out)  ff 
)
private

Like xmtoxc_vak, _ak, but also return derivatives wrt ak.

Parameters
[in]ak2-vector parameterization of the ESG mapping
[in]xm2-vector of map plane coordinates
[out]xcEarth-centered cartesian unit 3-vector
[out]xcdJacobian of xc wrt xm, d(xc)/d(xm)
[out]xc1Partial derivatives wrt ak of xc, d(xc)/d(ak)
[out]xcd1Second derivative wrt xm and ak of xc, d^2(xc)/(d(xm)d(ak))
[out]ffFailure flag
Author
R. J. Purser

Definition at line 400 of file pesg.f90.

References xmtoxt1(), and xttoxs1().

◆ xmtoxt()

subroutine pesg::xmtoxt ( real(dp), intent(in)  a,
real(dp), dimension(2), intent(in)  xm,
real(dp), dimension(2), intent(out)  xt,
real(dp), dimension(2,2), intent(out)  xtd,
logical, intent(out)  ff 
)
private

Like zmtozt, but for 2-vector xm and xt, and 2*2 diagonal Jacobian xtd.

Parameters
[in]aMapping parameter controlling grid line spacing profile
[in]xmVector value of map coordinates
[out]xtVector value of gnomonic plane coordinates
[out]xtd2*2 diagonal Jacobian, d(xt)/d(xm)
[out]ffFailure flag
Author
R. J. Purser

Definition at line 254 of file pesg.f90.

References pietc::u0.

◆ xmtoxt1()

subroutine pesg::xmtoxt1 ( real(dp), intent(in)  a,
real(dp), dimension(2), intent(in)  xm,
real(dp), dimension(2), intent(out)  xt,
real(dp), dimension(2,2), intent(out)  xtd,
real(dp), dimension(2), intent(out)  xt1,
real(dp), dimension(2,2), intent(out)  xtd1,
logical, intent(out)  ff 
)
private

Like zmtozt1, but for 2-vector xm and xt, and 2*2 diagonal Jacobian xtd Also, the derivatives, wrt a, of these quantities.

Parameters
[in]aMapping parameter controlling grid line spacing profile
[in]xmVector value of map plane coordinates
[out]xtVector value of gnomonic plane coordinates
[out]xtd2*2 diagonal Jacobian, d(xt)/d(xm)
[out]xt1Derivative wrt a of xt, d(xt)/da
[out]xtd1Derivative wrt a of Jacobian xtd, d^2(xt)/(d(xm)da)
[out]ffFailure flag
Author
R. J. Purser

Definition at line 276 of file pesg.f90.

References pietc::u0, and zmtozt1().

Referenced by xmtoxc_vak1().

◆ xstoxc()

subroutine pesg::xstoxc ( real(dp), dimension(2), intent(in)  xs,
real(dp), dimension(3), intent(out)  xc,
real(dp), dimension(3,2), intent(out)  xcd 
)
private

Standard transformation from polar stereographic map coordinates, xs, to cartesian, xc, assuming the projection axis is polar.

xcd=d(xc)/d(xs) is the jacobian matrix, encoding distortion and metric.

Parameters
[in]xsStereographic map coordinates
[out]xcCartesian earth-centered 3-vector
[out]xcdValue of jacobian matrix, encoding distortion and metric
Author
R. J. Purser

Definition at line 85 of file pesg.f90.

References pietc::u1, and pietc::u2.

◆ xstoxc1()

subroutine pesg::xstoxc1 ( real(dp), dimension(2), intent(in)  xs,
real(dp), dimension(3), intent(out)  xc,
real(dp), dimension(3,2), intent(out)  xcd,
real(dp), dimension(3,2,2), intent(out)  xcdd 
)

Standard transformation from polar stereographic map coordinates, xs, to cartesian, xc, assuming the projection axis is polar.

xcd=d(xc)/d(xs) is the jacobian matrix, encoding distortion and metric. xcdd is the further derivative, wrt xs, of xcd.

Parameters
[in]xsStereographic map coordinates
[out]xcCartesian earth-centered 3-vector
[out]xcdJacobian matrix, encoding distortion and metric
[out]xcddFurther derivative, wrt xs, of xcd
Author
R. J. Purser

Definition at line 107 of file pesg.f90.

References pietc::u0, pietc::u1, and pietc::u2.

◆ xstoxt()

subroutine pesg::xstoxt ( real(dp), intent(in)  k,
real(dp), dimension(2), intent(in)  xs,
real(dp), dimension(2), intent(out)  xt,
logical, intent(out)  ff 
)

Inverse of xttoxs.

Parameters
[in]kGaussian curvature parameter of Schmidt mapping
[in]xsStereographic plane coordinates
[out]xtScaled gnomonic plane coordinates
[out]ffFailure flag
Author
R. J. Purser

Definition at line 139 of file pesg.f90.

References pietc::u1, and pietc::u2.

◆ xttoxm()

subroutine pesg::xttoxm ( real(dp), intent(in)  a,
real(dp), dimension(2), intent(in)  xt,
real(dp), dimension(2), intent(out)  xm,
logical, intent(out)  ff 
)

Inverse of xmtoxt.

Parameters
[in]aMapping parameter controlling grid line spacing profile
[in]xtGnomonic plane coordinates
[out]xmMap coordinates
[out]ffFailure flag
Author
R. J. Purser

Definition at line 235 of file pesg.f90.

◆ xttoxs()

subroutine pesg::xttoxs ( real(dp), intent(in)  k,
real(dp), dimension(2), intent(in)  xt,
real(dp), dimension(2), intent(out)  xs,
real(dp), dimension(2,2), intent(out)  xsd,
logical, intent(out)  ff 
)
private

Scaled gnomonic plane xt to standard stereographic plane xs.

Parameters
[in]kGaussian curvature parameter of Schmidt mapping
[in]xtScaled gnomonic plane
[out]xsStandard stereographic plane
[out]xsdJacobian matrix, d(xs)/d(xt).
[out]ffFailure flag
Author
R. J. Purser

Definition at line 159 of file pesg.f90.

References pietc::u0, and pietc::u1.

◆ xttoxs1()

subroutine pesg::xttoxs1 ( real(dp), intent(in)  k,
real(dp), dimension(2), intent(in)  xt,
real(dp), dimension(2), intent(out)  xs,
real(dp), dimension(2,2), intent(out)  xsd,
real(dp), dimension(2,2,2), intent(out)  xsdd,
real(dp), dimension(2), intent(out)  xs1,
real(dp), dimension(2,2), intent(out)  xsd1,
logical, intent(out)  ff 
)

Like xttoxs, but also, return the derivatives, wrt K, of xs and xsd.

Parameters
[in]kGaussian curvature parameter of the Schmidt mapping
[in]xtScaled gnomonic plane
[out]xsStandard stereographic plane
[out]xsdJacobian matrix, d(xs)/d(xt)
[out]xsddSecond partial derivatives, d^2(xs)/(d(xt)d(xt))
[out]xs1Derivative of xs wrt mapping parameter, d(xs)/dk
[out]xsd1Derivative of Jacobian wrt k: d^2(xs)/(d(xt)dk)
[out]ffFailure flag
Author
R. J. Purser

Definition at line 193 of file pesg.f90.

References pietc::o2, pietc::u0, pietc::u1, and pietc::u2.

Referenced by xmtoxc_vak1().

◆ zmtozt()

subroutine pesg::zmtozt ( real(dp), intent(in)  a,
real(dp), intent(in)  zm,
real(dp), intent(out)  zt,
real(dp), intent(out)  ztd,
logical, intent(out)  ff 
)
private

Evaluate the function, zt = tan(sqrt(A)*z)/sqrt(A), and its derivative, ztd, for positive and negative A and for the limiting case, A –> 0.

Parameters
[in]aMapping parameter controlling grid line spacing profile
[in]zmScalar value of single map plane coordinate
[out]ztScalar value of single gnomonic plane coordinate
[out]ztdDerivative of gnomonic coordinate, d(zt)/d(zm)
[out]ffFailure flag
Author
R. J. Purser

Definition at line 323 of file pesg.f90.

References pietc::f, pietc::pih, pietc::u0, and pietc::u1.

◆ zmtozt1()

subroutine pesg::zmtozt1 ( real(dp), intent(in)  a,
real(dp), intent(in)  zm,
real(dp), intent(out)  zt,
real(dp), intent(out)  ztd,
real(dp), intent(out)  zt1,
real(dp), intent(out)  ztd1,
logical, intent(out)  ff 
)
private

Like zmtozt, but also, get the derivative with respect to a, zt1 of zt, and ztd1 of ztd.

Parameters
[in]aMapping parameter controlling grid line spacing profile
[in]zmSingle map plane coordinate
[in]ztSingle gnomonic plane coordinate
[in]ztdDerivative wrt zm of zt, d(zt)/d(zm)
[in]zt1Derivative wrt a of zt, d(zt)/da
[in]ztd1Derivative wrt a of ztd, d^2(zt)/(d(zm)da)
[in]ffFailure flag
Author
R. J. Purser

Definition at line 348 of file pesg.f90.

References pietc::o3.

Referenced by xmtoxt1().

◆ zttozm()

subroutine pesg::zttozm ( real(dp), intent(in)  a,
real(dp), intent(in)  zt,
real(dp), intent(out)  zm,
logical, intent(out)  ff 
)
private

Inverse of zmtozt.

Parameters
[in]aMapping parameter controlling grid line spacing profile
[in]ztScalar value of single gnomonic plane coordinate
[out]zmScalar value of single map plane coordinate
[out]ffFailure flag
Author
R. J. Purser

Definition at line 299 of file pesg.f90.

References pietc::f, pietc::u0, and pietc::u1.