NCEPLIBS-ip  5.0.0
ip_rot_equid_cylind_grid_mod Module Reference

Rotated equidistant cylindrical GRIB decoder and grid coordinate transformations for Arakawa grids A through D. More...

Data Types

type  ip_rot_equid_cylind_grid
 

Functions/Subroutines

subroutine gdswzd_rot_equid_cylind (self, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 GDS wizard for rotated equidistant cylindrical. More...
 
subroutine init_grib1 (self, g1_desc)
 Initializes a Rotated equidistant cylindrical grid given a grib1_descriptor object. More...
 
subroutine init_grib2 (self, g2_desc)
 Initializes a Rotated equidistant cylindrical grid given a grib2_descriptor object. More...
 
subroutine rot_equid_cylind_error (IOPT, FILL, RLAT, RLON, XPTS, YPTS, NPTS)
 Error handler. More...
 
subroutine rot_equid_cylind_grid_area (CLATR, FILL, AREA)
 Grid box area for rotated equidistant cylindrical grids - non "e" stagger. More...
 
subroutine rot_equid_cylind_map_jacob (FILL, RLON, CLATR, CLAT, SLAT, CLON, XLON, XLAT, YLON, YLAT)
 Map jacobians for rotated equidistant cylindrical grids - non "e" stagger. More...
 
subroutine rot_equid_cylind_vect_rot (RLON, CLATR, SLATR, CLAT, SLAT, CLON, CROT, SROT)
 Vector rotation fields for rotated equidistant cylindrical grids - non "e" stagger. More...
 

Variables

real(kind=kdclat0
 Local copy of clat0. More...
 
real(kind=kddlats
 Local copy of dlats. More...
 
real(kind=kddlons
 Local copy of dlons. More...
 
integer irot
 Local copy of irot. More...
 
integer, parameter kd = real64
 Fortran kind for reals. More...
 
real(kind=kdrerth
 Radius of the Earth. More...
 
real(kind=kdrlon0
 Local copy of rlon0. More...
 
real(kind=kdslat0
 Local copy of slat0. More...
 

Detailed Description

Rotated equidistant cylindrical GRIB decoder and grid coordinate transformations for Arakawa grids A through D.

(To handle the E grid, see ip_rot_equid_cylind_egrid_mod).

See more info about Awakawa grids.

Octet numbers refer to GRIB2 - GRID DEFINITION TEMPLATE 3.1 Rotate Latitude/Longitude.

Author
Gayno
Date
2007-NOV-15

Function/Subroutine Documentation

◆ gdswzd_rot_equid_cylind()

subroutine ip_rot_equid_cylind_grid_mod::gdswzd_rot_equid_cylind ( class(ip_rot_equid_cylind_grid), intent(in)  self,
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

GDS wizard for rotated equidistant cylindrical.

This subprogram decodes the grib 2 grid definition template (passed in integer form as decoded by the ncep g2 library) and returns one of the following:

  • (iopt=+1) earth coordinates of selected grid coordinates
  • (iopt=-1) grid coordinates of selected earth coordinates

Works for non-"e" staggered rotated equidistant cylindrical projections. the scan mode (section 3, octet 72, bits 5-6) determine whether this is an "h" or "v" grid.

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. The actual number of valid points computed is returned too.

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

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.

Program History Log

Date Programmer Comments
2010-jan-15 gayno based on routines gdswzdcb and gdswzdca
2015-jan-21 gayno merger of gdswizcd and gdswzdcd. make crot,sort,xlon,xlat,ylon,ylat and area optional arguments. make part of a module. move vector rotation, map jacobian and grid box area computations to separate subroutines.
2015-jul-13 gayno convert to grib 2. replace grib 1 kgds array with grib 2 grid definition template array. rename as "gdswzd_rot_equid_cylind."
2018-07-20 wesley add threads.
Parameters
[in]selfModule reference.
[in]ioptinteger option flag
  • 1 to compute earth coords of selected grid coords
  • -1 to compute grid coords of selected earth coords
[in]nptsinteger maximum number of coordinates
[in]fillreal fill value to set invalid output data (must be impossible value; suggested value: -9999.)
[in,out]xptsreal (npts) grid x point coordinates if iopt>0
[in,out]yptsreal (npts) grid y point coordinates if iopt>0
[in,out]rlonreal (npts) earth longitudes in degrees e if iopt<0 (acceptable range: -360. to 360.)
[in,out]rlatreal (npts) earth latitudes in degrees n if iopt<0 (acceptable range: -90. to 90.)
[out]nretinteger number of valid points computed
[out]crotreal, optional (npts) clockwise vector rotation cosines
[out]srotreal, optional (npts) clockwise vector rotation sines (ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlonreal, optional (npts) dx/dlon in 1/degrees
[out]xlatreal, optional (npts) dx/dlat in 1/degrees
[out]ylonreal, optional (npts) dy/dlon in 1/degrees
[out]ylatreal, optional (npts) dy/dlat in 1/degrees
[out]areareal, optional (npts) area weights in m**2
Author
Gayno
Date
2007-NOV-15

Definition at line 256 of file ip_rot_equid_cylind_grid_mod.F90.

References clat0, dlats, dlons, irot, rerth, rlon0, rot_equid_cylind_error(), rot_equid_cylind_grid_area(), rot_equid_cylind_map_jacob(), rot_equid_cylind_vect_rot(), and slat0.

◆ init_grib1()

subroutine ip_rot_equid_cylind_grid_mod::init_grib1 ( class(ip_rot_equid_cylind_grid), intent(inout)  self,
type(grib1_descriptor), intent(in)  g1_desc 
)
private

Initializes a Rotated equidistant cylindrical grid given a grib1_descriptor object.

Parameters
[in,out]selfThe grid to initialize
[in]g1_descA grib1_descriptor
Author
Gayno
Date
2007-NOV-15

Definition at line 73 of file ip_rot_equid_cylind_grid_mod.F90.

References ip_constants_mod::dpr.

◆ init_grib2()

subroutine ip_rot_equid_cylind_grid_mod::init_grib2 ( class(ip_rot_equid_cylind_grid), intent(inout)  self,
type(grib2_descriptor), intent(in)  g2_desc 
)
private

Initializes a Rotated equidistant cylindrical grid given a grib2_descriptor object.

Parameters
[in,out]selfThe grid to initialize
[in]g2_descA grib2_descriptor
Author
Gayno
Date
2007-NOV-15

Definition at line 139 of file ip_rot_equid_cylind_grid_mod.F90.

◆ rot_equid_cylind_error()

subroutine ip_rot_equid_cylind_grid_mod::rot_equid_cylind_error ( integer, intent(in)  IOPT,
real, intent(in)  FILL,
real, dimension(npts), intent(out)  RLAT,
real, dimension(npts), intent(out)  RLON,
real, dimension(npts), intent(out)  XPTS,
real, dimension(npts), intent(out)  YPTS,
integer, intent(in)  NPTS 
)
private

Error handler.

Upon an error, this subprogram assigns a "fill" value to the output fields.

Parameters
[in]ioptinteger option flag
  • +1 to compute earth coords of selected grid coords
  • -1 to compute grid coords of selected earth coords
[in]fillreal fill value to set invalid output data (must be impossible value; suggested value: -9999.)
[out]rlatreal (npts) earth latitudes in degrees n if iopt<0
[out]rlonreal (npts) earth longitudes in degrees e if iopt<0
[out]xptsreal (npts) grid x point coordinates if iopt>0
[out]yptsreal (npts) grid y point coordinates if iopt>0
[in]nptsinteger maximum number of coordinates
Author
Gayno
Date
2015-07-13

Definition at line 462 of file ip_rot_equid_cylind_grid_mod.F90.

Referenced by gdswzd_rot_equid_cylind().

◆ rot_equid_cylind_grid_area()

subroutine ip_rot_equid_cylind_grid_mod::rot_equid_cylind_grid_area ( real(kind=kd), intent(in)  CLATR,
real, intent(in)  FILL,
real, intent(out)  AREA 
)
private

Grid box area for rotated equidistant cylindrical grids - non "e" stagger.

This subprogram computes the grid box area for a rotated equidistant cylindrical grid - non "e" stagger.

Program History Log

Date Programmer Comments
2015-01-21 Gayno initial version
2015-07-19 gayno rename as "rot_equid_cylind_grid_area."
2018-07-20 wesley pass in clatr for threading
Parameters
[in]clatrcosine of unrotated latitude (real)
[in]fillfill value for undefined points (real)
[out]areaarea weights in m**2 (real)
Author
Gayno
Date
2015-01-21

Definition at line 603 of file ip_rot_equid_cylind_grid_mod.F90.

References dlats, dlons, and rerth.

Referenced by gdswzd_rot_equid_cylind().

◆ rot_equid_cylind_map_jacob()

subroutine ip_rot_equid_cylind_grid_mod::rot_equid_cylind_map_jacob ( real, intent(in)  FILL,
real, intent(in)  RLON,
real(kind=kd), intent(in)  CLATR,
real(kind=kd), intent(in)  CLAT,
real(kind=kd), intent(in)  SLAT,
real(kind=kd), intent(in)  CLON,
real, intent(out)  XLON,
real, intent(out)  XLAT,
real, intent(out)  YLON,
real, intent(out)  YLAT 
)
private

Map jacobians for rotated equidistant cylindrical grids - non "e" stagger.

This subprogram computes the map jacobians for a rotated equidistant cylindrical grid - non "e" stagger.

Program History Log

Date Programmer Comments
2015-01-21 gayno initial version
2015-09-17 gayno rename as "rot_equid_cylind_map_jacob".
2018-07-20 wesley pass in clatr, clat, slat, clon to allow threading.
Parameters
[in]fillfill value for undefined points (real)
[in]rlonlongitude in degrees (real)
[in]clatrcosine of unrotated latitude (real)
[in]clatcosine of latitude (real)
[in]slatsine of latitude (real)
[in]cloncosine of latitude (real)
[out]xlondx/dlon in 1/degrees (real)
[out]xlatdx/dlat in 1/degrees (real)
[out]ylondy/dlon in 1/degrees (real)
[out]ylatdy/dlat in 1/degrees (real)
Author
Gayno
Date
2015-01-21

Definition at line 558 of file ip_rot_equid_cylind_grid_mod.F90.

References clat0, dlats, dlons, rlon0, and slat0.

Referenced by gdswzd_rot_equid_cylind().

◆ rot_equid_cylind_vect_rot()

subroutine ip_rot_equid_cylind_grid_mod::rot_equid_cylind_vect_rot ( real, intent(in)  RLON,
real(kind=kd), intent(in)  CLATR,
real(kind=kd), intent(in)  SLATR,
real(kind=kd), intent(in)  CLAT,
real(kind=kd), intent(in)  SLAT,
real(kind=kd), intent(in)  CLON,
real, intent(out)  CROT,
real, intent(out)  SROT 
)
private

Vector rotation fields for rotated equidistant cylindrical grids - non "e" stagger.

This subprogram computes the vector rotation sines and cosines for a rotated equidistant cylindrical grid - non "e" stagger.

Program History Log

Date Programmer Comments
2015-01-21 gayno initial version
2015-07-19 gayno rename as "rot_equid_cylind_vect_rot."
2018-07-20 wesley pass in clatr, slatr, clat, slat, clon for threading.
Parameters
[in]rlonlongitude in degrees (real)
[in]clatrcosine of rotated latitude (real)
[in]slatrsine of rotated latitude (real)
[in]clatcosine of latitude (real)
[in]slatsine of latitude (real)
[in]cloncosine of longitude (real)
[out]crotclockwise vector rotation cosines (real)
[out]srotclockwise vector rotation sines (real) (ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
Author
Gayno
Date
2015-01-21

Definition at line 507 of file ip_rot_equid_cylind_grid_mod.F90.

References clat0, irot, rlon0, and slat0.

Referenced by gdswzd_rot_equid_cylind().

Variable Documentation

◆ clat0

real(kind=kd) ip_rot_equid_cylind_grid_mod::clat0
private

Local copy of clat0.

Definition at line 58 of file ip_rot_equid_cylind_grid_mod.F90.

Referenced by gdswzd_rot_equid_cylind(), rot_equid_cylind_map_jacob(), and rot_equid_cylind_vect_rot().

◆ dlats

real(kind=kd) ip_rot_equid_cylind_grid_mod::dlats
private

◆ dlons

real(kind=kd) ip_rot_equid_cylind_grid_mod::dlons
private

◆ irot

integer ip_rot_equid_cylind_grid_mod::irot
private

Local copy of irot.

Definition at line 56 of file ip_rot_equid_cylind_grid_mod.F90.

Referenced by gdswzd_rot_equid_cylind(), and rot_equid_cylind_vect_rot().

◆ kd

integer, parameter ip_rot_equid_cylind_grid_mod::kd = real64
private

Fortran kind for reals.

Definition at line 30 of file ip_rot_equid_cylind_grid_mod.F90.

◆ rerth

real(kind=kd) ip_rot_equid_cylind_grid_mod::rerth
private

Radius of the Earth.

Definition at line 57 of file ip_rot_equid_cylind_grid_mod.F90.

Referenced by gdswzd_rot_equid_cylind(), and rot_equid_cylind_grid_area().

◆ rlon0

real(kind=kd) ip_rot_equid_cylind_grid_mod::rlon0
private

Local copy of rlon0.

Definition at line 61 of file ip_rot_equid_cylind_grid_mod.F90.

Referenced by gdswzd_rot_equid_cylind(), rot_equid_cylind_map_jacob(), and rot_equid_cylind_vect_rot().

◆ slat0

real(kind=kd) ip_rot_equid_cylind_grid_mod::slat0
private

Local copy of slat0.

Definition at line 62 of file ip_rot_equid_cylind_grid_mod.F90.

Referenced by gdswzd_rot_equid_cylind(), rot_equid_cylind_map_jacob(), and rot_equid_cylind_vect_rot().