*** empty log message ***
This commit is contained in:
@@ -2,7 +2,7 @@ subroutine tecs_plot(auxpar)
|
||||
|
||||
character(len=*) auxpar
|
||||
|
||||
integer, parameter :: dmax=800, nmax=5, tmax=4, amax=3, nmenu=13, chartperiod=5, naux=1
|
||||
integer, parameter :: dmax=400, nmax=9, tmax=8, amax=3, nmenu=13, chartperiod=5, naux=1
|
||||
integer, parameter :: minRange=60, maxRange=7*24*3600
|
||||
integer, parameter :: oneDay = 24*3600
|
||||
integer, parameter :: zoom=1, right=2, live=3
|
||||
@@ -15,7 +15,7 @@ subroutine tecs_plot(auxpar)
|
||||
integer l,j,i,n,t,leng,i1,i2,rl,startday,thisday
|
||||
integer ncol, nset, mode
|
||||
integer first,last,step,tbase,lastj
|
||||
integer colorList(nmax)/5,3,2,4,8/
|
||||
integer colorList(nmax)/5,3,2,4,6,8,14,15,8/
|
||||
integer color(nmax)
|
||||
integer retLen(nmax)
|
||||
integer sel/0/, sel1, sel2, auxsel/1/
|
||||
@@ -36,7 +36,7 @@ subroutine tecs_plot(auxpar)
|
||||
,'q' ,'quit'/
|
||||
character weekdays(7)*4/'Mon','Tue','Wed','Thu','Fri','Sat','Sun'/
|
||||
character buf*8, device*8, name*40, filnam*128, numb*16, title*64, pars*64
|
||||
character(len=4) tpar(tmax)/'Te', 'Tr', 'Tm', 'Ts'/
|
||||
character(len=4) tpar(tmax)/'Te', 'Tr', 'Tm', 'Ts', 'T1', 'T2', 'T3', 'T4'/
|
||||
character(len=4) apar(amax)/'P', 'He', 'Aux'/
|
||||
character(len=16) parnam(nmax)
|
||||
logical gap, done
|
||||
@@ -44,7 +44,7 @@ subroutine tecs_plot(auxpar)
|
||||
integer iret, lund, numl, mon, day
|
||||
|
||||
! functions
|
||||
integer sys_gmt_off, myc_now, myc_time, myc_date, tecs_get_data, tecs_get_mult, tecs_get_par
|
||||
integer sys_gmt_off, myc_now, myc_time, myc_date, get_data, tecs_get_mult, tecs_get_par
|
||||
|
||||
data window/0./
|
||||
|
||||
@@ -74,6 +74,7 @@ subroutine tecs_plot(auxpar)
|
||||
endif
|
||||
|
||||
call pgask(.false.)
|
||||
call pgupdt
|
||||
l=0
|
||||
x1=0
|
||||
step=0
|
||||
@@ -92,7 +93,7 @@ subroutine tecs_plot(auxpar)
|
||||
pars=trim(pars)//' '//parnam(nset)
|
||||
enddo
|
||||
nset=nset+1
|
||||
color(nset)=colorList(5)
|
||||
color(nset)=colorList(3)
|
||||
parnam(nset)=apar(auxsel)
|
||||
pars=trim(pars)//' '//parnam(nset)
|
||||
|
||||
@@ -104,23 +105,34 @@ subroutine tecs_plot(auxpar)
|
||||
window=maxRange
|
||||
first=t-min(dmax*step-1,maxRange-step)
|
||||
else if (mode >= right) then
|
||||
step=window/(dmax-1)+0.99
|
||||
step=window/(dmax-2)+0.99
|
||||
last=t
|
||||
first=t-min(dmax*step-1,nint(window)-step)
|
||||
first=t-min(dmax*step-1,nint(window))
|
||||
else
|
||||
if (mode==zoom) then
|
||||
x2=(x1+x2+window)/2
|
||||
x1=x2-window
|
||||
endif
|
||||
if (x1 .gt. x2-minRange) x1=x2-minRange
|
||||
step=(x2-x1)/(dmax-1)+0.99
|
||||
last=nint(x2)+tbase
|
||||
first=nint(x1)+tbase
|
||||
step=(x2-x1)/(dmax-2)+0.99
|
||||
last=x2+tbase
|
||||
first=x1-step+tbase
|
||||
endif
|
||||
if (step == 0) step=1
|
||||
|
||||
if (step>60) then ! normalize step
|
||||
step=(step+59)/60*60
|
||||
else if (step>30) then
|
||||
step=60
|
||||
elseif (step>20) then
|
||||
step=30
|
||||
else
|
||||
step=(step+4)/5*5
|
||||
endif
|
||||
first=last-(last-first+step-1)/step*step ! round first
|
||||
! print *,step,last-first
|
||||
tbase=first-mod(first,7*oneDay)
|
||||
iret=tecs_get_data(pars, first, last, step, tbase, xd, yd, dmax, nmax, retLen)
|
||||
iret=get_data(pars, first, last, step, tbase, xd, yd, dmax, nmax, retLen)
|
||||
if (iret < 0) goto 99
|
||||
|
||||
x2 = last - tbase
|
||||
@@ -216,6 +228,7 @@ subroutine tecs_plot(auxpar)
|
||||
|
||||
do i=i1,i2
|
||||
call pgsci(color(i))
|
||||
l=0
|
||||
lastj=1
|
||||
do j=1,retLen(i)
|
||||
if (yd(j,i)==undef) then
|
||||
@@ -223,9 +236,12 @@ subroutine tecs_plot(auxpar)
|
||||
call pgline(j-lastj, xd(lastj,i), yd(lastj,i))
|
||||
endif
|
||||
lastj=j+1
|
||||
else
|
||||
l=j
|
||||
endif
|
||||
enddo
|
||||
if (retLen(i) > lastj) call pgline(retLen(i)+1-lastj, xd(lastj,i), yd(lastj,i))
|
||||
retLen(i)=l
|
||||
enddo
|
||||
call pgsci(1)
|
||||
if (rl == 1) then
|
||||
@@ -635,3 +651,42 @@ subroutine set_win(rl, x1, x2, y1, y2)
|
||||
|
||||
call pgswin(x1,x2,y1,y2)
|
||||
end subroutine
|
||||
|
||||
integer function get_data(pars, first, last, step, tbase, xd, yd, dmax, nmax, retlen)
|
||||
character pars*(*)
|
||||
integer first, last, step, tbase, dmax, nmax, retlen(nmax)
|
||||
real*4 xd(dmax,nmax), yd(dmax,nmax)
|
||||
|
||||
integer, parameter :: oneDay = 24*3600, maxn=9
|
||||
integer tecs_get_data
|
||||
|
||||
integer i,j,rl(maxn),m,k,n,mm
|
||||
|
||||
if (nmax > maxn) stop 'get_data: nmax>maxn'
|
||||
if (last-first <= oneDay) then
|
||||
get_data=tecs_get_data(pars, first, last, step, tbase, xd, yd, dmax, nmax, retLen)
|
||||
else
|
||||
do j=1,nmax
|
||||
retlen(j)=0
|
||||
enddo
|
||||
m=0
|
||||
do i=first/oneDay,last/oneDay
|
||||
get_data=tecs_get_data(pars, max(first,i*oneDay), min(last,(i+1)*oneDay-step), step, tbase &
|
||||
, xd(m+1, 1), yd(m+1, 1), dmax, nmax, rl)
|
||||
if (get_data<0) return
|
||||
mm=0
|
||||
do j=1,nmax
|
||||
n=retlen(j)
|
||||
do k=m+1,m+rl(j)
|
||||
n=n+1
|
||||
xd(n,j)=xd(k,j)
|
||||
yd(n,j)=yd(k,j)
|
||||
enddo
|
||||
retlen(j)=n
|
||||
mm=max(mm,n)
|
||||
enddo
|
||||
! print *,mm-m,' points read'
|
||||
m=mm
|
||||
enddo
|
||||
endif
|
||||
end function
|
||||
|
||||
Reference in New Issue
Block a user