Home > Archive > Fortran > March 2004 > Re: mac os xlf90 unformatted datas
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: mac os xlf90 unformatted datas
|
|
| Ville Hakulinen 2004-03-27, 12:17 am |
| In article <c37gbm$4ir$1@nef.ens.fr>, Herve wrote:
> I am running both ifort (intel fortran compiler) on a linux box
> (intel) and xlf90 (ibm, xlf90 8.1 beta version ) on a mac os X box. I
> currently have problems with unformatted datas: the mac os x box can not
> read the unformatted datas from the linux box. Does any know if there is
> a compiler option of xlf90 in order to allow it to read linux box datas
> or if there is a decent way to convert data files?
NetCDF was mentioned already, but if your data files have simple format,
you might consider writing a small conversion program that swaps the byte
order in integers and reals. This shouldn't be too difficult, since you
already have the code to read the data into your program on Mac.
--
Ville
| |
| Paul Van Delst 2004-03-27, 12:17 am |
| Ville Hakulinen wrote:
> In article <c37gbm$4ir$1@nef.ens.fr>, Herve wrote:
>
>
>
> NetCDF was mentioned already, but if your data files have simple format,
> you might consider writing a small conversion program that swaps the byte
> order in integers and reals. This shouldn't be too difficult, since you
> already have the code to read the data into your program on Mac.
Hello,
This is also an option but if this byte-swapping code is to be used in production software
(whatever that may mean for your app) and you want to be cautious during testing and thus
set your floating point traps during compilation, when you run the code the act of
either a) reading the data to be byteswapped, or b) actually byteswapping valid real
numbers (by whatever means, e.g. MVBITS, TRANSFER, etc) may generate invalid reals and
your code will stop with an FPE trap.
This is a simple thing to work around, e.g. turn off your FP exception compile switches --
or just turn of the "invalid" one, but I actually use those options for debug purposes.
Hence my use of netCDF.
And, as the poster above also mentioned, doing the byteswapping yourself means you have
have to have a very simple file format... unless you write a byteswapper for each file
your write/read.
cheers,
paulv
|
|
|
|
|