NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fb06.f
Go to the documentation of this file.
1C> @file
2C> @brief Lat/lon to pola (i,j) for grib.
3C> @author John Stackpole @date 1988-01-01
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 polar stereographic map pro-
8C> jection true at 60 degrees n or s latitude. w3fb06() is the reverse
9C> of w3fb07(). uses grib specification of the location of the grid
10C>
11C> Program history log:
12C> - John Stackpole 1988-01-01
13C> - Ralph Jones 1990-04-12 Convert to cray cft77 fortran.
14C>
15C> @param[in] ALAT Latitude in degrees (negative in southern hemis)
16C> @param[in] ALON East longitude in degrees, real*4
17C> @param[in] ALAT1 Latitude of lower left point of grid (point (1,1))
18C> @param[in] ALON1 Longitude of lower left point of grid (point (1,1))
19C> all real*4
20C> @param[in] DX Mesh length of grid in meters at 60 deg lat
21C> must be set negative if using
22C> southern hemisphere projection.
23C> 190500.0 lfm grid,
24C> 381000.0 nh pe grid, -381000.0 sh pe grid, etc.
25C> @param[in] ALONV The orientation of the grid. i.e.,
26C> the east longitude value of the vertical meridian
27C> which is parallel to the y-axis (or columns of
28C> of the grid)along which latitude increases as
29C> the y-coordinate increases. real*4
30C> for example:
31C> 255.0 for lfm grid,
32C> 280.0 nh pe grid, 100.0 sh pe grid, etc.
33C> @param[out] XI I Coordinate of the point specified by alat, alon.
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-01-01
41 SUBROUTINE w3fb06(ALAT,ALON,ALAT1,ALON1,DX,ALONV,XI,XJ)
42C
43 DATA rerth /6.3712e+6/, pi/3.1416/
44 DATA ss60 /1.86603/
45C
46C PRELIMINARY VARIABLES AND REDIFINITIONS
47C
48C H = 1 FOR NORTHERN HEMISPHERE; = -1 FOR SOUTHERN
49C
50C REFLON IS LONGITUDE UPON WHICH THE POSITIVE X-COORDINATE
51C DRAWN THROUGH THE POLE AND TO THE RIGHT LIES
52C ROTATED AROUND FROM ORIENTATION (Y-COORDINATE) LONGITUDE
53C DIFFERENTLY IN EACH HEMISPHERE
54C
55 IF (dx.LT.0) THEN
56 h = -1.0
57 dxl = -dx
58 reflon = alonv - 90.0
59 ELSE
60 h = 1.0
61 dxl = dx
62 reflon = alonv - 270.0
63 ENDIF
64C
65 radpd = pi / 180.0
66 rebydx = rerth/dxl
67C
68C RADIUS TO LOWER LEFT HAND (LL) CORNER
69C
70 ala1 = alat1 * radpd
71 rmll = rebydx * cos(ala1) * ss60/(1. + h * sin(ala1))
72C
73C USE LL POINT INFO TO LOCATE POLE POINT
74C
75 alo1 = (alon1 - reflon) * radpd
76 polei = 1. - rmll * cos(alo1)
77 polej = 1. - h * rmll * sin(alo1)
78C
79C RADIUS TO DESIRED POINT AND THE I J TOO
80C
81 ala = alat * radpd
82 rm = rebydx * cos(ala) * ss60/(1. + h * sin(ala))
83C
84 alo = (alon - reflon) * radpd
85 xi = polei + rm * cos(alo)
86 xj = polej + h * rm * sin(alo)
87C
88 RETURN
89 END
subroutine w3fb06(alat, alon, alat1, alon1, dx, alonv, xi, xj)
Converts the coordinates of a location on earth given in the natural coordinate system of latitude/lo...
Definition w3fb06.f:42