;$Id: pSCLt.pro,v 1.2 2020/04/13 03:53:07 brandenb Exp $
if !d.name eq 'PS' then begin
  ;device,xsize=18,ysize=8,yoffset=3
  device,xsize=18,ysize=16,yoffset=3
  !p.charthick=3 & !p.thick=3 & !x.thick=3 & !y.thick=3
end
;
;  mv idl.ps ~/tex/roper/GW/fig/pspecm_scl2.ps
;  mv idl.ps ~/tex/prop/computing/pdc/18/fig/pspecm_scl3n.ps
;
siz=1.3
@parameters
!p.charsize=1.7
;!p.charsize=1.8
!x.margin=[7.6,0.5]
!y.margin=[3.2,0.2]
;!p.multi=[0,1,2]
;
;power,'_GWh','_GWh',k=k,spec1=spec1 ,spec2=spec1 ,i=n,tt=t,/noplot
;power,'_SCL','_SCL',k=k,spec1=spec1 ,spec2=spec1 ,i=n,tt=t,/noplot
;power,'_SCL','_SCL',k=k,spec1=spec2 ,spec2=spec2 ,i=n,tt=t,/noplot
;power,'_VCT','_VCT',k=k,spec1=spec2 ,spec2=spec2 ,i=n,tt=t,/noplot
;power,'_VCT','_VCT',k=k,spec1=spec2 ,spec2=spec2 ,i=n,tt=t,/noplot
;power,'_GWh','_GWh',k=k,spec1=spec0 ,spec2=spec0 ,i=n,tt=t,/noplot,/lkscale
power,'_kin','_kin',k=k,spec1=spec0 ,spec2=spec0 ,i=n,tt=t,/noplot,/lkscale
power,'_Str','_Str',k=k,spec1=spec1 ,spec2=spec1 ,i=n,tt=t,/noplot,/lkscale
power,'_Tpq','_Tpq',k=k,spec1=spec2 ,spec2=spec2 ,i=n,tt=t,/noplot,/lkscale
power,'_SCL','_SCL',k=k,spec1=spec3 ,spec2=spec3 ,i=n,tt=t,/noplot,/lkscale
power,'_VCT','_VCT',k=k,spec1=spec4 ,spec2=spec4 ,i=n,tt=t,/noplot,/lkscale
;spec2=reform(spec2,576,1)
s0=size(spec0) & nt0=s0[2]
s1=size(spec1) & nt1=s1[2]
s2=size(spec2) & nt2=s2[2]
s3=size(spec3) & nt3=s3[2]
s4=size(spec4) & nt4=s4[2]
print,'nt0,nt1,nt2=',nt0,nt1,nt2,nt3,nt4
!x.title='!8k!6'
!y.title='!6'
;
kine=fltarr(nt0)
proj=fltarr(nt1)
full=fltarr(nt2)
SCL=fltarr(nt3)
VCT=fltarr(nt4)
for it=0,nt1-1 do kine[it]=total(spec0[1:*,it])
for it=0,nt1-1 do proj[it]=total(spec1[1:*,it])
for it=0,nt2-1 do full[it]=total(spec2[1:*,it])
for it=0,nt3-1 do SCL[it]=total(spec3[1:*,it]*k[1:*]^4)
for it=0,nt4-1 do VCT[it]=total(spec4[1:*,it]*k[1:*]^2)
;
xx=140. & dx=100.
legend,xx,dx,1e-14,0,col=155,'scalar'
legend,xx,dx,1e-16,1,col= 55,'full  '
loadct,6
legend,xx,dx,1e-18,1,col=122,'vector'
loadct,5
;
plot_io,yr=[1e-5,1e-1],t,t,/nodata
oplot,t,1.667*(2*kine)^2,col=188
oplot,t,proj,col=122
oplot,t,full,col=55,li=1,thick=5
oplot,t,SCL,col=155
loadct,6
oplot,t,VCT,col=122,li=2
loadct,5
;
xx=1000. & dx=400.
legend,xx,dx,1e-16,0,col=122,'projected'
legend,xx,dx,1e-18,1,        '!6d!8h!6/d!8t!6'
;
cwd,run
print,"$convert idl.ps /D/Print/GW_prog2019/pSCLt_"+run+".png"

END
