[MITgcm-support] Error in reading the input files

Constantinos Evangelinos ce107 at ocean.mit.edu
Tue Mar 2 22:38:32 EST 2010


On Monday 01 March 2010 17:17:41 David Hebert wrote:

> I believe most (if not all) MITgcm build scripts default to big endian.
> Thus, usually when MITgcm is compiled on a little-endian machine some
> form of byteswapio flag is used (i.e., pgf90 -byteswapio ... for
> Portland group compilers). When you build MITgcm is this flag in your
> build script? If so than it will not read your little endian file
> correctly. Also, it will write a big endian file regardless of what the
> input file endian type.

If one omits the byte swapping compiler flags and the byte swapping #define 
then the code expects native input and writes native output.

That means that on AIX, HP-UX and Sparc Solaris it will use big endian and on 
IA32/IA64/AMD64 Linux, *BSD (including Darwin), Solaris it will use little 
endian. 

Of course the problem is that the binary input files that come with the MITgcm 
tutorials and verification experiments are all big-endian. But were one to 
provide the model with little endian input it would work just fine.

Keep in mind that byte conversion does not come at zero performance cost. 
NetCDF3 does do internal byte swapping if needed to big-endian and pays a 
performance penalty for this - NetCDF4 is supposed to be better as is 
described in section 4.4 of this paper: 
http://www.unidata.ucar.edu/software/netcdf/papers/2006-ams.pdf 

Constantinos
-- 
Dr. Constantinos Evangelinos
Department of Earth, Atmospheric and Planetary Sciences
Massachusetts Institute of Technology




More information about the MITgcm-support mailing list