Reading in binary data exported with fwrite

Boyin Huang boyin.huang at NOAA.GOV
Mon Jul 11 10:59:46 EDT 2005


Hello, James:

Great to see your answer to the question about fwrite.

I encountered the similar problem when reading a cdf file and fwrite it
into a binary file. The file size is larger probably because of setting
lon value from 1 to lon levels+1. The question is why. Otherwise, I would
consider this setting is a bug.

Before reading your answer, I think the reason might be that I did not
specify the logitudinal domain. I tried 'set lon ...'  and 'set lat ...',
and surprisingly, the file reduced to what it should be, and ploting using
the ctl of the binary file is good (no skew).

So, to me, the answer is that we have to specify the boundaries of
original data set, although I don't know why. Intuitively, one may think
it is not necessary to explicitly specify the data boundaries, since the
system should use its default. Unfortunately, the system does not work
that way.



More information about the gradsusr mailing list