;$Id: pdecay_comp.pro,v 1.18 2020/07/23 06:18:05 brandenb Exp $
if !d.name eq 'PS' then begin
  ysize=34
  default,thick,4
  device,xsize=18,ysize=ysize,yoffset=3
  !p.charthick=thick & !p.thick=thick & !x.thick=thick & !y.thick=thick
end
;
siz=1.5
!p.charsize=3.3
!p.multi=0
half='!s!u 1!n!r!s-!r!d 2!n'
!x.margin=[8.2,6.5]
!y.margin=[3.2,1.4]
!y.margin=[3.2,2.7]
!p.multi=[0,1,3]
tilde='!9!s!aA!n!r!6'
;
dir0='H1_5em5_k180a' & eta01=5d-5 & k01=180d0 ;(orig, RunF)
dir1='Hf1_t2em5_k180a' & eta01=5d-5 & k01=180d0  ;(RunE)
dir2='Hf1em2_t2em5_k180a' & eta02=2d-5 & k02=180d0 ;(RunD)
dir3='Hf1em3_t2em5_k180a' & eta03=2d-5 & k03=180d0 ;(RunC)
dir4='Hf0_t2em5_k180a' & eta02=2d-5 & k02=180d0 ;(RunB)
dir4='Hf0_t2em5_k180c' & eta02=2d-5 & k02=180d0 ;(RunA)
file='kE.sav'
;
eps01=eta01^3*k01^2
LM01=eta01^3*k01^2
;
Vol=1d6^3
Vol=1d17
Vol=1d12*100
Bfac=1d14 & EMfac=Bfac^2
Bfac=1d13 & EMfac=Bfac^2
Bfac=1d12 & EMfac=Bfac^2
Bfac=2.5d12 & EMfac=Bfac^2
Bfac21=3d14 & EMfac21=Bfac21^2
Bfac2=1d15 & EMfac2=Bfac2^2
;Bfac2=2d15 & EMfac2=Bfac2^2
Bfac3=1d15 & EMfac3=Bfac2^2
Bfac3=5d14 & EMfac3=Bfac3^2
;
;-----------------------------------------------------------------------------
;  panel 1
;
!x.title='!8B!6!drms!n/[B]'
!y.title='!7e!6/[!7e!6]'
xr=[1e-4,.6]/eta01
yr=[1e-9,.5]/LM01
restore,'../'+dir1+'/'+file
plot_oo,(2*EM)^.5/eta01,LM/LM01,ps=1,xst=9,yst=9,xr=xr,yr=yr
restore,'../'+dir0+'/'+file
oplot,(2*EM)^.5/eta01,LM/LM01,ps=1,col=155
restore,'../'+dir2+'/'+file
oplot,(2*EM)^.5/eta01,LM/LM01,ps=1,col=122
restore,'../'+dir3+'/'+file
oplot,(2*EM)^.5/eta01,LM/LM01,ps=1,col=55
loadct,6
restore,'../'+dir4+'/'+file
oplot,(2*EM)^.5/eta01,LM/LM01,ps=1,col=122
loadct,5
xx=[.075,.20] & oplot,xx/eta01,2.7e1*xx^5.0/LM01
xx=[.065,.43] & oplot,xx/eta01,2.7e1*xx^5.0/LM01,li=1
xx=[.020,.13] & oplot,xx/eta01,1.7e3*xx^5.0/LM01,col=155
;xx=[.008,.033]& oplot,xx/eta01,2.1e4*xx^5.0/LM01,col=122
;xx=[.006,.053]& oplot,xx/eta01,2.1e4*xx^5.0/LM01,col=122,li=1
xx=[3e-3,.030]& oplot,xx/eta01,1.0e5*xx^5.0/LM01,col=55
xx=[2e-3,.05] & oplot,xx/eta01,1.0e5*xx^5.0/LM01,col=55,li=1
loadct,6
xx=[8e-4,.006]& oplot,xx/eta01,3.8e7*xx^5.0/LM01,col=122
xx=[2e-4,.007] & oplot,xx/eta01,3.8e7*xx^5.0/LM01,col=122,li=1
xx=[.017,.028] & oplot,xx/eta01,1.15e3*xx^3.0/LM01,col=122
xx=[.008,.04] & oplot,xx/eta01,1.15e3*xx^3.0/LM01,col=122,li=1
xyouts,20.,2e2,'A',siz=siz,col=122
loadct,5
xyouts,28.,1e5,'!9A!8B!6!s!u5!n!r!drms!n',siz=siz
xyouts,280.,1.4e7,'!9A!8B!6!s!u3!n!r!drms!n',siz=siz
xyouts,30.,2e0,'C',siz=siz,col=55
xyouts,113.,1e0,'D',siz=siz,col=122
xyouts,640.,2e3,'F',siz=siz,col=155
xyouts,2000.,1e4,'E',siz=siz
xyouts,2.7,1.3e7,'(a)',siz=siz
yy=2. & xyouts,1400.,yy*2,'time',siz=siz & arrow,/data,5000.,yy,800.,yy,thick=4
loadct,0
x0=2.28e2
y0=4.0e2
xx=[x0,20000.]& oplot,xx,xx*0+y0,col=200,li=3
yy=[y0,1e8]& oplot,yy*0+x0,yy,col=200,li=3
loadct,5
;
!x.title='                !8B!6!drms!n [G]'
!x.title='!8B!6!drms!n [G]'
!y.title='!8L!6 [erg s!u-1!n]'
;axis,yax=1,yr=yr*EMfac*Vol
epsunit=2.5d9
axis,yax=1,yr=yr*epsunit*Vol*1d7
axis,xax=1,xr=xr*sqrt(EMfac)
print,'x0=',x0,x0*sqrt(EMfac)
;
;-----------------------------------------------------------------------------
;  panel 2
;
yr=[8e-8,.004]/eta01
!x.title='!8B!6!drms!n/[B]'
!y.title='!8B!6!dLS!n/[B]'
restore,'../'+dir1+'/'+file
plot_oo,(2*EM)^.5/eta01,(2*ELM)^.5/eta01,ps=1,xst=9,yst=9,xr=xr,yr=yr
restore,'../'+dir0+'/'+file
oplot,(2*EM)^.5/eta01,(2*ELM)^.5/eta01,ps=1,col=155
restore,'../'+dir2+'/'+file
oplot,(2*EM)^.5/eta01,(2*ELM)^.5/eta01,ps=1,col=122
restore,'../'+dir3+'/'+file
oplot,(2*EM)^.5/eta01,(2*ELM)^.5/eta01,ps=1,col=55
loadct,6
restore,'../'+dir4+'/'+file
oplot,(2*EM)^.5/eta01,(2*ELM)^.5/eta01,ps=1,col=122
xyouts,8.,7e-3,'A',siz=siz,col=122
loadct,5
xyouts,30.,5e0,'C',siz=siz,col=55
xyouts,110.,6e0,'D',siz=siz,col=122
xyouts,340.,7e0,'F',siz=siz,col=155
xyouts,2000.,2e1,'E',siz=siz
xyouts,2.7,2.3e1,'(b)',siz=siz
xx=[1400.,4400.] & oplot,xx,1.0e17/xx^5.0
xyouts,2500.,2.5,'!9A!8B!6!s!u5!n!r!drms!n',siz=siz
yy=.003 & xyouts,1700.,yy*1.3,'time',siz=siz*.8
arrow,/data,6000.,yy,1000.,yy,thick=4
;
loadct,0
y0=1.3e-1
xx=[x0,20000.]& oplot,xx,xx*0+y0,col=200,li=3
yy=[y0,1e8]& oplot,yy*0+x0,yy,col=200,li=3
loadct,5
;
!x.title='              !8B!6!drms!n [G]'
!x.title='!8B!6!drms!n [G]'
!y.title='!8B!6!dLS!n [G]'
axis,yax=1,yr=yr*sqrt(EMfac)
axis,xax=1,xr=xr*sqrt(EMfac)
;
;-----------------------------------------------------------------------------
;  panel 3
;
!x.title='!8B!6!dLS!n/[B]'
!y.title='!7e!6/[!7e!6]'
xr=[8e-8,.004]/eta01
yr=[1e-9,.5]/LM01
restore,'../'+dir1+'/'+file
plot_oo,(2*ELM)^.5/eta01,LM/LM01,ps=1,xst=9,yst=9,xr=xr,yr=yr
restore,'../'+dir0+'/'+file
oplot,(2*ELM)^.5/eta01,LM/LM01,ps=1,col=155
restore,'../'+dir2+'/'+file
oplot,(2*ELM)^.5/eta01,LM/LM01,ps=1,col=122
restore,'../'+dir3+'/'+file
oplot,(2*ELM)^.5/eta01,LM/LM01,ps=1,col=55
loadct,6
restore,'../'+dir4+'/'+file
oplot,(2*ELM)^.5/eta01,LM/LM01,ps=1,col=122
loadct,5
;
;  fits
;
xx=[.10,40.] & oplot,xx,2.3e5/xx
xx=[.10,3.5] & oplot,xx,6.0e3/xx,col=155
xx=[.10,3.5] & oplot,xx,4.0e1/xx,col=122
loadct,6
xyouts,4e-3,2e2,'A',siz=siz,col=122
loadct,5
xyouts,4.8,1e5,'!9A!8B!6!s!u-1!n!r!drms!n',siz=siz
xyouts,6e-2,2e0,'C',siz=siz,col=55
xyouts,4.6,3e0,'D',siz=siz,col=122
xyouts,4.6,7e2,'F',siz=siz,col=155
xyouts,.3,3e6,'E',siz=siz
xyouts,2.0e-3,1.3e7,'(c)',siz=siz
;yy=2. & xyouts,1400.,yy*2,'time',siz=siz & arrow,/data,5000.,yy,800.,yy,thick=4
loadct,0
x0=2.28e2
y0=4.0e2
xx=[x0,20000.]& oplot,xx,xx*0+y0,col=200,li=3
yy=[y0,1e8]& oplot,yy*0+x0,yy,col=200,li=3
loadct,5
yy=2. & xyouts,13.,yy*1.8,'time',siz=siz*.8
arrow,/data,11.,yy,60.,yy,thick=4
;
!x.title='             !8B!6!dLS!n [G]'
!y.title='!8L!6 [erg s!u-1!n]'
;axis,yax=1,yr=yr*EMfac*Vol
epsunit=2.5d9
axis,yax=1,yr=yr*epsunit*Vol*1d7
axis,xax=1,xr=xr*sqrt(EMfac)
print,'x0=',x0,x0*sqrt(EMfac)
;
default,texdir,'HallMHD'
print,'$mv idl.ps ~/tex/mhd/'+texdir+'/fig/pdecay_comp.ps'
!p.multi=0
END
