[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #HPS-623090]: Re: [netcdfgroup] files with compound types not portable?



How did you create the file?

Jeff Whitaker wrote:
> New Client Reply: Re: [netcdfgroup] files with compound types not portable?
> 
> Unidata netCDF Support wrote:
>> Hi Jeff,
>>
>>   
>>> Following up on my previous message, h5dump does display the data
>>> correctly on both systems (but ncdump does not).
>>>     
>> I've verified different ncdump outputs for your test.nc file with ncdump
>> built on a Linux versus a Solaris/x86 system, and I also get the same output
>> from h5dump on both systems.  However, I'd like to verify that the h5dump
>> output I'm seeing is what you expect, becausee it also looks wrong to me.
>>
>> On both the Linux and Solaris/x86 systems, I see the following values from
>> h5dump for the "phony_compound_var" variable:
>>
>>    DATASET "phony_compound_var" {
>>       DATATYPE  "/cmp3"
>>       DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
>>       DATA {
>>       (0): {
>>             {
>>                20000,
>>                300000
>>             },
>>             {
>>                100000,
>>                [ 1.59954e-314, 1.59954e-314,
>>                   1.59954e-314, 1.59954e-314,
>>                   1.59954e-314, 2.42435e-154 ]
>>             }
>>          }
>>       }
>>
>> which are the same values (to float precision) I see in the ncdump output
>> on the Solaris system, whereas the ncdump output on the Linux system has
>>   
> 
> Russ:  No, those values are wrong.  h5dump does indeed agree with 
> ncdump, but gives different results on different systems.
>>    phony_compound_var = 
>>       {{20000, 300000}, {100000, {-100000.015594482, -100000, -100000, 
>> -100000, -100000, -100000}}} ;
>>
>>   
> Yes
>> I assume the latter values are what you expect.  Is that correct?  And are
>> you seeing the same values in the output from h5dump as I've pasted above?
>>   
> 
> Yes, my earlier message was incorrect.
>> An answer to this question will help isolate the bug to ncdump or one of the
>> libraries.
>>   
> 
> Seems like it's an error in the way the data is written to the file 
> (i.e. the library), not ncdump.
>> Thanks for reporting this!
>>
>> --Russ
>>   
> 
> My pleasure. 
> 
> -Jeff
>>   
>>> -Jeff
>>>     
>>>> I created a file with a nested compound type on a 64 bit linux box.
>>>> Here's the output of ncdump on the linux machine:
>>>>
>>>> nnetcdf test {
>>>> types:
>>>>  compound cmp1 {
>>>>    short i ;
>>>>    int j ;
>>>>  }; // cmp1
>>>>  compound cmp2 {
>>>>    float x ;
>>>>    double y(3, 2) ;
>>>>  }; // cmp2
>>>>  compound cmp3 {
>>>>    cmp1 xx ;
>>>>    cmp2 yy ;
>>>>  }; // cmp3
>>>> dimensions:
>>>>        phony_dim = 1 ;
>>>> variables:
>>>>        cmp3 phony_compound_var(phony_dim) ;
>>>> data:
>>>>
>>>> phony_compound_var =
>>>>    {{20000, 300000}, {100000, {-100000.028899567, -100000, -100000,
>>>> -100000, -100000, -100000}}} ;
>>>> }
>>>>
>>>> Copying the file over to MacOS X and running ncdump there gives:
>>>>
>>>> netcdf test {
>>>> types:
>>>>  compound cmp1 {
>>>>    short i ;
>>>>    int j ;
>>>>  }; // cmp1
>>>>  compound cmp2 {
>>>>    float x ;
>>>>    double y(3, 2) ;
>>>>  }; // cmp2
>>>>  compound cmp3 {
>>>>    cmp1 xx ;
>>>>    cmp2 yy ;
>>>>  }; // cmp3
>>>> dimensions:
>>>>        phony_dim = 1 ;
>>>> variables:
>>>>        cmp3 phony_compound_var(phony_dim) ;
>>>> data:
>>>>
>>>> phony_compound_var =
>>>>    {{20000, 300000}, {100000, {1.59954026355845e-314,
>>>> 1.59954026355845e-314, 1.59954026355845e-314, 1.59954026355845e-314,
>>>> 1.59954026355845e-314, 2.42435159293081e-154}}} ;
>>>> }
>>>>
>>>> This is with netcdf 4.0.1 and hdf5 1.8.2 in both places.  I've put the
>>>> netcdf file at ftp://ftp.cdc.noaa.gov/Public/jwhitaker/test.nc.
>>>>
>>>> ncdump should give the same result both places, shouldn't it?
>>>>
>>>> -Jeff
>>>>
>>>>       
>>> --
>>> Jeffrey S. Whitaker         Phone  : (303)497-6313
>>> Meteorologist               FAX    : (303)497-6449
>>> NOAA/OAR/PSD  R/PSD1        Email  : address@hidden
>>> 325 Broadway                Office : Skaggs Research Cntr 1D-113
>>> Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg
>>>
>>> _______________________________________________
>>> netcdfgroup mailing list
>>> address@hidden
>>> For list information or to unsubscribe,  visit: 
>>> http://www.unidata.ucar.edu/mailing_lists/
>>>
>>>
>>>     
>> Russ Rew                                         UCAR Unidata Program
>> address@hidden                     http://www.unidata.ucar.edu
>>
>>
>>
>> Ticket Details
>> ===================
>> Ticket ID: HPS-623090
>> Department: Support netCDF
>> Priority: Normal
>> Status: Closed
>>
>>   
> 
> 
> 
> Ticket Details
> ===================
> Ticket ID: HPS-623090
> Department: Support netCDF
> Priority: Normal
> Status: Open
> Link:  
> https://www.unidata.ucar.edu/esupport/staff/index.php?_m=tickets&_a=viewticket&ticketid=8748



Ticket Details
===================
Ticket ID: HPS-623090
Department: Support netCDF
Priority: Normal
Status: Open