[ncl-talk] Integrate a variable

Dennis Shea shea at ucar.edu
Sun Jun 12 06:43:40 MDT 2016


You can download the entire *beta* 6.4.0 library which includes:
wgt_vertical_n

http://www.cgd.ucar.edu/~shea/contributed.ncl_beta_640

===

In your NCL script:

load "/path/contributed.ncl_beta_640"   ; NOTE: this is a *BETA* version

===
The wgt_vertical_n' function is attached as a separate entity.





On Sat, Jun 11, 2016 at 1:04 AM, Guido Cioni <guidocioni at gmail.com> wrote:

> Hey Erick,
> 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:
>
> ;;;; first compute the pressure layers thicknesses ;;;
>  dp=new(dim sizes(height),typeof(p))
>  do i=0,dimsizes(time)-1
>   dp(i,:)=dpres_plevel(p(i,:),pres_sfc(i),p(i,0),0)
>  end do
>
> ; then compute the integral by summing the contribution of every layer
> ; note that NCL does the sum without looping, so everything should be fast
> ; also with big arrays
> var_int=dim_sum_n(var*dp, 1)/g
>
> I was using domain-averaged data, so with coordinates (time,z) but you can
> easily adapt the script for 2D (lat,lon) data.
> Cheers
>
> Guido Cioni
> http://guidocioni.altervista.org
>
> On 11 Jun 2016, at 03:36, Erick Gordon <erick.gordon24 at gmail.com> wrote:
>
> Hi
> 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
> Thank you very much
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160612/f4e84955/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wgt_vertical_n.ncl
Type: application/octet-stream
Size: 3846 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160612/f4e84955/attachment.obj 


More information about the ncl-talk mailing list