forked from haidi-ustc/HartreeFock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsys.F
71 lines (51 loc) · 1.76 KB
/
sys.F
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
!
! This file is part of the SIESTA package.
!
! Copyright (c) Fundacion General Universidad Autonoma de Madrid:
! E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal
! and J.M.Soler, 1996- .
!
! Use of this software constitutes agreement with the full conditions
! given in the SIESTA license, as signed by all legitimate users.
!
module sys
!
! Termination and messaging routines, MPI aware
!
public :: die, bye, message
CONTAINS
subroutine message(str)
character(len=*), intent(in), optional :: str
if (present(str)) then
write(6,'(a)') trim(str)
endif
end subroutine message
!
!--------------------------------------------------
subroutine die(str)
character(len=*), intent(in), optional :: str
! Even though formally (in MPI 1.X), only the master node
! can do I/O, in those systems that allow it having each
! node state its complaint can be useful.
!! if (Node.eq.0) then
if (present(str)) then
write(6,'(a)') trim(str)
write(0,'(a)') trim(str)
endif
stop
end subroutine die
!---------------------------------------------------------
subroutine bye(str)
character(len=*), intent(in), optional :: str
! Even though formally (in MPI 1.X), only the master node
! can do I/O, in those systems that allow it having each
! node state its complaint can be useful.
!! if (Node.eq.0) then
if (present(str)) then
write(6,'(a)') trim(str)
endif
write(6,'(a)') 'User-Requested End of Run. Bye!!'
!! endif
stop
end subroutine bye
end module sys