Skip to content

Commit b012f15

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 9b5fe23 commit b012f15

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
@@ -1100,7 +1100,7 @@ contains
11001100
m_MOK = int(m_glb + 1, MPI_OFFSET_KIND)
11011101
n_MOK = int(n_glb + 1, MPI_OFFSET_KIND)
11021102
p_MOK = int(p_glb + 1, MPI_OFFSET_KIND)
1103-
WP_MOK = int(storage_size(0)/8, MPI_OFFSET_KIND)
1103+
WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)
11041104
MOK = int(1._wp, MPI_OFFSET_KIND)
11051105

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

0 commit comments

Comments
 (0)