Re: how to plot figure using the average -

From: Maria Gehne <mgehne_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 09 2013 - 09:59:04 MDT

Hi Debora,

you are right using dim_avg or avg doesn't do what you want. You can
look at the function month_to_seasonN for seasonal averages:

To use that I would read all the monthly values into one data array,
instead of having 12 arrays called preca - preco. Maybe something like this:

prec = new((/nlat,nlon,12/),"float")

And then loop through your data files, or open them all at once:

do fi = 0, 11
     a = addfile ("/Users/inpe/Documents/testec/","r")
     prec(:,:,fi) = a->aprc(0,:,:)
end do

You should be able to use month_to_seasonN on the array prec.


On 08/09/2013 08:21 AM, Debora Alvim wrote:
> Dear NCL,
> I made a figure with data to each month, now I need to average for 3
> months. I have doubt if I use *dim_avg *or only *avg.*
> I get to print the values both when using dim_avg or avg in the
> screen, but I can not plot the charts because I doubt this part of
> my script "plot(0) = gsn_csm_contour_map_ce(wks,w,res)", I don't know
> the syntax for "w" variable
> Appear the following message when try run my script in ncl
> fatal:(lat) is not a dimension name in variable (w), could not
> determine dimension number
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 110
> in file precconv1999_2000_media.ncl
> The script is attached.
> Thank you,
> Débora Alvim.
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

Maria Gehne
Postdoctoral Fellow
P.O. Box 3000
Boulder, CO 80307

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Aug 9 09:59:31 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 14 2013 - 18:35:09 MDT