problems reading large netcdf file; returns zeros

2 views (last 30 days)
My netcdf file contains temperatures in 6 hours time bins between 1991 and 2010. From nc_dump or ncdisp, I get the information that the temperature comes in the dimension 96x48x63x30660, i.e. longitude, latitude, pressure level and time. However, after time step 1071, the matrix seems to be filled with up zeros. Even the time vector gives me zeros after 1071 elements. Up until then, the temperature data looks fine. People using IDL get the whole file, so it doesn't seem to be an issue with the netcdf-file. I don't get an error message.
Here is my routine:
%%%%%%%%%%%%%%%%%%%%%%%%%%%
filename = 'temperature.nc';
ind=(1:4:30660);
for i=1:(30660/4);
one_day_of_data=ncread(filename,'temp',[1 1 1 ind(i)],[96 48 63 4],[1 1 1 1]);
daily_T(i,:,:)=squeeze(mean(mean(one_day_of_data,4),1));
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1 Comment
Ashish Uthama
Ashish Uthama on 4 Jan 2013
Is the file available for public download? I cant explain why this might happen (MATLAB uses libnetcdf under the hood).

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!