Re: Coordinate subscripting bug crashes NCL

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Fri Sep 23 2005 - 16:13:01 MDT


Hi Dave,

We just confirmed that your "{time|:}" syntax causing a core dump is
indeed a bug. This seems to only occur when reading in a variable, not
when the variable is already local in ncl. This will be added to the NCL
known bug list. This syntax, while technically correct, is not
necessary. A simple "time|:" would suffice.

On a seperate note to all users, it is very inefficient to reorder the
dimensions of a variable as it is being read in. It is best to read in
the variable, and then reorder the array. I did a quick speed check here.
This took 97 seconds to complete:
a = addfile("PSL.ccm3.nc","r")
test = a->PSL({lat|40:80},lon|:,time|:)

This took 1 second:
a = addfile("PSL.ccm3.nc","r")
temp = a->PSL(:,{40:80.},:)
test = temp(lat|:,lon|:,time|:)
delete(temp)

Note that when reading in a variable, coordinate subscripting is fine,
dimension reordering should be avoided.
Adam

Dave Allured wrote:
> To all,
>
> My mistake on the second half of this problem report. I mixed up script
> versions with an older, undebugged version. Forget everything below
> "now here's the weird part". Sorry for the confusion.
>
> The first part about the bug in NCL coordinate subscripting "{time|:}",
> is still valid.
>
> --Dave A.
> CDC/NOAA/CIRES
>
> Dave Allured wrote:
>
>> Hello. I am getting mysterious behavior from NCL. In a fairly simple
>> script, I read an input array from a netcdf file. I am subsetting the
>> array on input, reordering dimensions, and using coordinate
>> subscripting, all in the same statement:
>>
>> pcp = f->precip({lat|lat1:lat2},{time|:},{lon|lon1+360.:lon2+360.})
>>
>> Note that the time subscript uses default range notation. According
>> to the documentation, "this should work".
>>
>> The script crashes consistently on this statement, on two different
>> platforms: Solaris 5.8 on Sun4U, and Mac OS X version 10.3.9 on Mac
>> G5. Crash messages are only "Segmentation Fault" or "Bus error"
>> (Mac). We have the current NCL installed, version 4.2.0.a032.
>>
>> Any of these are valid workarounds that allow the script to run:
>>
>> pcp = f->precip({lat|lat1:lat2},time|:,{lon|lon1+360.:lon2+360.})
>> pcp =
>> f->precip({lat|lat1:lat2},{time|0:364},{lon|lon1+360.:lon2+360.})
>> pcp =
>> f->precip({lat|lat1:lat2},{time|t1:t2},{lon|lon1+360.:lon2+360.})
>>
>> Now here's the weird part.
>>
>> 1. This is described as a known bug that was fixed in the current
>> release notes:
>>
>> http://www.ncl.ucar.edu/new_release.shtml (for version 4.2.0.a032)
>>
>> * Another coordinate subscripting bug
>>
>> If you tried to use coordinate subscripting without actually using
>> a subscript value, as in:
>>
>> buf2 = buf({lev|:},{lon|:},{lat|30:50})
>>
>> it would sometimes cause a core dump.
>>
>> 2. This script ran normally for me many times a couple months ago,
>> with the same version of NCL. Now, the identical script crashes
>> consistently.
>>
>> 3. There was at least one other strange change in NCL behavior,
>> having to do with changes in the way that data types could be coerced
>> at certain places in the same script (I think).
>>
>> This makes me suspect that my NCL installation may have somehow
>> changed. But a check shows that we have apparently been using the
>> same NCL executable and the same dynamic libraries for the entire time.
>>
>> It is possible that somehow the last bug fix did not completely
>> correct the subscripting problem, and that it is still intermittent in
>> nature.
>>
>> Has anyone else seen this behavior? Do you know of a possible
>> installation or environment issue that could cause this sort of shift
>> in behavior?
>>
>> --Dave A.
>> CDC/NOAA/CIRES
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk@ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Sep 26 2005 - 10:27:27 MDT