cmapf_mod Module

General conformal map routines for meteorological modelers written on 3/31/94 by

Dr. Albion Taylor NOAA / OAR / ARL phone: (301) 713-0295 x 132 rm. 3151, 1315 east-west highway fax: (301) 713-0119 silver spring, md 20910 e-mail: adtaylor@arlrisc.ssmc.noaa.gov

subroutine stlmbr (strcmp, tnglat, clong) This routine initializes the map structure array strcmp to the form of a specific map projection inputs: tnglat - the latitude at which the projection will be tangent to the earth. +90. For north polar stereographic, -90. for south polar stereographic, 0. For mercator, and other values for lambert conformal. -90 <= tnglat <= 90. clong - a longitude in the region under consideration. Longitudes between clong-180. and clong+180. Will be mapped in one connected region outputs: strcmp - a 9-value map structure array for use with subsequent calls to the coordinate transform routines.

real function eqvlat (xlat1,xlat2) This function is provided to assist in finding the tangent latitude equivalent to the 2-reference latitude specification in the legend of most lambert conformal maps. If the map specifies "scale 1:xxxxx true at 40n and 60n", then eqvlat(40.,60.) will return the equivalent tangent latitude. inputs: xlat1,xlat2: the two latitudes specified in the map legend returns: the equivalent tangent latitude example: call stlmbr(strcmp, eqvlat(40.,60.), 90.)

subroutine stcm2p (strcmp, x1,y1, xlat1,xlong1, x2,y2, xlat2,xlong2) subroutine stcm1p (strcmp, x1,y1, xlat1,xlong1, xlatg,xlongg, gridsz, orient) These routines complete the specification of the map structure array by conforming the map coordinates to the specifications of a particular grid. Either stcm1p or stcm2p must be called, but not both inputs: strcmp - a 9-value map structure array, set to a particular map form by a previous call to stlmbr for stcm2p: x1,y1, x2,y2 - the map coordinates of two points on the grid xlat1,xlong1, xlat2,xlong2 - the geographic coordinates of the same two points for stcm1p: x1,y1 - the map coordinates of one point on the grid xlat1,xlong1 - the geographic coordinates of the same point xlatg,xlongg - latitude and longitude of reference point for gridsz and orientation specification. gridsz - the desired grid size in kilometers, at xlatg,xlongg orient - the angle, with respect to north, of a y-grid line, at the point xlatg,xlongg outputs: strcmp - a 9-value map structure array, fully set for use by other subroutines in this system

subroutine cll2xy (strcmp, xlat,xlong, x,y) subroutine cxy2ll (strcmp, x,y, xlat,xlong) these routines convert between map coordinates x,y and geographic coordinates xlat,xlong inputs: strcmp(9) - 9-value map structure array for cll2xy: xlat,xlong - geographic coordinates for cxy2ll: x,y - map coordinates outputs: for cll2xy: x,y - map coordinates for cxy2ll: xlat,xlong - geographic coordinates

subroutine cc2gxy (strcmp, x,y, ue,vn, ug,vg) subroutine cg2cxy (strcmp, x,y, ug,vg, ue,vn) subroutine cc2gll (strcmp, xlat,xlong, ue,vn, ug,vg) subroutine cg2cll (strcmp, xlat,xlong, ug,vg, ue,vn) These subroutines convert vector wind components from geographic, or compass, coordinates, to map or grid coordinates. The site of the wind to be converted may be given either in geographic or map coordinates. Wind components are all in kilometers per hour, whether geographic or map coordinates. inputs: strcmp(9) - 9-value map structure array for cc2gxy and cg2cxy: x,y - map coordinates of site for cc2gll and cg2cll: xlat,xlong - geographic coordinates of site for cc2gxy and cc2gll: ue,vn - east and north wind components for cg2cxy and cg2cll: ug,vg - x- and y- direction wind components outputs: for cc2gxy and cc2gll: ug,vg - x- and y- direction wind components for cg2cxy and cg2cll: ue,vn - east and north wind components

subroutine ccrvxy (strcmp, x, y, gx,gy) subroutine ccrvll (strcmp, xlat,xlong, gx,gy) These subroutines return the curvature vector (gx,gy), as referenced to map coordinates, induced by the map transformation. When non-linear terms in wind speed are important, a "geodesic" force should be included in the vector form [ (u,u) g - (u,g) u ] where the inner product (u,g) is defined as uxgx + uygy. inputs: strcmp(9) - 9-value map structure array for ccrvxy: x,y - map coordinates of site for ccrvll: xlat,xlong - geographic coordinates of site outputs: gx,gy - vector coefficients of curvature, in units radians per kilometer

real function cgszll (strcmp, xlat) real function cgszxy (strcmp, x,y) These functions return the size, in kilometers, of each unit of motion in map coordinates (grid size). The grid size at any location depends on that location; the position may be given in either map or geographic coordinates. inputs: strcmp(9) - 9-value map structure array for cgszxy: x,y - map coordinates of site for cgszll: xlat - geographic coordinates of site returns: gridsize in kilometers at given site.

subroutine cpolxy (strcmp, x,y, enx,eny,enz) subroutine cpolll (strcmp, xlat,xlong, enx,eny,enz) These subroutines provide 3-d vector components of a unit vector in the direction of the north polar axis. When multiplied by twice the rotation rate of the earth (2 * pi/24 hr), the vertical component yields the coriolis factor. inputs: strcmp(9) - 9-value map structure array for cpolxy: x,y - map coordinates of site for cpolll: xlat,xlong - geographic coordinates of site returns: enx,eny,enz the direction cosines of a unit vector in the direction of the rotation axis of the earth

subroutine cnllxy (strcmp, xlat,xlong, xi,eta) subroutine cnxyll (strcmp, xi,eta, xlat,xlong) These subroutines perform the underlying transformations from geographic coordinates to and from canonical (equator centered) coordinates. They are called by cxy2ll and cll2xy, but are not intended to be called directly

real function cspanf (value, begin, end) This function assists other routines in providing a longitude in the proper range. It adds to value whatever multiple of (end - begin) is needed to return a number begin < cspanf <= end


Uses


Functions

public function cgszll(strcmp, xlat)

Written on 3/31/94 by Dr. Albion Taylor NOAA / OAR / ARL

Read more…

Arguments

Type IntentOptional Attributes Name
real :: strcmp(9)
real :: xlat

Return Value real


Subroutines

public subroutine cc2gll(strcmp, xlat, xlong, ue, vn, ug, vg)

Written on 3/31/94 by Dr. Albion Taylor NOAA / OAR / ARL

Read more…

Arguments

Type IntentOptional Attributes Name
real :: strcmp(9)
real :: xlat
real :: xlong
real :: ue
real :: vn
real :: ug
real :: vg

public subroutine cll2xy(strcmp, xlat, xlong, x, y)

Written on 3/31/94 by Dr. Albion Taylor NOAA / OAR / ARL

Arguments

Type IntentOptional Attributes Name
real :: strcmp(9)
real :: xlat
real :: xlong
real :: x
real :: y

public subroutine cxy2ll(strcmp, x, y, xlat, xlong)

Written on 3/31/94 by Dr. Albion Taylor NOAA / OAR / ARL

Arguments

Type IntentOptional Attributes Name
real :: strcmp(9)
real :: x
real :: y
real :: xlat
real :: xlong

public subroutine stcm2p(strcmp, x1, y1, xlat1, xlong1, x2, y2, xlat2, xlong2)

Written on 3/31/94 by Dr. Albion Taylor NOAA / OAR / ARL

Arguments

Type IntentOptional Attributes Name
real :: strcmp(9)
real :: x1
real :: y1
real :: xlat1
real :: xlong1
real :: x2
real :: y2
real :: xlat2
real :: xlong2

public subroutine stlmbr(strcmp, tnglat, xlong)

Written on 3/31/94 by Dr. Albion Taylor NOAA / OAR / ARL

Read more…

Arguments

Type IntentOptional Attributes Name
real :: strcmp(9)
real :: tnglat
real :: xlong