Endian problem

P.Romero romero619 at HOTMAIL.COM
Tue May 12 11:50:09 EDT 2009


I *believe* I might have an endian problem...

Im working with a weather model (NOAA's wavewatch3) & its data on a
little-endian machine.
The raw source data from NOAA is only available in big-endian format.
So, I had to enable 'byte-swapping' on my machine, switching from
'little-endian' to 'big-endian' for 'unformatted IO'.
This was done in order for the IO routines within the model to work
correctly on my platform.

Anyway, this model also provides a post-processing routine that writes a
GrADS control & binary data file.
When I open the resulting ctl & data file in grads, everything looks fine,
but the data is completely off.

Im *guessing* this is because my version of grads is running in native
'little-endian' on my machine, but the grads binary file from the model
post-processor was written in big-endian, due to the 'byte-swapping' I
enabled.

Is there a reasonably easy way to somehow 'adjust' this binary file back
into little-endian?
Or, is it possible to force grads into 'big-endian' just for this specific
data source?

Please help,
Thanks,
P.Romero



More information about the gradsusr mailing list