Re: addfiles problem

From: Kyle Griffin <ksgriffin2_at_nyahnyahspammersnyahnyah>
Date: Wed Aug 29 2012 - 19:35:01 MDT

While I don't have the ERA-40 files you are working with, my experience
with other datasets, the error you're seeing, and the name on the variable
in your script would leave me to believe you're pulling dynamic tropopause
data (which is different from tropopause data). Dynamic tropopause data
appears to be a 2-D variable, but is actually 3-D by virtue of its
definition. In the Northern Hemisphere, it's the 2 PVU surface, while in
the Southern Hemisphere it's on the -2 PVU surface. This necessitates the
need for a level variable, as the 'PVL' (most likely potential vorticity
level) in the variable name of your GRIB file indicates.

Use ncl_filedump to examine the header info of your GRIB file to check that
my thoughts are correct and that PT_GDS4_PVL does require 3 variables as
the error is indicating. Thinking about your error a bit more, it's also
possible that each file you are reading from does not define the variable
in the same way, such that some are 2-D and some are 3-D, but I think this
is unlikely given the relatively official nature of the dataset.

If any of the above proves useful/true, I have no idea why your script
would have worked previously. Hope this helps some,

Kyle
----------------------------------------
Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
1225 W Dayton St, Madison, WI 53715
Room 1421 Email: ksgriffin2@wisc.edu

On Wed, Aug 29, 2012 at 7:31 PM, David Small <david.small2@mail.mcgill.ca>wrote:

> 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
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Aug 29 19:35:33 2012

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