Skip to content

Commit

Permalink
Remove [[some!]] unused variables (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbryngelson authored Nov 8, 2024
1 parent 73782f5 commit 8775a61
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 138 deletions.
2 changes: 0 additions & 2 deletions src/common/m_phase_change.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ contains
real(kind(0.0d0)), intent(in) :: rhoe
real(kind(0.0d0)), intent(out) :: TS

integer, dimension(num_fluids) :: ig !< flags to toggle the inclusion of fluids for the pT-equilibrium
real(kind(0.0d0)), dimension(num_fluids) :: pk !< individual initial pressures
real(kind(0.0d0)) :: gp, gpp, hp, pO, mCP, mQ !< variables for the Newton Solver

integer :: i, ns !< generic loop iterators
Expand Down
14 changes: 3 additions & 11 deletions src/simulation/m_bubbles.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ contains

subroutine s_initialize_bubbles_module

integer :: i, j, k, l, q
integer :: l

@:ALLOCATE_GLOBAL(rs(1:nb))
@:ALLOCATE_GLOBAL(vs(1:nb))
Expand Down Expand Up @@ -119,7 +119,7 @@ contains
integer, intent(in) :: idir
type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf

integer :: i, j, k, l, q
integer :: j, k, l

if (idir == 1) then

Expand Down Expand Up @@ -183,18 +183,11 @@ contains
real(kind(0d0)) :: rddot
real(kind(0d0)) :: pb, mv, vflux, pbdot
real(kind(0d0)) :: n_tait, B_tait

real(kind(0d0)), dimension(nb) :: Rtmp, Vtmp
real(kind(0d0)) :: myR, myV, alf, myP, myRho, R2Vav, R3
real(kind(0d0)), dimension(num_fluids) :: myalpha, myalpha_rho
real(kind(0d0)) :: start, finish

real(kind(0d0)) :: nbub !< Bubble number density

real(kind(0d0)), dimension(2) :: Re !< Reynolds number

integer :: i, j, k, l, q, ii !< Loop variables
integer :: ndirs !< Number of coordinate directions

real(kind(0d0)) :: err1, err2, err3, err4, err5 !< Error estimates for adaptive time stepping
real(kind(0d0)) :: t_new !< Updated time step size
Expand Down Expand Up @@ -452,7 +445,7 @@ contains
real(kind(0d0)), intent(IN) :: fntait, fBtait, f_bub_adv_src, f_divu
real(kind(0d0)), intent(out) :: h

real(kind(0d0)) :: h0, h1, h_min !< Time step size
real(kind(0d0)) :: h0, h1 !< Time step size
real(kind(0d0)) :: d0, d1, d2 !< norms
real(kind(0d0)), dimension(2) :: myR_tmp, myV_tmp, myA_tmp !< Bubble radius, radial velocity, and radial acceleration

Expand Down Expand Up @@ -912,7 +905,6 @@ contains

real(kind(0.d0)) :: T_bar
real(kind(0.d0)) :: grad_T
real(kind(0.d0)) :: tmp1, tmp2
real(kind(0.d0)) :: f_bpres_dot

if (thermal == 3) then
Expand Down
11 changes: 0 additions & 11 deletions src/simulation/m_chemistry.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ contains

type(vector_field), dimension(:), intent(IN) :: flux_n
type(scalar_field), dimension(sys_size), intent(INOUT) :: rhs_vf
type(int_bounds_info) :: ix, iy, iz

integer :: x, y, z
integer :: eqn

Expand Down Expand Up @@ -103,21 +101,12 @@ contains
subroutine s_compute_chemistry_reaction_flux(rhs_vf, q_cons_qp, q_prim_qp)

type(scalar_field), dimension(sys_size), intent(INOUT) :: rhs_vf, q_cons_qp, q_prim_qp

integer :: i

integer :: x, y, z
integer :: eqn

real(kind(0d0)) :: T
integer :: o
real(kind(0d0)) :: dyn_pres
real(kind(0d0)) :: E

real(kind(0d0)) :: rho, omega_m
real(kind(0d0)), dimension(num_species) :: Ys
real(kind(0d0)), dimension(num_species) :: omega
real(kind(0d0)) :: cp_mix

if (chemistry) then
!$acc parallel loop collapse(3) gang vector default(present) &
Expand Down
43 changes: 5 additions & 38 deletions src/simulation/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,42 +224,24 @@ contains
type(scalar_field), dimension(sys_size), intent(IN) :: q_prim_vf
integer, intent(IN) :: t_step

real(kind(0d0)), dimension(num_fluids) :: alpha_rho !< Cell-avg. partial density
real(kind(0d0)) :: rho !< Cell-avg. density
real(kind(0d0)), dimension(num_dims) :: vel !< Cell-avg. velocity
real(kind(0d0)) :: vel_sum !< Cell-avg. velocity sum
real(kind(0d0)) :: pres !< Cell-avg. pressure
real(kind(0d0)), dimension(num_fluids) :: alpha !< Cell-avg. volume fraction
real(kind(0d0)) :: gamma !< Cell-avg. sp. heat ratio
real(kind(0d0)) :: pi_inf !< Cell-avg. liquid stiffness function
real(kind(0d0)) :: qv !< Cell-avg. fluid reference energy
real(kind(0d0)) :: c !< Cell-avg. sound speed
real(kind(0d0)) :: E !< Cell-avg. energy
real(kind(0d0)) :: H !< Cell-avg. enthalpy
real(kind(0d0)), dimension(2) :: Re !< Cell-avg. Reynolds numbers

! ICFL, VCFL, CCFL and Rc stability criteria extrema for the current
! time-step and located on both the local (loc) and the global (glb)
! computational domains

real(kind(0d0)) :: blkmod1, blkmod2 !<
!! Fluid bulk modulus for Woods mixture sound speed

integer :: i, j, k, l, q !< Generic loop iterators

integer :: Nfq
real(kind(0d0)) :: fltr_dtheta !<
!! Modified dtheta accounting for Fourier filtering in azimuthal direction.
integer :: j, k, l

! Computing Stability Criteria at Current Time-step ================
!$acc parallel loop collapse(3) gang vector default(present) private(alpha_rho, vel, alpha, Re, fltr_dtheta, Nfq)
!$acc parallel loop collapse(3) gang vector default(present) private(vel, alpha, Re)
do l = 0, p
do k = 0, n
do j = 0, m

call s_compute_enthalpy(q_prim_vf, pres, rho, gamma, pi_inf, Re, H, alpha, vel, vel_sum, j, k, l)

! Compute mixture sound speed
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, alpha, vel_sum, 0d0, c)

if (viscous) then
Expand Down Expand Up @@ -380,14 +362,9 @@ contains

character(LEN=15) :: FMT

integer :: i, j, k, l, ii, r!< Generic loop iterators
integer :: i, j, k, l, r

real(kind(0d0)), dimension(nb) :: nRtmp !< Temporary bubble concentration
real(kind(0d0)) :: nbub, nR3, vftmp !< Temporary bubble number density
real(kind(0d0)) :: gamma, lit_gamma, pi_inf, qv !< Temporary EOS params
real(kind(0d0)) :: rho !< Temporary density
real(kind(0d0)), dimension(2) :: Re !< Temporary Reynolds number
real(kind(0d0)) :: E_e !< Temp. elastic energy contribution

! Creating or overwriting the time-step root directory
write (t_step_dir, '(A,I0,A,I0)') trim(case_dir)//'/p_all'
Expand Down Expand Up @@ -950,21 +927,17 @@ contains
real(kind(0d0)) :: int_pres
real(kind(0d0)) :: max_pres
real(kind(0d0)), dimension(2) :: Re
real(kind(0d0)) :: E_e
real(kind(0d0)), dimension(6) :: tau_e
real(kind(0d0)) :: G
real(kind(0d0)) :: dyn_p, Temp

integer :: i, j, k, l, s, q, d !< Generic loop iterator
integer :: i, j, k, l, s, d !< Generic loop iterator

real(kind(0d0)) :: nondim_time !< Non-dimensional time

real(kind(0d0)) :: tmp !<
!! Temporary variable to store quantity for mpi_allreduce

real(kind(0d0)) :: blkmod1, blkmod2 !<
!! Fluid bulk modulus for Woods mixture sound speed

integer :: npts !< Number of included integral points
real(kind(0d0)) :: rad, thickness !< For integral quantities
logical :: trigger !< For integral quantities
Expand All @@ -978,7 +951,7 @@ contains
if (t_step_old /= dflt_int) then
nondim_time = real(t_step + t_step_old, kind(0d0))*dt
else
nondim_time = real(t_step, kind(0d0))*dt !*1.d-5/10.0761131451d0
nondim_time = real(t_step, kind(0d0))*dt
end if
end if

Expand Down Expand Up @@ -1603,10 +1576,6 @@ contains
!! other procedures that are necessary to setup the module.
subroutine s_initialize_data_output_module

type(int_bounds_info) :: ix, iy, iz

integer :: i !< Generic loop iterator

! Allocating/initializing ICFL, VCFL, CCFL and Rc stability criteria
@:ALLOCATE_GLOBAL(icfl_sf(0:m, 0:n, 0:p))
icfl_max = 0d0
Expand Down Expand Up @@ -1644,8 +1613,6 @@ contains
!> Module deallocation and/or disassociation procedures
subroutine s_finalize_data_output_module

integer :: i !< Generic loop iterator

! Deallocating the ICFL, VCFL, CCFL, and Rc stability criteria
@:DEALLOCATE_GLOBAL(icfl_sf)
if (viscous) then
Expand Down
3 changes: 0 additions & 3 deletions src/simulation/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,8 @@ contains
logical :: beg_end_geq_0
integer :: pack_offsets(1:3), unpack_offsets(1:3)
integer :: pack_offset, unpack_offset
real(kind(0d0)), pointer :: p_send, p_recv
integer, pointer, dimension(:) :: p_i_send, p_i_recv
#ifdef MFC_MPI
Expand Down Expand Up @@ -2136,7 +2134,6 @@ contains
logical :: beg_end_geq_0
integer :: pack_offsets(1:3), unpack_offsets(1:3)
integer :: pack_offset, unpack_offset
real(kind(0d0)), pointer :: p_send, p_recv
Expand Down
13 changes: 6 additions & 7 deletions src/simulation/m_qbmm.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ contains
real(kind(0.d0)), intent(in) :: pres, rho, c
real(kind(0.d0)), dimension(nterms, 0:2, 0:2), intent(out) :: coeffs

integer :: i1, i2, q
integer :: i1, i2

coeffs = 0d0

Expand Down Expand Up @@ -776,7 +776,7 @@ contains
real(kind(0.d0)), intent(inout) :: pres, rho, c
real(kind(0.d0)), dimension(nterms, 0:2, 0:2), intent(out) :: coeffs

integer :: i1, i2, q
integer :: i1, i2

coeffs = 0d0

Expand Down Expand Up @@ -841,20 +841,19 @@ contains

real(kind(0d0)), dimension(nmom) :: moms, msum
real(kind(0d0)), dimension(nnode, nb) :: wght, abscX, abscY, wght_pb, wght_mv, wght_ht, ht
real(kind(0d0)), dimension(nterms, 0:2, 0:2) :: mom3d_terms, coeff
real(kind(0d0)) :: pres, rho, nbub, c, alf, R3, momsum, drdt, drdt2, chi_vw, x_vw, rho_mw, k_mw, T_bar, grad_T
real(kind(0d0)) :: start, finish
real(kind(0d0)), dimension(nterms, 0:2, 0:2) :: coeff
real(kind(0d0)) :: pres, rho, nbub, c, alf, momsum, drdt, drdt2, chi_vw, x_vw, rho_mw, k_mw, T_bar, grad_T
real(kind(0d0)) :: n_tait, B_tait

integer :: j, k, l, q, r, s !< Loop variables
integer :: id1, id2, id3
integer :: i1, i2
integer :: j, q, r

is1_qbmm = ix; is2_qbmm = iy; is3_qbmm = iz

!$acc update device(is1_qbmm, is2_qbmm, is3_qbmm)

!$acc parallel loop collapse(3) gang vector default(present) private(moms, msum, wght, abscX, abscY, wght_pb, wght_mv, wght_ht, coeff, ht, r, q, n_tait, B_tait, pres, rho, nbub, c, alf, R3, momsum, drdt, drdt2, chi_vw, x_vw, rho_mw, k_mw, T_bar, grad_T)
!$acc parallel loop collapse(3) gang vector default(present) private(moms, msum, wght, abscX, abscY, wght_pb, wght_mv, wght_ht, coeff, ht, r, q, n_tait, B_tait, pres, rho, nbub, c, alf, momsum, drdt, drdt2, chi_vw, x_vw, rho_mw, k_mw, T_bar, grad_T)
do id3 = is3_qbmm%beg, is3_qbmm%end
do id2 = is2_qbmm%beg, is2_qbmm%end
do id1 = is1_qbmm%beg, is1_qbmm%end
Expand Down
30 changes: 4 additions & 26 deletions src/simulation/m_rhs.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,30 +699,9 @@ contains
integer, intent(in) :: t_step
real(kind(0d0)), intent(inout) :: time_avg

real(kind(0d0)) :: t_start, t_finish
real(kind(0d0)) :: gp_sum

real(kind(0d0)) :: top, bottom !< Numerator and denominator when evaluating flux limiter function
real(kind(0d0)), dimension(num_fluids) :: myalpha_rho, myalpha

real(kind(0d0)) :: tmp1, tmp2, tmp3, tmp4, &
c_gas, c_liquid, &
Cpbw, Cpinf, Cpinf_dot, &
myH, myHdot, rddot, alf_gas

real(kind(0d0)) :: n_tait, B_tait, angle, angle_z

real(kind(0d0)), dimension(nb) :: Rtmp, Vtmp
real(kind(0d0)) :: myR, myV, alf, myP, myRho, R2Vav
real(kind(0d0)), dimension(0:m, 0:n, 0:p) :: nbub
integer :: ndirs

real(kind(0d0)) :: sound
real(kind(0d0)) :: start, finish
real(kind(0d0)) :: s2, const_sos, s1

integer :: i, c, j, k, l, q, ii, id !< Generic loop iterators
integer :: term_index
real(kind(0d0)) :: t_start, t_finish
integer :: i, j, k, l, id !< Generic loop iterators

call nvtxStartRange("Compute_RHS")

Expand Down Expand Up @@ -1593,7 +1572,7 @@ contains
type(scalar_field), dimension(sys_size), intent(in) :: flux_src_n
type(scalar_field), dimension(sys_size), intent(in) :: dq_prim_dx_vf, dq_prim_dy_vf, dq_prim_dz_vf

integer :: i, j, k, l, q
integer :: i, j, k, l

if (idir == 1) then ! x-direction

Expand Down Expand Up @@ -2089,7 +2068,6 @@ contains

integer :: weno_dir !< Coordinate direction of the WENO reconstruction

integer :: i, j, k, l
! Reconstruction in s1-direction ===================================

if (norm_dir == 1) then
Expand Down Expand Up @@ -2213,7 +2191,7 @@ contains
!> Module deallocation and/or disassociation procedures
subroutine s_finalize_rhs_module

integer :: i, j, k, l !< Generic loop iterators
integer :: i, j, l

do j = cont_idx%beg, cont_idx%end
!$acc exit data detach(q_prim_qp%vf(j)%sf)
Expand Down
Loading

0 comments on commit 8775a61

Please sign in to comment.