Protect against locator at antipodes causing undefined azimuth.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7376 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-12-10 18:12:45 +00:00
parent e21f69b5e9
commit 6977ecbbdf

View File

@ -49,11 +49,9 @@ subroutine azdist(grid1,grid2,utch,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
HotABetter=.true. HotABetter=.true.
go to 900 go to 900
endif endif
call grid2deg(MyGrid,dlong1,dlat1) call grid2deg(MyGrid,dlong1,dlat1)
call grid2deg(HisGrid,dlong2,dlat2) call grid2deg(HisGrid,dlong2,dlat2)
eps=1.e-6 eps=1.e-6
if(abs(dlat1-dlat2).lt.eps .and. abs(dlong1-dlong2).lt.eps) then
Az=0. Az=0.
Dmiles=0. Dmiles=0.
Dkm=0.0 Dkm=0.0
@ -61,11 +59,17 @@ subroutine azdist(grid1,grid2,utch,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
HotA=0. HotA=0.
HotB=0. HotB=0.
HotABetter=.true. HotABetter=.true.
if(abs(dlat1-dlat2).lt.eps .and. abs(dlong1-dlong2).lt.eps) go to 900
difflong=mod(dlong1-dlong2+720.0,360.0)
if(abs(dlat1+dlat2).lt.eps .and. abs(difflong-180.0).lt.eps) then
! Antipodes
Dkm=20400
go to 900 go to 900
else
call geodist(dlat1,dlong1,dlat2,dlong2,Az,Baz,Dkm)
endif endif
call geodist(dlat1,dlong1,dlat2,dlong2,Az,Baz,Dkm)
ndkm=Dkm/100 ndkm=Dkm/100
j=ndkm-4 j=ndkm-4
if(j.lt.1) j=1 if(j.lt.1) j=1