diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /lib/astro0.f90 | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'lib/astro0.f90')
| -rw-r--r-- | lib/astro0.f90 | 97 |
1 files changed, 81 insertions, 16 deletions
diff --git a/lib/astro0.f90 b/lib/astro0.f90 index d852fbf3..207aa6a4 100644 --- a/lib/astro0.f90 +++ b/lib/astro0.f90 @@ -1,35 +1,63 @@ subroutine astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,sd8,poloffset8,xnr8,dfdt,dfdt0, & - width1,width2,xlst8,techo8) + width1,width2,xlst8,techo8,ephemeris_result) + use jpl_ephemeris_status, only: EPHEMERIS_JPL, & + EPHEMERIS_ANALYTIC_FALLBACK, EPHEMERIS_INVALID_INPUT, & + EPHEMERIS_UNAVAILABLE, jpl_reader_generation parameter (DEGS=57.2957795130823d0) - character*6 mygrid,hisgrid + character*6 mygrid,hisgrid,mygrid_calc,hisgrid_calc + character(len=6), parameter :: legacy_blank_grid='BB44mm' real*8 AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8 real*8 dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,xnr8,dfdt,dfdt0,dt real*8 sd8,poloffset8,width1,width2,xlst8 real*8 uth8,techo8,freq8 real*8 xl,b + integer ephemeris_result,result_dx,result_self,last_result + integer last_reader_generation common/librcom/xl(2),b(2) common/echocom2/fspread_self,fspread_dx data uth8z/0.d0/ + data last_result/-1/ + data last_reader_generation/-1/ save uth=uth8 - call astro(nyear,month,nday,uth,freq8,hisgrid,2,1, & + mygrid_calc=mygrid + hisgrid_calc=hisgrid +! Blank locators historically reduce to the same periodic position as BB44mm. + if(len_trim(mygrid_calc).eq.0) mygrid_calc=legacy_blank_grid + if(len_trim(hisgrid_calc).eq.0) hisgrid_calc=legacy_blank_grid + + call astro(nyear,month,nday,uth,freq8,hisgrid_calc,2,1, & AzSun,ElSun,AzMoon,ElMoon,ntsky,doppler00,doppler, & dbMoon,RAMoon,DecMoon,HA,Dgrd,sd,poloffset,xnr, & - day,xlon2,xlat2,xlst,techo) + day,xlon2,xlat2,xlst,techo,result_dx) + if(result_dx.eq.EPHEMERIS_INVALID_INPUT .or. & + result_dx.eq.EPHEMERIS_UNAVAILABLE) then + ephemeris_result=result_dx + go to 800 + endif AzMoonB8=AzMoon ElMoonB8=ElMoon xl2=xl(1) xl2a=xl(2) b2=b(1) b2a=b(2) - call astro(nyear,month,nday,uth,freq8,mygrid,1,1, & + call astro(nyear,month,nday,uth,freq8,mygrid_calc,1,1, & AzSun,ElSun,AzMoon,ElMoon,ntsky,doppler00,doppler, & dbMoon,RAMoon,DecMoon,HA,Dgrd,sd,poloffset,xnr, & - day,xlon1,xlat1,xlst,techo) + day,xlon1,xlat1,xlst,techo,result_self) + if(result_self.eq.EPHEMERIS_INVALID_INPUT .or. & + result_self.eq.EPHEMERIS_UNAVAILABLE) then + ephemeris_result=result_self + go to 800 + endif + ephemeris_result=EPHEMERIS_JPL + if(result_dx.eq.EPHEMERIS_ANALYTIC_FALLBACK .or. & + result_self.eq.EPHEMERIS_ANALYTIC_FALLBACK) & + ephemeris_result=EPHEMERIS_ANALYTIC_FALLBACK xl1=xl(1) xl1a=xl(2) b1=b(1) @@ -45,7 +73,10 @@ subroutine astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & width1=0.5*6741*fghz*rate1 rate2=sqrt((dldt1+dldt2)**2 + (dbdt1+dbdt2)**2) width2=0.5*6741*fghz*rate2 - if(hisgrid(1:4).eq.' ') width2=width1 !No hisgrid, use self width + if(hisgrid(1:4).eq.' ') then + width2=width1 + xnr=0. + endif fspread_self=width1 !Save for avecho() fspread_dx=width2 !Save for avecho() @@ -65,19 +96,53 @@ subroutine astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & ndop=nint(doppler) ndop00=nint(doppler00) - if(uth8z.eq.0.d0) then - uth8z=uth8-1.d0/3600.d0 - dopplerz=doppler - doppler00z=doppler00 + if(uth8z.eq.0.d0 .or. ephemeris_result.ne.last_result .or. & + jpl_reader_generation.ne.last_reader_generation) then + dfdt=0.d0 + dfdt0=0.d0 + else + dt=60.0*(uth8-uth8z) + if(dt.le.0) dt=1.d0/60.d0 + dfdt=(doppler-dopplerz)/dt + dfdt0=(doppler00-doppler00z)/dt endif - - dt=60.0*(uth8-uth8z) - if(dt.le.0) dt=1.d0/60.d0 - dfdt=(doppler-dopplerz)/dt - dfdt0=(doppler00-doppler00z)/dt uth8z=uth8 dopplerz=doppler doppler00z=doppler00 + last_result=ephemeris_result + last_reader_generation=jpl_reader_generation + + return +800 uth8z=0.d0 + dopplerz=0.0 + doppler00z=0.0 + last_result=-1 + last_reader_generation=-1 + fspread_self=0.0 + fspread_dx=0.0 + AzSun8=0.d0 + ElSun8=0.d0 + AzMoon8=0.d0 + ElMoon8=0.d0 + AzMoonB8=0.d0 + ElMoonB8=0.d0 + ntsky=0 + ndop=0 + ndop00=0 + dbMoon8=0.d0 + RAMoon8=0.d0 + DecMoon8=0.d0 + HA8=0.d0 + Dgrd8=0.d0 + sd8=0.d0 + poloffset8=0.d0 + xnr8=0.d0 + dfdt=0.d0 + dfdt0=0.d0 + width1=0.d0 + width2=0.d0 + xlst8=0.d0 + techo8=0.d0 return end subroutine astro0 |
