Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/common/m_helper_basic.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module m_helper_basic

private
public :: f_approx_equal, f_approx_in_array, f_is_default, f_all_default, f_is_integer, s_configure_coordinate_bounds, &
& s_update_cell_bounds
& s_update_cell_bounds, f_save_index

contains

Expand Down Expand Up @@ -109,6 +109,17 @@ contains

end function f_is_integer

!> Index of the save written at t_step: t_step itself under CFL-based stepping (the caller passes the save count), else
!! t_step/t_step_save.
pure integer function f_save_index(t_step, cfl_mode, t_step_save) result(idx)

integer, intent(in) :: t_step, t_step_save
logical, intent(in) :: cfl_mode

idx = merge(t_step, t_step/t_step_save, cfl_mode)

end function f_save_index

!> Compute ghost-cell buffer size and set interior/buffered coordinate index bounds.
subroutine s_configure_coordinate_bounds(recon_type, weno_polyn, muscl_polyn, igr_order, buff_size, idwint, idwbuff, viscous, &
& bubbles_lagrange, m, n, p, num_dims, igr, ib, fd_number)
Expand Down
3 changes: 2 additions & 1 deletion src/post_process/m_data_input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module m_data_input
use m_boundary_common
use m_boundary_io
use m_helper
use m_helper_basic, only: f_save_index

implicit none

Expand Down Expand Up @@ -153,7 +154,7 @@ impure subroutine s_read_ib_data_files(file_loc_base, t_step)
p_MOK = int(p_glb + 1, MPI_OFFSET_KIND)
MOK = int(1._wp, MPI_OFFSET_KIND)
WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)
save_index = t_step/t_step_save ! get the number of saves done to this point
save_index = f_save_index(t_step, cfl_dt, t_step_save)

data_size = (m + 1)*(n + 1)*(p + 1)
var_MOK = int(sys_size + 1, MPI_OFFSET_KIND)
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ contains
call s_check_mpi_file_open(ierr, file_loc)

var_MOK = int(sys_size + 1, MPI_OFFSET_KIND)
disp = m_MOK*max(MOK, n_MOK)*max(MOK, p_MOK)*WP_MOK*(var_MOK - 1 + int(time_step/t_step_save))
disp = m_MOK*max(MOK, n_MOK)*max(MOK, p_MOK)*WP_MOK*(var_MOK - 1 + f_save_index(time_step, cfl_dt, t_step_save))
if (time_step == 0) disp = 0

call MPI_FILE_SET_VIEW(ifile, disp, MPI_INTEGER, MPI_IO_IB_DATA%view, 'native', mpi_info_int, ierr)
Expand Down
Loading