time dimension problem

From: Ioana Colfescu <colfescu_at_nyahnyahspammersnyahnyah>
Date: Sun Feb 28 2010 - 19:15:08 MST

Hi ,

Could anybody help me with the following problem ?

I have 10 monthly data .nc files .
I want to put them all in one single .nc file ( so I should get an .nc with 10 moments of time).
The problem is that though I seem to get a .nc file the time in the .nc file I get is still 1 , not 10.
Can anybody tell me what should I do to get the correct dimension for time ?
I'm attaching the code I'm using below .
Thanks !

-----------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin

; Make a list of all files we are interested in
  DATADir = "./"
  FILES = systemfunc (" ls -1 " + DATADir + "20C3Mb1.cam*.nc ")
  numFILES = dimsizes(FILES)

; We generate plots, but what kind do we prefer?
  type = "x11"
; type = "pdf"
; type = "ps"
; type = "ncgm"
  wks = gsn_open_wks(type,"plt_metgrid_3")

  res = True ; Set up some basic plot resources
  res@MainTitle = "METGRID FILES"
  res@Footer = False

  pltres = True
  mpres = True

  opts = res
  opts@cnFillOn = True

  do ifil = 0,numFILES-1

    a = addfile(FILES(ifil)+".nc","r") ; Open the next file

    slp1 = a->T ; Get sea level pressure from file
    wks = gsn_open_wks("x11","example")
    gsn_define_colormap(wks,"rainbow")
    r = True
    r@cnFillOn = True
    r@gsnSpreadColors = True
  ; contour = wrf_contour(a,wks,slp,opts)
    plot = gsn_csm_contour_map(wks,slp1(0,1,:,:),r)
  end do
end
---------------------------------------------------
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Feb 28 19:15:27 2010

This archive was generated by hypermail 2.1.8 : Mon Mar 01 2010 - 08:49:37 MST