Error Statement

From: Sean Heuser <spheuser_at_nyahnyahspammersnyahnyah>
Date: Wed, 8 Aug 2007 10:38:10 -0400 (EDT)

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)

-- 
Sean Heuser
Masters Student
Department of Marine, Earth & Atmospheric Sciences
North Carolina State University
spheuser_at_ncsu.edu
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Aug 08 2007 - 08:38:10 MDT

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