<div dir="ltr"><div><div><div><div>CAPE **is** sensitive to the starting LCL. <br><br>About 17 years ago, I tested a number of CAPE codes and the calculated values varied &#39;considerably&#39;. To be honest, I have forgotten why I chose the version I put into NCL. I would be open to altering the code or including a different one if you can substantiate and document the issues.<br><br>--<br><br>A number of CAPE (mainly fortran) subroutines are at:<br>    <a href="http://www.cgd.ucar.edu/~shea/CAPE/*">http://www.cgd.ucar.edu/~shea/CAPE/*</a><br>    <a href="http://www.cgd.ucar.edu/~shea/rip_cape.f">http://www.cgd.ucar.edu/~shea/rip_cape.f</a><br><br></div><div>    The capeThermo.f is the one used by NCL (see: subroutine cape_djs)</div><div><br></div><div>    The rip_cape.f was originally written by Mark Stoelinga, U. Washington<br>     <a href="http://www2.mmm.ucar.edu/wrf/users/docs/ripug.htm">http://www2.mmm.ucar.edu/wrf/users/docs/ripug.htm</a><br></div><div><br></div>Also, you can download all of Kerry Emanuel&#39;s codes from:<br><br><span style="font-weight:normal"><font size="2">     <a href="ftp://texmex.mit.edu/pub/emanuel/BOOK/">ftp://texmex.mit.edu/pub/emanuel/BOOK/</a><br><br>===<br></font></span></div><span style="font-weight:normal"><font size="2">NOTE: WRF provides two functions. These call rip_cape.f<br><br><br>===<br></font></span></div><div><span style="font-weight:normal"><font size="2">Let ncl-talk know if you need more information.<br><br></font></span></div><div><span style="font-weight:normal"><font size="2">Cheers<br>D</font></span><span style="font-weight:normal"></span><br></div><div><span style="font-weight:normal"></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 5:19 AM, Stavros Dafis <span dir="ltr">&lt;<a href="mailto:sdafis@cc.uoi.gr" target="_blank">sdafis@cc.uoi.gr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear users,<br>
<br>
I am trying to find the Fortran code that calculates CAPE, as I cannot find it<br>
in my libraries (I am using ncl 6.2.0). I want to try and fix the problem with<br>
the excessive CAPE and also find the CIN from sounding data. Is there any ready<br>
program to calculate CIN as the cape_thermo one?<br>
<br>
I am plotting real data from soundings and I have also noticed the problem with<br>
CAPE. The LCL calculated by ncl is always lower than the actual one and EL<br>
quite higher.<br>
<br>
I do not understand why ncl adjusts the LCL higher than the first guess, as I<br>
saw these lines while debugging the code:<br>
<br>
<br>
cape.f: LCL pressure: original    915.26794433593750       mb<br>
cape.f: adjusted to    925.00000000000000       mb<br>
cape.f: and lies at level            4<br>
<br>
<br>
In my data, the actual LCL is at 879mb, but 915mb would be better than 925mb.<br>
Anyway, I need to see the Fortran code to find the problem. Any suggestions on<br>
that? Choose the second guess of LCL?<br>
<br>
Furthermore, I would like to propose the following changes at the skewt_func.ncl<br>
code, in order the users to find the LFC and Equillibrium levels, because they<br>
are already calculated but not printed:<br>
<br>
<br>
<br>
  iprnt = 0   ; debug only (&gt;0)<br>
   nlLcl= 0   ; LCL<br>
   nlLfc= 0   ; LFC<br>
 nlCross= 0   ; EL<br>
<br>
 cape = cape_thermo(p,tc,plcl,iprnt)       ; (J/kg)<br>
<br>
  tpar = cape@tparcel                      ; temp of the parcel<br>
  nlLcl= cape@jlcl<br>
  nlLfc= cape@jlfc<br>
  nlCross= cape@jcross<br>
                                          ; Equillibrium Level<br>
EL_p = p(nlCross)                         ; hPa<br>
EL_z = z(nlCross) /1000                   ; in km<br>
EL = decimalPlaces(EL_z,1,True)<br>
print(&quot;EL = &quot;+EL+&quot; km&quot;)<br>
<br>
LFC_p = p(nlLfc)                         ; LFC in hPa<br>
LFC_z = z(nlLfc) /1000                   ; in km<br>
LFC = decimalPlaces(LFC_z,2,True)<br>
print(&quot;LFC = &quot;+LFC+&quot; km&quot;)<br>
<br>
<br>
<br>
--<br>
Stavros Dafis<br>
MSc student Atmospheric Sciences and Environment<br>
University of Ioannina<br>
LATMOS Laboratoire Atmospheres, Milieux,Observations Spatiales; Versailles,<br>
France.<br>
Tel: <a href="tel:%2B30%202651008499" value="+302651008499">+30 2651008499</a>,  Mobile: <a href="tel:%2B30%206970420242" value="+306970420242">+30 6970420242</a><br>
e-mails: <a href="mailto:sdafis@noa.gr">sdafis@noa.gr</a> or <a href="mailto:dafis91@yahoo.gr">dafis91@yahoo.gr</a> or <a href="mailto:sdafis@cc.uoi.gr">sdafis@cc.uoi.gr</a><br>
Weather charts: <a href="http://www.metar.gr" rel="noreferrer" target="_blank">http://www.metar.gr</a><br>
<a href="http://www.meteovolos.gr" rel="noreferrer" target="_blank">http://www.meteovolos.gr</a><br>
<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>