Skip to content

Commit 3c80270

Browse files
XZTian64Xuzheng Tiansbryngelson
authored
Check and Fix Warnings during Compiling (#843)
Co-authored-by: Xuzheng Tian <xtian64@login-phoenix-rh9-3.pace.gatech.edu> Co-authored-by: Spencer Bryngelson <sbryngelson@gmail.com>
1 parent 8a24386 commit 3c80270

25 files changed

+65
-119
lines changed

src/common/m_boundary_common.fpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ contains
7777
real(wp), dimension(idwbuff(1)%beg:, idwbuff(2)%beg:, idwbuff(3)%beg:, 1:, 1:), intent(inout) :: pb, mv
7878
type(integer_field), dimension(1:num_dims, -1:1), intent(in) :: bc_type
7979

80-
integer :: bc_loc, bc_dir
8180
integer :: k, l
8281

8382
! Population of Buffers in x-direction
@@ -249,7 +248,7 @@ contains
249248
integer, intent(in) :: bc_dir, bc_loc
250249
integer, intent(in) :: k, l
251250

252-
integer :: j, q, i
251+
integer :: j, i
253252

254253
if (qbmm .and. .not. polytropic) then
255254
call s_qbmm_extrapolation(pb, mv, bc_dir, bc_loc, k, l)
@@ -789,7 +788,7 @@ contains
789788
integer, intent(in) :: bc_dir, bc_loc
790789
integer, intent(in) :: k, l
791790

792-
integer :: j, q, i
791+
integer :: j, i
793792

794793
if (qbmm .and. .not. polytropic) then
795794
call s_qbmm_extrapolation(pb, mv, bc_dir, bc_loc, k, l)
@@ -888,7 +887,7 @@ contains
888887
integer, intent(in) :: bc_dir, bc_loc
889888
integer, intent(in) :: k, l
890889

891-
integer :: j, q, i
890+
integer :: j, i
892891

893892
if (qbmm .and. .not. polytropic) then
894893
call s_qbmm_extrapolation(pb, mv, bc_dir, bc_loc, k, l)
@@ -1023,7 +1022,7 @@ contains
10231022
integer, intent(in) :: bc_dir, bc_loc
10241023
integer, intent(in) :: k, l
10251024

1026-
integer :: j, i, q
1025+
integer :: j, i
10271026

10281027
#ifdef MFC_PRE_PROCESS
10291028
call s_ghost_cell_extrapolation(q_prim_vf, pb, mv, 1, -1, k, l)
@@ -1162,7 +1161,7 @@ contains
11621161
type(scalar_field), dimension(num_dims + 1), intent(inout) :: c_divs
11631162
type(integer_field), dimension(1:num_dims, -1:1), intent(in) :: bc_type
11641163

1165-
integer :: i, j, k, l
1164+
integer :: k, l
11661165

11671166
!< x-direction
11681167
if (bcxb >= 0) then
@@ -1290,7 +1289,7 @@ contains
12901289
integer, intent(in) :: bc_dir, bc_loc
12911290
integer, intent(in) :: k, l
12921291

1293-
integer :: j, i, q
1292+
integer :: j, i
12941293

12951294
if (bc_dir == 1) then !< x-direction
12961295
if (bc_loc == -1) then !bc_x%beg
@@ -1348,7 +1347,7 @@ contains
13481347
integer, intent(in) :: bc_dir, bc_loc
13491348
integer, intent(in) :: k, l
13501349

1351-
integer :: j, i, q
1350+
integer :: j, i
13521351

13531352
if (bc_dir == 1) then !< x-direction
13541353
if (bc_loc == -1) then !bc_x%beg
@@ -1430,7 +1429,7 @@ contains
14301429
integer, intent(in) :: bc_dir, bc_loc
14311430
integer, intent(in) :: k, l
14321431

1433-
integer :: j, i, q
1432+
integer :: j, i
14341433

14351434
if (bc_dir == 1) then !< x-direction
14361435
if (bc_loc == -1) then !bc_x%beg
@@ -1485,7 +1484,7 @@ contains
14851484
#ifdef MFC_MPI
14861485
integer :: dir, loc
14871486
integer, dimension(3) :: sf_start_idx, sf_extents_loc
1488-
integer :: ifile, ierr, data_size
1487+
integer :: ierr
14891488

14901489
do dir = 1, num_dims
14911490
do loc = -1, 1, 2

src/common/m_chemistry.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ contains
2828
type(int_bounds_info), dimension(1:3), intent(in) :: bounds
2929

3030
integer :: x, y, z, eqn
31-
real(wp) :: energy, mean_molecular_weight
31+
real(wp) :: energy
3232
real(wp), dimension(num_species) :: Ys
3333

3434
do z = bounds(3)%beg, bounds(3)%end

src/common/m_eigen_solver.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ subroutine corth(nm, nl, low, igh, ar, ai, ortr, orti)
225225
real(wp), dimension(igh), intent(out) :: ortr, orti
226226

227227
integer :: i, j, ml, ii, jj, la, mp, kp1, mll
228-
real(wp) :: f, g, h, fi, fr, scale, c
228+
real(wp) :: f, g, h, fi, fr, scale
229229

230230
mll = 6
231231

@@ -353,7 +353,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr)
353353

354354
integer :: i, j, k, l, ml, en, ii, jj, ll, nn, ip1, itn, its, lp1, enm1, iend
355355
real(wp) :: si, sr, ti, tr, xi, xr, xxi, xxr, yi, yr, zzi, zzr, &
356-
norm, tst1, tst2, c, d
356+
norm, tst1, tst2, c
357357
!
358358
ierr = 0
359359
! initialize eigenvector matrix

src/common/m_helper.fpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,6 @@ contains
395395
396396
integer :: i
397397
398-
real(wp), dimension(1:4) :: tmp
399-
400398
do i = 1, 3
401399
call s_transform_vec(triangle%v(i, :), matrix)
402400
end do

src/common/m_mpi_common.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ contains
160160
#ifdef MFC_MPI
161161
162162
! Generic loop iterator
163-
integer :: i, j, q, k, l
163+
integer :: i, j
164164
165165
!Altered system size for the lagrangian subgrid bubble model
166166
integer :: alt_sys
@@ -309,7 +309,7 @@ contains
309309
integer, intent(in) :: root ! Rank of the root process
310310
real(wp), allocatable, intent(out) :: gathered_vector(:) ! Gathered vector on the root process
311311
312-
integer :: i, offset, ierr
312+
integer :: i, ierr
313313
integer, allocatable :: recounts(:), displs(:)
314314
315315
#ifdef MFC_MPI
@@ -1076,7 +1076,7 @@ contains
10761076
type(scalar_field), dimension(num_dims + 1), intent(inout) :: c_divs_vf
10771077
integer, intent(in) :: mpi_dir, pbc_loc
10781078
1079-
integer :: i, j, k, l, r, q !< Generic loop iterators
1079+
integer :: i, j, k, l, r !< Generic loop iterators
10801080
10811081
integer :: buffer_counts(1:3), buffer_count
10821082

src/common/m_variables_conversion.fpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -846,15 +846,15 @@ contains
846846

847847
real(wp) :: rhoYks(1:num_species)
848848

849-
real(wp) :: vftmp, nR3, nbub_sc, R3tmp
849+
real(wp) :: vftmp, nbub_sc
850850

851851
real(wp) :: G_K
852852

853-
real(wp) :: pres, Yksum
853+
real(wp) :: pres
854854

855-
integer :: i, j, k, l, q !< Generic loop iterators
855+
integer :: i, j, k, l !< Generic loop iterators
856856

857-
real(wp) :: ntmp, T
857+
real(wp) :: T
858858
real(wp) :: pres_mag
859859

860860
real(wp) :: Ga ! Lorentz factor (gamma in relativity)
@@ -885,7 +885,7 @@ contains
885885

886886
!$acc parallel loop collapse(3) gang vector default(present) &
887887
!$acc private(alpha_K, alpha_rho_K, Re_K, nRtmp, rho_K, gamma_K, &
888-
!$acc pi_inf_K, qv_K, dyn_pres_K, R3tmp, rhoYks, B)
888+
!$acc pi_inf_K, qv_K, dyn_pres_K, rhoYks, B)
889889
do l = ibounds(3)%beg, ibounds(3)%end
890890
do k = ibounds(2)%beg, ibounds(2)%end
891891
do j = ibounds(1)%beg, ibounds(1)%end
@@ -1181,13 +1181,12 @@ contains
11811181
real(wp) :: pi_inf
11821182
real(wp) :: qv
11831183
real(wp) :: dyn_pres
1184-
real(wp) :: nbub, R3, vftmp, R3tmp
1184+
real(wp) :: nbub, R3tmp
11851185
real(wp), dimension(nb) :: Rtmp
11861186
real(wp) :: G
11871187
real(wp), dimension(2) :: Re_K
11881188

1189-
integer :: i, j, k, l, q !< Generic loop iterators
1190-
integer :: spec
1189+
integer :: i, j, k, l !< Generic loop iterators
11911190

11921191
real(wp), dimension(num_species) :: Ys
11931192
real(wp) :: e_mix, mix_mol_weight, T
@@ -1592,8 +1591,6 @@ contains
15921591

15931592
subroutine s_finalize_variables_conversion_module()
15941593

1595-
integer :: i !< Generic loop iterators
1596-
15971594
! Deallocating the density, the specific heat ratio function and the
15981595
! liquid stiffness function
15991596
#ifdef MFC_POST_PROCESS
@@ -1698,7 +1695,6 @@ contains
16981695
integer, intent(in) :: norm
16991696

17001697
real(wp) :: B2, term, disc
1701-
real(wp) :: term2
17021698

17031699
B2 = sum(B**2)
17041700

src/post_process/m_data_input.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ subroutine s_read_parallel_data_files(t_step)
278278

279279
integer :: ifile, ierr, data_size
280280
integer, dimension(MPI_STATUS_SIZE) :: status
281-
real(wp) :: start, finish
281+
282282
integer(KIND=MPI_OFFSET_KIND) :: disp
283283
integer(KIND=MPI_OFFSET_KIND) :: m_MOK, n_MOK, p_MOK
284284
integer(KIND=MPI_OFFSET_KIND) :: WP_MOK, var_MOK, str_MOK

src/post_process/m_data_output.fpp

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,6 @@ contains
859859
860860
! Generic loop iterator
861861
integer :: i, j, k
862-
real(wp) :: start, finish
863862
864863
! Silo-HDF5 Database Format
865864
@@ -1092,23 +1091,22 @@ contains
10921091
subroutine s_write_lag_bubbles_results(t_step)
10931092
10941093
integer, intent(in) :: t_step
1095-
character(len=len_trim(case_dir) + 2*name_len) :: t_step_dir
1094+
10961095
character(len=len_trim(case_dir) + 3*name_len) :: file_loc
1097-
logical :: dir_check
1098-
integer :: id, nlg_bubs
1096+
1097+
integer :: id
10991098
11001099
#ifdef MFC_MPI
11011100
real(wp), dimension(20) :: inputvals
1102-
real(wp) :: id_real, time_real
1101+
real(wp) :: time_real
11031102
integer, dimension(MPI_STATUS_SIZE) :: status
11041103
integer(KIND=MPI_OFFSET_KIND) :: disp
11051104
integer :: view
11061105
1107-
integer, dimension(3) :: cell
1108-
logical :: indomain, lg_bub_file, lg_bub_data, file_exist
1106+
logical :: lg_bub_file, file_exist
11091107
11101108
integer, dimension(2) :: gsizes, lsizes, start_idx_part
1111-
integer :: ifile, ireq, ierr, data_size, tot_data
1109+
integer :: ifile, ierr, tot_data
11121110
integer :: i
11131111
11141112
write (file_loc, '(A,I0,A)') 'lag_bubbles_mpi_io_', t_step, '.dat'
@@ -1196,12 +1194,11 @@ contains
11961194
subroutine s_write_intf_data_file(q_prim_vf)
11971195
11981196
type(scalar_field), dimension(sys_size), intent(IN) :: q_prim_vf
1199-
integer :: i, j, k, l, w, cent !< Generic loop iterators
1200-
integer :: ierr, counter, root !< number of data points extracted to fit shape to SH perturbations
1201-
real(wp), dimension(num_fluids) :: alpha, vol_fluid, xcom, ycom, zcom
1197+
integer :: i, j, k, l, cent !< Generic loop iterators
1198+
integer :: counter, root !< number of data points extracted to fit shape to SH perturbations
12021199
real(wp), parameter :: pi = 4._wp*tan(1._wp)
12031200
real(wp), allocatable :: x_td(:), y_td(:), x_d1(:), y_d1(:), y_d(:), x_d(:)
1204-
real(wp) :: axp, axm, ayp, aym, azm, azp, tgp, euc_d, thres, maxalph_loc, maxalph_glb
1201+
real(wp) :: axp, axm, ayp, aym, tgp, euc_d, thres, maxalph_loc, maxalph_glb
12051202
12061203
allocate (x_d1(m*n))
12071204
allocate (y_d1(m*n))
@@ -1290,9 +1287,8 @@ contains
12901287
real(wp) :: Elk, Egk, Elp, Egint, Vb, Vl, pres_av, Et
12911288
real(wp) :: rho, pres, dV, tmp, gamma, pi_inf, MaxMa, MaxMa_glb, maxvel, c, Ma, H
12921289
real(wp), dimension(num_vels) :: vel
1293-
real(wp), dimension(num_fluids) :: gammas, pi_infs, adv
1290+
real(wp), dimension(num_fluids) :: adv
12941291
integer :: i, j, k, l, s !looping indices
1295-
integer :: ierr, counter, root !< number of data points extracted to fit shape to SH perturbations
12961292
12971293
Egk = 0_wp
12981294
Elp = 0_wp

src/post_process/m_derived_variables.fpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ contains
329329
real(wp), dimension(ndim), intent(inout) :: b
330330
real(wp), dimension(ndim), intent(out) :: sol
331331

332-
integer, dimension(ndim) :: ipiv
333-
334-
integer :: nrhs, lda, ldb, info
335332
!EXTERNAL DGESV
336333

337334
integer :: i, j, k
@@ -491,7 +488,7 @@ contains
491488
real(wp), &
492489
dimension(1:3, 1:3) :: q_jacobian_sf, S, S2, O, O2
493490

494-
real(wp) :: trS, trS2, trO2, Q, IIS
491+
real(wp) :: trS, Q, IIS
495492
integer :: j, k, l, r, jj, kk !< Generic loop iterators
496493

497494
do l = -offset_z%beg, p + offset_z%end
@@ -585,8 +582,6 @@ contains
585582
!! The first position in the variable contains the maximum value and
586583
!! the second contains the rank of the processor on which it occurred.
587584
588-
real(wp) :: alpha_unadv !< Unadvected volume fraction
589-
590585
integer :: i, j, k, l !< Generic loop iterators
591586
592587
! Computing Gradient Magnitude of Density

src/pre_process/m_assign_variables.fpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,7 @@ contains
111111
type(scalar_field), dimension(1:sys_size), intent(inout) :: q_prim_vf
112112
integer, dimension(0:m, 0:n, 0:p), intent(inout) :: patch_id_fp
113113
114-
real(wp) :: rho !< density
115-
real(wp), dimension(int(E_idx - mom_idx%beg)) :: vel !< velocity
116-
real(wp) :: pres !< pressure
117-
real(wp) :: gamma !< specific heat ratio function
118-
real(wp) :: x_centroid, y_centroid
119-
real(wp) :: epsilon, beta
120114
real(wp) :: Ys(1:num_species)
121-
real(wp) :: mean_molecular_weight
122115
123116
integer :: smooth_patch_id
124117
integer :: i !< generic loop operator
@@ -308,13 +301,7 @@ contains
308301
real(wp) :: rcoord, theta, phi, xi_sph
309302
real(wp), dimension(3) :: xi_cart
310303
311-
real(wp), dimension(int(E_idx - mom_idx%beg)) :: vel !< velocity
312-
real(wp) :: pres !< pressure
313-
real(wp) :: x_centroid, y_centroid
314-
real(wp) :: epsilon, beta
315-
316304
real(wp) :: Ys(1:num_species)
317-
real(wp) :: mean_molecular_weight
318305
319306
real(wp), dimension(sys_size) :: orig_prim_vf !<
320307
!! Vector to hold original values of cell for smoothing purposes

0 commit comments

Comments
 (0)