<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Guilherme,<div class=""><br class=""></div><div class="">Please check the units in “stdatmus_p2tdz" function. Pressure values must be in hPa, but you are using Pa values in the script.</div><div class=""><br class=""></div><div class="">Deniz</div><div class=""><span style="font-family: Menlo; font-size: 11px;" class=""><br class=""></span></div><div class=""><div class=""><span class="" style="color: rgb(132, 132, 132); font-size: 11px; border-collapse: separate;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: collapse; font-family: Arial;">--</span><div class="" style="border-collapse: separate;"><font face="Arial" class=""><div class="" style="word-wrap: break-word;"><div class="" style="border-collapse: separate; word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><div class="" style="word-wrap: break-word;"><div class="" style="word-wrap: break-word;"><div class="" style="border-collapse: separate;"><span class="" style="border-collapse: collapse;">Deniz Bozkurt, PhD<br class=""></span></div><div class="" style="border-collapse: separate;"><span class="" style="border-collapse: collapse;">Post-doctoral Fellow</span></div></div></div></div></span></div></div><span class="" style="border-collapse: collapse;">Center&nbsp;for&nbsp;Climate&nbsp;and Resilience Research</span></font></div></div><span class="" style="border-collapse: collapse; font-family: Arial;">Department of Geophysics</span>, University of Chile<span class="" style="border-collapse: collapse; font-family: Arial;"></span><div class=""><span class="" style="border-collapse: collapse; font-family: Arial;"></span><div class="" style="word-wrap: break-word;"><div class="" style="border-collapse: separate;"><span class="" style="border-collapse: collapse;"><font face="Arial" class="">Blanco Encalada 2002, Santiago, Chile</font></span></div><div class="" style="border-collapse: separate;"><font face="Arial" class=""><span class="" style="border-collapse: collapse;">E-mail:&nbsp;<a href="mailto:dbozkurt@dgf.uchile.cl" target="_blank" class="">dbozkurt@dgf.uchile.cl</a>,&nbsp;<a href="mailto:deniboz@gmail.com" target="_blank" class="">deniboz@gmail.com</a></span></font></div></div></div></div></span></div></span></div></span></div></span><span style="color: rgb(132, 132, 132); font-size: 11px;" class="">Web:&nbsp;</span><a href="http://dgf.uchile.cl/%7Edbozkurt/" target="_blank" class="" style="font-size: 11px;">http://dgf.uchile.cl/~dbozkurt/</a></div></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Apr 7, 2016, at 4:11 PM, Guilherme Martins &lt;<a href="mailto:jgmsantos@gmail.com" class="">jgmsantos@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">My files don't have missing value.</div><div class=""><br class=""></div><div class="">Thanks for your help.</div><div class=""><br class=""></div><div class="">Guilherme.<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">Em qui, 7 de abr de 2016 às 14:23, Bill Ladwig &lt;<a href="mailto:ladwig@ucar.edu" class="">ladwig@ucar.edu</a>&gt; escreveu:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Your units look correct in the script.&nbsp; Pressure should be in Pa and surface pressure should be in hPa.&nbsp; The C wrapper converts the pressure to hPa before calling the fortran routine, which expects hPa. &nbsp;<div class=""><br class=""></div><div class="">Do you have missing data values in your data set?&nbsp; Since those files aren't WRF model output files, I'm guessing your data has missing values (probably for temperature).&nbsp; If that's the case, the routine is going to use the missing/fill values in the cape routines and crash.&nbsp; You'll need to remove or replace these values with something the algorithm can use (via interpolation, std atmosphere, etc). &nbsp;</div><div class=""><br class=""></div><div class="">For the variable inputs to the cape routines, you can do a printVarSummary on them to see if they contain missing values.</div></div><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Bill</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 6, 2016 at 5:56 AM, Guilherme Martins <span dir="ltr" class="">&lt;<a href="mailto:jgmsantos@gmail.com" target="_blank" class="">jgmsantos@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Dear Guido,<div class=""><br class=""></div><div class="">I used in Pa and the result is undef. I sent a e-mail to <a href="mailto:wrfhelp@ucar.edu" target="_blank" class="">wrfhelp@ucar.edu</a>.<br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Guilherme.</div><div class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">Em qua, 6 de abr de 2016 às 07:21, Guido Cioni &lt;<a href="mailto:guidocioni@gmail.com" target="_blank" class="">guidocioni@gmail.com</a>&gt; escreveu:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Guilherme, you should pose this question on the ncl-talk dedicated to WRF (<a href="mailto:wrfhelp@ucar.edu" target="_blank" class="">wrfhelp@ucar.edu</a>).&nbsp;<div class=""><div class=""><br class=""></div><div class="">It seems that the problem is related to <font face="Menlo" class="">THTE</font> but, judging from the code, it appears that this variable is computed based on pressure, so that if you pass the wrong units you will eventually get a NaN. I think that you are using hPa instead of Pa judging from the output message that you get (<b class="">1016.5871875000000</b>). Try to use the correct units and see if you still get an error. If it’s still the case please try to</div><div class=""><br class=""><div class=""><ul class=""><li class="">pass to the function only a subset of the data in order to see if the vertical levels are too much for the routine to handle. In my case I omitted the first 30 upper vertical levels doing that: &nbsp;<font face="Menlo" class="">values=wrf_cape_2d(pres(:,31:149,:,:),temp(:,31:149,:,:),qvap(:,31:149,:,:),z(:,31:149,:,:),z(:,149,:,:),pres(:,149,:,:),False)</font>. I was getting a different error but maybe it’s worth trying also in your case..</li><li class="">do you have missing values in the data used for the computation of CAPE? Please mind that there is no control on missing data in that function, so that you need to remove them before.</li></ul><div class="">Cheers</div><div class=""><br class=""></div><div class="">P.S. Just for reference, you can found the code of the deprecated function, which I believe it is included in the new one, here&nbsp;<a href="https://www.ncl.ucar.edu/Support/talk_archives/2010/att-0235/rip_cape.f" target="_blank" class="">https://www.ncl.ucar.edu/Support/talk_archives/2010/att-0235/rip_cape.f</a>&nbsp;</div><div class=""><br class=""></div><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">Guido Cioni</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="http://guidocioni.altervista.org/" target="_blank" class="">http://guidocioni.altervista.org</a>&nbsp;</div>

</div>
<br class=""><div class=""><blockquote type="cite" class=""></blockquote></div></div></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On 05 Apr 2016, at 21:35, Guilherme Martins &lt;<a href="mailto:jgmsantos@gmail.com" target="_blank" class="">jgmsantos@gmail.com</a>&gt; wrote:</div><br class=""></blockquote></div></div></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">Hi users,<div class=""><br class=""></div><div class="">I'm using the wrf_cape_2d function to calculate CAPE. I wrote a script and when I run it I receive the mesage below.</div><div class=""><br class=""></div><div class=""><div class=""><b class="">capecalc3d: Outside of lookup table bounds. prs,thte= &nbsp; 1016.5871875000000 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NaN</b></div></div><div class=""><br class=""></div><div class="">I compared my units and variables with the link below and everything it's okay.</div><div class=""><br class=""></div><div class=""><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/wrf_cape_2d.shtml#Description" target="_blank" class="">http://www.ncl.ucar.edu/Document/Functions/Built-in/wrf_cape_2d.shtml#Description</a><br class=""></div><div class=""><br class=""></div><div class="">Can anyone give me any tip?</div><div class=""><br class=""></div><div class="">My script is in attachment.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Guiherme.</div></div><div dir="ltr" class="">-- <br class=""></div><div dir="ltr" class=""><div class=""><font size="2" class=""><div class="">------------------------------------------------------------------------------------------</div><div class="">Dr. Guilherme Martins</div><div class="">Instituto Nacional de Pesquisas Espaciais (INPE)<br class=""></div></font></div><div class=""><font size="2" class="">Centro de Ciência do Sistema Terrestre (CCST) -&nbsp;Prédio CES<br class=""></font>Grupo de Superfície-Biosfera-Atmosfera (GSBA)<font size="2" class=""><br class=""></font></div><div class="">Telefone (INPE/CP): <a href="tel:%2B55%2012%203186-9520" value="+551231869520" target="_blank" class="">+55 12 3186-9520</a> || Celular (TIM): <a href="tel:%2B55%2012%2098152-8580" value="+5512981528580" target="_blank" class="">+55 12 98152-8580</a><br class="">E-mail: <a href="mailto:guilherme.martins@inpe.br" target="_blank" class="">guilherme.martins@inpe.br</a> || <a href="mailto:jgmsantos@gmail.com" target="_blank" class="">jgmsantos@gmail.com</a><br class="">Skype: guilherme.martins.<br class="">Homepage: <a href="https://sites.google.com/site/jgmsantos" target="_blank" class="">https://sites.google.com/site/jgmsantos</a><br class="">Currículo Lattes: <a href="http://lattes.cnpq.br/5997657584785803" target="_blank" class="">http://lattes.cnpq.br/5997657584785803</a><span class=""><br class=""></span>------------------------------------------------------------------------------------------</div></div>
</div></blockquote></div></div></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><span class="">&lt;ex01_wrf_cape_2d.ncl&gt;</span>_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div></div></div></div><div class=""><div class=""><div dir="ltr" class="">-- <br class=""></div><div dir="ltr" class=""><div class=""><font size="2" class=""><div class="">------------------------------------------------------------------------------------------</div><div class="">Dr. Guilherme Martins</div><div class="">Instituto Nacional de Pesquisas Espaciais (INPE)<br class=""></div></font></div><div class=""><font size="2" class="">Centro de Ciência do Sistema Terrestre (CCST) -&nbsp;Prédio CES<br class=""></font>Grupo de Superfície-Biosfera-Atmosfera (GSBA)<font size="2" class=""><br class=""></font></div><div class="">Telefone (INPE/CP): <a href="tel:%2B55%2012%203186-9520" value="+551231869520" target="_blank" class="">+55 12 3186-9520</a> || Celular (TIM): <a href="tel:%2B55%2012%2098152-8580" value="+5512981528580" target="_blank" class="">+55 12 98152-8580</a><br class="">E-mail: <a href="mailto:guilherme.martins@inpe.br" target="_blank" class="">guilherme.martins@inpe.br</a> || <a href="mailto:jgmsantos@gmail.com" target="_blank" class="">jgmsantos@gmail.com</a><br class="">Skype: guilherme.martins.<br class="">Homepage: <a href="https://sites.google.com/site/jgmsantos" target="_blank" class="">https://sites.google.com/site/jgmsantos</a><br class="">Currículo Lattes: <a href="http://lattes.cnpq.br/5997657584785803" target="_blank" class="">http://lattes.cnpq.br/5997657584785803</a><span class=""><br class=""></span>------------------------------------------------------------------------------------------</div></div>
</div></div><br class="">_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</blockquote></div></div></div><div dir="ltr" class="">-- <br class=""></div><div dir="ltr" class=""><div class=""><font size="2" class=""><div class="">------------------------------------------------------------------------------------------</div><div class="">Dr. Guilherme Martins</div><div class="">Instituto Nacional de Pesquisas Espaciais (INPE)<br class=""></div></font></div><div class=""><font size="2" class="">Centro de Ciência do Sistema Terrestre (CCST) -&nbsp;Prédio CES<br class=""></font>Grupo de Superfície-Biosfera-Atmosfera (GSBA)<font size="2" class=""><br class=""></font></div><div class="">Telefone (INPE/CP): +55 12 3186-9520 || Celular (TIM): +55 12 98152-8580<br class="">E-mail: <a href="mailto:guilherme.martins@inpe.br" class="">guilherme.martins@inpe.br</a> || <a href="mailto:jgmsantos@gmail.com" class="">jgmsantos@gmail.com</a><br class="">Skype: guilherme.martins.<br class="">Homepage: <a href="https://sites.google.com/site/jgmsantos" class="">https://sites.google.com/site/jgmsantos</a><br class="">Currículo Lattes: <a href="http://lattes.cnpq.br/5997657584785803" class="">http://lattes.cnpq.br/5997657584785803</a><span class=""><br class=""></span>------------------------------------------------------------------------------------------</div></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></body></html>