[Paraview] Re: write binary VTK -rectilinear grid data- using
fortran77
Kent Eschenberg
eschenbe at psc.edu
Tue Mar 14 09:48:32 EST 2006
--On Tuesday, March 14, 2006 03:11:01 PM +0100 Adrian Magda
<amagda at gmail.com> wrote:
> 1 if my data is real in fortran and in paraview reader is float are this
> two corespondent, i mean the same?
Yes, real and float mean the same here.
> 2 the file for writing should be unformatted or binary opened for writing
> - i am working on a sun machine?
I can't answer that as my Fortran is rusty.
> 3 how do i sweep bites? a line command would be very helpful
I can only give an example in C; perhaps someone can contribute an example
in Fortran. In C, if "a" is your array of integers or floats, the bytes
could be swapped as follows:
int i;
char one_byte;
char *b = (char*)a;
for( i=0; i<nWords; ++i, b+=4 ) {
one_byte = b[0]; b[0] = b[3]; b[3] = one_byte;
one_byte = b[1]; b[1] = b[2]; b[2] = one_byte;
}
Kent
Pittsburgh Supercomputing Center
More information about the ParaView
mailing list