I am having a fortran code to generate a grid in binary VTK format. This code produces a binary VTK file like this one:
# vtk DataFile Version 3.0
vtk output
One issue is, that arrays are specified as [0., 1.]
, not as (0., 1.)
, that would be a complex number equal to one imaginary unit i. The same way [0.]
instead of (0.)
. Thanks to Alexander Voigt in binary vtk for Rectilinear_grid from fortran code can not worked by paraview, for pointing out the issue.
You state that you use FLOAT
, but than you store real*8
there. They are not compatible. Either store real*4
(or a more modern real(real32)
) there, or place the text DOUBLE
instead of FLOAT
in the file.
Note, the stand conforming access=stream
is much better than the non-standard form=binary
. Also, convert=BIG_ENDIAN
is non-standard and will not work with many compilers (e.g., gfortran, if I recall it correctly). The char(10)
is better to be achar(10)
but that is a minor issue.
BTW,
buffer = 'DIMENSIONS '//str1//str2//str3//lf ; write(ivtk) trim(buffer)
can just be
write(ivtk) 'DIMENSIONS '//str1//str2//str3//lf