Skip to content

Rename misleading WP_MOK in post_process MPI-IO (holds storage-precision byte count) #1505

Description

@sbryngelson

WP_MOK in src/post_process/m_data_input.f90 is named after working precision (wp), but it is computed from storage precision (stp):

WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)   ! L96, L138, L409

storage_size(0._stp)/8 is the per-element byte count of the field-data storage type, used to compute the file displacement disp. In mixed-precision mode (wp=double, stp=half) wp and stp differ, so the name WP_MOK is not just stylistically wrong — it claims the wrong precision for the value it holds, which is actively misleading when reasoning about I/O byte layout.

Locations: m_data_input.f90 L83/96 (s_setup_mpi_io_params decl + assignment), L116/138/146 (s_read_serial...), L261, L353, L372/409/447/452 (s_read_parallel_conservative_data and its dummy-arg thread-through). The name appears in two subroutine signatures and is passed between them, so the rename must update the dummy args in lock-step.

Suggested name: STP_MOK (to match its 0._stp origin and the existing m_MOK/n_MOK/p_MOK style). Pure rename, no behavior change → no golden-file impact. Worth grepping src/ for the same WP_MOK pattern in other targets and renaming consistently if present.


Filed from a repo-wide code-cleanliness review; verified against master @ 40dde5e.

Code references

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions