V3FIT
assert_mod.f90
1  MODULE assert_mod
2  USE stel_kinds
3  interface assert
4  module procedure assert_int, assert_real, assert_string
5  end interface assert
6 
7  CONTAINS
8 
9  subroutine assert_int(lcond,msg,ival)
10  implicit none
11  logical,intent(in) :: lcond
12  character*(*),intent(in) :: msg
13  integer,intent(in) :: ival
14 
15  if (.not.lcond) then
16  write(*,*) msg,ival
17  stop '** assertion error ** '
18  endif
19 
20  return
21  end subroutine assert_int
22 
23 
24  subroutine assert_real(lcond,msg,ival)
25  implicit none
26  logical,intent(in) :: lcond
27  character*(*),intent(in) :: msg
28  real(rprec),intent(in) :: ival
29 
30  if (.not.lcond) then
31  write(*,*) msg,ival
32  stop '** assertion error ** '
33  endif
34 
35  return
36  end subroutine assert_real
37 
38 
39  subroutine assert_string(lcond,msg,ival)
40  implicit none
41  logical,intent(in) :: lcond
42  character*(*),intent(in) :: msg
43  character*(*),intent(in) :: ival
44 
45  if (.not.lcond) then
46  write(*,*) msg,ival
47  stop '** assertion error ** '
48  endif
49 
50  return
51  end subroutine assert_string
52 
53  END MODULE assert_mod
assert_mod::assert
Definition: assert_mod.f90:3