Allocates the internal data-structures of the given list. This has to be called before any of the other routines. For deallocation call list_[valuetype]_destroy.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(list_timerenv_type), | intent(inout) | :: | list | |||
integer, | intent(in), | optional | :: | initial_capacity |
The initial size of the internal array (default=11). |
SUBROUTINE list_timerenv_init(list, initial_capacity) # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" !! Allocates the internal data-structures of the given list. # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" !! This has to be called before any of the other routines. # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" !! For deallocation call list_[valuetype]_destroy. # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" TYPE(list_timerenv_type), intent(inout) :: list # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" INTEGER, INTENT(in), OPTIONAL :: initial_capacity # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" !! The initial size of the internal array (default=11). # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" INTEGER :: stat # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" INTEGER :: initial_capacity_ # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" initial_capacity_ = 11 # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" If(PRESENT(initial_capacity)) initial_capacity_ = initial_capacity # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" IF(initial_capacity_ < 0) & # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" DBCSR_ABORT("list_timerenv_create: initial_capacity < 0") # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" IF(ASSOCIATED(list%arr)) & # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" DBCSR_ABORT("list_timerenv_create: list is already initialized.") # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" ALLOCATE(list%arr(initial_capacity_), stat=stat) # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" IF (stat/=0)& # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" DBCSR_ABORT("list_timerenv_init: allocation failed") # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" list%size = 0 # 21 "/__w/dbcsr/dbcsr/src/core/dbcsr_list_timerenv.F" END SUBROUTINE list_timerenv_init