NCEPLIBS-w3emc  2.11.0
w3fb01.f
Go to the documentation of this file.
1 C> @file
2 C> @brief I,J TO LATITUDE, LONGITUDE
3 C> @author A. Heermann @date 1969-08-01
4 
5 C> Converts the coordinates of a location from the grid(i,j)
6 C> coordinate system overlaid on the polar stereographic map pro-
7 C> jection true at 60 n to the natural coordinate system of latitude
8 C> /longitude on the Earth. A preferable more flexible subroutine to
9 C> use is w3fb05(). w3fb01() is the reverse of w3fb00().
10 C>
11 C> PROGRAM HISTORY LOG:
12 C> - A. Heermann 1969-08-01 A. HEERMANN
13 C> - Ralph Jones 1990-08-31 Change to cray cft77 fortran.
14 C>
15 C> @param[in] XI I of the point relative to north pole.
16 C> @param[in] XJ J of the point relative to north pole.
17 C> @param[in] XMESHL Mesh length of grid in kilometers at 60n.
18 C> @param[out] ALAT Latitude in deg. (-20.0(s. hemis) < alat < 90.0).
19 C> @param[out] ALONG West longitude in degrees.
20 C>
21 C> @note The grid used in this subroutine has its origin (i=0,j=0)
22 C> at the north pole, so if the user's grid has its origin at a
23 C> point other than the north pole, a translation is required to
24 C> get i and j for input into w3fb01(). The subroutine grid is
25 C> oriented so that longitude 80w is parallel to gridlines of
26 C> i=constant. The Earth's radius is taken to be 6371.2 km.
27 C> All parameters in the call statement must be real.
28 C>
29 C> @author A. Heermann @date 1969-08-01
30  SUBROUTINE w3fb01(XI,XJ,XMESHL,ALAT,ALONG)
31 C
32  DATA degprd/57.2957795/
33  DATA earthr/6371.2/
34 C
35  gi2 = (1.86603 * earthr) / xmeshl
36  gi2 = gi2 * gi2
37  r2 = xi * xi + xj * xj
38  IF (r2.NE.0.0) GO TO 100
39  along = 0.0
40  alat = 90.0
41  RETURN
42 C
43 100 CONTINUE
44  alat = asin((gi2-r2) / (gi2+r2)) * degprd
45  xlong = degprd * atan2(xj,xi)
46  IF (xlong) 200,300,300
47 C
48 200 CONTINUE
49  along = -10.0 - xlong
50  IF (along.LT.0.0) along = along + 360.0
51  GO TO 400
52 C
53 300 CONTINUE
54  along = 350.0 - xlong
55 C
56 400 CONTINUE
57  RETURN
58  END
subroutine w3fb01(XI, XJ, XMESHL, ALAT, ALONG)
Converts the coordinates of a location from the grid(i,j) coordinate system overlaid on the polar ste...
Definition: w3fb01.f:31