NCEPLIBS-ip  5.0.0
ip_lambert_conf_grid_mod Module Reference

Lambert conformal grib decoder and grid coordinate transformations. More...

Data Types

type  ip_lambert_conf_grid
 

Functions/Subroutines

subroutine gdswzd_lambert_conf (self, IOPT, NPTS, FILL, XPTS, YPTS, RLON, RLAT, NRET, CROT, SROT, XLON, XLAT, YLON, YLAT, AREA)
 GDS wizard for lambert conformal conical. More...
 
subroutine init_grib1 (self, g1_desc)
 Initializes a Lambert Conformal grid given a grib1_descriptor object. More...
 
subroutine init_grib2 (self, g2_desc)
 Initializes a Lambert Conformal grid given a grib2_descriptor object. More...
 
subroutine lambert_conf_grid_area (RLAT, FILL, DR, AREA)
 Grid box area for lambert conformal conical. More...
 
subroutine lambert_conf_map_jacob (RLAT, FILL, DLON, DR, XLON, XLAT, YLON, YLAT)
 Map jacobians for lambert conformal conical. More...
 
subroutine lambert_conf_vect_rot (DLON, CROT, SROT)
 Vector rotation fields for lambert conformal conical. More...
 

Variables

real an
 Cone factor. More...
 
real dxs
 x-direction grid length adjusted for scan mode. More...
 
real dys
 y-direction grid length adjusted for scan model. More...
 
real h
 Hemisphere flag. More...
 
integer irot
 vector rotation flag. More...
 
real rerth
 Radius of the earth. More...
 

Detailed Description

Lambert conformal grib decoder and grid coordinate transformations.

Octet numbers refer to [GRIB2 - GRID DEFINITION TEMPLATE 3.30 Lambert conformal](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp3-30.shtml).

Author
Iredell
Date
96-04-10

Function/Subroutine Documentation

◆ gdswzd_lambert_conf()

subroutine ip_lambert_conf_grid_mod::gdswzd_lambert_conf ( class(ip_lambert_conf_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 lambert conformal conical.

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 lambert conformal conical projections.

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, map jacobians and grid box areas for this grid 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
96-04-10 iredell Initial.
96-10-01 iredell protected against unresolvable points
97-10-20 iredell include map options
1999-04-27 gilbert corrected minor error calculating variable an for the secant projection case (rlati1.ne.rlati2).
2012-08-14 gayno fix problem with sh grids. Ensure grid box area always positive.
2015-01-21 gayno merger of gdswiz03() and gdswzd03(). 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-07-13 gayno Convert to grib 2. Replace grib 1 kgds array with grib 2 grid definition template array. Rename routine.
2018-07-20 wesley add threads.
Parameters
[in]selfip_lambert_conf_grid object.
[in]ioptoption flag
  • 1 to compute earth coords of selected grid coords
  • -1 to 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]xpts(npts) grid x point coordinates if iopt>0
[in,out]ypts(npts) grid y point coordinates if iopt>0
[in,out]rlon(npts) earth longitudes in degrees e if iopt<0 (acceptable range: -360. to 360.)
[in,out]rlat(npts) earth latitudes in degrees n if iopt<0 (acceptable range: -90. to 90.)
[out]nretnumber of valid points computed
[out]crotoptional (npts) clockwise vector rotation cosines
[out]srotoptional (npts) clockwise vector rotation sines (ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
[out]xlonoptional (npts) dx/dlon in 1/degrees
[out]xlatoptional (npts) dx/dlat in 1/degrees
[out]ylonoptional (npts) dy/dlon in 1/degrees
[out]ylatoptional (npts) dy/dlat in 1/degrees
[out]areaoptional (npts) area weights in m**2 (proportional to the square of the map factor)
Author
Iredell
Date
96-04-10

Definition at line 219 of file ip_lambert_conf_grid_mod.F90.

References an, dxs, dys, h, irot, lambert_conf_grid_area(), lambert_conf_map_jacob(), lambert_conf_vect_rot(), and rerth.

◆ init_grib1()

subroutine ip_lambert_conf_grid_mod::init_grib1 ( class(ip_lambert_conf_grid), intent(inout)  self,
type(grib1_descriptor), intent(in)  g1_desc 
)
private

Initializes a Lambert Conformal grid given a grib1_descriptor object.

Parameters
[in,out]selfThe grid to initialize
[in]g1_descA grib1_descriptor
Author
Iredell
Date
96-04-10

Definition at line 60 of file ip_lambert_conf_grid_mod.F90.

◆ init_grib2()

subroutine ip_lambert_conf_grid_mod::init_grib2 ( class(ip_lambert_conf_grid), intent(inout)  self,
type(grib2_descriptor), intent(in)  g2_desc 
)
private

Initializes a Lambert Conformal grid given a grib2_descriptor object.

Parameters
[in,out]selfThe grid to initialize
[in]g2_descA grib2_descriptor
Author
Iredell
Date
96-04-10

Definition at line 112 of file ip_lambert_conf_grid_mod.F90.

◆ lambert_conf_grid_area()

subroutine ip_lambert_conf_grid_mod::lambert_conf_grid_area ( real, intent(in)  RLAT,
real, intent(in)  FILL,
real, intent(in)  DR,
real, intent(out)  AREA 
)
private

Grid box area for lambert conformal conical.

This subprogram computes the grid box area for a lambert conformal conical grid.

Program History Log

Date Programmer Comments
2015-01-21 Gayno initial version
2015-09-17 Gayno rename as "lambert_conf_grid_area"
2018-07-20 Wesley pass in dr for threading.
Parameters
[in]rlatlatitude of grid point in degrees (real)
[in]fillfill value for undefined points (real)
[in]drdistance from pole point (real)
[out]areaarea weights in m**2 (real)
Author
Gayno
Date
2015-01-21

Definition at line 468 of file ip_lambert_conf_grid_mod.F90.

References an, dxs, dys, and rerth.

Referenced by gdswzd_lambert_conf().

◆ lambert_conf_map_jacob()

subroutine ip_lambert_conf_grid_mod::lambert_conf_map_jacob ( real, intent(in)  RLAT,
real, intent(in)  FILL,
real, intent(in)  DLON,
real, intent(in)  DR,
real, intent(out)  XLON,
real, intent(out)  XLAT,
real, intent(out)  YLON,
real, intent(out)  YLAT 
)
private

Map jacobians for lambert conformal conical.

This subprogram computes the map jacobians for a lambert conformal conical grid.

Program History Log

Date Programmer Comments
2015-01-21 Gayno initial version
2015-09-17 Gayno rename as "lambert_conf_map_jacob"
2018-07-20 Wesley pass dlon and dr for threading.
Parameters
[in]rlatgrid point latitude in degrees (real)
[in]fillfill value for undefined points (real)
[in]dlondistance from orientation longitude (real)
[in]drdistance from pole point (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 427 of file ip_lambert_conf_grid_mod.F90.

References an, dxs, dys, and h.

Referenced by gdswzd_lambert_conf().

◆ lambert_conf_vect_rot()

subroutine ip_lambert_conf_grid_mod::lambert_conf_vect_rot ( real, intent(in)  DLON,
real, intent(out)  CROT,
real, intent(out)  SROT 
)
private

Vector rotation fields for lambert conformal conical.

This subprogram computes the vector rotation sines and cosines for a lambert conformal conical grid.

Program History Log

Date Programmer Comments
2015-01-21 gayno initial version
2015-09-17 gayno rename as "lambert_conf_vect_rot"
2018-07-20 wesley pass in dlon for threading.
Parameters
[in]dlonfrom orientation longitude (real)
[out]crotvector rotation cosines (real)
[out]srotvector rotation sines (real) (ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth)
Author
Gayno
Date
2015-01-21

Definition at line 390 of file ip_lambert_conf_grid_mod.F90.

References an, and irot.

Referenced by gdswzd_lambert_conf().

Variable Documentation

◆ an

real ip_lambert_conf_grid_mod::an
private

◆ dxs

real ip_lambert_conf_grid_mod::dxs
private

x-direction grid length adjusted for scan mode.

GRIB2, Section 3, octets 56-59.

Definition at line 46 of file ip_lambert_conf_grid_mod.F90.

Referenced by gdswzd_lambert_conf(), lambert_conf_grid_area(), and lambert_conf_map_jacob().

◆ dys

real ip_lambert_conf_grid_mod::dys
private

y-direction grid length adjusted for scan model.

GRIB2, Section 3, octets 60-63.

Definition at line 47 of file ip_lambert_conf_grid_mod.F90.

Referenced by gdswzd_lambert_conf(), lambert_conf_grid_area(), and lambert_conf_map_jacob().

◆ h

real ip_lambert_conf_grid_mod::h
private

Hemisphere flag.

1-NH, minus 1-SH.

Definition at line 48 of file ip_lambert_conf_grid_mod.F90.

Referenced by gdswzd_lambert_conf(), and lambert_conf_map_jacob().

◆ irot

integer ip_lambert_conf_grid_mod::irot
private

vector rotation flag.

When "1", vectors are grid relative. When "0", vectors are earth relative. GRIB2, Section 3, octet 55.

Definition at line 44 of file ip_lambert_conf_grid_mod.F90.

Referenced by gdswzd_lambert_conf(), and lambert_conf_vect_rot().

◆ rerth

real ip_lambert_conf_grid_mod::rerth
private

Radius of the earth.

GRIB2, Section 3, octets 15-30.

Definition at line 49 of file ip_lambert_conf_grid_mod.F90.

Referenced by gdswzd_lambert_conf(), and lambert_conf_grid_area().