dbcsr_logger_release Subroutine

public subroutine dbcsr_logger_release(logger)

releases this logger

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_logger_type), POINTER:: logger

the logger to release


Contents

Source Code


Source Code

   SUBROUTINE dbcsr_logger_release(logger)
      !! releases this logger

      TYPE(dbcsr_logger_type), POINTER                   :: logger
         !! the logger to release

      CHARACTER(len=*), PARAMETER :: routineN = 'dbcsr_logger_release', &
                                     routineP = moduleN//':'//routineN

      IF (ASSOCIATED(logger)) THEN
         IF (logger%ref_count < 1) &
            DBCSR_ABORT(routineP//" logger%ref_count<1")
         logger%ref_count = logger%ref_count - 1
         IF (logger%ref_count == 0) THEN
            IF (logger%close_global_unit_on_dealloc .AND. &
                logger%default_global_unit_nr >= 0) THEN
               CALL close_file(logger%default_global_unit_nr)
               logger%close_global_unit_on_dealloc = .FALSE.
               logger%default_global_unit_nr = -1
            END IF
            IF (logger%close_local_unit_on_dealloc .AND. &
                logger%default_local_unit_nr >= 0) THEN
               CALL close_file(logger%default_local_unit_nr)
               logger%close_local_unit_on_dealloc = .FALSE.
               logger%default_local_unit_nr = -1
            END IF
            CALL dbcsr_mp_release(logger%mp_env)
            CALL dbcsr_iteration_info_release(logger%iter_info)
            DEALLOCATE (logger)
         END IF
      END IF
   END SUBROUTINE dbcsr_logger_release