[ncl-talk] Segfault error with Wavelet function in cygwin/x
Mary Haley
haley at ucar.edu
Sun May 7 11:41:20 MDT 2017
Dipti,
I'm responding back to ncl-talk on this one because I think I found the
source of the problem.
It looks like it's a simple memory issue that fails under 32-bit Cygwin.
I had to reduce the amount of memory that the wavelet Fortran subroutine
was requesting, and this seemed to make it work.
I compiled a new "ncl" executable for you to try.
To get the new executable, use wget or anonymous ftp:
wget ftp.ucar.edu:/pub/scd/haley/nclcfix.exe
or
ftp ftp.ucar.edu
<log in as "anonymous">
<Use email address as password>
cd /pub/scd/haley
get nclcfix.exe
quit
Once you have the file, move it to $NCARG_ROOT/bin and make sure it is
executable:
chmod gou+x nclcfix.exe
mv nclcfix.exe $NCARG_ROOT/bin/.
Now you can try this new "nclcfix.exe" executable instead of the one
already installed on your system:
nclcfix your_wavelet_script.ncl
If you are comfortable that this executable works, you can replace your old
ncl executable with this new one. You should first make a copy of your old
one:
mv $NCARG_ROOT/bin/ncl.exe $NCARG_ROOT/bin/nclold.exe
mv $NCARG_ROOT/bin/nclcfix.exe $NCARG_ROOT/bin/ncl.exe
Please respond back to ncl-talk and let us know if this fixes the problem.
Thanks,
--Mary
On Fri, Apr 21, 2017 at 8:31 AM, Mary Haley <haley at ucar.edu> wrote:
> Dear Dipti,
>
> I was able to reproduce this problem on my Cygwin system at home, but I
> didn't have much time to debug it.
>
> Kevin tried your script on a Mac system, and I tried it on both a 32-bit
> and 64-bit Linux system and it worked fine. So, it seems to be limited to
> Cywgin.
>
> I will look into this over the weekend.
>
> Meanwhile, is your system a 64-bit system running Windows 10? If so, then
> you might want to consider using Window's Linux subsystem instead of Cygwin
> for your UNIX environment. I'm guessing that your wavelet program might
> work under this system.
>
> Please see this link for more information:
>
> http://www.ncl.ucar.edu/Download/windows_linux_subsystem.shtml
>
>
> --Mary
>
>
> On Thu, Apr 20, 2017 at 6:05 PM, Kevin Hallock <hallock at ucar.edu> wrote:
>
>> 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,isig
>> test,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
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170507/ab7b0af1/attachment-0001.html
More information about the ncl-talk
mailing list