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
WP_MOKinsrc/post_process/m_data_input.f90is named after working precision (wp), but it is computed from storage precision (stp):storage_size(0._stp)/8is the per-element byte count of the field-data storage type, used to compute the file displacementdisp. In mixed-precision mode (wp=double,stp=half)wpandstpdiffer, so the nameWP_MOKis 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.f90L83/96 (s_setup_mpi_io_paramsdecl + assignment), L116/138/146 (s_read_serial...), L261, L353, L372/409/447/452 (s_read_parallel_conservative_dataand 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 its0._stporigin and the existingm_MOK/n_MOK/p_MOKstyle). Pure rename, no behavior change → no golden-file impact. Worth greppingsrc/for the sameWP_MOKpattern in other targets and renaming consistently if present.Filed from a repo-wide code-cleanliness review; verified against
master@40dde5e.Code references
src/post_process/m_data_input.f90:96— WP_MOK = storage_size(0._stp)/8src/post_process/m_data_input.f90:138— WP_MOKsrc/post_process/m_data_input.f90:409— WP_MOK