dbcsr_mutable_release Subroutine

public subroutine dbcsr_mutable_release(mutable)

Unregisters a reference to the mutable data type The object is destroy when there is no reference to it left.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_mutable_obj), intent(inout) :: mutable

mutable data


Source Code

   SUBROUTINE dbcsr_mutable_release(mutable)
      !! Unregisters a reference to the mutable data type
      !! The object is destroy when there is no reference to it left.

      TYPE(dbcsr_mutable_obj), INTENT(INOUT)             :: mutable
         !! mutable data

!   ---------------------------------------------------------------------------

      IF (.NOT. ASSOCIATED(mutable%m)) &
         DBCSR_ABORT("Mutable data area not instantiated")
      mutable%m%refcount = mutable%m%refcount - 1
      IF (mutable%m%refcount .EQ. 0) THEN
         CALL dbcsr_mutable_destroy(mutable)
      END IF
   END SUBROUTINE dbcsr_mutable_release