Fortran library for Geodesics 2.1
Loading...
Searching...
No Matches
planimeter.for
Go to the documentation of this file.
1*> @file planimeter.for
2*! @brief A test program for area()
3
4*> A simple program to compute the area of a geodesic polygon.
5*!
6*! This program reads in up to 10000 lines with lat, lon for each vertex
7*! of a polygon. At the end of input, the program prints the number of
8*! vertices, the perimeter of the polygon and its area (for the WGS84
9*! ellipsoid).
10
11 program planimeter
12 implicit none
13
14 include 'geodesic.inc'
15
16 integer maxpts
17 parameter(maxpts = 10000)
18 double precision a, f, lats(maxpts), lons(maxpts), s, p
19 integer n
20
21* WGS84 values
22 a = 6378137d0
23 f = 1/298.257223563d0
24
25 n = 0
26 10 continue
27 if (n .ge. maxpts) go to 20
28 read(*, *, end=20, err=20) lats(n+1), lons(n+1)
29 n = n+1
30 go to 10
31 20 continue
32 call area(a, f, lats, lons, n, s, p)
33 print 30, n, p, s
34 30 format(i6, 1x, f20.8, 1x, f20.3)
35 stop
36 end
program planimeter
A simple program to compute the area of a geodesic polygon.