Re: Reading specific monthly values from a netcdf file

From: <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 25 May 2007 17:48:57 -0600 (MDT)

Hi Andrea,

(untested)

syear = 1950
eyear = 2000

nyr = eyear-syear+1
precip = f->P({syear*100+1:eyear*100+12},:,:)
ntim = nyr*7
arr = precip(:ntim-1,:,:)
arr = arr@_FillValue
time = new(ntim,integer)

cntr = 0
do gg = 0,nyr-1
   arr(cntr:cntr+6,:,:) = (/ precip(gg*12+3:gg*12+9,:,:) /)
   time(cntr:cntr+6) = (/ precip&time(gg*12+3:gg*12+9) /)
   cntr = cntr+7
end do
time!0 = "time"
time&time = time
arr&time = time

Good luck!
Adam

> Hi everyone
>
> I have a netcdf file that has monthly mean precipitation rate for a number
> of years from about 1850-2004.
>
> To read in a certain range of data, I used the following:
> precip = f->P({195001:200101},:,:), which gives me all the monthly data
> from 1950/01 to 2001/01.
>
> However, I just realized that for my purpose, I would like to only read in
> the April to October monthly data for every year from 1950-2001. How would
> I do that in NCL?
>
> Thanks!
> Andrea
>
> --
> Andrea M. Sealy
> ASP Postdoctoral Fellow
> Climate and Global Dynamics Division
> National Center for Atmospheric Research
> P.O. Box 3000
> Boulder, CO 80307-3000
> Office: (303) 497-1344
> Fax: (303) 497-1695
>
>
>
> _______________________________________________
> 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 May 25 2007 - 17:48:57 MDT

This archive was generated by hypermail 2.2.0 : Tue May 29 2007 - 07:20:15 MDT