NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fb04.f
Go to the documentation of this file.
1C> @file
2C> @brief Latitude, longitude to grid coordinates.
3C> @author James McDonell @date 1986-07-17
4
5C> Converts the coordinates of a location on earth from the
6C> natural coordinate system of latitude/longitude to the grid (i,j)
7C> coordinate system overlaid on a polar stereographic map pro-
8C> jection true at 60 degrees n or s latitude. w3fb04() is the reverse
9C> of w3fb05().
10C>
11C> Program history log:
12C> - James McDonell 1986-07-17
13C> - Ralph Jones 1988-06-07 Clean up code, take out goto, use then, else.
14C> - Ralph Jones 1989-11-02 Change to cray cft77 fortran.
15C>
16C> @param[in] ALAT Latitude in degrees (<0 if sh).
17C> @param[in] ALONG West longitude in degrees.
18C> @param[in] XMESHL Mesh length of grid in km at 60 deg lat(<0 if sh)
19C> (190.5 lfm grid, 381.0 nh pe grid,-381.0 sh pe grid).
20C> @param[in] ORIENT Orientation west longitude of the grid
21C> (105.0 lfm grid, 80.0 nh pe grid, 260.0 sh pe grid).
22C> @param[out] XI I of the point relative to north or south pole.
23C> @param[out] XJ J of the point relative to north or south pole.
24C>
25C> @note All parameters in the calling statement must be
26c> real. the range of allowable latitudes is from a pole to
27c> 30 degrees into the opposite hemisphere.
28c> The grid used in this subroutine has its origin (i=0,j=0)
29c> at the pole in either hemisphere, so if the user's grid has its
30c> origin at a point other than the pole, a translation is needed
31c> to get i and j. The gridlines of i=constant are parallel to a
32c> longitude designated by the user. the earth's radius is taken
33c> to be 6371.2 km.
34C>
35C> @note This code is not vectorized. To vectorize take it and the
36C> subroutine it calls and put them in line.
37C>
38C> @author James McDonell @date 1986-07-17
39 SUBROUTINE w3fb04(ALAT,ALONG,XMESHL,ORIENT,XI,XJ)
40C
41 DATA radpd /.01745329/
42 DATA earthr/6371.2/
43C
44 re = (earthr * 1.86603) / xmeshl
45 xlat = alat * radpd
46C
47 IF (xmeshl.GE.0.) THEN
48 wlong = (along + 180.0 - orient) * radpd
49 r = (re * cos(xlat)) / (1.0 + sin(xlat))
50 xi = r * sin(wlong)
51 xj = r * cos(wlong)
52 ELSE
53 re = -re
54 xlat = -xlat
55 wlong = (along - orient) * radpd
56 r = (re * cos(xlat)) / (1.0 + sin(xlat))
57 xi = r * sin(wlong)
58 xj = -r * cos(wlong)
59 ENDIF
60C
61 RETURN
62 END
subroutine w3fb04(alat, along, xmeshl, orient, xi, xj)
Converts the coordinates of a location on earth from the natural coordinate system of latitude/longit...
Definition w3fb04.f:40