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