I write a fortran code and save the data in VTK legacy format with structured points. However, for certain data somehow Paraview and Mayavi are unable to read the VTK file. It gives a “Generic Warning”, and says that

`Error reading ascii data!`

After days of debugging, it turns out that the cause is my precision, I used double precision for my data, and there are some data with 3 digit for the exponents, and I write to the file using ES format. This turns out cannot be read by Paraview and Mayavi. So when I changed the format to F which is just a floating point with decimal points (no exponents), then paraview and mayavi2 can read my data. But this is of course is not a good format to store. And after looking for more detail in Fortran languange, I can set my digit in the exponent to only 2. This is the format in fortran

ESw.dEe

where “e” is the digit for the exponent.

The other thing is that In VTK, I set the data type as “float”, I need to change this to “double”.

Filed under: Uncategorized | Tagged: fortran, visualization | Leave a comment »