Skip to content

Commit ab00a28

Browse files
committed
fix: remove unused module-level and local variables in simulation
Remove dead CCFL variables from m_data_output.fpp (ccfl_sf, ccfl_max_loc, ccfl_max_glb, ccfl_max). Remove dead gradient magnitude variables from m_rhs.fpp (gm_alpha_qp, gm_alphaL_n, gm_alphaR_n, nbub) including their GPU_DECLARE and ALLOCATE. Remove 13 unused module-level variables from m_ib_patches.fpp and 7 unused local variables from its subroutines. Remove unused idist/odist from m_fftw.fpp and dest from m_time_steppers.fpp.
1 parent 8f98be8 commit ab00a28

5 files changed

Lines changed: 11 additions & 61 deletions

File tree

src/simulation/m_data_output.fpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,20 @@ module m_data_output
3232
integer :: ib_state_unit = -1 !< I/O unit for IB state binary file
3333
real(wp), allocatable, dimension(:,:,:) :: icfl_sf !< ICFL stability criterion
3434
real(wp), allocatable, dimension(:,:,:) :: vcfl_sf !< VCFL stability criterion
35-
real(wp), allocatable, dimension(:,:,:) :: ccfl_sf !< CCFL stability criterion
3635
real(wp), allocatable, dimension(:,:,:) :: Rc_sf !< Rc stability criterion
3736
real(wp), public, allocatable, dimension(:,:) :: c_mass
38-
$:GPU_DECLARE(create='[icfl_sf, vcfl_sf, ccfl_sf, Rc_sf, c_mass]')
37+
$:GPU_DECLARE(create='[icfl_sf, vcfl_sf, Rc_sf, c_mass]')
3938

4039
real(wp) :: icfl_max_loc, icfl_max_glb !< ICFL stability extrema on local and global grids
4140
real(wp) :: vcfl_max_loc, vcfl_max_glb !< VCFL stability extrema on local and global grids
42-
real(wp) :: ccfl_max_loc, ccfl_max_glb !< CCFL stability extrema on local and global grids
4341
real(wp) :: Rc_min_loc, Rc_min_glb !< Rc stability extrema on local and global grids
4442
$:GPU_DECLARE(create='[icfl_max_loc, icfl_max_glb, vcfl_max_loc, vcfl_max_glb]')
45-
$:GPU_DECLARE(create='[ccfl_max_loc, ccfl_max_glb, Rc_min_loc, Rc_min_glb]')
43+
$:GPU_DECLARE(create='[Rc_min_loc, Rc_min_glb]')
4644

47-
!> @name ICFL, VCFL, CCFL and Rc stability criteria extrema over all the time-steps
45+
!> @name ICFL, VCFL, and Rc stability criteria extrema over all the time-steps
4846
!> @{
4947
real(wp) :: icfl_max !< ICFL criterion maximum
5048
real(wp) :: vcfl_max !< VCFL criterion maximum
51-
real(wp) :: ccfl_max !< CCFL criterion maximum
5249
real(wp) :: Rc_min !< Rc criterion maximum
5350
!> @}
5451

src/simulation/m_fftw.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module m_fftw
5353
!> @endcond
5454

5555
integer, allocatable :: gpu_fft_size(:), iembed(:), oembed(:)
56-
integer :: istride, ostride, idist, odist, rank
56+
integer :: istride, ostride, rank
5757
#endif
5858

5959
contains

src/simulation/m_ib_patches.fpp

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,11 @@ module m_ib_patches
2424
private; public :: s_apply_ib_patches, s_update_ib_rotation_matrix, f_convert_cyl_to_cart, s_instantiate_STL_models, &
2525
& s_decode_patch_periodicity
2626

27-
real(wp) :: x_centroid, y_centroid, z_centroid
28-
real(wp) :: length_x, length_y, length_z
29-
$:GPU_DECLARE(create='[x_centroid, y_centroid, z_centroid]')
30-
$:GPU_DECLARE(create='[length_x, length_y, length_z]')
31-
32-
integer :: smooth_patch_id
33-
real(wp) :: smooth_coeff
34-
$:GPU_DECLARE(create='[smooth_patch_id, smooth_coeff]')
35-
! These variables are analogous in both meaning and use to the similarly named components in the ic_patch_parameters type (see
36-
! m_derived_types.f90 for additional details). They are employed as a means to more concisely perform the actions necessary to
37-
! lay out a particular patch on the grid.
38-
39-
real(wp) :: cart_x, cart_y, cart_z
27+
real(wp) :: cart_y, cart_z
4028
real(wp) :: sph_phi
41-
$:GPU_DECLARE(create='[cart_x, cart_y, cart_z, sph_phi]')
29+
$:GPU_DECLARE(create='[cart_y, cart_z, sph_phi]')
4230
! Variables to be used to hold cell locations in Cartesian coordinates if 3D simulation is using cylindrical coordinates
4331

44-
type(bounds_info) :: x_boundary, y_boundary, z_boundary
45-
$:GPU_DECLARE(create='[x_boundary, y_boundary, z_boundary]')
46-
! These variables combine the centroid and length parameters associated with a particular patch to yield the locations of the
47-
! patch boundaries in the x-, y- and z-coordinate directions. They are used as a means to concisely perform the actions
48-
! necessary to lay out a particular patch on the grid.
49-
50-
character(len=5) :: istr !< string to store int to string result for error checking
51-
5232
contains
5333

5434
!> Apply all immersed boundary patch geometries to mark interior cells in the IB marker array
@@ -773,15 +753,15 @@ contains
773753

774754
integer, intent(in) :: patch_id
775755
type(integer_field), intent(inout) :: ib_markers
776-
integer, intent(in) :: xp, yp !< integers containing the periodicity projection information
777-
integer :: i, j, k, il, ir, jl, jr !< Generic loop iterators
756+
integer, intent(in) :: xp, yp !< integers containing the periodicity projection information
757+
integer :: i, j, il, ir, jl, jr !< Generic loop iterators
778758
integer :: spc, encoded_patch_id
779759
integer :: cx, cy
780760
real(wp) :: lx(2), ly(2)
781761
real(wp), dimension(1:2) :: bbox_min, bbox_max
782762
real(wp), dimension(1:3) :: local_corner, world_corner
783763
real(wp) :: eta, threshold
784-
real(wp), dimension(1:3) :: point, local_point, offset
764+
real(wp), dimension(1:3) :: offset
785765
real(wp), dimension(1:3) :: center, xy_local
786766
real(wp), dimension(1:3,1:3) :: inverse_rotation, rotation
787767

@@ -853,8 +833,8 @@ contains
853833
integer, intent(in) :: xp, yp, zp !< integers containing the periodicity projection information
854834
integer :: i, j, k, il, ir, jl, jr, kl, kr !< Generic loop iterators
855835
integer :: spc, encoded_patch_id
856-
real(wp) :: eta, threshold, corner_distance
857-
real(wp), dimension(1:3) :: point, local_point, offset
836+
real(wp) :: eta, threshold
837+
real(wp), dimension(1:3) :: offset
858838
real(wp), dimension(1:3) :: center, xyz_local
859839
real(wp), dimension(1:3,1:3) :: inverse_rotation, rotation
860840
integer :: cx, cy, cz
@@ -936,7 +916,6 @@ contains
936916
subroutine s_update_ib_rotation_matrix(patch_id)
937917

938918
integer, intent(in) :: patch_id
939-
integer :: i
940919
real(wp), dimension(3, 3, 3) :: rotation
941920
real(wp) :: angle
942921

src/simulation/m_rhs.fpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,6 @@ module m_rhs
6767
type(scalar_field), allocatable, dimension(:) :: tau_Re_vf
6868
$:GPU_DECLARE(create='[tau_Re_vf]')
6969

70-
type(vector_field) :: gm_alpha_qp !< Volume fraction gradient magnitudes at cell-interior quadrature points
71-
$:GPU_DECLARE(create='[gm_alpha_qp]')
72-
73-
!> @name The left and right WENO-reconstructed cell-boundary values of the cell- average gradient magnitude of volume fractions,
74-
!! located in gm_alpha_qp.
75-
!> @{
76-
type(vector_field), allocatable, dimension(:) :: gm_alphaL_n
77-
type(vector_field), allocatable, dimension(:) :: gm_alphaR_n
78-
#if defined(MFC_OpenACC)
79-
$:GPU_DECLARE(create='[gm_alphaL_n, gm_alphaR_n]')
80-
#endif
81-
!> @}
82-
8370
!> @name The cell-boundary values of the fluxes (src - source, gsrc - geometrical source). These are computed by applying the
8471
!! chosen Riemann problem solver .on the left and right cell-boundary values of the primitive variables
8572
!> @{
@@ -122,9 +109,6 @@ module m_rhs
122109
$:GPU_DECLARE(create='[qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, qR_rsx_vf, qR_rsy_vf, qR_rsz_vf]')
123110
$:GPU_DECLARE(create='[dqL_rsx_vf, dqL_rsy_vf, dqL_rsz_vf, dqR_rsx_vf, dqR_rsy_vf, dqR_rsz_vf]')
124111

125-
real(wp), allocatable, dimension(:,:,:) :: nbub !< Bubble number density
126-
$:GPU_DECLARE(create='[nbub]')
127-
128112
contains
129113

130114
!> Initialize the RHS module
@@ -513,22 +497,13 @@ contains
513497
if (mpp_lim .and. bubbles_euler) then
514498
@:ALLOCATE(alf_sum%sf(idwbuff(1)%beg:idwbuff(1)%end, idwbuff(2)%beg:idwbuff(2)%end, idwbuff(3)%beg:idwbuff(3)%end))
515499
end if
516-
if (.not. igr) then
517-
@:ALLOCATE(gm_alphaL_n(1:num_dims))
518-
@:ALLOCATE(gm_alphaR_n(1:num_dims))
519-
end if
520-
521500
if (alt_soundspeed) then
522501
@:ALLOCATE(blkmod1(0:m, 0:n, 0:p), blkmod2(0:m, 0:n, 0:p), alpha1(0:m, 0:n, 0:p), alpha2(0:m, 0:n, 0:p), Kterm(0:m, &
523502
& 0:n, 0:p))
524503
end if
525504

526505
call s_initialize_pressure_relaxation_module
527506

528-
if (bubbles_euler) then
529-
@:ALLOCATE(nbub(0:m, 0:n, 0:p))
530-
end if
531-
532507
end subroutine s_initialize_rhs_module
533508

534509
!> Compute the right-hand side of the semi-discrete governing equations for a single time stage

src/simulation/m_time_steppers.fpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ contains
463463
integer, intent(in) :: nstage
464464
integer :: i, j, k, l, q, s !< Generic loop iterator
465465
real(wp) :: start, finish
466-
integer :: dest
467466

468467
call cpu_time(start)
469468
call nvtxStartRange("TIMESTEP")

0 commit comments

Comments
 (0)