[ncl-talk] Segfault error with Wavelet function in cygwin/x

Dipti Sharma sdipti596 at gmail.com
Wed Apr 19 12:23:00 MDT 2017


Dear All,

I am trying to understand how to do the wavelet analysis using NCL. I am
using ncl v6.4.0 in cygwin/x. I started using an example code and the data
that are available online. But I got an error message as "segmentation
fault (core dumped)" when I ran the program. I have given the code that I
used as below for you to review. Also I have attached the data I used in
the email.

So, could you please suggest me how I solve this problem?

Thanks in advance.

Dipti S.

THE CODE is here and the data is attached in the email,

 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/shea_util.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

;--------------------------------------------------------------------
; CREATE SAME WAVELET FIGURE AS TORRENCE & COMPO using seasonal Nino3
; from 1871-1997
begin
ninoseas = asciiread("C:\diptic\sst\sst_nino3.dat",-1,"float")
  ninoseas!0 = "time"
  ntime = dimsizes(ninoseas)
  timeo = fspan(1871.25,1996.,ntime)
  print(ntime)
  ninoseas&time = timeo
  ninomam = dim_avg_Wrap(ninoseas(0::4))
  ninojja = dim_avg_Wrap(ninoseas(1::4))
  ninoson = dim_avg_Wrap(ninoseas(2::4))
  ninodjf = dim_avg_Wrap(ninoseas(3::4))
  ninoseas(0::4) = ninoseas(0::4) - ninomam
  ninoseas(1::4) = ninoseas(1::4) - ninojja
  ninoseas(2::4) = ninoseas(2::4) - ninoson
  ninoseas(3::4) = ninoseas(3::4) - ninodjf
  time  = timeo
  N     = dimsizes(time)
;_FillValue=1e+36
;printMinMax(ninoseas,False)
;return
;************************************
; compute wavelet
;************************************
  mother  = 0
  param   = 6.0
  dt      = 0.25    ;timesteps in units of years
  s0      = dt
  dj      = 0.25
  jtot    = 1+floattointeger(((log10(N*dt/s0))/dj)/log10(2.))
  npad    = N
  nadof   = 0.0
  noise   = 1
  siglvl  = 0.05
  isigtest= 0
print(nadof)
w =wavelet(ninoseas,mother,dt,param,s0,dj,jtot,npad,noise,
isigtest,siglvl,nadof)
printVarSummary(w)
return
end
;;; This is the output I received,

Variable: ntime
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:   [1]
Coordinates:
(0)     504
(0)     min=-1.8504   max=2.49921

Variable: nadof
Type: float
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:   [1]
Coordinates:
(0)      0
Segmentation fault (core dumped)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170419/9d9cf9f2/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sst_nino3.dat
Type: application/octet-stream
Size: 3526 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170419/9d9cf9f2/attachment.obj 


More information about the ncl-talk mailing list