VTK error reading ascii data! when writing using Fortran

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”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: