70 SUBROUTINE w3fb10(DLAT1, DLON1, DLAT2, DLON2, BEARD, GCDKM)
74 IMPLICIT REAL (A-H,O-Z)
82 REAL TDEG, TRAD, TPOD, TFLT
84 REAL WHOLCD, HALFCD, QUARCD
88 REAL RLAT1, RLAT2, COSLA1, COSLA2, SINLA1, SINLA2
89 REAL DLOND, RLOND, COSLO, SINLO, SANGG, ABEAR
90 REAL YDISP, XDISP, DDLAT1, DDLAT2, DBANG
91 REAL DLAT1, DLAT2, DLON1, DLON2, BEARD, GCDKM
95 DATA pi /3.141592653589793238462643/
96 DATA halfpi/1.570796326794896619231322/
97 DATA dr /0.017453292519943295769237/
98 DATA rd /57.295779513082320876798155/
99 DATA tdeg /1e-10/, trad/1e-10/, tpod/1e-6/, tflt/1e-6/
101 DATA wholcd/360.0/, halfcd/180.0/, quarcd/90.0/
107 dlond = dlon2 - dlon1
108 IF (dlond .GT. halfcd) dlond = dlond - wholcd
109 IF (dlond .LT. -halfcd) dlond = dlond + wholcd
117 IF (abs(ddlat1-quarcd) .LT. tdeg)
THEN
118 IF (abs(ddlat2-quarcd) .LT. tdeg)
THEN
121 ELSE IF (abs(ddlat2+quarcd) .LT. tdeg)
THEN
126 sangg = halfpi - rlat2
128 ELSE IF (abs(ddlat1+quarcd) .LT. tdeg)
THEN
129 IF (abs(ddlat2-quarcd) .LT. tdeg)
THEN
132 ELSE IF (abs(ddlat2+quarcd) .LT. tdeg)
THEN
137 sangg = halfpi + rlat2
144 ELSE IF (abs(ddlat2-quarcd) .LT. tdeg)
THEN
146 sangg = halfpi - rlat1
147 ELSE IF (abs(ddlat2+quarcd) .LT. tdeg)
THEN
149 sangg = halfpi + rlat1
166 sangg = acos(sinla1*sinla2 + cosla1*cosla2*coslo)
171 IF (abs(sangg) .LT. trad)
THEN
180 ELSE IF (abs(sangg) .LT. tflt)
THEN
183 abear = atan2(xdisp, ydisp)
185 sangg = sqrt(ydisp**2 + xdisp**2)
192 ELSE IF (abs(sangg-pi) .LT. tpod)
THEN
201 abear = asin(amax1(-1.0,amin1(+1.0,cosla2*sinlo/
211 IF (0.0 .LE. cosla1*sinla2 .AND. cosla1*sinla2 .LE.
212 & cosla2*sinla1*coslo .OR. cosla1*sinla2 .LE. 0.0 .AND.
213 & cosla2*sinla1*coslo .GE. cosla1*sinla2) abear =
214 & sign(pi,abear) - abear
223 IF (dbang .LE. -halfcd) dbang = dbang + wholcd
224 IF (dbang .GT. halfcd) dbang = dbang - wholcd
225 gcdkm = earthr * sangg
subroutine w3fb10(dlat1, dlon1, dlat2, dlon2, beard, gcdkm)
Given a pair of points (1) and (2) given by latitude and longitude, w3fb10() computes the bearing and...