This WWW page is mainly a note to myself. Occasionally I'll get a request for an ASII version of a netCDF file that I wrote. I can never remember the ordering of how the data is written out by
ncdump. The following is to remind me.
I created a simple matrix of latitudes:
75 75 75 75 75 75 25 25 25 25 25 25 -25 -25 -25 -25 -25 -25 -75 -75 -75 -75 -75 -75and there are 4 rows and 6 columns. I wrote this matrix out 10 times in a netCDF file, which for each iteration the value at each grid point is multiplied by the iteration number. This was done to aid in discerning the order that values are written out as. The loop would look like this:
loop for iteration = 1: 10 write_to_netcdf_file( latitudes * iteration ) end of loopThe output of "
ncdump filename.nc" (no quotes) is linked here and the bottom line is that the data array A(10,180,360) is written out from the outermost (1:360) to innermost (1:10) array counters. This is the same as the C programming language convention but opposite the FORTRAN convention.