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