<div dir="ltr"><div><div><div>Hi all,<br><br></div>There have been a few enquiries recently about plotting freezing levels.<br><br></div>For data on sigma levels with sigma level height given, one can adapt Bob Hart's script, <a href="http://isen.gs" target="_blank">isen.gs</a>, to do this. (See the script library on the grads website.)<br>
<br></div><div>That script can also be adapted to plot any variable on
any surface, such as height on potential vorticity, height on potential
temperature, wind on potential temperature, or wind on potential
vorticity etc.<br>
<br> (Ideally you should do this calculation in height coordinates
with a polynomial interpolation or Fourier series, but I think a linear
interpolation
between sigma levels works well if you have enough sigma levels in your
data file.)<br><br></div><div>I've added my version of the script below.
(It's set up to work with fwrite and several output files and times at
the moment. The gen*ctl files are generic non-dimensional files (no pdef entry) which
are needed for fwrite purposes. Feel free to modify the script as you
please.)<br>
<br></div><div>Cheers,<br></div><div><br>Ted Pollock<br>
</div><div><br></div><div>**********************<a href="http://frzlvl.gs" target="_blank">frzlvl.gs</a>*************************<br></div><div><br>function frzlvl(args)<br><br>dom=1<br>
while(dom<=3)<br>
<br>
'set gxout fwrite'<br>'set fwrite FRZ.d'dom'.dat'<br><br>tt=1<br>while(tt<=48)<br><br>'open gen.d'dom'.3d.ctl'<br>'open gen.d'dom'.2d.ctl'<br><br>'set t 'tt<br>
'set z 1 23'<br>'define height=z+ter.2'<br><br>'set z 1 23'<br>'define temp=t'<br>'set z 2 23'<br>'define tempp=t(z-1)'<br>'set z 1 22'<br>'define tempm=t(z+1)'<br>
<br>'define tabove=0.5*maskout(maskout(temp,temp-273.15),temp(z-1)-temp(z+1))+0.5*ma<br>skout(maskout(temp,273.15-tempm),temp(z-1)-temp(z+1))'<br>'define tbelow=0.5*maskout(maskout(temp,tempp-273.15),temp(z-1)-temp(z+1))+0.5*m<br>
askout(maskout(temp,273.15-temp),temp(z-1)-temp(z+1))'<br><br>'define fabove=tabove*0+height'<br>'define fbelow=tbelow*0+height'<br><br>'set z 1'<br><br>'define fabove=max(maskout(fabove,temp(z+0)-temp(z+1)),z=1,z=23)'<br>
'define fbelow=max(maskout(fbelow,temp(z+0)-temp(z+1)),z=1,z=23)'<br>'define tabove=max(maskout(tabove,temp(z+0)-temp(z+1)),z=1,z=23)'<br>'define tbelow=max(maskout(tbelow,temp(z+0)-temp(z+1)),z=1,z=23)'<br>
<br>'define slope=(fabove-fbelow)/(tabove-tbelow)'<br>'define b=fbelow-slope*tbelow'<br>'define interp=slope*273.15+b'<br><br>'d const(maskout(interp,interp),0,-u)+const(const(interp,0),1,-u)*(ter.2+((t-273<br>
.15)/0.0075))'<br>'d ter.2'<br><br><br>'close 2'<br>'close 1'<br><br>tt=tt+1<br>endwhile<br><br>'disable fwrite'<br><br>dom=dom+1<br>endwhile<br><br>'quit'<br><br>return</div></div>