Error spanning multiple files, addfiles_GetVar

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Tue, 05 Feb 2008 20:05:05 -0500

Hi.
May I have some help?

I am trying to span multiple files, return a variable, and put it into an
array.
I have 245 4xdaily data files that I am trying to read "VV" from ( yet only
at 12 UTC). So this means (245-1)/4 = 61 timesteps tat I am trying to span.

I tried making the code below using the concatenate "ListSetType (b, "cat"),
addfiles, and addfiles_GetVar" functions similar to the example at
http://www.ncl.ucar.edu/Applications/addfiles.shtml

I am not sure why I keep getting the "out of range" error below, even though
I allocated enough space.

Could I have a suggestion here?
Humbly yours,
Erik

fatal:Subscript out of range, error in subscript #0
fatal:Execute: Error occurred at or near line 22 in file test_script3.ncl

; Script to Read FNL Reanalysis 4 x Daily data (245 files)
; Read in V data for every 12 UTC timestep
; Create a new array
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
  ;========================
  ; get list of all met_em files and open as "one big file" for array
  ;========================
  DATADir = "/Volumes/Data_and_Models/NAMA-SOP3/" ; path to your data -
must have trailing "/"
  ALLFILES = systemfunc ("csh -c ' ls " + DATADir + "met_em.d01.2006*nc'")
; root of data file you want to plot
  numFILES = dimsizes(ALLFILES) ; 245 files present, 4 hourly data
  finarr = new((/(numFILES-1)/4,27,110,139/),"float") ;244/4=61,27 levels,
110x139 grid

 do ifil = 0, (numFILES-1)/4
 b = addfiles(ALLFILES(ifil*4+2),"r")
  ListSetType (b, "cat")
  finarr(ifil*4+2,:,:,:) = addfiles_GetVar(b,ALLFILES(ifil*4+2),"VV")
 end do
  printVarSummary(finarr)
end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 05 2008 - 18:05:05 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 05 2008 - 21:51:46 MST