Skip to content

Commit 867a17f

Browse files
authored
Update m_precision_select.f90
Check if old method of checking MPI support passes mpi tests
1 parent a25acd2 commit 867a17f

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

src/common/m_precision_select.f90

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,23 @@
1-
!> @file m_precision_select.f90
2-
!> @brief Contains module m_precision_select
1+
!>
2+
!! @file m_precision_select.f90
3+
!! @brief Contains module m_precision_select
34

45
!> @brief This file contains the definition of floating point used in MFC
56
module m_precision_select
67
#ifdef MFC_MPI
7-
use mpi !< Message Passing Interface (MPI) module
8+
use mpi !< Message passing interface (MPI) module
89
#endif
910

1011
implicit none
1112

12-
! Define the available precision types
1313
integer, parameter :: single_precision = selected_real_kind(6, 37)
1414
integer, parameter :: double_precision = selected_real_kind(15, 307)
1515

16-
! Set the working precision (wp) to single or double precision
17-
integer, parameter :: wp = double_precision ! Change this to single_precision if needed
18-
16+
integer, parameter :: wp = double_precision
1917
#ifdef MFC_MPI
20-
! Declare mpi_p as a module variable
21-
integer :: mpi_p
18+
integer, parameter :: mpi_p = MPI_DOUBLE_PRECISION
2219
#else
2320
integer, parameter :: mpi_p = -100
2421
#endif
2522

26-
contains
27-
28-
! Subroutine to initialize mpi_p based on wp
29-
subroutine initialize_precision()
30-
#ifdef MFC_MPI
31-
if (wp == single_precision) then
32-
mpi_p = MPI_FLOAT
33-
else if (wp == double_precision) then
34-
mpi_p = MPI_DOUBLE_PRECISION
35-
else
36-
stop 'Unsupported precision kind.'
37-
end if
38-
#endif
39-
end subroutine initialize_precision
40-
41-
end module m_precision_select
23+
end module m_precision_select

0 commit comments

Comments
 (0)