From b2b53fd23e5cbc8ba8a642fe22c2b5e34e08f682 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 27 Apr 2016 20:26:46 +0000 Subject: [PATCH] Fix the zero-distance problem also at its root, in geodist.f90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6651 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/geodist.f90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/geodist.f90 b/lib/geodist.f90 index 2ca755354..f93bde923 100644 --- a/lib/geodist.f90 +++ b/lib/geodist.f90 @@ -29,6 +29,13 @@ subroutine geodist(Eplat,Eplon,Stlat,Stlon,Az,Baz,Dist) data D2R/0.01745329251994/ ! degrees to radians conversion factor data Pi2/6.28318530718/ + if(abs(Eplat-Stlat).lt.0.02 .and. abs(Eplon-Stlon).lt.0.02) then + Az=0. + Baz=180.0 + Dist=0 + go to 999 + endif + BOA = BL/AL F = 1.0 - BOA ! Convert st/end pts to radians @@ -93,4 +100,6 @@ subroutine geodist(Eplat,Eplon,Stlat,Stlon,Az,Baz,Dist) az = 360.0 - az baz = 360.0 - baz + +999 return end subroutine geodist