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

[netCDF #CEZ-194696]: segmentation fault while allocating 4darray in cpp



Greetings Nils,

Is there a copy of the file you are trying to read on the web somewhere? If 
not, would it be possible to get a copy?

Thanks!

Sean

> Dear help team
> 
> attached is a file to read a netcdf file with unknown dimension size.
> it fails to allocate the size of the multidimension arrays:
> 
> 
> T_2M_AV = new float***[timelength];
> for (i = 0; i < timelength; ++i){
> T_2M_AV[i] = new float**[heightlenght];
> for (j = 0; j< heightlenght; ++j)
> T_2M_AV[i][j] = new float*[latlength];
> for (k = 0; k < latlength; ++k)
> T_2M_AV[i][j][k] = new float[lonlength];
> }
> 
> ncdump gives:
> ...
> float T_2M_AV(time, height_2m, lat, lon) ;
> ...
> 
> compiling the code with
> g++ -c readdynamic.cpp
> g++ -o readdynamic readdynamic.cpp -lnetcdf_c++ -lnetcdf
> 
> 
> I will be very happy if you have any advice.
> 
> best regrades
> 
> Nils
> 
> 


Ticket Details
===================
Ticket ID: CEZ-194696
Department: Support netCDF
Priority: Normal
Status: Open


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.