Re: Custom Equations

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 03 Oct 2008 08:23:01 -0600

Hello,

If the data array is at constant pressure levels
then the following would work

Say you have an array 'x' with coordinate dimensions
(time,lev,lat,lon), then:

   x = ( u(:,{1000},:,:)+u(:,{850},:,:)+u(:,{700},:,:))/3

Note, if u want a weighted average the you would want
something like

   dp = (/75, 150, 75/) ; layer thickness

   x = ( u(:,{1000},:,:)*dp(0) \
        +u(:, {850},:,:)*dp(1) \
        +u(:, {700},:,:)*dp(2) )/sum(dp)
=========
I suggest that you look at the mini-manuals (pdf).

http://www.ncl.ucar.edu/Document/Manuals/

Good luck

Nicholas B. Tito wrote:
> Dear NCL Users,
>
> My name is Nick, a graduate student in the Department of Chemistry
> at Dartmouth College. I apologize for the post in advance if this
> question is answered within documentation somewhere. Is it possible
> to input custom equations into NCL, such as ones that employ
> variables at different pressure levels? For example,
>
> X = [ u(1000 hPa) + u(850 hPa) + u(700 hPa) ] / 3
>
> In other words, how do I go about referencing variables at specific
> pressure levels within one equation in the NCL coding syntax?
> (Note: This equation would be calculated on GRIB2 data converted
> into NetCDF).
>
> Thanks for your help! I'm very new to NCL, so the help is greatly
> appreciated!
>
> Nick Tito
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Oct 03 2008 - 08:23:01 MDT

This archive was generated by hypermail 2.2.0 : Tue Oct 07 2008 - 09:09:48 MDT