Skip to content
Draft
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
28 changes: 1 addition & 27 deletions src/post_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,23 +457,6 @@ contains
allocate (MPI_IO_DATA%view(1:sys_size))
allocate (MPI_IO_DATA%var(1:sys_size))
end if

do i = 1, sys_size
if (down_sample) then
allocate (MPI_IO_DATA%var(i)%sf(-1:m + 1,-1:n + 1,-1:p + 1))
else
allocate (MPI_IO_DATA%var(i)%sf(0:m,0:n,0:p))
end if
MPI_IO_DATA%var(i)%sf => null()
end do
if (qbmm .and. .not. polytropic) then
do i = sys_size + 1, sys_size + 2*nb*nnode
allocate (MPI_IO_DATA%var(i)%sf(0:m,0:n,0:p))
MPI_IO_DATA%var(i)%sf => null()
end do
end if

if (ib) allocate (MPI_IO_IB_DATA%var%sf(0:m,0:n,0:p))
#endif

! Size of the ghost zone layer is non-zero only when post-processing the raw simulation data of a parallel multidimensional
Expand Down Expand Up @@ -583,8 +566,6 @@ contains
!> Deallocation procedures for the module
impure subroutine s_finalize_global_parameters_module

integer :: i

if (bubbles_euler) then
deallocate (qbmm_idx%rs, qbmm_idx%vs, qbmm_idx%ps, qbmm_idx%ms)
if (qbmm) deallocate (qbmm_idx%moms)
Expand Down Expand Up @@ -614,14 +595,7 @@ contains
deallocate (adv)

#ifdef MFC_MPI
if (parallel_io) then
do i = 1, sys_size
MPI_IO_DATA%var(i)%sf => null()
end do

deallocate (MPI_IO_DATA%var)
deallocate (MPI_IO_DATA%view)
end if
deallocate (MPI_IO_DATA%var, MPI_IO_DATA%view)

if (ib) MPI_IO_IB_DATA%var%sf => null()
#endif
Expand Down
24 changes: 1 addition & 23 deletions src/pre_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,19 +562,6 @@ contains
allocate (MPI_IO_DATA%view(1:sys_size))
allocate (MPI_IO_DATA%var(1:sys_size))
end if

if (.not. down_sample) then
do i = 1, sys_size
allocate (MPI_IO_DATA%var(i)%sf(0:m,0:n,0:p))
MPI_IO_DATA%var(i)%sf => null()
end do
end if
if (qbmm .and. .not. polytropic) then
do i = sys_size + 1, sys_size + 2*nb*nnode
allocate (MPI_IO_DATA%var(i)%sf(0:m,0:n,0:p))
MPI_IO_DATA%var(i)%sf => null()
end do
end if
#endif

! Allocating grid variables for the x-direction
Expand Down Expand Up @@ -611,8 +598,6 @@ contains
!> Deallocate all global grid, index, and equation-of-state parameter arrays.
impure subroutine s_finalize_global_parameters_module

integer :: i

if (bubbles_euler) then
deallocate (qbmm_idx%rs, qbmm_idx%vs, qbmm_idx%ps, qbmm_idx%ms)
if (qbmm) deallocate (qbmm_idx%moms, qbmm_idx%fullmom)
Expand All @@ -632,14 +617,7 @@ contains
call s_finalize_global_parameters_common

#ifdef MFC_MPI
if (parallel_io) then
do i = 1, sys_size
MPI_IO_DATA%var(i)%sf => null()
end do

deallocate (MPI_IO_DATA%var)
deallocate (MPI_IO_DATA%view)
end if
deallocate (MPI_IO_DATA%var, MPI_IO_DATA%view)
#endif

if (allocated(neighbor_ranks)) deallocate (neighbor_ranks)
Expand Down
4 changes: 2 additions & 2 deletions src/simulation/m_cbc.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ contains
if (all((/bc_y%beg, bc_y%end/) <= -5) .and. all((/bc_y%beg, &
& bc_y%end/) >= -13) .or. bc_y%beg <= -5 .and. bc_y%beg >= -13 .or. bc_y%end <= -5 .and. bc_y%end >= -13) then
@:DEALLOCATE(fd_coef_y)
if (weno_order > 1) then
if (weno_order > 1 .or. muscl_order > 1) then
@:DEALLOCATE(pi_coef_y)
end if
end if
Expand All @@ -1414,7 +1414,7 @@ contains
if (all((/bc_z%beg, bc_z%end/) <= -5) .and. all((/bc_z%beg, &
& bc_z%end/) >= -13) .or. bc_z%beg <= -5 .and. bc_z%beg >= -13 .or. bc_z%end <= -5 .and. bc_z%end >= -13) then
@:DEALLOCATE(fd_coef_z)
if (weno_order > 1) then
if (weno_order > 1 .or. muscl_order > 1) then
@:DEALLOCATE(pi_coef_z)
end if
end if
Expand Down
3 changes: 0 additions & 3 deletions src/simulation/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,13 +886,10 @@ contains
if (dir_check .neqv. .true.) then
call s_create_directory(trim(file_loc))
end if
call s_create_directory(trim(file_loc))
end if
call s_mpi_barrier()
call s_delay_file_access(proc_rank)

call s_initialize_mpi_data(q_cons_vf, qbmm_pb=pb_ts(1), qbmm_mv=mv_ts(1))

write (file_loc, '(I0,A,i7.7,A)') t_step, '_', proc_rank, '.dat'
file_loc = trim(case_dir) // '/restart_data/lustre_' // trim(t_step_string) // trim(mpiiofs) // trim(file_loc)
inquire (FILE=trim(file_loc), EXIST=file_exist)
Expand Down
45 changes: 5 additions & 40 deletions src/simulation/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,24 +900,6 @@ contains
allocate (MPI_IO_DATA%var(1:sys_size))
end if

if (.not. down_sample) then
do i = 1, sys_size
allocate (MPI_IO_DATA%var(i)%sf(0:m,0:n,0:p))
MPI_IO_DATA%var(i)%sf => null()
end do
end if
if (bubbles_euler .and. qbmm .and. .not. polytropic) then
do i = sys_size + 1, sys_size + 2*nb*nnode
allocate (MPI_IO_DATA%var(i)%sf(0:m,0:n,0:p))
MPI_IO_DATA%var(i)%sf => null()
end do
else if (bubbles_lagrange) then
do i = 1, sys_size + 1
allocate (MPI_IO_DATA%var(i)%sf(0:m,0:n,0:p))
MPI_IO_DATA%var(i)%sf => null()
end do
end if

! Configure WENO averaging flag (arithmetic mean vs. unaltered values)
wa_flg = 0._wp; if (weno_avg) wa_flg = 1._wp
$:GPU_UPDATE(device='[wa_flg]')
Expand All @@ -927,8 +909,6 @@ contains
wenojs = .not. (mapped_weno .or. wenoz .or. teno)
#:endif

if (ib) allocate (MPI_IO_IB_DATA%var%sf(0:m,0:n,0:p))

if (hypoelasticity .or. mhd .or. probe_wrt .or. ib .or. bubbles_lagrange) then
fd_number = max(1, fd_order/2)
end if
Expand Down Expand Up @@ -1069,8 +1049,6 @@ contains
!> Module deallocation and/or disassociation procedures
impure subroutine s_finalize_global_parameters_module

integer :: i

! Deallocating the variables bookkeeping the indexes of any viscous fluids and any pairs of fluids whose interfaces
! supported effects of surface tension

Expand All @@ -1097,23 +1075,14 @@ contains
! Shared: deallocate proc_coords and start_idx
call s_finalize_global_parameters_common

if (parallel_io) then
if (bubbles_lagrange) then
do i = 1, sys_size + 1
MPI_IO_DATA%var(i)%sf => null()
end do
else
do i = 1, sys_size
MPI_IO_DATA%var(i)%sf => null()
end do
end if

deallocate (MPI_IO_DATA%var)
deallocate (MPI_IO_DATA%view)
end if
deallocate (MPI_IO_DATA%var, MPI_IO_DATA%view)

if (ib) MPI_IO_IB_DATA%var%sf => null()

if (allocated(neighbor_ranks)) then
@:DEALLOCATE(neighbor_ranks)
end if

! Deallocating grid variables for the x-, y- and z-directions
@:DEALLOCATE(x_cb, x_cc, dx)

Expand All @@ -1123,10 +1092,6 @@ contains
if (p == 0) return
@:DEALLOCATE(z_cb, z_cc, dz)

if (allocated(neighbor_ranks)) then
@:DEALLOCATE(neighbor_ranks)
end if

end subroutine s_finalize_global_parameters_module

end module m_global_parameters
2 changes: 1 addition & 1 deletion src/simulation/m_surface_tension.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ contains

integer :: j

do j = 1, num_dims
do j = 1, num_dims + 1
@:DEALLOCATE(c_divs(j)%sf)
end do

Expand Down
Loading