Skip to content

Commit 1cdea6b

Browse files
sbryngelsonclaude
andcommitted
Fix IB data WP_MOK to use stp instead of default integer
The IB read/write displacement formula uses WP_MOK to skip past floating-point field data. Using storage_size(0) gave the default integer size (4 bytes), not the field storage precision size, causing incorrect byte offsets in double-precision builds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 23d9466 commit 1cdea6b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/post_process/m_data_input.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impure subroutine s_read_ib_data_files(file_loc_base, t_step)
177177
n_MOK = int(n_glb + 1, MPI_OFFSET_KIND)
178178
p_MOK = int(p_glb + 1, MPI_OFFSET_KIND)
179179
MOK = int(1._wp, MPI_OFFSET_KIND)
180-
WP_MOK = int(storage_size(0)/8, MPI_OFFSET_KIND)
180+
WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)
181181
save_index = t_step/t_step_save ! get the number of saves done to this point
182182

183183
data_size = (m + 1)*(n + 1)*(p + 1)

src/simulation/m_data_output.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ contains
10871087
m_MOK = int(m_glb + 1, MPI_OFFSET_KIND)
10881088
n_MOK = int(n_glb + 1, MPI_OFFSET_KIND)
10891089
p_MOK = int(p_glb + 1, MPI_OFFSET_KIND)
1090-
WP_MOK = int(storage_size(0)/8, MPI_OFFSET_KIND)
1090+
WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)
10911091
MOK = int(1._wp, MPI_OFFSET_KIND)
10921092

10931093
write (file_loc, '(A)') 'ib.dat'

0 commit comments

Comments
 (0)