dbcsr_logger_get_default_io_unit Function

public function dbcsr_logger_get_default_io_unit(logger) result(res)

returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs calling this function is not the ionode

Arguments

Type IntentOptional Attributes Name
type(dbcsr_logger_type), optional, POINTER :: logger

the logger you want to log in

Return Value integer


Source Code

   FUNCTION dbcsr_logger_get_default_io_unit(logger) RESULT(res)
      !! returns the unit nr for the ionode (-1 on all other processors)
      !! skips as well checks if the procs calling this function is not the ionode

      TYPE(dbcsr_logger_type), OPTIONAL, POINTER         :: logger
         !! the logger you want to log in
      INTEGER                                            :: res

      TYPE(dbcsr_logger_type), POINTER                   :: local_logger

      IF (PRESENT(logger)) THEN
         local_logger => logger
      ELSE IF (stack_pointer == 0) THEN
         res = -1 ! edge case: default logger not yet/anymore available
         RETURN
      ELSE
         local_logger => dbcsr_get_default_logger()
      END IF

      res = dbcsr_logger_get_default_unit_nr(local_logger, local=.FALSE., skip_not_ionode=.TRUE.)
   END FUNCTION dbcsr_logger_get_default_io_unit