NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fb05.f
Go to the documentation of this file.
1C> @file
2C> @brief Grid coordinates to latitude, longitude.
3C> @author Ralph Jones @date 1986-07-17
4
5C> Converts the coordinates of a location from the grid(i,j)
6C> coordinate system overlaid on the polar stereographic map projec-
7C> tion true at 60 degrees n or s latitude to the natural coordinate
8C> system of latitude/longitude on the earth. w3fb05() is the reverse
9C> of w3fb04().
10C>
11C> Program history log:
12C> - Ralph Jones 1986-07-17
13C> - Ralph Jones 1989-11-01 Change to cray cft77 fortran.
14C>
15C> @param[in] XI I of the point relative to the north or s. pole
16C> @param[in] XJ J of the point relative to the north or s. pole
17C> @param[in] XMESHL Mesh length of grid in km at 60 degrees(<0 if sh)
18C> (190.5 lfm grid, 381.0 nh pe grid,-381.0 sh pe grid)
19C> @param[in] ORIENT Orientation west longitude of the grid
20C> (105.0 lfm grid, 80.0 nh pe grid, 260.0 sh pe grid)
21C> @param[out] ALAT Latitude in degrees (<0 if sh)
22C> @param[out] ALONG West longitude in degrees
23C>
24C> @note All parameters in the calling statement must be
25C> real. the range of allowable latitudes is from a pole to
26C> 30 degrees into the opposite hemisphere.
27C> the grid used in this subroutine has its origin (i=0,j=0)
28C> at the pole, so if the user's grid has its origin at a point
29C> other than a pole, a translation is required to get i and j for
30C> input into w3fb05(). the subroutine grid is oriented so that
31C> gridlines of i=constant are parallel to a west longitude sup-
32C> plied by the user. the earth's radius is taken to be 6371.2 km.
33C>
34C> @note This code will not vectorize, it is normaly used in a
35C> double do loop with w3ft01(), w3ft00(), etc. to vectorize it,
36C> put it in line, put w3ft01(), w3ft00(), etc. in line.
37C>
38C> @author Ralph Jones @date 1986-07-17
39 SUBROUTINE w3fb05(XI,XJ,XMESHL,ORIENT,ALAT,ALONG)
40C
41 DATA degprd/57.2957795/
42 DATA earthr/6371.2/
43C
44 gi2 = ((1.86603 * earthr) / (xmeshl))**2
45 r2 = xi * xi + xj * xj
46C
47 IF (r2.EQ.0.0) THEN
48 along = 0.0
49 alat = 90.0
50 IF (xmeshl.LT.0.0) alat = -alat
51 RETURN
52 ELSE
53 alat = asin((gi2 - r2) / (gi2 + r2)) * degprd
54 angle = degprd * atan2(xj,xi)
55 IF (angle.LT.0.0) angle = angle + 360.0
56 ENDIF
57C
58 IF (xmeshl.GE.0.0) THEN
59 along = 270.0 + orient - angle
60C
61 ELSE
62C
63 along = angle + orient - 270.0
64 alat = -(alat)
65 ENDIF
66C
67 IF (along.LT.0.0) along = along + 360.0
68 IF (along.GE.360.0) along = along - 360.0
69C
70 RETURN
71C
72 END
subroutine w3fb05(xi, xj, xmeshl, orient, alat, along)
Converts the coordinates of a location from the grid(i,j) coordinate system overlaid on the polar ste...
Definition w3fb05.f:40