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