Re: 5_month_season

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 13 2010 - 10:40:15 MST

If you have x(time,lat,lon)

    dimx = dimsizes( x )
    ntim = dimx(0)
    nlat = dimx(1)
    mlon = dimx(2)

    nmon = 5

    nyear = ntim/12
    n5 = nyear*nmon
    xNew = new ( (/n5,nlat,mlon/), typeof(x), getFillValue(x) )

    nStrt = 4 ; May
    nLast = nStrt+navg-1 ; Sept
    na = 0
    nb = nmon-1
    do nyr=0,nyear-1
          xNew(na:nb,:,:)= x(nStrt:nLast,:,:)
          nStrt = nStrt + 12
          nLast = nLast+12
          na = na+nmon
          nb = nb+nmon
    end do

=========
If you have x(time,lat,lon) and want the seasonal average at each grid point

      x5 = runave_Wrap (x(lat|:,lon|:,time|:), 5, 0)

      xmjjas = x5(:,:,6:ntim-1:12) ; (lat,lon,one_MJJAS_per_year)

==========

Good luck

On 01/13/2010 09:26 AM, Aaron Goldner wrote:
> Sorry, I was not clear in my original message. I am not looking to
> take a 5 month seasonal average. I want to take those five months out
> of each year of my entire dataset. So my original dataset of 468
> months will have 195 months with all the May through June months
> included in the new variable. I am going to have to use a loop which
> I can do, I was just checking to see if there was a function
> available. Thanks for the help.
>
> Aaron
>
>
>
> > Date: Wed, 13 Jan 2010 07:19:39 -0900
> > From: debasish@gi.alaska.edu
> > To: golgicomplex3@hotmail.com
> > CC: ncl-talk@ucar.edu
> > Subject: Re: 5_month_season
> >
> > Dear Aaron,
> >
> > Please check the web page:
> > http://www.ncl.ucar.edu/Support/talk_archives/2009/2262.html
> >
> > Where Adam Phillips showed the way to calculate 4 month seasonal
> > average. You can follow the same way for your five month case.
> >
> > Good Luck
> >
> > Debasish
> >
> > Quoting Aaron Goldner <golgicomplex3@hotmail.com>:
> >
> > >
> > > Hi,
> > >
> > > If I have 468 monthly timesteps, starting with January at timestep
> > > 0. Is there a function in NCL that will subsect months may-sept for
> > > each year? Or will I have to create a do loop and pull out the
> > > subsequent months manually?
> > >
> > > Thanks,
> > > Aaron
> > >
> > > _________________________________________________________________
> > > Hotmail: Powerful Free email with security by Microsoft.
> > > http://clk.atdmt.com/GBL/go/196390710/direct/01/
> >
> >
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
>
> ------------------------------------------------------------------------
> Hotmail: Free, trusted and rich email service. Get it now.
> <http://clk.atdmt.com/GBL/go/196390708/direct/01/>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate&  Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 13 10:41:59 2010

This archive was generated by hypermail 2.1.8 : Fri Jan 15 2010 - 13:51:45 MST