1. The issue.
On large cartesian-grid runs, .vtu/.vtp files became unreadable in ParaView once they crossed ~2 GB. The appended-data byte offsets (offset="…") and the per-block size prefixes were default 4-byte INTEGER, so they overflow at 2³¹. The files still wrote to full size, but the offset values wrapped to garbage and ParaView could no longer parse them.
2. Key modifications
(3 files: cartesian_grid/vtk_mod.f, cartesian_grid/vtk_out.f, des/vtp_mod.f):
-
VTU_offsetand the per-routinenbytes_*/offset_*locals →INTEGER(KIND=8). -
Byte-size products evaluated in 64-bit via
INT(count,8), so the count×components term can’t overflow before promotion. -
New module parameter
VTK_HEADER_SIZE = 8: the appended-block size prefix grew 4→8 bytes, so everyoffset = prev + <prefix> + nbytesterm now advances by 8 — not just the variable kinds (the bookkeeping point flagged on the channel). -
header_type="UInt64"added to the<VTKFile>tags that carry appended data (UnstructuredGrid.vtu, PolyData.vtp); offset output field widenedI12 → I20. -
Used
KIND=8/c_int64_tthroughout (8 bytes on both LP64 and LLP64), neverc_long, so the 8-byte prefixes stay consistent with the existingbyte_order="BigEndian",ACCESS='STREAM'writes on Windows and Linux. (One local literally namedintwas renamedint4— it shadowed theINT()intrinsic.)
Payloads are unchanged (still Float32/Int32); files grow 4 bytes per appended block. Validated on HPC >3 GB .vtu files now write and open correctly in ParaView (When the default MFIX-25.3 or MFIX-26.1.1 did not). The fix was tested with some of the 2D TFM and DEM-CFD tutorials. Note Paraview 6.1.0 cannot open the files but Paraview 6.0* can
. The modified three subroutines are attached in the zip file.
vtk_mod.zip (48.3 KB)