Dan,<br> <br> Do you run your own WRF model or are you obtaining the GRIB files from else where. The reason that I ask is there is a variable called "hgtadcl" that can be enabled and it would solve your LCL caluculation problems quickly. I am currently working on something similar and here's what I am using.<br>
<br>'set gxout stat'<br>'set stat on'<br>'d tmp2m-273.16'<br>ret=sublin(result,9)<br>temp=subwrd(ret,5)<br>'d dpt2m-273.16'<br>ret=sublin(result,9)<br>dewp=subwrd(ret,5)<br>'d pressfc/100'<br>
ret=sublin(result,9)<br>pres=subwrd(ret,5)<br>lclp = Preslcl(temp,dewp,pres)<br>lclp = math_format(fmt,lclp)<br><br>Where Preslcl is the function from Bob Hart's <a href="http://plotskew.gs">plotskew.gs</a><br>**************************************************************************<br>
<br>function Preslcl(temp,dewp,pres)<br><br>*-------------------------------------------------------<br>* Calculate press of LCL given temp & dewp in C and pressure<br>*-------------------------------------------------------<br>
<br>Tlclk=Templcl(temp,dewp)+273.15<br>tempk=temp+273.15<br>theta=tempk*pow(1000/pres,0.286)<br>plcl=1000*pow(Tlclk/theta,3.48)<br>return(plcl)<br><br>**************************************************************************<br>
<br>I am using the pressfc/100 and this gets me within ~10mb of the BUFKIT LCL pressure.<br><br>This is rough code and hasn't been rehacked. I apologize for the slop in advance.<br><br>Shawn<br><a href="http://www.expweather.com">www.expweather.com</a><br>
<br><br>
<br><div class="gmail_quote">On Wed, Apr 30, 2008 at 10:33 PM, Dan Leins <<a href="mailto:theedge981@gmail.com" target="_blank">theedge981@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
All,<br><br>I am trying to calculate and plot LCL heights (in millibars) across an entire WRF model domain. I am already accomplishing this on a point-by-point basis using Bob Hart's <a href="http://plotskew.gs" target="_blank">plotskew.gs</a> program, but would like to show the heights on a plan-view plot. Has anyone accomplished this? I dug pretty deep into the <a href="http://plotskew.gs" target="_blank">plotskew.gs</a> code to determine how Bob calculated LCL heights and I was able to adapt a portion of his script for my needs. Here is what I've got so far...<br>
<br>'define tempk=tmpsfc+273.15'<br>'define dewpk=dptprs(lev=1013)+273.15'<br>'define Parta=1/(dewpk-56)'<br>'define Partb=log(tempk/dewpk)/800'<br>'define Tlcl=1/(Parta+Partb)+56'<br>
<br><br>'define Tlclk=Tlcl'<br>'define tempk=tmpprs+273.15'<br>'define theta=tempk*pow(1000/990,0.286)'<br>'define plcl=1000*pow(Tlclk/theta,3.48)'<br>'d plcl'<br><br>This seems to match up "poorly" with the LCL heights indicated on my skew-T images, and is just plain horrendous when compared to the LCL heights shown in Bufkit. Not that Bufkit is considered the correct solution, but I expect to be within the ballpark with my calculations. In some spots I was off by over 200mb.<br>
<br>Any thoughts on how I might be able to accomplish this?<br><br>Thanks,<br><font color="#888888">Dan<br>
</font></blockquote></div><br>