error compiling bpf

From: Wilhelm Haygen <w.haygen_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 10 2012 - 18:04:42 MDT

Hi NCL users,
Anybody know why i couldnt run this simple script?

fatal:syntax error: line 22 before or near \n
  bpass = band_pass_latlon_time (x(:,{latS:latN},{lonL:lonR},srate, bpf,
wgty({latS:latN}), opt)
------------------------------------------------------------------------------------------------^

fatal:Syntax Error in block, block not executed

Thanks

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/diagnostics_cam.ncl"

begin

  f = addfile("./golden_mjo.nc", "r")
  x = short2flt(f->olr) ; (time,lat,lon) , ntim=1461
 printVarSummary( x )

; select region
  latS = -20.
  latN = 20.
  lonL = 0.
  lonR = 360.

  srate = 1
  bpf = (/20,100,201/)
  wgty = latRegWgt(x&lat, "float", 0)
  opt = False

  bpass = band_pass_latlon_time (x(:,{latS:latN},{lonL:lonR},srate, bpf,
wgty({latS:latN}), opt)

diro ="./"
filo = "filterolr.nc"
a = addfile(diro+filo, "c")
a->olr_filt =bpass
end

Variable: x
Type: float
Total Size: 15347520 bytes
            3836880 values
Number of Dimensions: 3
Dimensions and sizes: [time | 365] x [lat | 73] x [lon | 144]
Coordinates:
            time: [17496624..17505360]
            lat: [90..-90]
            lon: [ 0..357.5]
Number Of Attributes: 13
  long_name : Daily OLR
  unpacked_valid_range : ( 0, 500 )
  actual_range : ( 83.5, 338.19 )
  units : W/m^2
  var_desc : Outgoing Longwave Radiation
  precision : 2
  dataset : NOAA Interpolated OLR
  level_desc : Other
  statistic : Mean
  parent_stat : Individual Obs
  _FillValue : 32766
  valid_range : ( 0, 500 )
  missing_value : 32766

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 10 18:04:53 2012

This archive was generated by hypermail 2.1.8 : Wed Aug 15 2012 - 08:12:08 MDT