Print a debug message at a debug level. The debug message will be prefixed by "MPAS Interface (N): ", where N
is the MPI rank. The debug level is one of the debugout_*
constants from the cam_logfile
module.
If printer
is not supplied, the MPI root rank will print. Otherwise, the designated MPI rank will print instead.
(KCW, 2024-02-03)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | level | |||
character(len=*), | intent(in) | :: | message | |||
integer, | intent(in), | optional | :: | printer |
subroutine dyn_debug_print(level, message, printer) ! Module(s) from CAM-SIMA. use cam_logfile, only: debug_output, iulog use spmd_utils, only: iam, masterproc use string_utils, only: stringify integer, intent(in) :: level character(*), intent(in) :: message integer, optional, intent(in) :: printer ! Bail out early if the log level is less verbose than the debug level. if (debug_output < level) then return end if if (present(printer)) then if (iam /= printer) then return end if else if (.not. masterproc) then return end if end if write(iulog, '(a)') 'MPAS Interface (' // stringify([iam]) // '): ' // message end subroutine dyn_debug_print