NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fb11.f
Go to the documentation of this file.
1C> @file
2C> @brief Lat/lon to lambert(i,j) for grib.
3C> @author John Stackpole @date 1988-11-25
4
5C> Converts the coordinates of a location on Earth given in
6C> the natural coordinate system of latitude/longitude to a grid
7C> coordinate system overlaid on a lambert conformal tangent cone
8C> projection true at a given n or s latitude. w3fb11() is the reverse
9C> of w3fb12(). uses grib specification of the location of the grid
10C>
11C> Program history log:
12C> - John Stackpole 1988-11-25
13C> - Ralph Jones 1990-04-12 Convert to cft77 fortran.
14C> - Ralph Jones 1994-04-28 Add save statement.
15C>
16C> @param[in] ALAT Latitude in degrees (negative in southern hemis).
17C> @param[in] ELON East longitude in degrees, real*4.
18C> @param[in] ALAT1 Latitude of lower left point of grid (point (1,1)).
19C> @param[in] ELON1 Longitude of lower left point of grid (point (1,1))
20C> all real*4.
21C> @param[in] DX Mesh length of grid in meters at tangent latitude.
22C> @param[in] ELONV The orientation of the grid. i.e.,
23C> the east longitude value of the vertical meridian
24C> which is parallel to the y-axis (or columns of
25C> of the grid) along which latitude increases as
26C> the y-coordinate increases. real*4
27C> this is also the meridian (on the back side of the
28C> tangent cone) along which the cut is made to lay
29C> the cone flat.
30C> @param[in] ALATAN The latitude at which the lambert cone is tangent to
31C> (touching) the spherical Earth. Set negative to indicate a
32C> southern hemisphere projection.
33C> @param[out] XI I coordinate of the point specified by alat, elon
34C> @param[out] XJ J coordinate of the point; both real*4
35C>
36C> @note Formulae and notation loosely based on hoke, hayes,
37C> and renninger's "map projections and grid systems...", march 1981
38C> afgwc/tn-79/003.
39C>
40C> @author John Stackpole @date 1988-11-25
41 SUBROUTINE w3fb11(ALAT,ELON,ALAT1,ELON1,DX,ELONV,ALATAN,XI,XJ)
42C
43 SAVE
44C
45 DATA rerth /6.3712e+6/, pi/3.14159/
46C
47C PRELIMINARY VARIABLES AND REDIFINITIONS
48C
49C H = 1 FOR NORTHERN HEMISPHERE; = -1 FOR SOUTHERN
50C
51 IF (alatan.GT.0) THEN
52 h = 1.
53 ELSE
54 h = -1.
55 ENDIF
56C
57 radpd = pi / 180.0
58 rebydx = rerth / dx
59 alatn1 = alatan * radpd
60 an = h * sin(alatn1)
61 cosltn = cos(alatn1)
62C
63C MAKE SURE THAT INPUT LONGITUDES DO NOT PASS THROUGH
64C THE CUT ZONE (FORBIDDEN TERRITORY) OF THE FLAT MAP
65C AS MEASURED FROM THE VERTICAL (REFERENCE) LONGITUDE.
66C
67 elon1l = elon1
68 IF ((elon1 - elonv).GT.180.)
69 & elon1l = elon1 - 360.
70 IF ((elon1 - elonv).LT.(-180.))
71 & elon1l = elon1 + 360.
72C
73 elonl = elon
74 IF ((elon - elonv).GT.180.)
75 & elonl = elon - 360.
76 IF ((elon - elonv).LT.(-180.))
77 & elonl = elon + 360.
78C
79 elonvr = elonv * radpd
80C
81C RADIUS TO LOWER LEFT HAND (LL) CORNER
82C
83 ala1 = alat1 * radpd
84 rmll = rebydx * (((cosltn)**(1.-an))*(1.+an)**an) *
85 & (((cos(ala1))/(1.+h*sin(ala1)))**an)/an
86C
87C USE LL POINT INFO TO LOCATE POLE POINT
88C
89 elo1 = elon1l * radpd
90 arg = an * (elo1-elonvr)
91 polei = 1. - h * rmll * sin(arg)
92 polej = 1. + rmll * cos(arg)
93C
94C RADIUS TO DESIRED POINT AND THE I J TOO
95C
96 ala = alat * radpd
97 rm = rebydx * ((cosltn**(1.-an))*(1.+an)**an) *
98 & (((cos(ala))/(1.+h*sin(ala)))**an)/an
99C
100 elo = elonl * radpd
101 arg = an*(elo-elonvr)
102 xi = polei + h * rm * sin(arg)
103 xj = polej - rm * cos(arg)
104C
105C IF COORDINATE LESS THAN 1
106C COMPENSATE FOR ORIGIN AT (1,1)
107C
108 IF (xi.LT.1.) xi = xi - 1.
109 IF (xj.LT.1.) xj = xj - 1.
110C
111 RETURN
112 END
subroutine w3fb11(alat, elon, alat1, elon1, dx, elonv, alatan, xi, xj)
Converts the coordinates of a location on Earth given in the natural coordinate system of latitude/lo...
Definition w3fb11.f:42