Re: How to define variable in NCL?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 30 2009 - 07:58:10 MST

; user specified dates [yyyymmdd]

   date_select = (/19830131, 19850202, 19890610/)

   diri = "./" ; input directory
   fili = systemfunc("cd "+diri +" ; ls uwnd*nc")
   print(fili)

   f = addfiles(diri+fili, "r")

   time = f[:]->time
   date = ut_calendar(time, -2) ; yyyymmdd

   idate= get1Dindex(date, date_select) ; index for each desired data

   u_select = f[:]->uwnd(idate,:,:,:) ; read selected dates only

   diro = "./"
   filo = "uwnd_select.nc"
   system("/bin/rm -f "+diro+filo) ; rm any pre-existing file

   f_select = addfile(diro+filo, "c")
   f_select->date = date(idate)
   f_select->uwnd = u_select

Please read the documentation for the functions used.

http://www.ncl.ucar.edu/Document/Functions/Contributed/get1Dindex.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/ut_calendar.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/system.shtml

Sabeerali(sebi) wrote:
>
> Helloo
>
> I have daily ncep ncar uwnd data from 01 jan 1982 to 31 dec
> 2005....I want to take the particular data from the above data set. and
> has to make a single file....For example I want to take 31jan1983,
> 2feb1985, 10jun 1989 like that... How it is possible in NCL?
> --
> **********************************
> Sabeerali C T
> Climate and Global Modeling Division
> Indian Institute of Tropical Meteorology
> Pashan, Pune, 411 008
> ****************************************
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 30 07:59:00 2009

This archive was generated by hypermail 2.1.8 : Thu Dec 03 2009 - 09:53:22 MST