NCEPLIBS-w3emc  2.11.0
w3fb09.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Merc (i,j) to lat/lon for grib
3 C> @author John Stackpole @date 1988-03-01
4 
5 C> Converts a location on Earth given in
6 C> an i,j coordinate system overlaid on a mercator map projection
7 C> to the coordinate system of latitude/longitude
8 C> w3fb09() is the reverse of w3fb08()
9 C> uses grib specification of the location of the grid.
10 C>
11 C> Program history log:
12 C> - John Stackpole 1988-03-01
13 C> - Ralph Jones 1990-04-12 Convert to cray cft77 fortran.
14 C>
15 C> @param[in] XI I coordinate of the point.
16 C> @param[in] XJ J coordinate of the point; both real*4.
17 C> @param[in] ALAT1 Latitude of lower left corner of grid (point (1,1)).
18 C> @param[in] ALON1 Longitude of lower left corner of grid (point (1,1))
19 C> all real*4.
20 C> @param[in] ALATIN The latitude at which the mercator cylinder
21 C> intersects the Earth.
22 C> @param[in] DX Mesh length of grid in meters at alatin.
23 C> @param[out] ALAT Latitude in degrees (negative in southern hemis).
24 C> @param[out] ALON East longitude in degrees, real*4
25 C> of the point specified by (i,j).
26 C>
27 C> @note Formulae and notation loosely based on hoke, hayes,
28 C> and renninger's "map projections and grid systems...", march 1981
29 C> afgwc/tn-79/003
30 C>
31 C> @author John Stackpole @date 1988-03-01
32  SUBROUTINE w3fb09(XI,XJ,ALAT1,ALON1,ALATIN,DX,ALAT,ALON)
33 C
34  DATA rerth /6.3712e+6/, pi/3.1416/
35 C
36 C PRELIMINARY VARIABLES AND REDIFINITIONS
37 C
38  radpd = pi / 180.0
39  degpr = 180.0 / pi
40  clain = cos(radpd*alatin)
41  dellon = dx / (rerth*clain)
42 C
43 C GET DISTANCE FROM EQUATOR TO ORIGIN ALAT1
44 C
45  djeo = 0.
46  IF (alat1.NE.0.)
47  & djeo = (alog(tan(0.5*((alat1+90.0)*radpd))))/dellon
48 C
49 C NOW THE LAT AND LON
50 C
51  alat = 2.0*atan(exp(dellon*(djeo + xj-1.)))*degpr - 90.0
52  alon = (xi-1.) * dellon * degpr + alon1
53 C
54  RETURN
55  END
subroutine w3fb09(XI, XJ, ALAT1, ALON1, ALATIN, DX, ALAT, ALON)
Converts a location on Earth given in an i,j coordinate system overlaid on a mercator map projection ...
Definition: w3fb09.f:33