<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey Erick,<div class="">if you need to integrate over a certain depth I believe you can write the function yourself. I did something similar in one of my scripts:</div><div class=""><br class=""></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">;;;; first compute the pressure layers thicknesses ;;;</font></div><div class=""><div class=""><font face="Menlo" style="font-size: 11px;" class="">&nbsp;dp=new(dim sizes(height),typeof(p))</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">&nbsp;do i=0,dimsizes(time)-1</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">&nbsp; dp(i,:)=dpres_plevel(p(i,:),pres_sfc(i),p(i,0),0)</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">&nbsp;end do</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">; then compute the integral by summing the contribution of every layer</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">; note that NCL does the sum without looping, so everything should be fast</font></div><div class=""><font face="Menlo" style="font-size: 11px;" class="">; also with big arrays</font></div><div class=""><div class=""><font face="Menlo" style="font-size: 11px;" class="">var_int=dim_sum_n(var*dp, 1)/g</font></div></div><div class=""><br class=""></div><div class="">I was using domain-averaged data, so with coordinates (time,z) but you can easily adapt the script for 2D (lat,lon) data.&nbsp;</div><div class="">Cheers</div><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Guido Cioni</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://guidocioni.altervista.org" class="">http://guidocioni.altervista.org</a>&nbsp;</div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 11 Jun 2016, at 03:36, Erick Gordon &lt;<a href="mailto:erick.gordon24@gmail.com" class="">erick.gordon24@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi</div><div class="">I need to know how I can calculate the integral of a variable in NCL. In the case of wgt_vertical_n function will only be available from version 6.4.0 and later. For example, I need to integrate the divergence of moisture flux from 1000 to 500 hPa. If anyone can help me I would be grateful</div><div class="">Thank you very much</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>