list_routinestat_del Subroutine

public subroutine list_routinestat_del(list, pos)

Removes the value at the given position from the list.

Arguments

Type IntentOptional Attributes Name
type(list_routinestat_type), intent(inout) :: list
integer, intent(in) :: pos

Position in the list - must fulfill 0 < pos < list_size+1 .


Source Code

SUBROUTINE list_routinestat_del(list, pos)
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
   !! Removes the value at the given position from the list.
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    TYPE(list_routinestat_type), intent(inout)  :: list
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    INTEGER, intent(in) :: pos
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
      !! Position in the list - must fulfill 0 < pos < list_size+1 .
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    INTEGER :: i
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    IF(.not. ASSOCIATED(list%arr)) &
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
       DBCSR_ABORT("list_routinestat_del: list is not initialized.")
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    IF(pos < 1)&
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
       DBCSR_ABORT("list_routinestat_det: pos < 1")
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    IF(pos > list%size)&
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
       DBCSR_ABORT("list_routinestat_det: pos > size")
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    deallocate(list%arr(pos)%p)
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    do i=pos, list%size-1
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
       list%arr(i)%p => list%arr(i+1)%p
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    end do
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
    list%size = list%size - 1
# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"

# 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_routinestat.F"
END SUBROUTINE list_routinestat_del