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

[netCDF #PDU-209279]: segmentation fault on nf_inq_var



> cant figure this out
> i am using the latest version of netcdf3 on a opensuse machine 64bit
> 
> I used a program called cdf35fortran.f90 that generates fortran 90 code
> to read my netcdf archive (i used it many times before).  it opens the
> archive with status 0 then when it tries to  inquire the variable on
> the following line:
> 
> !----------------------------------------------------
> !   Retrieve data for Variable 'time'
> status=nf_inq_var(ncid,   1,dummy,xtype,ndim,dimids,natts)
> if ( status/=nf_noerr ) write (*,*) nf_strerror(status)
> 
> i get a segmentation fault.
> 
> when i used ncdump -h i was able to retrieve this data:
> 
> dimensions:
> time = UNLIMITED ; // (361 currently)
> z = 30 ;
> y = 76 ;
> x = 140 ;
> variables:
> float time(time) ;
> time:long_name = "time" ;
> time:units = "days since 2000-01-01 00:00:00 +00:00" ;
> 
> and when i used ncdump -c i was able to see the values for the time
> variable
> 
> any ideas of what goes wrong?
> 
> thank in advance
> yair
> --
> Yair Suari
> Geva Carmel, Israel 30855
> Phone-0528-524520, 04-9840943
> 
> 

Howdy Yair!

This could be caused by your dimids array being too short. It has to have 
enough space for all the dimensions.

Good luck!

Ed

Ticket Details
===================
Ticket ID: PDU-209279
Department: Support netCDF
Priority: High
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.