-
Notifications
You must be signed in to change notification settings - Fork 0
/
MOM_error_handler.F90
61 lines (43 loc) · 1.86 KB
/
MOM_error_handler.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
!> Routines for error handling and I/O management
module MOM_error_handler
implicit none ; private
! These routines are found in this module.
public :: MOM_error, MOM_mesg
!> Integer parameters encoding the severity of an error message
public :: NOTE, WARNING, FATAL
public :: stdlog, stdout
integer :: NOTE = 0
integer :: WARNING = 1
integer :: FATAL = 2
contains
integer function stdout()
stdout = 6
end function stdout
integer function stdlog()
stdlog = -1
end function stdlog
!> This provides a convenient interface for writing an informative comment, depending
!! on the model's current verbosity setting and the verbosity level for this message.
subroutine MOM_mesg(message, verb, all_print)
character(len=*), intent(in) :: message !< A message to write out
integer, optional, intent(in) :: verb !< A level of verbosity for this message
logical, optional, intent(in) :: all_print !< If present and true, any PEs are
!! able to write this message.
! This provides a convenient interface for writing an informative comment.
integer :: verb_msg
logical :: write_msg
print *,message
end subroutine MOM_mesg
!> This provides a convenient interface for writing an error message
!! with run-time filter based on a verbosity and the severity of the error.
subroutine MOM_error(level, message, all_print)
integer, intent(in) :: level !< The severity level of this message
character(len=*), intent(in) :: message !< A message to write out
logical, optional, intent(in) :: all_print !< If present and true, any PEs are
!! able to write this message.
! This provides a convenient interface for writing an error message
! with run-time filter based on a verbosity.
logical :: write_msg
print *,message
end subroutine MOM_error
end module MOM_error_handler