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