NetCDF addfile question

From: Nick Guy <nick.guy_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 07 2012 - 12:30:58 MST

Hello,
I created NetCDF files recently and used the addfiles function to read a list. I was having trouble reading in the global attributes until I discovered that I had to only read one file at a time via addfile to be able to properly read global attributes. So just a general question: Anyone know why are the attributes not allowed to be read in the same way as variables for the different functions?

I've pasted the snippet of code below that I help demonstrates what I am getting at.
;=========================================
  sondeList=systemfunc("ls "+fdir+"D20111122_*.nc")

  ; Read all NetCDF files
  fAll=addfiles(sondeList,"r")

  file0=addfile(sondeList(0),"r")

  ListSetType(fAll,"join")

  AttsAll=getvaratts(fAll) ;; THIS RETURNS ONLY ONE MISSING FIELD
  print(AttsAll)

  Atts0=getvaratts(file0) ;; THIS RETURNS THE GLOBAL ATTRIBUTES
  print(Atts0)

I was having trouble reading in the global attributes
========================================
All the best,

Nick Guy
nick.guy@noaa.gov

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 7 12:31:12 2012

This archive was generated by hypermail 2.1.8 : Tue Nov 13 2012 - 14:27:24 MST