NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fb08.f
Go to the documentation of this file.
1C> @file
2C> @brief Lat/lon to merc (i,j) for grib.
3C> @author John Stackpole @date 1988-03-01
4
5C> Converts a location on earth given in
6C> the coordinate system of latitude/longitude to an (i,j)
7C> coordinate system overlaid on a mercator map projection
8C> w3fb08() is the reverse of w3fb09()
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] ALAT Latitude in degrees (negative in southern hemis).
16C> @param[in] ALON East longitude in degrees, 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] XI I coordinate of the point specified by alat, alon.
24C> @param[out] XJ J coordinate of the point; both real*4.
25C>
26C> @note Formulae and notation loosely based on hoke, hayes,
27C> and renninger's "map projections and grid systems...", march 1981
28C> afgwc/tn-79/003
29C>
30C> @author John Stackpole @date 1988-03-01
31 SUBROUTINE w3fb08(ALAT,ALON,ALAT1,ALON1,ALATIN,DX,XI,XJ)
32C
33 DATA rerth /6.3712e+6/, pi/3.1416/
34C
35C PRELIMINARY VARIABLES AND REDIFINITIONS
36C
37 radpd = pi / 180.0
38 degpr = 180.0 / pi
39 clain = cos(radpd*alatin)
40 dellon = dx / (rerth*clain)
41C
42C GET DISTANCE FROM EQUATOR TO ORIGIN ALAT1
43C
44 djeo = 0.
45 IF (alat1.NE.0.)
46 & djeo = (alog(tan(0.5*((alat1+90.0)*radpd))))/dellon
47C
48C NOW THE I AND J COORDINATES
49C
50 xi = 1. + ((alon - alon1)/(dellon*degpr))
51 xj = 1. + (alog(tan(0.5*((alat + 90.) * radpd))))/
52 & dellon
53 & - djeo
54C
55 RETURN
56 END
subroutine w3fb08(alat, alon, alat1, alon1, alatin, dx, xi, xj)
Converts a location on earth given in the coordinate system of latitude/longitude to an (i,...
Definition w3fb08.f:32