ITM AMNS: User Interface  \$Id: Doxyfile 502 2015-10-15 12:23:45Z dpc $
call_utils.F90
Go to the documentation of this file.
1 
8 module call_utils
9 
10 
11  use f90_kind
12 
13  implicit none
14 
15  private
16 
17  integer(ikind), parameter :: max_call_deep=100
18  character(skind) :: sub_called(max_call_deep)
19  integer(ikind) :: sub_called_pos=0
20 
21 
23 
24 contains
25 
26  !------------------------------------------------
27  !------- assert ---------------------------------
28  !------------------------------------------------
29  subroutine assert (lcond, message)
30 
31  logical, intent(in) :: lcond
32  character(len=*), intent(in) :: message
33 
34  if(.not.lcond)then
35  print*, message
36  call exitall()
37  endif
38  end subroutine assert
39 
40 
41  !------------------------------------------------
42  !------- warning --------------------------------
43  !------------------------------------------------
44  subroutine warning (lcond, message)
45 
46  logical, intent(in) :: lcond
47  character(len=*), intent(in) :: message
48  if(.not.lcond)then
49  print*,"warning!: "// message
50  endif
51  end subroutine warning
52 
53  !------------------------------------------------
54  !------- exiting --------------------------------
55  !------------------------------------------------
56  subroutine exiting (lcond, message)
57 
58  logical, intent(in) :: lcond
59  character(len=*), intent(in) :: message
60 
61  if(.not.lcond)then
62  print*,"Panik !: "// message
63  call exitall()
64  endif
65  end subroutine exiting
66 
67 
68  !------------------------------------------------
69  !------- exitall --------------------------------
70  !------------------------------------------------
71 
72  subroutine exitall()
73 
74  integer :: i
75 
76  do i=sub_called_pos,1,-1
77  print*, trim(sub_called(sub_called_pos))
78  enddo
79  stop 'exitall@utils: at eof'
80 
81  end subroutine exitall
82 
83  !------------------------------------------------
84  !--------- sub_init ------------------------------
85  !------------------------------------------------
86  subroutine sub_init(subin)
87  character(len=*), intent(in) :: subin
88  ! print *,' +++> ',subin , sub_called_pos, max_call_deep
89  call assert(sub_called_pos<max_call_deep,'sub_init error sub_called_pos>=max_call_deep')
90  sub_called_pos=sub_called_pos+1
91  sub_called(sub_called_pos)=trim(subin)
92  end subroutine sub_init
93 
94  !------------------------------------------------
95  !--------- sub_end ------------------------------
96  !------------------------------------------------
97  subroutine sub_end()
98 
99  ! print *,' ---> ',sub_called(sub_called_pos)
100  sub_called_pos=sub_called_pos-1
101 
102 
103  end subroutine sub_end
104 
105 end module call_utils
106 
utils module from Silvio Gori&#39;s grid package
Definition: call_utils.F90:8
for i
Definition: amns.pyx:365
subroutine, public exiting(lcond, message)
Definition: call_utils.F90:56
subroutine, public exitall()
Definition: call_utils.F90:72
subroutine, public warning(lcond, message)
Definition: call_utils.F90:44
subroutine, public sub_init(subin)
Definition: call_utils.F90:86
subroutine, public sub_end()
Definition: call_utils.F90:97
f90_kind module from Silvio Gori&#39;s grid package
Definition: f90_kind.F90:9
subroutine, public assert(lcond, message)
Definition: call_utils.F90:29