Fix a bug in azdist() that can cause bad behavior when computed

distance is 0.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6650 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-04-27 17:03:24 +00:00
parent d9e4d5f25f
commit d9c04c5472

View File

@ -1,5 +1,6 @@
subroutine azdist(MyGrid,HisGrid,utch,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter) subroutine azdist(grid1,grid2,utch,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
character*(*) grid1,grid2
character*6 MyGrid,HisGrid,mygrid0,hisgrid0 character*6 MyGrid,HisGrid,mygrid0,hisgrid0
real*8 utch,utch0 real*8 utch,utch0
logical HotABetter,IamEast logical HotABetter,IamEast
@ -11,6 +12,11 @@ subroutine azdist(MyGrid,HisGrid,utch,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
data mygrid0/" "/,hisgrid0/" "/,utch0/-999.d0/ data mygrid0/" "/,hisgrid0/" "/,utch0/-999.d0/
save save
MyGrid=grid1
HisGrid=grid2
if(ichar(grid1(5:5)).eq.0) MyGrid(5:6)=' '
if(ichar(grid2(5:5)).eq.0) HisGrid(5:6)=' '
if(MyGrid.eq.HisGrid) then if(MyGrid.eq.HisGrid) then
naz=0 naz=0
nel=0 nel=0
@ -46,7 +52,19 @@ subroutine azdist(MyGrid,HisGrid,utch,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
call grid2deg(MyGrid,dlong1,dlat1) call grid2deg(MyGrid,dlong1,dlat1)
call grid2deg(HisGrid,dlong2,dlat2) call grid2deg(HisGrid,dlong2,dlat2)
call geodist(dlat1,dlong1,dlat2,dlong2,Az,Baz,Dkm) eps=1.e-6
if(abs(dlat1-dlat2).lt.eps .and. abs(dling1-dling2).lt.eps) then
Az=0.
Dmiles=0.
Dkm=0.0
El=0.
HotA=0.
HotB=0.
HotABetter=.true.
go to 900
else
call geodist(dlat1,dlong1,dlat2,dlong2,Az,Baz,Dkm)
endif
ndkm=Dkm/100 ndkm=Dkm/100
j=ndkm-4 j=ndkm-4