2018-01-17 11:41:07 -05:00
|
|
|
subroutine plotsave(swide,nw,nh,irow)
|
2018-01-12 15:40:15 -05:00
|
|
|
|
2018-01-17 11:41:07 -05:00
|
|
|
real, dimension(:,:), allocatable :: sw
|
|
|
|
real swide(0:nw-1)
|
|
|
|
data nw0/-1/,nh0/-1/
|
|
|
|
save nw0,nh0,sw
|
|
|
|
|
2018-01-17 12:56:01 -05:00
|
|
|
if(irow.eq.-99) then
|
|
|
|
if(allocated(sw)) deallocate(sw)
|
2018-01-26 13:41:09 -05:00
|
|
|
go to 900
|
2018-01-17 12:56:01 -05:00
|
|
|
endif
|
|
|
|
|
2018-01-26 13:41:09 -05:00
|
|
|
if(nw.ne.nw0 .or. nh.ne.nh0 .or. (.not.allocated(sw))) then
|
2018-01-17 13:08:15 -05:00
|
|
|
if(allocated(sw)) deallocate(sw)
|
|
|
|
! if(nw0.ne.-1) deallocate(sw)
|
2018-01-17 11:41:07 -05:00
|
|
|
allocate(sw(0:nw-1,0:nh-1))
|
|
|
|
sw=0.
|
|
|
|
nw0=nw
|
|
|
|
nh0=nh
|
|
|
|
endif
|
2018-01-17 10:32:45 -05:00
|
|
|
df=12000.0/16384
|
2018-01-12 15:40:15 -05:00
|
|
|
if(irow.lt.0) then
|
2018-01-17 11:41:07 -05:00
|
|
|
! Push a new row of data into sw
|
|
|
|
do j=nh-1,1,-1
|
|
|
|
sw(0:nw-1,j)=sw(0:nw-1,j-1)
|
2018-01-17 10:32:45 -05:00
|
|
|
enddo
|
2018-01-17 11:41:07 -05:00
|
|
|
sw(0:nw-1,0)=swide
|
2018-01-12 15:40:15 -05:00
|
|
|
else
|
2018-01-17 11:41:07 -05:00
|
|
|
! Return the saved "irow" as swide(), for a waterfall replot.
|
|
|
|
swide=sw(0:nw-1,irow)
|
2018-01-12 15:40:15 -05:00
|
|
|
endif
|
|
|
|
|
2018-01-26 13:41:09 -05:00
|
|
|
900 return
|
2018-01-12 15:40:15 -05:00
|
|
|
end subroutine plotsave
|