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

Kevin Hallock hallock at ucar.edu
Thu Apr 20 18:05:49 MDT 2017


Hi Dipti,

I tried to run your script on my Mac, but it ran successfully without a segfault. We will find a Windows system with cygwin to test your script on and will respond again soon.

Kevin

> On Apr 19, 2017, at 12:23 PM, Dipti Sharma <sdipti596 at gmail.com> wrote:
> 
> 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)
> 
> 
> <sst_nino3.dat>_______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



More information about the ncl-talk mailing list