;$Id: pdecay_comp_time.pro,v 1.3 2023/05/19 06:57:06 brandenb Exp $
if !d.name eq 'PS' then begin
  ysize=18.
  thick=2.
  device,xsize=18,ysize=ysize,yoffset=3
  !p.charthick=thick & !p.thick=thick & !x.thick=thick & !y.thick=thick
end
;
siz=1.0
!p.charsize=1.6
!p.multi=0
half='!s!u 1!n!r!s-!r!d 2!n'
!x.margin=[7.2,6.5]
!y.margin=[3.2,2.7]
!p.multi=[0,1,2]
;!p.multi=0
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
;
k0=k01
eta0=eta01
default,t0,.1
default,rexp,-.43
eta0eff=eta0*t0^rexp
tunit=1./(eta0eff*k0^2)
print,'tunit=',tunit
;
;-----------------------------------------------------------------------------
;  panel 1
;
!x.title='!8t!6/[!8t!6]'
!y.title='!8B!6!drms!n/[!8B!6]  and  !8B!6!dLS!n/[!8B!6]'
xr=[3e-3,3e4]
yr=[1e-3,1e4]
restore,'../'+dir1+'/'+file
tt=t/tunit
plot_oo,tt,LM/LM01,ps=1,xst=9,yst=9,xr=xr,yr=yr,/nodata
oplot,tt,(2*EM)^.5/eta01,ps=1
oplot,tt,(2*ELM)^.5/eta01,ps=4
;
restore,'../'+dir0+'/'+file
tt=t/tunit
;oplot,tt,LM/LM01,ps=1,col=155
oplot,tt,(2*EM)^.5/eta01,ps=1,col=155
oplot,tt,(2*ELM)^.5/eta01,ps=4,col=155
;
restore,'../'+dir2+'/'+file
tt=t/tunit
;oplot,tt,LM/LM01,ps=1,col=122
oplot,tt,(2*EM)^.5/eta01,ps=1,col=122
oplot,tt,(2*ELM)^.5/eta01,ps=4,col=122
;
restore,'../'+dir3+'/'+file
tt=t/tunit
;oplot,tt,LM/LM01,ps=1,col=55
oplot,tt,(2*EM)^.5/eta01,ps=1,col=55
oplot,tt,(2*ELM)^.5/eta01,ps=4,col=55
;
loadct,6
restore,'../'+dir4+'/'+file
tt=t/tunit
;oplot,tt,LM/LM01,ps=1,col=122
oplot,tt,(2*EM)^.5/eta01,ps=1,col=122
oplot,tt,(2*ELM)^.5/eta01,ps=4,col=122
loadct,5
;
xx=[.3,60.] & oplot,xx,3e3/xx^.2,li=1
xx=[.3,60.] & oplot,xx,1e3/xx^.2,li=1,col=155
xx=[.3,600.] & oplot,xx,5e2/xx^.2,li=1,col=122
loadct,6
xx=[.3,3e4] & oplot,xx,7e1/xx^0.43,li=1,col=122
loadct,5
;
xx=[.3,60.] & oplot,xx,.32*xx^1.2
xx=[.8,60.] & oplot,xx,.021*xx^1.2,col=155
xx=[8.,600.] & oplot,xx,.0018*xx^1.2,col=122
;
;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=[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,1e2,1e0,'D',siz=siz,col=122
xyouts,3e1,4e0,'F',siz=siz,col=155
xyouts,.7,1e0,'E',siz=siz
xyouts,1e4,1.3e3,'(a)',siz=siz
loadct,5
;
!x.title='!8t!6 [Myr]'
!y.title='!8B!6!drms!n [G]'
;
tunit=0.8
axis,xax=1,xr=xr*tunit
axis,yax=1,yr=yr*sqrt(EMfac)

;print,'x0=',x0,x0*sqrt(EMfac)
;
;-----------------------------------------------------------------------------
;  panel 2
;
!x.title='!8t!6/[!8t!6]'
!y.title='!7e!6/[!7e!6]'
xr=[3e-3,3e4]
yr=[1e-9,.5]/LM01
restore,'../'+dir1+'/'+file
tt=t/tunit
plot_oo,tt,LM/LM01,ps=1,xst=9,yst=9,xr=xr,yr=yr
;
restore,'../'+dir0+'/'+file
tt=t/tunit
oplot,tt,LM/LM01,ps=1,col=155
;
restore,'../'+dir2+'/'+file
tt=t/tunit
oplot,tt,LM/LM01,ps=1,col=122
;
restore,'../'+dir3+'/'+file
tt=t/tunit
oplot,tt,LM/LM01,ps=1,col=55
;
loadct,6
restore,'../'+dir4+'/'+file
tt=t/tunit
oplot,tt,LM/LM01,ps=1,col=122
loadct,5
;
;  fits
;
xx=[.10,40.] & oplot,xx,1.4e5/xx^1.3
xx=[.50,35.] & oplot,xx,7.0e4/xx^1.3,col=155
xx=[.10,100.] & oplot,xx,7.0e3/xx^1.3,col=122
loadct,6
xyouts,4e-1,2e2,'A',siz=siz,col=122
xx=[1.0,100.] & oplot,xx,3.0e2/xx^1.7,col=122
loadct,5
xyouts,4.8,1e5,'!9A!8t!6!u-4/3!n',siz=siz
xyouts,4e2,2e0,'C',siz=siz,col=55
xyouts,2e2,1e1,'D',siz=siz,col=122
xyouts,46.,3e2,'F',siz=siz,col=155
xyouts,.3,3e6,'E',siz=siz
xyouts,1.0e4,1.3e7,'(b)',siz=siz
;
!x.title='!8t!6 [Myr]'
!y.title='!8L!6 [erg s!u-1!n]'
tunit=0.8
axis,xax=1,xr=xr*tunit
axis,yax=1,yr=yr*epsunit*Vol*1d7
;
default,texdir,'HallMHD'
print,'$mv idl.ps ~/GitHub/Axel/CCOs/SM/pdecay_comp_time.eps'
!p.multi=0
END
