addfiles problem

From: David Small <david.small2_at_nyahnyahspammersnyahnyah>
Date: Wed Aug 29 2012 - 18:31:18 MDT

Hello,

I upgraded NCL to version 6.0.0. My script to regrid and truncate ERA interim tropopause files stopped working. When trying to add multiple files, which worked before, I get the following error:

fatal:Number of subscripts on rhs do not match number of dimensions of aggregated join type variable, (2) Subscripts used, (3) Subscripts expected.

This makes no sense because the grid I'm reading in is 2D, i.e. potential temperature on the tropopause at a single 6 hr period. The script is below:

;*************************************************
; NCL Graphics: polar_1.ncl
;************************************************
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
;************************************************
; read in netCDF file
;************************************************

  do yr=2011,2011
   do mon=2,12
  print("Currently processing... "+yr+" "+mon)

;=========================================;
; open original grid
;=========================================;
    if(mon.lt.10) then
      lst = systemfunc("ls /Volumes/ERA40/ERAinterimTROP/ERAi_"+yr+"/ei.oper.an.pv.regn128sc."+yr+"0"+mon+"*.grb")
    else
      lst = systemfunc("ls /Volumes/ERA40/ERAinterimTROP/ERAi_"+yr+"/ei.oper.an.pv.regn128sc."+yr+mon+"*.grb")
    end if

    a=addfiles(lst,"r")

  ListSetType (a, "join") ; join

  f = a[:]->PT_GDS4_PVL(::-1,:)
  lat = a[0]->g4_lat_0(::-1)
  lon = a[0]->g4_lon_1

  f!0="time"
  f!1="lat"
  f!2="lon"
  f&lat = lat
  f&lon=lon

  delete(lst)

;=========================================;
; interpolate to new grid
;=========================================;
  dm = dimsizes(f)
  jlat=dm(1)
  ilon=dm(2)
  f2 = g2gsh (f, (/jlat,ilon/), 21) ;
  THETA = g2fsh_Wrap(f2,(/73,144/))

   oname = "/Volumes/Storage/intregridT21/itropthetaregrid."+yr+"."+mon+".nc"

   fout = addfile(oname, "c")

   fout->THETA=THETA

   delete(oname)
   delete(f)
   delete(THETA)
   delete(f2)

end do
end do

end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Aug 29 18:31:28 2012

This archive was generated by hypermail 2.1.8 : Tue Sep 11 2012 - 15:30:42 MDT