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