This subroutine prints a debug message at a debug level. The debug message
will be prefixed by "MPAS Subdriver (N): ", where N
is the MPI rank. The
debug level is one of the log_level_*
constants.
If printer
is not supplied, the MPI root rank will print. Otherwise,
the designated MPI rank will print instead.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mpas_dynamical_core_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | level | |||
character(len=*), | intent(in) | :: | message | |||
integer, | intent(in), | optional | :: | printer |
subroutine dyn_mpas_debug_print(self, level, message, printer) class(mpas_dynamical_core_type), intent(in) :: self 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 (self % log_level < level) then return end if if (present(printer)) then if (self % mpi_rank /= printer) then return end if else if (.not. self % mpi_rank_root) then return end if end if write(self % log_unit, '(a)') 'MPAS Subdriver (' // stringify([self % mpi_rank]) // '): ' // message end subroutine dyn_mpas_debug_print