Re: Segmentation fault/core dumps when using NCL calendar and string parsing functions

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 03 2011 - 08:51:48 MST

Joh,

This is a pretty basic script, and I'm surprised to see it seg faulting.

I'm curious about some of the output that I'm seeing when you run the script. First, there's:

   "Press ENTER or type command to continue"

and then:

  "shell returned 139"

How is this script being executed? Do you know which line of the NCL script it is failing on?

If you comment the "begin" and "end" statements and then run this script using the "-x" option, then NCL will echo every line as it is executed. This will show you where it's failing.

--Mary

On Mar 3, 2011, at 7:10 AM, John Kerfoot wrote:

> Hello,
>
> I'm running NCL 5.2.1 (opendap enabled) on a machine, but keep getting
> segmenation faults/core dumps when trying to use either the NCL
> calendar functions or some of the string parsing functions. For
> example, I ran the code from the ut_calendar documenation page:
>
> ----------------------------------------------------------------------------------------------------------------------
> begin
> ;
> ; Array to hold month abbreviations. Don't store anything in index
> ; '0' (i.e. let index 1=Jan, 2=Feb, ..., index 12=Dec).
> ;
> month_abbr = (/"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep", \
> "Oct","Nov","Dec"/)
> ;
> ; Time values and units.
> ;
> time = (/17522904, 17522928, 17522952, 17522976, 17523000/)
> time@units = "hours since 1-1-1 00:00:0.0"
> ;
> ; Convert to UTC time.
> ;
> utc_date = ut_calendar(time, 0)
> ;
> ; Store return information into more meaningful variables.
> ;
> year = floattointeger(utc_date(:,0)) ; Convert to integer for
> month = floattointeger(utc_date(:,1)) ; use sprinti
> day = floattointeger(utc_date(:,2))
> hour = floattointeger(utc_date(:,3))
> minute = floattointeger(utc_date(:,4))
> second = utc_date(:,5)
> ;
> ; Write out strings in the format "hhZ dd mmm yyyy".
> ;
>
> date_str = sprinti("%0.2iZ ", hour) + sprinti("%0.2i ", day) + \
> month_abbr(month) + " " + sprinti("%0.4i", year)
>
> print(date_str)
> end
> ----------------------------------------------------------------------------------------------------------------------
>
> and get the following when I run it:
>
> Press ENTER or type command to continue
> Copyright (C) 1995-2010 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.2.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> /bin/bash: line 1: 24760 Segmentation fault (core dumped) ncl <
> ./formatTimestamps.ncl
>
>
> Here's the info on the machine I'm running this on:
>
> Linux kerfoot-lin.marine.rutgers.edu 2.6.35.10-74.fc14.x86_64 #1 SMP
> Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
>
> Any insight/suggestions?
>
> Thanks in advance.
>
> John
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 3 08:51:54 2011

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2011 - 10:00:25 MST