-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm_error.f90
99 lines (94 loc) · 1.87 KB
/
m_error.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
!---------------------------------------------------------------------------
! MELQUIADES: Metropolis Monte Carlo Program !
!---------------------------------------------------------------------------
!bop
!
! !Module: m_error
!
! !Description: This module contains routines for evaluating failures
!while reading files and the management memory.
!\\
!\\
! !Interface:
!
module m_error
!
implicit none
!
! !Public member functions:
!
public :: r_ealloc
public :: r_eread
!
! !Revision history:
! 06Aug 2015 Asdrubal Lozada
!
!eop
!--------------------------------------------------------------------------
!
contains
!
!bop
!
! !Iroutine: r_ealloc
!
! !Description: Returns a error message if management memory fails.
!\\
!\\
! !Interface:
!
subroutine r_ealloc( var_name, error )
!
implicit none
!
! !Input parameters:
!
character(len=*), intent(in) :: var_name
integer, intent(in) :: error
!
! !Revision history:
! 06Aug 2015 Asdrubal Lozada
!
!eop
!---------------------------------------------------------------------------
! Local variables
!boc
character(len=33) :: msg
msg = "Space requested not possible for "
if( error /= 0 ) then
write(*,'(a)') msg//" "//trim(var_name)
stop
end if
!eoc
end subroutine r_ealloc
!bop
!
! !Iroutine: r_eread
!
! !Description: Returns a error message if the reading fails.
!\\
!\\
! !Interface:
!
subroutine r_eread( ios, arg )
!
implicit none
!
! !Input parameters:
!
integer, intent(in) :: ios
character(len=*), intent(in) :: arg
!
! !Revision history:
! 06Aug 2015 Asdrubal Lozada
!
!eop
!---------------------------------------------------------------------------
if(ios>0) then
write(*,'("*** Check the input file ***")')
write(*,*) 'Error at line-argument ', trim(arg)
write(*,'("*** ***")')
stop
end if
end subroutine r_eread
end module m_error