Skip to content

Commit aed7bc4

Browse files
certikbonachea
authored andcommitted
Get rid of an interface
1 parent 6192f4e commit aed7bc4

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

src/assert/assert_subroutine_m.F90

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,39 +68,30 @@ pure subroutine assert_error_stop_interface(stop_code_char)
6868
#endif
6969
logical, parameter :: enforce_assertions=USE_ASSERTIONS
7070

71-
interface
7271

73-
pure module subroutine assert(assertion, description)
72+
contains
73+
74+
pure subroutine assert(assertion, description)
7475
!! If assertion is .false. and enforcement is enabled (e.g. via -DASSERTIONS=1),
7576
!! then error-terminate with a character stop code that contains the description argument if present
7677
implicit none
7778
logical, intent(in) :: assertion
7879
!! Most assertions will be expressions such as i>0
7980
character(len=*), intent(in) :: description
8081
!! A brief statement of what is being asserted such as "i>0" or "positive i"
81-
end subroutine
82-
83-
pure module subroutine assert_always(assertion, description)
84-
!! Same as above but always enforces the assertion (regardless of ASSERTIONS)
85-
implicit none
86-
logical, intent(in) :: assertion
87-
character(len=*), intent(in) :: description
88-
end subroutine
89-
90-
end interface
91-
92-
contains
93-
94-
module procedure assert
9582

9683
toggle_assertions: &
9784
if (enforce_assertions) then
9885
call assert_always(assertion, description)
9986
end if toggle_assertions
10087

101-
end procedure
88+
end subroutine
10289

103-
module procedure assert_always
90+
pure module subroutine assert_always(assertion, description)
91+
!! Same as above but always enforces the assertion (regardless of ASSERTIONS)
92+
implicit none
93+
logical, intent(in) :: assertion
94+
character(len=*), intent(in) :: description
10495
character(len=:), allocatable :: message
10596
integer me
10697

@@ -153,7 +144,7 @@ pure function string(numeric) result(number_as_string)
153144

154145
end function string
155146

156-
end procedure
147+
end subroutine
157148

158149
end module assert_subroutine_m
159150

0 commit comments

Comments
 (0)