summaryrefslogtreecommitdiff
path: root/lib/plotsave.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
committerChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
commit059831534c7e884f0a607ed86b582fd00d821731 (patch)
tree76bcb67a78f8aa2654fd34c2ad801a62136b0170 /lib/plotsave.f90
parentd83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff)
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
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