;$Id: pres.pro,v 1.15 2026/07/01 16:36:08 brandenb Exp $
if !d.name eq 'PS' then begin
  device,xsize=18,ysize=18,yoffset=3
  !p.charthick=3 & !p.thick=3 & !x.thick=3 & !y.thick=3
end
;
@parameters
!p.charsize=1.5
!x.margin=[7.6,.5]
!y.margin=[3.2,.5]
!x.range=[0,3.3]
!p.multi=[0,1,2]
xout=.091
;
file='res.txt'
a=rtable(file,16,head=1)
c=rtablec(file,132,head=1)
nu=reform(a[0,*])
ratm=reform(a[1,*])
ratm2=reform(a[2,*])
ratmd=reform(a[3,*])
genmax=reform(a[4,*])
dismax=reform(a[5,*])
dynmax=reform(a[6,*])
Nmesh=reform(a[7,*])
epsK=reform(a[8,*])
divurms=reform(a[9,*])
orms=reform(a[10,*])
knu=reform(a[11,*])
uini=reform(a[13,*])
ratdx=reform(a[14,*])
umax=reform(a[15,*])
;
good=[0,2,3,5,6]
bad=[1,4]
;
;-----------------------------------------------------------------------------
;  panel 1
;
!x.title='!6'
!y.title='!6contributions'
xr=[.005,.12]
yr=[.0014,.3]
circ_sym,1.3,0
plot_oo,nu,ratm,ps=8,xr=xr,yr=yr,/nodata
circ_sym,1.3,1
loadct,6
oplot,nu(good),genmax(good),ps=8,col=144
xyouts,siz=siz,.05,.190,'!8T!6!dgen0!n',col=144
loadct,5
oplot,nu(good),dismax(good),ps=8,col=55
oplot,nu(good),dynmax(good),ps=8,col=122
;
circ_sym,1.3,0
loadct,6
oplot,nu(bad),genmax(bad),ps=8,col=144
loadct,5
oplot,nu(bad),dismax(bad),ps=8,col=55
oplot,nu(bad),dynmax(bad),ps=8,col=122
;
siz=1.6
xyouts,siz=siz,.05,.002,'!8T!6!ddyn0!n',col=122
xyouts,siz=siz,.05,.100,'!8T!6!ddis0!n',col=55
xyouts,xout,.17,siz=siz,'!6(a)'
;
;-----------------------------------------------------------------------------
;  panel 2
;
!x.title='!7m!6'
!y.title='!6ratios'
xr=[.005,.12]
yr=[.04,1.5]
circ_sym,1.3,1
plot_oo,nu(good),ratm(good),ps=8,xr=xr,yr=yr
oplot,nu(good),ratm2(good),ps=8,col=155 & loadct,6
oplot,nu(good),ratdx(good),ps=8,col=144 & loadct,5
oplot,nu(good),ratmd(good),ps=8,col=122
circ_sym,1.3,0
oplot,nu(bad),ratm(bad),ps=8
oplot,nu(bad),ratm2(bad),ps=8,col=155 & loadct,6
oplot,nu(bad),ratdx(bad),ps=8,col=144 & loadct,5
oplot,nu(bad),ratmd(bad),ps=8,col=122
;
siz=1.6
xyouts,siz=siz,.05,.920,'!8R!6!dgen2!n',col=155
xyouts,siz=siz,.05,.660,'!8R!6!dgen1!n'
xyouts,siz=siz,.05,.050,'!8R!6!ddyn1!n',col=122 & loadct,6
xyouts,siz=siz,.05,.48,'!8R!6!ddyn2!n',col=144 & loadct,5
xx=[.008,.045] & oplot,xx,.0026/xx,col=122
xyouts,siz=siz,.025,.13,'!9A!7m!6!u-1!n',col=122
;
loadct,6
xx=[.008,.045] & oplot,xx,2.0*xx^.4,col=144,li=1
print,.6*xx^.5
xyouts,siz=siz,.025,.30,'!9A!7m!6!u0.4!n',col=144
loadct,5
xyouts,xout,1.05,siz=siz,'!6(b)'
;
;-----------------------------------------------------------------------------
;  produce table
;
k0=2.5
urms=1. ;(sonic)
fo='(f5.3)'
fo1='(f3.1)'
fo1b='(f4.1)'
fo2='(f4.2)'
fo4='(f6.4)'
fo_int='(i4)'
fo_int2='(i3)'
for j=0,n_elements(nu)-1 do begin
  dx=4*!pi/Nmesh[j]
  print,uppercase(j), ' & ', latex_fixed(uini[j],fo2), $
                      ' & ', latex_fixed(nu[j],fo), $
                      ' & ', latex_fixed(knu[j],fo1b), $
                      ' & ', latex_fixed(epsK[j],fo), $
                      ' & ', latex_fixed(divurms[j],fo2), $
                      ' & ', latex_fixed(orms[j],fo), $
                      ' & ', latex_fixed(umax[j]*dx/nu[j],fo1),  $
                      ' & ', latex_fixed(urms/(nu[j]*k0),fo_int2),  $
                      ' & ', latex_fixed(dynmax[j],fo4),  $
                      ' & ', latex_fixed(genmax[j],fo),  $
                      ' & ', latex_fixed(dismax[j],fo),  $
                      ' & ', latex_fixed(ratm[j],fo2),  $
                      ' & ', latex_fixed(ratm2[j],fo2),  $
                      ' & ', latex_fixed(ratmd[j],fo),  $
                      ' & ', latex_fixed(Nmesh[j], fo_int), $
                      ' \\% ',c[j]
endfor
;
!p.multi=0
print,"$mv idl.ps ~/Overleaf/Eva/BE_collapse/fig/pres.eps"
END
