Re: Error Statement

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed, 08 Aug 2007 09:00:14 -0600

Hi Sean,

Can you send the results of:
printVarSummary(v)

That might help us find the cause...
Thanks,
Adam

Sean Heuser wrote:
> NCL Users,
> So a friend of mine is working on NCL and is using a dim_Avg function. He
> gets this error when running the script.
>
> Could not coerce input data to double, can't continue.
>
> Any idea on what this error means? I've attached a part of his code below.
>
>
> 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 data
> ;*************************************************
> in1 = addfile("/ncsu/volume1/bonol/DATA/NNRP1/2005/vwnd.2005.nc","r")
> lon = in1->lon
> lat = in1->lat
> time = in1->time
> lev = in1->level
>
> v = in1->vwnd
>
> ;**************************************************
> ; take input data and calculate derived quantities
> ;**************************************************
> ; dims = dimsizes(ps)
> ; ntim = dims(0)
> ; nlat = dims(1)
> ; nlon = dims(2)
> ; dims_lev = dimsizes(sigma)
> ; nlev = dims_lev
> ; pres = new((/ntim,nlev,nlat,nlon /),float)
> ; do k=0,nlev-1 ; calc press @ pt
> ; pres(:,k,:,:) = (ps-pt)*sigma(k)-pt
> ; end do
> ; pres!0 = "time"
> ; pres!1 = "lev"
> ; pres!2 = "lat"
> ; pres!3 = "lon"
> ; pres&time = time
> ; pres&lev = lev
> ; pres&lon = lon
> ; pres&lat = lat
> v!0 = "time"
> v!1 = "lev"
> v!2 = "lat"
> v!3 = "lon"
> v&time = time
> v&lev = lev
> v&lon = lon
> v&lat = lat
>
> ; ===============================================
> ; filter code
> ;================================================
> ; get the meridional average you intend to analyze by using the
> function dim_avg()
> ; the right most is lat/lon you intend to average
> ; add your stuff here
> ; for example, your data v(time|:,lat|:,lon|:)
> ; v_zonal = dim_avg_Wrap( pres(time|:, lev|:, lon|:, lat|:) )
> v_zonal = dim_avg(v(time|:, lev|:, lon|:, lat|:) )(ERROR IS HERE!!!!)
> ; you will get v_zonal(time|:,lat|:)
> ; create the weight by using filwgts_lancos
> ; you can adjust the nwt to fit your own research
> nwt = 43
> fca = 0.05 ; 3 day
> fcb = 0.085 ; 5 day
> ihp = 2 ; band pass filter
> nsigma = 1.
> wgt = filwgts_lancos (nwt, ihp, fca, fcb, nsigma)
>
> ; weight average wgt_runave
> opt = 0
> v_zonal1 = wgt_runave_Wrap(v_zonal(lev|:,lon|:, lat|:,time|:), wgt,
> opt)
>
>
>

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Aug 08 2007 - 09:00:14 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 09 2007 - 10:59:25 MDT