From ab4a3c481a1eea00c4e91d6e40e30c2273fff566 Mon Sep 17 00:00:00 2001 From: Steve Abbott Date: Fri, 8 Nov 2024 08:54:14 -0600 Subject: [PATCH] Address PR reivew comments --- src/simulation/m_cbc.fpp | 6 +++++ src/simulation/m_data_output.fpp | 2 +- src/simulation/m_start_up.fpp | 39 ++++++++++++-------------------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/simulation/m_cbc.fpp b/src/simulation/m_cbc.fpp index 29c243d92..07e01d41d 100644 --- a/src/simulation/m_cbc.fpp +++ b/src/simulation/m_cbc.fpp @@ -53,6 +53,12 @@ module m_cbc real(kind(0d0)), allocatable, dimension(:, :, :, :) :: F_rsy_vf, F_src_rsy_vf !< real(kind(0d0)), allocatable, dimension(:, :, :, :) :: F_rsz_vf, F_src_rsz_vf !< + !! There is a CCE bug that is causing some subset of these variables to interfere + !! with variables of the same name in m_riemann_solvers.fpp, and giving this versions + !! unique "_l" names works around the bug. Other private module allocatable arrays + !! in `acc declare create` clauses don't have this problem, so we still need to + !! isolate this bug. + real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsx_vf_l, flux_src_rsx_vf_l !< real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsy_vf_l, flux_src_rsy_vf_l real(kind(0d0)), allocatable, dimension(:, :, :, :) :: flux_rsz_vf_l, flux_src_rsz_vf_l diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 66e0d8a06..d5f1ed0f3 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -86,7 +86,7 @@ contains integer, intent(in) :: t_step - if (parallel_io .neqv. .true.) then + if (.not. parallel_io) then call s_write_serial_data_files(q_cons_vf, q_prim_vf, t_step) else call s_write_parallel_data_files(q_cons_vf, q_prim_vf, t_step) diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index 46268fdef..6e8fbe2bf 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -94,28 +94,28 @@ module m_start_up s_perform_time_step, s_save_data, & s_save_performance_metrics - abstract interface ! =================================================== - !! @param q_cons_vf Conservative variables - subroutine s_read_abstract_data_files(q_cons_vf) - - import :: scalar_field, sys_size, pres_field - - type(scalar_field), & - dimension(sys_size), & - intent(inout) :: q_cons_vf + type(scalar_field), allocatable, dimension(:) :: grad_x_vf, grad_y_vf, grad_z_vf, norm_vf - end subroutine s_read_abstract_data_files + real(kind(0d0)) :: dt_init - end interface ! ======================================================== +contains - type(scalar_field), allocatable, dimension(:) :: grad_x_vf, grad_y_vf, grad_z_vf, norm_vf + !> Read data files. Dispatch subroutine that replaces procedure pointer. + !! @param q_cons_vf Conservative variables + subroutine s_read_data_files(q_cons_vf) - procedure(s_read_abstract_data_files), pointer :: s_read_data_files => null() + type(scalar_field), & + dimension(sys_size), & + intent(inout) :: q_cons_vf - real(kind(0d0)) :: dt_init + if (.not. parallel_io) then + call s_read_serial_data_files(q_cons_vf) + else + call s_read_parallel_data_files(q_cons_vf) + end if -contains + end subroutine s_read_data_files !> The purpose of this procedure is to first verify that an !! input file has been made available by the user. Provided @@ -1350,13 +1350,6 @@ contains call acc_present_dump() #endif - ! Associate pointers for serial or parallel I/O - if (parallel_io .neqv. .true.) then - s_read_data_files => s_read_serial_data_files - else - s_read_data_files => s_read_parallel_data_files - end if - ! Reading in the user provided initial condition and grid data call s_read_data_files(q_cons_ts(1)%vf) @@ -1490,8 +1483,6 @@ contains end subroutine s_initialize_gpu_vars subroutine s_finalize_modules - ! Disassociate pointers for serial and parallel I/O - s_read_data_files => null() call s_finalize_time_steppers_module() call s_finalize_derived_variables_module()