[MITgcm-devel] C byteswap routines for FIZHI integers
Ed Hill
ed at eh3.com
Thu May 12 11:08:09 EDT 2005
On Thu, 2005-05-12 at 10:28 -0400, Andrea Molod wrote:
> hi ed,
>
> > Hi Andrea & Jean-Michel,
> >
> > Attached is the alternate C byte-swap for integers that we discussed
> > today. I've tested it with verification/fizhi-gridalt-hs and it
> > compiles and runs (though I'm not certain that its used to produce any
> > output in that example).
> >
> > I've also tested it independently with the attached self-contained
> > "hi.f" example and it compiles, runs, and produces the correct results
> > with g77.
> >
> > So take a look, verify that it works for you, and then we can check it
> > into the model.
> >
> > Ed
> >
> > ps - In the fizhi-gridalt-hs test, I added the "-DHAVE_C_BSWAP" flag
> > to the Makefile per:
> >
> > DEFINES = -D_BYTESWAPIO -DHAVE_C_BSWAP -DWORDLENGTH=4 ...
>
>
> unfortunately, the fizhi-gridalt-hs verfication experiment does not use
> any of this byteswapping stuff for integers, so it is not a test of the
> new code. i wish you had asked me which experiment to use to test this
> out. and i took a quick look at your hi.f to test it offline. it seems
> to write and then byteswap the integer, but we don't know whether it
> byteswapped anything or not..... but thanks for the effort.
Hi Andrea,
There are two issues:
1) Yes, I'm aware that the fizhi-gridalt-hs experiment does not
exercise that part of the fizhi code.
2) What do you mean by "byteswapped anything or not"?
It works correctly. Period. And the included Makefile has
all the commands so all you need to type is:
tar -xzf C_byteswap.tar.gz
cd ./C_byteswap
make
and it will very conveniently compile, run, and print the
hexdump to the screen which *proves* that its working
correctly.
Ed
--
Edward H. Hill III, PhD
office: MIT Dept. of EAPS; Rm 54-1424; 77 Massachusetts Ave.
Cambridge, MA 02139-4307
emails: eh3 at mit.edu ed at eh3.com
URLs: http://web.mit.edu/eh3/ http://eh3.com/
phone: 617-253-0098
fax: 617-253-4464
More information about the MITgcm-devel
mailing list