dbcsr_iterator_stop Subroutine

public subroutine dbcsr_iterator_stop(iterator)

Stops up an iterator


Type IntentOptional Attributes Name
type(dbcsr_iterator), intent(inout) :: iterator

the iterator

Source Code

   SUBROUTINE dbcsr_iterator_stop(iterator)
      !! Stops up an iterator

      TYPE(dbcsr_iterator), INTENT(INOUT)                :: iterator
         !! the iterator

      CHARACTER(len=*), PARAMETER :: routineN = 'dbcsr_iterator_stop'

      INTEGER                                            :: error_handle

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

      CALL timeset(routineN, error_handle)
      iterator%row = 0
      iterator%pos = 0

      NULLIFY (iterator%tdist)
!$OMP     CRITICAL (crit_data)
      CALL dbcsr_data_release(iterator%data_area)
!$OMP     END CRITICAL (crit_data)
      IF (iterator%dynamic) THEN
!$OMP        BARRIER
!$OMP        MASTER
         common_int_pointer => iterator%common_pos
         DEALLOCATE (common_int_pointer)
!$OMP        FLUSH (common_int_pointer)
         NULLIFY (iterator%common_pos)
!$OMP        BARRIER
      END IF
      IF (iterator%local_indexing) THEN
         NULLIFY (iterator%local_rows)
         NULLIFY (iterator%global_rows)
      END IF
      CALL timestop(error_handle)
   END SUBROUTINE dbcsr_iterator_stop