NCEPLIBS-ip  4.1.0
gdswzd_mod Module Reference

Driver module for gdswzd routines. More...

Data Types

interface  gdswzd
 

Functions/Subroutines

subroutine gdswzd_1d_array (IGDTNUM, IGDTMPL, IGDTLEN, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 Decodes the grib 2 grid definition template and returns one of the following: More...
 
subroutine gdswzd_2d_array (IGDTNUM, IGDTMPL, IGDTLEN, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 Decodes the grib 2 grid definition template and returns one of the following (for 2d-arrays): More...
 
subroutine, public gdswzd_2d_array_grib1 (KGDS, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 Decodes the grib grid description section and returns one of the following (for 2-d arrays): More...
 
subroutine, public gdswzd_grib1 (KGDS, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 Decodes the grib grid description section and returns one of the following (for 1-d arrays): More...
 
subroutine gdswzd_grid (grid, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 Returns one of the following for a grid object: More...
 
subroutine gdswzd_scalar (IGDTNUM, IGDTMPL, IGDTLEN, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 Decodes the grib 2 grid definition template and returns one of the following (for scalars): More...
 

Detailed Description

Driver module for gdswzd routines.

These routines do the following for several map projections:

  • Convert from earth to grid coordinates or vice versa.
  • Compute vector rotation sines and cosines.
  • Compute map jacobians.
  • Compute grid box area.

Map projections include:

  • Equidistant Cyclindrical
  • Mercator Cylindrical
  • Gaussian Cylindrical
  • Polar stereographic
  • Lambert Conformal Conic
  • Rotated Equidistant Cyclindrical ("E" and non-"E" staggers)
Author
Mark Iredell, George Gayno, Kyle Gerheiser
Date
Jan 2015

Function/Subroutine Documentation

◆ gdswzd_1d_array()

subroutine gdswzd_mod::gdswzd_1d_array ( integer, intent(in)  IGDTNUM,
integer, dimension(igdtlen), intent(in)  IGDTMPL,
integer, intent(in)  IGDTLEN,
integer, intent(in)  IOPT,
integer, intent(in)  NPTS,
real, intent(in)  FILL,
real, dimension(npts), intent(inout)  XPTS,
real, dimension(npts), intent(inout)  YPTS,
real, dimension(npts), intent(inout)  RLON,
real, dimension(npts), intent(inout)  RLAT,
integer, intent(out)  NRET,
real, dimension(npts), intent(out), optional  CROT,
real, dimension(npts), intent(out), optional  SROT,
real, dimension(npts), intent(out), optional  XLON,
real, dimension(npts), intent(out), optional  XLAT,
real, dimension(npts), intent(out), optional  YLON,
real, dimension(npts), intent(out), optional  YLAT,
real, dimension(npts), intent(out), optional  AREA 
)
private

Decodes the grib 2 grid definition template and returns one of the following:

  • iopt=0 Grid and earth coordinates of all grid points.
  • iopt=+1 Earth coordinates of selected grid coordinates.
  • iopt=-1 Grid coordinates of selected earth coordinates.

The current code recognizes the following projections, where "igdtnum" is the grid definition template number:

  • igdtnum=00 Equidistant Cylindrical
  • igdtnum=01 Rotated Equidistant Cylindrical. "E" and non-"E" staggered
  • igdtnum=10 Mercator Cyclindrical
  • igdtnum=20 Polar Stereographic Azimuthal
  • igdtnum=30 Lambert Conformal Conical
  • igdtnum=40 Gaussian Equidistant Cyclindrical

If the selected coordinates are more than one gridpoint beyond the the edges of the grid domain, then the relevant output elements are set to fill values. Also if iopt=0, if the number of grid points exceeds the number allotted, then all the output elements are set to fill values.

The actual number of valid points computed is returned too.

Optionally, the vector rotations, map jacobians and grid box areas may be returned.

To compute the vector rotations, the optional arguments 'srot' and 'crot' must be present. To compute the map jacobians, the optional arguments 'xlon', 'xlat', 'ylon', 'ylat' must be present.

To compute the grid box areas, the optional argument 'area' must be present.

Parameters
[in]igdtnumGrid definition template number. Corresponds to the gfldigdtnum component of the ncep g2 library gridmod data structure:
  • 00 - Equidistant Cylindrical
  • 01 - Rotated Equidistant Cylindrical. "E" and non-"E" staggered
  • 10 - Mercator Cyclindrical
  • 20 - Polar Stereographic Azimuthal
  • 30 - Lambert Conformal Conical
  • 40 - Gaussian Equidistant Cyclindrical
[in]igdtmplGrid definition template array. Corresponds to the gfldigdtmpl component of the NCEPLIBS-g2 gridmod data structure

Section 3 Info:

All Map Projections:

  • 1: Shape of earth, octet 15.
  • 2: Scale factor of spherical earth radius, octet 16.
  • 3: Scaled value of radius of spherical earth, octets 17-20.
  • 4: Scale factor of major axis of elliptical earth, octet 21.
  • 5: Scaled value of major axis of elliptical earth, octets 22-25.
  • 6: Scale factor of minor axis of elliptical earth, octet 26.
  • 7: Scaled value of minor axis of elliptical earth, octets 27-30.

Equidistant Cyclindrical:

  • 8: Number of points along a parallel, octs 31-34.
  • 9: Number of points along a meridian, octs 35-38.
  • 10: Basic angle of initial production domain, octets 39-42.
  • 11: Subdivisions of basic angle, octets 43-46.
  • 12: Latitude of first grid point, octets 47-50.
  • 13: Longitude of first grid point, octets 51-54.
  • 14: Resolution and component flags, octet 55.
  • 15: Latitude of last grid point, octets 56-59.
  • 16: Longitude of last grid point, octets 60-63.
  • 17: i-direction increment, octets 64-67.
  • 18: j-direction increment, octets 68-71.
  • 19: Scanning mode, octet 72.

Mercator Cyclindrical:

  • 8: Number of points along a parallel, octs 31-34.
  • 9: Number of points along a meridian, octs 35-38.
  • 10: Latitude of first point, octets 39-42.
  • 11: Longitude of first point, octets 43-46.
  • 12: Resolution and component flags, octet 47.
  • 13: Tangent latitude, octets 48-51.
  • 14: Latitude of last point, octets 52-55.
  • 15: Longitude of last point, octets 56-59.
  • 16: Scanning mode flags, octet 60.
  • 17: Orientation of grid, octets 61-64.
  • 18: Longitudinal grid length, octets 65-68.
  • 19: Latitudinal grid length, octets 69-72.

Lambert Conformal Conical:

  • 8: Number of points along x-axis, octs 31-34.
  • 9: Number of points along y-axis, octs 35-38.
  • 10: Latitude of first point, octets 39-42.
  • 11: Longitude of first point, octets 43-46.
  • 12: Resolution of component flag, octet 47.
  • 13: Latitude where grid lengths specified,octets 48-51.
  • 14: Longitude of meridian that is parallel to y-axis, octets 52-55.
  • 15: x-direction grid length, octets 56-59.
  • 16: y-direction grid length, octets 60-63.
  • 17: Projection center flag, octet 64.
  • 18: Scanning mode, octet 65.
  • 19: First tangent latitude from pole, octets 66-69.
  • 20: Second tangent latitude from pole, octets 70-73.
  • 21: Latitude of south pole of projection, octets 74-77.
  • 22: Longitude of south pole of projection, octets 78-81.

Gaussian Cylindrical:

  • 8: Number of points along a parallel, octs 31-34.
  • 9: Number of points along a meridian, octs 35-38.
  • 10: Basic angle of initial production domain, octets 39-42.
  • 11: Subdivisions of basic angle, octets 43-46.
  • 12: Latitude of first grid point, octets 47-50.
  • 13: Longitude of first grid point, octets 51-54.
  • 14: Resolution and component flags, octet 55.
  • 15: Latitude of last grid point, octets 56-59.
  • 16: Longitude of last grid point, octets 60-63.
  • 17: i-direction increment, octets 64-67.
  • 18: Number of parallels between pole and equator, octets 68-71.
  • 19: Scanning mode, octet 72.

Polar Stereographic Azimuthal:

  • 8: Number of points along x-axis, octets 31-34.
  • 9: Number of points along y-axis, octets 35-38.
  • 10: Latitude of first grid point, octets 39-42.
  • 11: Longitude of first grid point, octets 43-46.
  • 12: Resolution and component flags, octet 47.
  • 13: True latitude, octets 48-51.
  • 14: Orientation longitude, octets 52-55.
  • 15: x-direction grid length, octets 56-59.
  • 16: y-direction grid length, octets 60-63.
  • 17: Projection center flag, octet 64.
  • 18: Scanning mode flags, octet 65.

Rotated Equidistant Cyclindrical:

  • 8: Number of points along a parallel, octs 31-34.
  • 9: Number of points along a meridian, octs 35-38.
  • 10: Basic angle of initial production domain, octets 39-42.
  • 11: Subdivisions of basic angle, octets 43-46.
  • 12: Latitude of first grid point, octets 47-50.
  • 13: Longitude of first grid point, octets 51-54.
  • 14: Resolution and component flags, octet 55.
  • 15: Latitude of last grid point, octets 56-59.
  • 16: Longitude of last grid point, octets 60-63.
  • 17: i-direction increment, octets 64-67.
  • 18: j-direction increment, octets 68-71.
  • 19: Scanning mode, octet 72.
  • 20: Latitude of southern pole of projection, octets 73-76.
  • 21: Longitude of southern pole of projection, octets 77-80.
  • 22: Angle of rotation of projection, octs 81-84.
Parameters
[in]igdtlenNumber of elements of the grid definition template array. Corresponds to the gfldigdtlen component of the ncep g2 library gridmod data structure.
[in]ioptOption flag.
  • 0 Earth coords of all the grid points.
  • 1 Earth coords of selected grid coords.
  • -1 Grid coords of selected earth coords
[in]nptsMaximum number of coordinates.
[in]fillFill value to set invalid output data. Must be impossible value; suggested value: -9999.
[in,out]xptsGrid x point coordinates.
[in,out]yptsGrid y point coordinates.
[in,out]rlonEarth longitudes in degrees E. (Acceptable range: -360. to 360.)
[in,out]rlatEarth latitudes in degrees N. (Acceptable range: -90. to 90.)
[out]nretNumber of valid points computed.
[out]crotClockwise vector rotation cosines.
[out]srotClockwise vector rotation sines. ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlondx/dlat in 1/degrees
[out]xlatdy/dlon in 1/degrees
[out]ylondy/dlon in 1/degrees
[out]ylatdy/dlat in 1/degrees
[out]areaArea weights in m^2. Proportional to the square of the map factor in the case of conformal projections
Author
George Gayno, Mark Iredell
Date
Jan 2015

Definition at line 665 of file gdswzd_mod.F90.

Referenced by gdswzd_mod::gdswzd::gdswzd_2d_array(), and gdswzd_mod::gdswzd::gdswzd_scalar().

◆ gdswzd_2d_array()

subroutine gdswzd_mod::gdswzd_2d_array ( integer, intent(in)  IGDTNUM,
integer, dimension(igdtlen), intent(in)  IGDTMPL,
integer, intent(in)  IGDTLEN,
integer, intent(in)  IOPT,
integer, intent(in)  NPTS,
real, intent(in)  FILL,
real, dimension(:,:), intent(inout)  XPTS,
real, dimension(:,:), intent(inout)  YPTS,
real, dimension(:,:), intent(inout)  RLON,
real, dimension(:,:), intent(inout)  RLAT,
integer, intent(out)  NRET,
real, dimension(:,:), intent(out), optional  CROT,
real, dimension(:,:), intent(out), optional  SROT,
real, dimension(:,:), intent(out), optional  XLON,
real, dimension(:,:), intent(out), optional  XLAT,
real, dimension(:,:), intent(out), optional  YLON,
real, dimension(:,:), intent(out), optional  YLAT,
real, dimension(:,:), intent(out), optional  AREA 
)
private

Decodes the grib 2 grid definition template and returns one of the following (for 2d-arrays):

  • iopt=0 Grid and earth coordinates of all grid points.
  • iopt=+1 Earth coordinates of selected grid coordinates.
  • iopt=-1 Grid coordinates of selected earth coordinates.

The current code recognizes the following projections, where "igdtnum" is the grid definition template number:

  • igdtnum=00 Equidistant Cylindrical
  • igdtnum=01 Rotated Equidistant Cylindrical. "E" and non-"E" staggered
  • igdtnum=10 Mercator Cyclindrical
  • igdtnum=20 Polar Stereographic Azimuthal
  • igdtnum=30 Lambert Conformal Conical
  • igdtnum=40 Gaussian Equidistant Cyclindrical

If the selected coordinates are more than one gridpoint beyond the the edges of the grid domain, then the relevant output elements are set to fill values. Also if iopt=0, if the number of grid points exceeds the number allotted, then all the output elements are set to fill values.

The actual number of valid points computed is returned too.

Optionally, the vector rotations, map jacobians and grid box areas may be returned.

To compute the vector rotations, the optional arguments 'srot' and 'crot' must be present. To compute the map jacobians, the optional arguments 'xlon', 'xlat', 'ylon', 'ylat' must be present.

To compute the grid box areas, the optional argument 'area' must be present.

Parameters
[in]igdtnumGrid definition template number.
[in]igdtmplGrid definition template array. Corresponds to the gfldigdtmpl component of the NCEPLIBS-g2 gridmod data structure. See igdtmpl definition in gdswzd_1d_array() for full details.
[in]igdtlenNumber of elements of the grid definition template array. Corresponds to the gfldigdtlen component of the ncep g2 library gridmod data structure.
[in]ioptOption flag.
  • 0 Earth coords of all the grid points.
  • 1 Earth coords of selected grid coords.
  • -1 Grid coords of selected earth coords
[in]nptsMaximum number of coordinates.
[in]fillFill value to set invalid output data. Must be impossible value; suggested value: -9999.
[in,out]xptsGrid x point coordinates.
[in,out]yptsGrid y point coordinates.
[in,out]rlonEarth longitudes in degrees E. (Acceptable range: -360. to 360.)
[in,out]rlatEarth latitudes in degrees N. (Acceptable range: -90. to 90.)
[out]nretNumber of valid points computed.
[out]crotClockwise vector rotation cosines.
[out]srotClockwise vector rotation sines. ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlondx/dlat in 1/degrees
[out]xlatdy/dlon in 1/degrees
[out]ylondy/dlon in 1/degrees
[out]ylatdy/dlat in 1/degrees
[out]areaArea weights in m^2. Proportional to the square of the map factor in the case of conformal projections
Author
George Gayno, Mark Iredell
Date
Jan 2015

Definition at line 459 of file gdswzd_mod.F90.

◆ gdswzd_2d_array_grib1()

subroutine, public gdswzd_mod::gdswzd_2d_array_grib1 ( integer, dimension(200), intent(in)  KGDS,
integer, intent(in)  IOPT,
integer, intent(in)  NPTS,
real, intent(in)  FILL,
real, dimension(:,:), intent(inout)  XPTS,
real, dimension(:,:), intent(inout)  YPTS,
real, dimension(:,:), intent(inout)  RLON,
real, dimension(:,:), intent(inout)  RLAT,
integer, intent(out)  NRET,
real, dimension(:,:), intent(out), optional  CROT,
real, dimension(:,:), intent(out), optional  SROT,
real, dimension(:,:), intent(out), optional  XLON,
real, dimension(:,:), intent(out), optional  XLAT,
real, dimension(:,:), intent(out), optional  YLON,
real, dimension(:,:), intent(out), optional  YLAT,
real, dimension(:,:), intent(out), optional  AREA 
)

Decodes the grib grid description section and returns one of the following (for 2-d arrays):

  • iopt=0 Grid and earth coordinates of all grid points.
  • iopt=+1 Earth coordinates of selected grid coordinates.
  • iopt=-1 Grid coordinates of selected earth coordinates.

If the selected coordinates are more than one gridpoint beyond the the edges of the grid domain, then the relevant output elements are set to fill values. Also if iopt=0, if the number of grid points exceeds the number allotted, then all the output elements are set to fill values.

The actual number of valid points computed is returned too.

Optionally, the vector rotations, map jacobians and grid box areas may be returned.

To compute the vector rotations, the optional arguments 'srot' and 'crot' must be present. To compute the map jacobians, the optional arguments 'xlon', 'xlat', 'ylon', 'ylat' must be present.

To compute the grid box areas, the optional argument 'area' must be present.

The current code recognizes the following projections:

  • kgds(1)=000 Equidistant Cylindrical
  • kgds(1)=001 Mercator Cylindrical
  • kgds(1)=003 lambert Conformal Conical
  • kgds(1)=004 Gaussian Cylindrical
  • kgds(1)=005 Polar Stereographic azimuthal
  • kgds(1)=203 E-staggered Rotated Equidistant Cylindrical
  • kgds(1)=205 B-staggered Rotated Equidistant Cylindrical
Parameters
[in]kgdsGDS parameters as decoded by w3fi63.
[in]ioptOption flag.
  • 0 Earth coords of all the grid points.
  • 1 Earth coords of selected grid coords.
  • -1 Grid coords of selected earth coords
[in]nptsMaximum number of coordinates.
[in]fillFill value to set invalid output data. Must be impossible value; suggested value: -9999.
[in,out]xptsGrid x point coordinates.
[in,out]yptsGrid y point coordinates.
[in,out]rlonEarth longitudes in degrees E. (Acceptable range: -360. to 360.)
[in,out]rlatEarth latitudes in degrees N. (Acceptable range: -90. to 90.)
[out]nretNumber of valid points computed.
[out]crotClockwise vector rotation cosines.
[out]srotClockwise vector rotation sines. ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlondx/dlat in 1/degrees
[out]xlatdy/dlon in 1/degrees
[out]ylondy/dlon in 1/degrees
[out]ylatdy/dlat in 1/degrees
[out]areaArea weights in m^2. Proportional to the square of the map factor in the case of conformal projections
Author
George Gayno, Mark Iredell
Date
April 1996

Definition at line 850 of file gdswzd_mod.F90.

◆ gdswzd_grib1()

subroutine, public gdswzd_mod::gdswzd_grib1 ( integer, dimension(200), intent(in)  KGDS,
integer, intent(in)  IOPT,
integer, intent(in)  NPTS,
real, intent(in)  FILL,
real, dimension(npts), intent(inout)  XPTS,
real, dimension(npts), intent(inout)  YPTS,
real, dimension(npts), intent(inout)  RLON,
real, dimension(npts), intent(inout)  RLAT,
integer, intent(out)  NRET,
real, dimension(npts), intent(out), optional  CROT,
real, dimension(npts), intent(out), optional  SROT,
real, dimension(npts), intent(out), optional  XLON,
real, dimension(npts), intent(out), optional  XLAT,
real, dimension(npts), intent(out), optional  YLON,
real, dimension(npts), intent(out), optional  YLAT,
real, dimension(npts), intent(out), optional  AREA 
)

Decodes the grib grid description section and returns one of the following (for 1-d arrays):

  • iopt=0 Grid and earth coordinates of all grid points.
  • iopt=+1 Earth coordinates of selected grid coordinates.
  • iopt=-1 Grid coordinates of selected earth coordinates.

If the selected coordinates are more than one gridpoint beyond the the edges of the grid domain, then the relevant output elements are set to fill values. Also if iopt=0, if the number of grid points exceeds the number allotted, then all the output elements are set to fill values.

The actual number of valid points computed is returned too.

Optionally, the vector rotations, map jacobians and grid box areas may be returned.

To compute the vector rotations, the optional arguments 'srot' and 'crot' must be present. To compute the map jacobians, the optional arguments 'xlon', 'xlat', 'ylon', 'ylat' must be present.

To compute the grid box areas, the optional argument 'area' must be present.

The current code recognizes the following projections:

  • kgds(1)=000 Equidistant Cylindrical
  • kgds(1)=001 Mercator Cylindrical
  • kgds(1)=003 lambert Conformal Conical
  • kgds(1)=004 Gaussian Cylindrical
  • kgds(1)=005 Polar Stereographic azimuthal
  • kgds(1)=203 E-staggered Rotated Equidistant Cylindrical
  • kgds(1)=205 B-staggered Rotated Equidistant Cylindrical
Parameters
[in]kgdsGDS parameters as decoded by w3fi63.
[in]ioptOption flag.
  • 0 Earth coords of all the grid points.
  • 1 Earth coords of selected grid coords.
  • -1 Grid coords of selected earth coords
[in]nptsMaximum number of coordinates.
[in]fillFill value to set invalid output data. Must be impossible value; suggested value: -9999.
[in,out]xptsGrid x point coordinates.
[in,out]yptsGrid y point coordinates.
[in,out]rlonEarth longitudes in degrees E. (Acceptable range: -360. to 360.)
[in,out]rlatEarth latitudes in degrees N. (Acceptable range: -90. to 90.)
[out]nretNumber of valid points computed.
[out]crotClockwise vector rotation cosines.
[out]srotClockwise vector rotation sines. ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlondx/dlat in 1/degrees
[out]xlatdy/dlon in 1/degrees
[out]ylondy/dlon in 1/degrees
[out]ylatdy/dlat in 1/degrees
[out]areaArea weights in m^2. Proportional to the square of the map factor in the case of conformal projections
Author
George Gayno, Mark Iredell
Date
April 1996

Definition at line 758 of file gdswzd_mod.F90.

◆ gdswzd_grid()

subroutine gdswzd_mod::gdswzd_grid ( class(ip_grid), intent(in)  grid,
integer, intent(in)  IOPT,
integer, intent(in)  NPTS,
real, intent(in)  FILL,
real, dimension(npts), intent(inout)  XPTS,
real, dimension(npts), intent(inout)  YPTS,
real, dimension(npts), intent(inout)  RLON,
real, dimension(npts), intent(inout)  RLAT,
integer, intent(out)  NRET,
real, dimension(npts), intent(out), optional  CROT,
real, dimension(npts), intent(out), optional  SROT,
real, dimension(npts), intent(out), optional  XLON,
real, dimension(npts), intent(out), optional  XLAT,
real, dimension(npts), intent(out), optional  YLON,
real, dimension(npts), intent(out), optional  YLAT,
real, dimension(npts), intent(out), optional  AREA 
)
private

Returns one of the following for a grid object:

  • iopt=0 Grid and earth coordinates of all grid points.
  • iopt=+1 Earth coordinates of selected grid coordinates.
  • iopt=-1 Grid coordinates of selected earth coordinates.

If the selected coordinates are more than one gridpoint beyond the the edges of the grid domain, then the relevant output elements are set to fill values. Also if iopt=0, if the number of grid points exceeds the number allotted, then all the output elements are set to fill values.

The actual number of valid points computed is returned too.

Optionally, the vector rotations, map jacobians and grid box areas may be returned.

To compute the vector rotations, the optional arguments 'srot' and 'crot' must be present. To compute the map jacobians, the optional arguments 'xlon', 'xlat', 'ylon', 'ylat' must be present.

To compute the grid box areas, the optional argument 'area' must be present.

Parameters
[in]gridGrid to call gdswzd on.
[in]ioptOption flag.
  • 0 Earth coords of all the grid points.
  • 1 Earth coords of selected grid coords.
  • -1 Grid coords of selected earth coords
[in]nptsMaximum number of coordinates.
[in]fillFill value to set invalid output data. Must be impossible value; suggested value: -9999.
[in,out]xptsGrid x point coordinates.
[in,out]yptsGrid y point coordinates.
[in,out]rlonEarth longitudes in degrees E. (Acceptable range: -360. to 360.)
[in,out]rlatEarth latitudes in degrees N. (Acceptable range: -90. to 90.)
[out]nretNumber of valid points computed.
[out]crotClockwise vector rotation cosines.
[out]srotClockwise vector rotation sines. ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlondx/dlat in 1/degrees
[out]xlatdy/dlon in 1/degrees
[out]ylondy/dlon in 1/degrees
[out]ylatdy/dlat in 1/degrees
[out]areaArea weights in m^2. Proportional to the square of the map factor in the case of conformal projections
Author
Kyle Gerheiser
Date
July 2021

Definition at line 105 of file gdswzd_mod.F90.

Referenced by gdswzd_mod::gdswzd::gdswzd_1d_array(), gdswzd_mod::gdswzd::gdswzd_2d_array_grib1(), and gdswzd_mod::gdswzd::gdswzd_grib1().

◆ gdswzd_scalar()

subroutine gdswzd_mod::gdswzd_scalar ( integer, intent(in)  IGDTNUM,
integer, dimension(igdtlen), intent(in)  IGDTMPL,
integer, intent(in)  IGDTLEN,
integer, intent(in)  IOPT,
integer, intent(in)  NPTS,
real, intent(in)  FILL,
real, intent(inout)  XPTS,
real, intent(inout)  YPTS,
real, intent(inout)  RLON,
real, intent(inout)  RLAT,
integer, intent(out)  NRET,
real, intent(out), optional  CROT,
real, intent(out), optional  SROT,
real, intent(out), optional  XLON,
real, intent(out), optional  XLAT,
real, intent(out), optional  YLON,
real, intent(out), optional  YLAT,
real, intent(out), optional  AREA 
)
private

Decodes the grib 2 grid definition template and returns one of the following (for scalars):

  • iopt=0 Grid and earth coordinates of all grid points.
  • iopt=+1 Earth coordinates of selected grid coordinates.
  • iopt=-1 Grid coordinates of selected earth coordinates.

The current code recognizes the following projections, where "igdtnum" is the grid definition template number:

  • igdtnum=00 Equidistant Cylindrical
  • igdtnum=01 Rotated Equidistant Cylindrical. "E" and non-"E" staggered
  • igdtnum=10 Mercator Cyclindrical
  • igdtnum=20 Polar Stereographic Azimuthal
  • igdtnum=30 Lambert Conformal Conical
  • igdtnum=40 Gaussian Equidistant Cyclindrical

If the selected coordinates are more than one gridpoint beyond the the edges of the grid domain, then the relevant output elements are set to fill values. Also if iopt=0, if the number of grid points exceeds the number allotted, then all the output elements are set to fill values.

The actual number of valid points computed is returned too.

Optionally, the vector rotations, map jacobians and grid box areas may be returned.

To compute the vector rotations, the optional arguments 'srot' and 'crot' must be present. To compute the map jacobians, the optional arguments 'xlon', 'xlat', 'ylon', 'ylat' must be present.

To compute the grid box areas, the optional argument 'area' must be present.

Parameters
[in]igdtnumGrid definition template number.
[in]igdtmplGrid definition template array. Corresponds to the gfldigdtmpl component of the NCEPLIBS-g2 gridmod data structure See igdtmpl definition in gdswzd_1d_array() for full details.
[in]igdtlenNumber of elements of the grid definition template array. Corresponds to the gfldigdtlen component of the ncep g2 library gridmod data structure.
[in]ioptOption flag.
  • 0 Earth coords of all the grid points.
  • 1 Earth coords of selected grid coords.
  • -1 Grid coords of selected earth coords
[in]nptsMaximum number of coordinates.
[in]fillFill value to set invalid output data. Must be impossible value; suggested value: -9999.
[in,out]xptsGrid x point coordinates.
[in,out]yptsGrid y point coordinates.
[in,out]rlonEarth longitudes in degrees E. (Acceptable range: -360. to 360.)
[in,out]rlatEarth latitudes in degrees N. (Acceptable range: -90. to 90.)
[out]nretNumber of valid points computed.
[out]crotClockwise vector rotation cosines.
[out]srotClockwise vector rotation sines. ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlondx/dlat in 1/degrees
[out]xlatdy/dlon in 1/degrees
[out]ylondy/dlon in 1/degrees
[out]ylatdy/dlat in 1/degrees
[out]areaArea weights in m^2. Proportional to the square of the map factor in the case of conformal projections
Author
George Gayno, Mark Iredell
Date
Jan 2015

Definition at line 278 of file gdswzd_mod.F90.