Binary VTK for RECTILINEAR_GRID from fortran code

谁说胖子不能爱 提交于 2019-12-01 01:43:21
Vladimir F

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!