Asked by Bodil
on 22 Nov 2012

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

*No products are associated with this question.*

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 1 Comment

## Ashish Uthama (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/54473#comment_120743

Is the file available for public download? I cant explain why this might happen (MATLAB uses libnetcdf under the hood).