<div dir="ltr">Greetings!<div><br></div><div>I have written the following script to calculate ThetaE from NARR data using a new formula referenced in Volume 137 of AMS's Monthly Weather Review. The script runs successfully and displays data which makes sense. However it plots the same values of ThetaE no matter what level I choose. I am hoping someone out there will be able to provide me with some direction as to what I might be doing wrong.</div>
<div><br></div><div>Thanks in advance for the help!</div><div><br></div><div><div>******************************************************************************************************************************************</div>
<div>*Script to calculate Equivalent Potential Temperature referencing equation 6.5 from </div><div>*Davies-Jones' September 2009 Monthly Weather Review findings On Formulas for Equivalent </div><div>'open narr.ctl'</div>
<div>'set lat 30 55'</div><div>'set lon -140 -100'</div><div>*First calculate 2m Dew Point Temperature</div><div>*</div><div>'define tc2m = TMP2m - 273.15'</div><div>'define B = (log(RH2m/100)+((17.27*tc2m)/(237.3+tc2m)))/17.27'</div>
<div>'define TdC2m = (237.3*B)/(1-B)'</div><div>'define dewp2m = TdC2m + 273.15'</div><div>*</div><div>*Then we can calculate Temperature at LCL [K]</div><div>'define templcl=(((1/(1/(dewp2m-56)+log((tmp2m/dewp2m))/800))+56))'</div>
<div>*</div><div>*And calculate the Pressure at LCL</div><div>'define preslcl=(pressfc*pow(((templcl+273.16)/tmp2m),(7/2)))/1000'</div><div>*</div><div>*With this data in hand we can calculate Potential Temperature at LCL *(K)</div>
<div>*Saturation Vapor Pressure (mb)=6.112 * exp[17.67(Tk-C)/(Tk-C+243.5)]</div><div>*</div><div>'define eslcl = 6.112*exp((17.67*(templcl-273.15))/(templcl-273.15+243.5))'</div><div>*</div><div>'define thetaLCL = templcl*pow(1000/(lev-eslcl),0.2854)'</div>
<div>*</div><div>*Calculate Equivalent Potential Temperature (ThetaE)</div><div>*Define constants</div><div>*</div><div>'define L0 = 2501000'</div><div>'define L1 = 1754'</div><div>'define L3 = L0 - L1'</div>
<div>'define K2 = 1137000'</div><div>'define cpd = 1105.7'</div><div>'define C = 273.15'</div><div>'define mythetae = thetaLCL*exp((L3*(tmpprs-C)+(K2*ICMRprs))*ICMRprs/(cpd*templcl))'</div>
<div><br></div><div><div dir="ltr"><b style="color:rgb(69,69,69);font-family:'comic sans ms',sans-serif;font-size:large;font-style:italic"><i>C. Corby Dickerson IV</i></b><br><div><div style="color:rgb(69,69,69);font-size:12px;font-family:Arial,Helvetica,sans-serif">
<font face="'comic sans ms', sans-serif">-General Forecaster-</font></div><div style="color:rgb(69,69,69);font-size:12px;font-family:Arial,Helvetica,sans-serif"><font face="'comic sans ms', sans-serif">Weather Story Program Manager</font></div>
<div style="color:rgb(69,69,69);font-size:12px;font-family:Arial,Helvetica,sans-serif"><a rel="nofollow" style="font-family:'comic sans ms',sans-serif;color:rgb(35,71,134);outline:0px"><b>406-329-4840</b></a><br></div>
<div style="color:rgb(69,69,69);font-family:'comic sans ms',sans-serif;font-size:12px"><a href="https://twitter.com/NWSMissoula" style="color:rgb(17,85,204)" target="_blank"><img src="cid:ii_13c873336c4b68e4" alt="Inline image 1" style="font-family: arial; font-size: small; color: rgb(34, 34, 34);"></a><span style="font-family:arial;font-size:small;color:rgb(34,34,34)"> </span><a href="https://www.facebook.com/#!/US.NationalWeatherService.Missoula.gov" style="color:rgb(17,85,204)" target="_blank"><img src="cid:ii_13c87337e85c84db" alt="Inline image 2" style="font-family: arial; font-size: small; color: rgb(34, 34, 34);"></a> <a href="https://www.youtube.com/user/NWSMissoula" style="color:rgb(17,85,204)" target="_blank"><img src="cid:ii_13c8735baa9c301e" alt="Inline image 3"></a> <a href="http://www.wrh.noaa.gov/mso/" style="color:rgb(17,85,204)" target="_blank"><img src="cid:ii_13c8735eaaf71ded" alt="Inline image 4"></a> </div>
</div><div style="color:rgb(69,69,69);font-family:'comic sans ms',sans-serif;font-size:12px"><a href="http://www.nssl.noaa.gov/projects/ping/" target="_blank"><img src="http://www.nssl.noaa.gov/projects/ping/display/resources/images/PING-Banner-336x54.png" width="200" height="31"></a><br>
</div></div></div>
</div></div>