FV3 Bundle
ncdr_climsg.F90
Go to the documentation of this file.
1 module ncdr_climsg
2  implicit none
3 
4  ! NetCDF Diag Reader - CLI Message portion
5  ! (Declarations)
6  logical :: ncdr_enable_info = .false.
7 
8  contains
9  ! NetCDF Diag Reader - CLI Message portion
10  ! (Subroutine/Function implementation)
11 
12  subroutine ncdr_error(err)
13  character(len=*), intent(in) :: err
14 #ifdef ERROR_TRACEBACK
15  integer :: div0
16 #endif
17  write(*, "(A)") " ** ERROR: " // err
18 #ifdef ERROR_TRACEBACK
19  write(*, "(A)") " ** Failed to read NetCDF4."
20  write(*, "(A)") " (Traceback requested, triggering div0 error...)"
21  div0 = 1 / 0
22  write(*, "(A)") " Couldn't trigger traceback, ending gracefully."
23  write(*, "(A)") " (Ensure floating point exceptions are enabled,"
24  write(*, "(A)") " and that you have debugging (-g) and tracebacks"
25  write(*, "(A)") " compiler flags enabled!)"
26  stop 1
27 #else
28  write (*, "(A)") " ** Failed to read NetCDF4."
29  stop 1
30 #endif
31  end subroutine ncdr_error
32 
33  subroutine ncdr_warning(warn)
34  character(len=*), intent(in) :: warn
35  write(*, "(A)") " ** WARNING: " // warn
36  end subroutine ncdr_warning
37 
38  subroutine ncdr_set_info_display(info_on_off)
39  logical :: info_on_off
40  ncdr_enable_info = info_on_off
41  end subroutine ncdr_set_info_display
42 
43  subroutine ncdr_info(ifo)
44  character(len=*), intent(in) :: ifo
45  if (ncdr_enable_info) &
46  write(*, "(A)") " ** INFO: " // ifo
47  end subroutine ncdr_info
48 
49 #ifdef _DEBUG_MEM_
50  subroutine ncdr_debug(dbg)
51  character(len=*), intent(in) :: dbg
52  write(*, "(A, A)") "D: ", dbg
53  end subroutine ncdr_debug
54 #endif
55 
56 end module ncdr_climsg
subroutine ncdr_info(ifo)
Definition: ncdr_climsg.F90:44
subroutine ncdr_set_info_display(info_on_off)
Definition: ncdr_climsg.F90:39
subroutine ncdr_error(err)
Definition: ncdr_climsg.F90:13
subroutine ncdr_warning(warn)
Definition: ncdr_climsg.F90:34
logical ncdr_enable_info
Definition: ncdr_climsg.F90:6