summaryrefslogtreecommitdiff
path: root/lib/plotsave.f90
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
committerhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
commitc25cbdf6fb6d946175f4335fab77bfea601b56db (patch)
tree6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /lib/plotsave.f90
parent71f5689252c9f13e70e1c24856904475b2307809 (diff)
parent0685fcada9f95fe90f70b387cd7d757da8209624 (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/plotsave.f90')
-rw-r--r--lib/plotsave.f9020
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/plotsave.f90 b/lib/plotsave.f90
index ee1a41cf..4e144264 100644
--- a/lib/plotsave.f90
+++ b/lib/plotsave.f90
@@ -1,7 +1,8 @@
subroutine plotsave(swide,nw,nh,irow)
- real, dimension(:,:), allocatable :: sw
+ real, dimension(:,:), allocatable :: sw,sw_old
real swide(0:nw-1)
+ integer mw,mh
data nw0/-1/,nh0/-1/
save nw0,nh0,sw
@@ -11,10 +12,19 @@ subroutine plotsave(swide,nw,nh,irow)
endif
if(nw.ne.nw0 .or. nh.ne.nh0 .or. (.not.allocated(sw))) then
- if(allocated(sw)) deallocate(sw)
-! if(nw0.ne.-1) deallocate(sw)
- allocate(sw(0:nw-1,0:nh-1))
- sw=0.
+ if(allocated(sw)) then
+! Resize: keep the overlapping history instead of blanking the waterfall.
+ call move_alloc(sw,sw_old)
+ allocate(sw(0:nw-1,0:nh-1))
+ sw=0.
+ mw=min(nw,nw0)
+ mh=min(nh,nh0)
+ sw(0:mw-1,0:mh-1)=sw_old(0:mw-1,0:mh-1)
+ deallocate(sw_old)
+ else
+ allocate(sw(0:nw-1,0:nh-1))
+ sw=0.
+ endif
nw0=nw
nh0=nh
endif