Skip to content

Commit

Permalink
Replace MPI_DOUBLE_PRECISION with constant declared in common, fix bu…
Browse files Browse the repository at this point in the history
…gs with syscheck module
  • Loading branch information
arciyer123 authored and Krishnan Iyer committed Sep 20, 2024
1 parent 922d543 commit 5ea9a80
Show file tree
Hide file tree
Showing 22 changed files with 303 additions and 303 deletions.
2 changes: 1 addition & 1 deletion src/common/m_eigen_solver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr)

integer :: i, j, k, l, ml, en, ii, jj, ll, nn, ip1, itn, its, lp1, enm1, iend
real(wp) :: si, sr, ti, tr, xi, xr, xxi, xxr, yi, yr, zzi, zzr, &
norm, tst1, tst2, c, d
norm, tst1, tst2, c, d
!
ierr = 0
! .......... initialize eigenvector matrix ..........
Expand Down
26 changes: 13 additions & 13 deletions src/common/m_mpi_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ contains
! Define the view for each variable
do i = 1, sys_size
call MPI_TYPE_CREATE_SUBARRAY(num_dims, sizes_glb, sizes_loc, start_idx, &
MPI_ORDER_FORTRAN, MPI_DOUBLE_PRECISION, MPI_IO_DATA%view(i), ierr)
MPI_ORDER_FORTRAN, mpi_p, MPI_IO_DATA%view(i), ierr)
call MPI_TYPE_COMMIT(MPI_IO_DATA%view(i), ierr)
end do
#ifndef MFC_POST_PROCESS
if (qbmm .and. .not. polytropic) then
do i = sys_size + 1, sys_size + 2*nb*4
call MPI_TYPE_CREATE_SUBARRAY(num_dims, sizes_glb, sizes_loc, start_idx, &
MPI_ORDER_FORTRAN, MPI_DOUBLE_PRECISION, MPI_IO_DATA%view(i), ierr)
MPI_ORDER_FORTRAN, mpi_p, MPI_IO_DATA%view(i), ierr)
call MPI_TYPE_COMMIT(MPI_IO_DATA%view(i), ierr)
end do
Expand Down Expand Up @@ -167,7 +167,7 @@ contains
#endif
call MPI_TYPE_CREATE_SUBARRAY(1, airfoil_glb, airfoil_loc, airfoil_start, &
MPI_ORDER_FORTRAN, MPI_DOUBLE_PRECISION, MPI_IO_airfoil_IB_DATA%view(1), ierr)
MPI_ORDER_FORTRAN, mpi_p, MPI_IO_airfoil_IB_DATA%view(1), ierr)

Check warning on line 170 in src/common/m_mpi_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_mpi_common.fpp#L170

Added line #L170 was not covered by tests
call MPI_TYPE_COMMIT(MPI_IO_airfoil_IB_DATA%view(1), ierr)
#ifdef MFC_PRE_PROCESS
Expand All @@ -177,7 +177,7 @@ contains
end do
#endif
call MPI_TYPE_CREATE_SUBARRAY(1, airfoil_glb, airfoil_loc, airfoil_start, &
MPI_ORDER_FORTRAN, MPI_DOUBLE_PRECISION, MPI_IO_airfoil_IB_DATA%view(2), ierr)
MPI_ORDER_FORTRAN, mpi_p, MPI_IO_airfoil_IB_DATA%view(2), ierr)

Check warning on line 180 in src/common/m_mpi_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_mpi_common.fpp#L180

Added line #L180 was not covered by tests
call MPI_TYPE_COMMIT(MPI_IO_airfoil_IB_DATA%view(2), ierr)
end if
Expand All @@ -197,7 +197,7 @@ contains
#ifdef MFC_MPI
call MPI_GATHER(time_avg, 1, MPI_DOUBLE_PRECISION, proc_time(0), 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
call MPI_GATHER(time_avg, 1, mpi_p, proc_time(0), 1, mpi_p, 0, MPI_COMM_WORLD, ierr)

Check warning on line 200 in src/common/m_mpi_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_mpi_common.fpp#L200

Added line #L200 was not covered by tests
#endif
Expand Down Expand Up @@ -242,15 +242,15 @@ contains
! Reducing local extrema of ICFL, VCFL, CCFL and Rc numbers to their
! global extrema and bookkeeping the results on the rank 0 processor
call MPI_REDUCE(icfl_max_loc, icfl_max_glb, 1, &
MPI_DOUBLE_PRECISION, MPI_MAX, 0, &
mpi_p, MPI_MAX, 0, &
MPI_COMM_WORLD, ierr)
if (any(Re_size > 0)) then
call MPI_REDUCE(vcfl_max_loc, vcfl_max_glb, 1, &
MPI_DOUBLE_PRECISION, MPI_MAX, 0, &
mpi_p, MPI_MAX, 0, &
MPI_COMM_WORLD, ierr)
call MPI_REDUCE(Rc_min_loc, Rc_min_glb, 1, &
MPI_DOUBLE_PRECISION, MPI_MIN, 0, &
mpi_p, MPI_MIN, 0, &
MPI_COMM_WORLD, ierr)
end if
Expand All @@ -274,7 +274,7 @@ contains
#ifdef MFC_MPI
! Performing the reduction procedure
call MPI_ALLREDUCE(var_loc, var_glb, 1, MPI_DOUBLE_PRECISION, &
call MPI_ALLREDUCE(var_loc, var_glb, 1, mpi_p, &
MPI_SUM, MPI_COMM_WORLD, ierr)
#endif
Expand All @@ -296,7 +296,7 @@ contains
#ifdef MFC_MPI
! Performing the reduction procedure
call MPI_ALLREDUCE(var_loc, var_glb, 1, MPI_DOUBLE_PRECISION, &
call MPI_ALLREDUCE(var_loc, var_glb, 1, mpi_p, &
MPI_MIN, MPI_COMM_WORLD, ierr)
#endif
Expand All @@ -318,7 +318,7 @@ contains
#ifdef MFC_MPI
! Performing the reduction procedure
call MPI_ALLREDUCE(var_loc, var_glb, 1, MPI_DOUBLE_PRECISION, &
call MPI_ALLREDUCE(var_loc, var_glb, 1, mpi_p, &
MPI_MAX, MPI_COMM_WORLD, ierr)
#endif
Expand All @@ -342,10 +342,10 @@ contains
! Performing reduction procedure and eventually storing its result
! into the variable that was initially inputted into the subroutine
call MPI_REDUCE(var_loc, var_glb, 1, MPI_DOUBLE_PRECISION, &
call MPI_REDUCE(var_loc, var_glb, 1, mpi_p, &
MPI_MIN, 0, MPI_COMM_WORLD, ierr)
call MPI_BCAST(var_glb, 1, MPI_DOUBLE_PRECISION, &
call MPI_BCAST(var_glb, 1, mpi_p, &
0, MPI_COMM_WORLD, ierr)
var_loc = var_glb
Expand Down
6 changes: 3 additions & 3 deletions src/common/m_phase_change.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ contains

! updating common pressure for the newton solver
pS = pO + ((1.0_wp - gp)/gpp)/(1.0_wp - (1.0_wp - gp + DABS(1.0_wp - gp)) &
/(2.0_wp*gpp)*hp)
/(2.0_wp*gpp)*hp)
end do

! common temperature
Expand Down Expand Up @@ -430,8 +430,8 @@ contains
p_infpTg = p_infpT

if (((pS < 0.0_wp) .and. ((q_cons_vf(lp + contxb - 1)%sf(j, k, l) &
+ q_cons_vf(vp + contxb - 1)%sf(j, k, l)) > ((rhoe &
- gs_min(lp)*ps_inf(lp)/(gs_min(lp) - 1))/qvs(lp)))) .or. &
+ q_cons_vf(vp + contxb - 1)%sf(j, k, l)) > ((rhoe &

Check warning on line 433 in src/common/m_phase_change.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_phase_change.fpp#L433

Added line #L433 was not covered by tests
- gs_min(lp)*ps_inf(lp)/(gs_min(lp) - 1))/qvs(lp)))) .or. &
((pS >= 0.0_wp) .and. (pS < 1.0d-1))) then

! improve this initial condition
Expand Down
2 changes: 1 addition & 1 deletion src/common/m_precision_select.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ module m_precision_select
integer, parameter :: mpi_p = -100
#endif

end module m_precision_select
end module m_precision_select
18 changes: 9 additions & 9 deletions src/post_process/m_data_input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ subroutine s_read_parallel_data_files(t_step)
if (file_exist) then
data_size = m_glb + 2
call MPI_FILE_OPEN(MPI_COMM_WORLD, file_loc, MPI_MODE_RDONLY, mpi_info_int, ifile, ierr)
call MPI_FILE_READ(ifile, x_cb_glb, data_size, MPI_DOUBLE_PRECISION, status, ierr)
call MPI_FILE_READ(ifile, x_cb_glb, data_size, mpi_p, status, ierr)
call MPI_FILE_CLOSE(ifile, ierr)
else
call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...')
Expand All @@ -304,7 +304,7 @@ subroutine s_read_parallel_data_files(t_step)
if (file_exist) then
data_size = n_glb + 2
call MPI_FILE_OPEN(MPI_COMM_WORLD, file_loc, MPI_MODE_RDONLY, mpi_info_int, ifile, ierr)
call MPI_FILE_READ(ifile, y_cb_glb, data_size, MPI_DOUBLE_PRECISION, status, ierr)
call MPI_FILE_READ(ifile, y_cb_glb, data_size, mpi_p, status, ierr)
call MPI_FILE_CLOSE(ifile, ierr)
else
call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...')
Expand All @@ -325,7 +325,7 @@ subroutine s_read_parallel_data_files(t_step)
if (file_exist) then
data_size = p_glb + 2
call MPI_FILE_OPEN(MPI_COMM_WORLD, file_loc, MPI_MODE_RDONLY, mpi_info_int, ifile, ierr)
call MPI_FILE_READ(ifile, z_cb_glb, data_size, MPI_DOUBLE_PRECISION, status, ierr)
call MPI_FILE_READ(ifile, z_cb_glb, data_size, mpi_p, status, ierr)
call MPI_FILE_CLOSE(ifile, ierr)
else
call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...')
Expand Down Expand Up @@ -375,14 +375,14 @@ subroutine s_read_parallel_data_files(t_step)
var_MOK = int(i, MPI_OFFSET_KIND)

call MPI_FILE_READ_ALL(ifile, MPI_IO_DATA%var(i)%sf, data_size, &
MPI_DOUBLE_PRECISION, status, ierr)
mpi_p, status, ierr)

Check warning on line 378 in src/post_process/m_data_input.f90

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_data_input.f90#L378

Added line #L378 was not covered by tests
end do
else
do i = 1, adv_idx%end
var_MOK = int(i, MPI_OFFSET_KIND)

call MPI_FILE_READ_ALL(ifile, MPI_IO_DATA%var(i)%sf, data_size, &
MPI_DOUBLE_PRECISION, status, ierr)
mpi_p, status, ierr)

Check warning on line 385 in src/post_process/m_data_input.f90

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_data_input.f90#L385

Added line #L385 was not covered by tests
end do
end if

Expand Down Expand Up @@ -451,10 +451,10 @@ subroutine s_read_parallel_data_files(t_step)
! Initial displacement to skip at beginning of file
disp = m_MOK*max(MOK, n_MOK)*max(MOK, p_MOK)*WP_MOK*(var_MOK - 1)

call MPI_FILE_SET_VIEW(ifile, disp, MPI_DOUBLE_PRECISION, MPI_IO_DATA%view(i), &
call MPI_FILE_SET_VIEW(ifile, disp, mpi_p, MPI_IO_DATA%view(i), &

Check warning on line 454 in src/post_process/m_data_input.f90

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_data_input.f90#L454

Added line #L454 was not covered by tests
'native', mpi_info_int, ierr)
call MPI_FILE_READ_ALL(ifile, MPI_IO_DATA%var(i)%sf, data_size, &
MPI_DOUBLE_PRECISION, status, ierr)
mpi_p, status, ierr)
end do
else
do i = 1, sys_size
Expand All @@ -463,10 +463,10 @@ subroutine s_read_parallel_data_files(t_step)
! Initial displacement to skip at beginning of file
disp = m_MOK*max(MOK, n_MOK)*max(MOK, p_MOK)*WP_MOK*(var_MOK - 1)

call MPI_FILE_SET_VIEW(ifile, disp, MPI_DOUBLE_PRECISION, MPI_IO_DATA%view(i), &
call MPI_FILE_SET_VIEW(ifile, disp, mpi_p, MPI_IO_DATA%view(i), &

Check warning on line 466 in src/post_process/m_data_input.f90

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_data_input.f90#L466

Added line #L466 was not covered by tests
'native', mpi_info_int, ierr)
call MPI_FILE_READ_ALL(ifile, MPI_IO_DATA%var(i)%sf, data_size, &
MPI_DOUBLE_PRECISION, status, ierr)
mpi_p, status, ierr)
end do
end if

Expand Down
6 changes: 3 additions & 3 deletions src/post_process/m_derived_variables.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ contains
blkmod2 = ((fluid_pp(2)%gamma + 1._wp)*q_prim_vf(E_idx)%sf(i, j, k) + &

Check warning on line 208 in src/post_process/m_derived_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_derived_variables.fpp#L208

Added line #L208 was not covered by tests
fluid_pp(2)%pi_inf)/fluid_pp(2)%gamma
q_sf(i, j, k) = (1._wp/(rho_sf(i, j, k)*(q_prim_vf(adv_idx%beg)%sf(i, j, k)/blkmod1 + &
(1._wp - q_prim_vf(adv_idx%beg)%sf(i, j, k))/blkmod2)))
(1._wp - q_prim_vf(adv_idx%beg)%sf(i, j, k))/blkmod2)))

Check warning on line 211 in src/post_process/m_derived_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_derived_variables.fpp#L210-L211

Added lines #L210 - L211 were not covered by tests
end if

if (mixture_err .and. q_sf(i, j, k) < 0._wp) then
Expand Down Expand Up @@ -237,8 +237,8 @@ contains
type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf

real(wp), dimension(-offset_x%beg:m + offset_x%end, &
-offset_y%beg:n + offset_y%end, &
-offset_z%beg:p + offset_z%end), &
-offset_y%beg:n + offset_y%end, &
-offset_z%beg:p + offset_z%end), &
intent(inout) :: q_sf

real(wp) :: top, bottom, slope !< Flux limiter calcs
Expand Down
Loading

0 comments on commit 5ea9a80

Please sign in to comment.