NCEPLIBS-ip  5.0.0
ip_gaussian_grid_mod Module Reference

Gaussian grid coordinate transformations. More...

Data Types

type  ip_gaussian_grid
 

Functions/Subroutines

subroutine gaussian_grid_area (YPTS, AREA)
 Computes the grid box area for a gaussian cylindrical grid. More...
 
subroutine gaussian_map_jacob (YPTS, XLON, XLAT, YLON, YLAT)
 Computes the map jacobians for a gaussian cylindrical grid. More...
 
subroutine gaussian_vect_rot (CROT, SROT)
 Computes the vector rotation sines and cosines for a gaussian cylindrical grid. More...
 
subroutine gdswzd_gaussian (self, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 Calculates Earth coordinates (iopt = 1) or grid coorindates (iopt = -1) for Gaussian grids. More...
 
subroutine init_grib1 (self, g1_desc)
 Initializes a gaussian grid given a grib1_descriptor object. More...
 
subroutine init_grib2 (self, g2_desc)
 Initializes a gaussian grid given a grib2_descriptor object. More...
 

Variables

real, dimension(:), allocatable blat
 Gaussian latitude for each parallel. More...
 
real dlon
 "i"-direction increment. More...
 
integer j1
 'j' index of first grid point within the global array of latitudes. More...
 
integer jh
 Scan mode flag in 'j' direction. More...
 
real rerth
 Radius of the earth. More...
 
real, dimension(:), allocatable ylat_row
 dy/dlat for each row in 1/degrees. More...
 

Detailed Description

Gaussian grid coordinate transformations.

Octet numbers refer to [GRIB2 - GRID DEFINITION TEMPLATE 3.40 Gaussian Latitude/Longitude](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp3-40.shtml).

Author
George Gayno, Mark Iredell, Kyle Gerheiser
Date
July 2021

Function/Subroutine Documentation

◆ gaussian_grid_area()

subroutine ip_gaussian_grid_mod::gaussian_grid_area ( real, intent(in)  YPTS,
real, intent(out)  AREA 
)
private

Computes the grid box area for a gaussian cylindrical grid.

Parameters
[in]yptsy-index of grid point.
[out]areaArea weights in m^2
Author
Mark Iredell, George Gayno
Date
July 2021

Definition at line 416 of file ip_gaussian_grid_mod.F90.

References blat, dlon, j1, jh, and rerth.

Referenced by gdswzd_gaussian().

◆ gaussian_map_jacob()

subroutine ip_gaussian_grid_mod::gaussian_map_jacob ( real, intent(in)  YPTS,
real, intent(out)  XLON,
real, intent(out)  XLAT,
real, intent(out)  YLON,
real, intent(out)  YLAT 
)
private

Computes the map jacobians for a gaussian cylindrical grid.

Parameters
[in]yptsy-index of grid point.
[out]xlondx/dlon in 1/degrees.
[out]xlatdx/dlat in 1/degrees.
[out]ylondy/dlon in 1/degrees.
[out]ylatdy/dlat in 1/degrees.
Author
George Gayno
Date
July 2021

Definition at line 396 of file ip_gaussian_grid_mod.F90.

References dlon, and ylat_row.

Referenced by gdswzd_gaussian().

◆ gaussian_vect_rot()

subroutine ip_gaussian_grid_mod::gaussian_vect_rot ( real, intent(out)  CROT,
real, intent(out)  SROT 
)
private

Computes the vector rotation sines and cosines for a gaussian cylindrical grid.

Parameters
[out]crotClockwise vector rotation cosines.
[out]srotClockwise vector rotation sines.
Note
ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
Author
George Gayno
Date
July 2021

Definition at line 376 of file ip_gaussian_grid_mod.F90.

Referenced by gdswzd_gaussian().

◆ gdswzd_gaussian()

subroutine ip_gaussian_grid_mod::gdswzd_gaussian ( class(ip_gaussian_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

Calculates Earth coordinates (iopt = 1) or grid coorindates (iopt = -1) for Gaussian grids.

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.

Parameters
[in]selfThe grid object gdswzd was called on.
[in]ioptoption flag
  • +1 to compute earth coords of selected grid coords.
  • -1 o compute 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 if iopt>0.
[in,out]yptsGrid y point coordinates if iopt>0.
[in,out]rlonEarth longitudes in degrees e if iopt<0 (Acceptable range: -360. to 360.)
[in,out]rlatEarth latitudes in degrees n if iopt<0 (Acceptable range: -90. to 90.)
[out]nretNumber of valid points computed.
[out]crotOptional clockwise vector rotation cosines.
[out]srotOptional clockwise vector rotation sines.
[out]xlonOptional dx/dlon in 1/degrees.
[out]xlatOptional dx/dlat in 1/degrees.
[out]ylonOptional dy/dlon in 1/degrees.
[out]ylatOptional dy/dlat in 1/degrees.
[out]areaOptional area weights in m**2.
Author
Mark Iredell, George Gayno, Kyle Gerheiser
Date
July 2021

Definition at line 194 of file ip_gaussian_grid_mod.F90.

References blat, dlon, gaussian_grid_area(), gaussian_map_jacob(), gaussian_vect_rot(), j1, jh, rerth, splat(), and ylat_row.

◆ init_grib1()

subroutine ip_gaussian_grid_mod::init_grib1 ( class(ip_gaussian_grid), intent(inout)  self,
type(grib1_descriptor), intent(in)  g1_desc 
)
private

Initializes a gaussian grid given a grib1_descriptor object.

Parameters
[in,out]selfThe grid to initialize
[in]g1_descA grib1_descriptor
Author
Kyle Gerheiser
Date
July 2021

Definition at line 59 of file ip_gaussian_grid_mod.F90.

◆ init_grib2()

subroutine ip_gaussian_grid_mod::init_grib2 ( class(ip_gaussian_grid), intent(inout)  self,
type(grib2_descriptor), intent(in)  g2_desc 
)
private

Initializes a gaussian grid given a grib2_descriptor object.

Parameters
[in,out]selfThe grid to initialize
[in]g2_descA grib2_descriptor
Author
Kyle Gerheiser
Date
July 2021

Definition at line 108 of file ip_gaussian_grid_mod.F90.

Variable Documentation

◆ blat

real, dimension(:), allocatable ip_gaussian_grid_mod::blat
private

Gaussian latitude for each parallel.

Definition at line 45 of file ip_gaussian_grid_mod.F90.

Referenced by gaussian_grid_area(), and gdswzd_gaussian().

◆ dlon

real ip_gaussian_grid_mod::dlon
private

"i"-direction increment.

GRIB2 Section 3, octets 64-67.

Definition at line 46 of file ip_gaussian_grid_mod.F90.

Referenced by gaussian_grid_area(), gaussian_map_jacob(), and gdswzd_gaussian().

◆ j1

integer ip_gaussian_grid_mod::j1
private

'j' index of first grid point within the global array of latitudes.

Definition at line 43 of file ip_gaussian_grid_mod.F90.

Referenced by gaussian_grid_area(), and gdswzd_gaussian().

◆ jh

integer ip_gaussian_grid_mod::jh
private

Scan mode flag in 'j' direction.

When '1' points scan from N to S. When "-1" points scan from S to N.

Definition at line 44 of file ip_gaussian_grid_mod.F90.

Referenced by gaussian_grid_area(), and gdswzd_gaussian().

◆ rerth

real ip_gaussian_grid_mod::rerth
private

Radius of the earth.

GRIB2 Section 3, octets 15-30.

Definition at line 47 of file ip_gaussian_grid_mod.F90.

Referenced by gaussian_grid_area(), and gdswzd_gaussian().

◆ ylat_row

real, dimension(:), allocatable ip_gaussian_grid_mod::ylat_row
private

dy/dlat for each row in 1/degrees.

Definition at line 48 of file ip_gaussian_grid_mod.F90.

Referenced by gaussian_map_jacob(), and gdswzd_gaussian().