Fortran library for Geodesics  1.44
geodinverse.for
Go to the documentation of this file.
1 *> @file geodinverse.for
2 *! @brief A test program for invers()
3 
4 *> A simple program to solve the inverse geodesic problem.
5 *!
6 *! This program reads in lines with lat1, lon1, lon2, lat2 and prints
7 *! out lines with azi1, azi2, s12 (for the WGS84 ellipsoid).
8 
9  program geodinverse
10  implicit none
11 
12  include 'geodesic.inc'
13 
14  double precision a, f, lat1, lon1, azi1, lat2, lon2, azi2, s12,
15  + dummy1, dummy2, dummy3, dummy4, dummy5
16  integer omask
17 
18 * WGS84 values
19  a = 6378137d0
20  f = 1/298.257223563d0
21 
22  omask = 0
23 
24  10 continue
25  read(*, *, end=90, err=90) lat1, lon1, lat2, lon2
26  if (abs(lat1) .gt. 90 .or. abs(lat2) .gt. 90) then
27  print 15
28  15 format(1x,'lat1 and lat2 must be in [-90,90]')
29  go to 10
30  end if
31  call invers(a, f, lat1, lon1, lat2, lon2,
32  + s12, azi1, azi2, omask,
33  + dummy1, dummy2, dummy3, dummy4 , dummy5)
34  print 20, azi1, azi2, s12
35  20 format(1x, f20.15, 1x, f20.15, 1x, f19.10)
36  go to 10
37  90 continue
38 
39  stop
40  end
program geodinverse
A simple program to solve the inverse geodesic problem.
Definition: geodinverse.for:9