13#include "../base/base_uses.f90"
32 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
171 INTERFACE cp_insert_at
239 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous :: first_el => null()
265 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: first_el => null()
291 REAL(kind=
dp),
dimension(:),
pointer,
contiguous :: first_el => null()
317 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: first_el => null()
414 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: first_el
417 IF (.NOT.
PRESENT(first_el))
THEN
419 IF (
PRESENT(rest)) sll => rest
422 sll%first_el =>first_el
424 IF (
PRESENT(rest)) sll%rest => rest
438 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: first_el
441 IF (.NOT.
PRESENT(first_el))
THEN
443 IF (
PRESENT(rest)) sll => rest
446 sll%first_el =>first_el
448 IF (
PRESENT(rest)) sll%rest => rest
462 REAL(kind=
dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: first_el
465 IF (.NOT.
PRESENT(first_el))
THEN
467 IF (
PRESENT(rest)) sll => rest
470 sll%first_el =>first_el
472 IF (
PRESENT(rest)) sll%rest => rest
486 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: first_el
489 IF (.NOT.
PRESENT(first_el))
THEN
491 IF (
PRESENT(rest)) sll => rest
494 sll%first_el =>first_el
496 IF (
PRESENT(rest)) sll%rest => rest
513 IF (.NOT.
PRESENT(first_el))
THEN
515 IF (
PRESENT(rest)) sll => rest
518 sll%first_el =>first_el
520 IF (
PRESENT(rest)) sll%rest => rest
614 SUBROUTINE cp_sll_3d_r_dealloc_node(sll)
618 END SUBROUTINE cp_sll_3d_r_dealloc_node
626 SUBROUTINE cp_sll_3d_c_dealloc_node(sll)
630 END SUBROUTINE cp_sll_3d_c_dealloc_node
638 SUBROUTINE cp_sll_1d_r_dealloc_node(sll)
642 END SUBROUTINE cp_sll_1d_r_dealloc_node
650 SUBROUTINE cp_sll_1d_c_dealloc_node(sll)
654 END SUBROUTINE cp_sll_1d_c_dealloc_node
662 SUBROUTINE cp_sll_rs_dealloc_node(sll)
666 END SUBROUTINE cp_sll_rs_dealloc_node
680 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous :: res
694 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: res
708 REAL(kind=
dp),
dimension(:),
pointer,
contiguous :: res
722 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: res
755 INTEGER,
OPTIONAL :: iter
761 IF (.NOT.
ASSOCIATED(sll))
THEN
764 IF (
PRESENT(iter))
THEN
767 IF (
ASSOCIATED(res%rest))
THEN
770 cpabort(
"tried to go past end")
775 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
798 INTEGER,
OPTIONAL :: iter
804 IF (.NOT.
ASSOCIATED(sll))
THEN
807 IF (
PRESENT(iter))
THEN
810 IF (
ASSOCIATED(res%rest))
THEN
813 cpabort(
"tried to go past end")
818 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
841 INTEGER,
OPTIONAL :: iter
847 IF (.NOT.
ASSOCIATED(sll))
THEN
850 IF (
PRESENT(iter))
THEN
853 IF (
ASSOCIATED(res%rest))
THEN
856 cpabort(
"tried to go past end")
861 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
884 INTEGER,
OPTIONAL :: iter
890 IF (.NOT.
ASSOCIATED(sll))
THEN
893 IF (
PRESENT(iter))
THEN
896 IF (
ASSOCIATED(res%rest))
THEN
899 cpabort(
"tried to go past end")
904 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
927 INTEGER,
OPTIONAL :: iter
933 IF (.NOT.
ASSOCIATED(sll))
THEN
936 IF (
PRESENT(iter))
THEN
939 IF (
ASSOCIATED(res%rest))
THEN
942 cpabort(
"tried to go past end")
947 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
976 IF (
ASSOCIATED(iterator))
THEN
978 iterator => iterator%rest
1003 IF (
ASSOCIATED(iterator))
THEN
1005 iterator => iterator%rest
1030 IF (
ASSOCIATED(iterator))
THEN
1032 iterator => iterator%rest
1057 IF (
ASSOCIATED(iterator))
THEN
1059 iterator => iterator%rest
1084 IF (
ASSOCIATED(iterator))
THEN
1086 iterator => iterator%rest
1105 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous :: res
1107 INTEGER,
INTENT(in) :: index
1111 IF (index == -1)
THEN
1116 cpassert(
ASSOCIATED(pos))
1132 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: res
1134 INTEGER,
INTENT(in) :: index
1138 IF (index == -1)
THEN
1143 cpassert(
ASSOCIATED(pos))
1159 REAL(kind=
dp),
dimension(:),
pointer,
contiguous :: res
1161 INTEGER,
INTENT(in) :: index
1165 IF (index == -1)
THEN
1170 cpassert(
ASSOCIATED(pos))
1186 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: res
1188 INTEGER,
INTENT(in) :: index
1192 IF (index == -1)
THEN
1197 cpassert(
ASSOCIATED(pos))
1215 INTEGER,
INTENT(in) :: index
1219 IF (index == -1)
THEN
1224 cpassert(
ASSOCIATED(pos))
1242 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous ::
value
1244 INTEGER,
INTENT(in) :: index
1248 IF (index == -1)
THEN
1253 cpassert(
ASSOCIATED(pos))
1255 pos%first_el =>
value
1270 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: value
1272 INTEGER,
INTENT(in) :: index
1276 IF (index == -1)
THEN
1281 cpassert(
ASSOCIATED(pos))
1283 pos%first_el =>
value
1298 REAL(kind=
dp),
dimension(:),
pointer,
contiguous ::
value
1300 INTEGER,
INTENT(in) :: index
1304 IF (index == -1)
THEN
1309 cpassert(
ASSOCIATED(pos))
1311 pos%first_el =>
value
1326 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: value
1328 INTEGER,
INTENT(in) :: index
1332 IF (index == -1)
THEN
1337 cpassert(
ASSOCIATED(pos))
1339 pos%first_el =>
value
1356 INTEGER,
INTENT(in) :: index
1360 IF (index == -1)
THEN
1365 cpassert(
ASSOCIATED(pos))
1367 pos%first_el =>
value
1384 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: el_att
1387 IF (
ASSOCIATED(iterator))
THEN
1389 if (
present(el_att)) el_att =>iterator%first_el
1390 iterator => iterator%rest
1407 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: el_att
1410 IF (
ASSOCIATED(iterator))
THEN
1412 if (
present(el_att)) el_att =>iterator%first_el
1413 iterator => iterator%rest
1430 REAL(kind=
dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: el_att
1433 IF (
ASSOCIATED(iterator))
THEN
1435 if (
present(el_att)) el_att =>iterator%first_el
1436 iterator => iterator%rest
1453 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: el_att
1456 IF (
ASSOCIATED(iterator))
THEN
1458 if (
present(el_att)) el_att =>iterator%first_el
1459 iterator => iterator%rest
1479 IF (
ASSOCIATED(iterator))
THEN
1481 if (
present(el_att)) el_att =>iterator%first_el
1482 iterator => iterator%rest
1503 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous:: el
1526 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous:: el
1549 REAL(kind=
dp),
dimension(:),
pointer,
contiguous:: el
1572 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous:: el
1621 IF (
ASSOCIATED(sll))
THEN
1623 CALL cp_sll_3d_r_dealloc_node(node_to_rm)
1625 cpabort(
"tried to remove first el of an empty list")
1643 IF (
ASSOCIATED(sll))
THEN
1645 CALL cp_sll_3d_c_dealloc_node(node_to_rm)
1647 cpabort(
"tried to remove first el of an empty list")
1665 IF (
ASSOCIATED(sll))
THEN
1667 CALL cp_sll_1d_r_dealloc_node(node_to_rm)
1669 cpabort(
"tried to remove first el of an empty list")
1687 IF (
ASSOCIATED(sll))
THEN
1689 CALL cp_sll_1d_c_dealloc_node(node_to_rm)
1691 cpabort(
"tried to remove first el of an empty list")
1709 IF (
ASSOCIATED(sll))
THEN
1711 CALL cp_sll_rs_dealloc_node(node_to_rm)
1713 cpabort(
"tried to remove first el of an empty list")
1730 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous :: el
1731 INTEGER,
INTENT(in) :: index
1736 IF (index == 1)
THEN
1739 IF (index == -1)
THEN
1744 cpassert(
ASSOCIATED(pos))
1761 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: el
1762 INTEGER,
INTENT(in) :: index
1767 IF (index == 1)
THEN
1770 IF (index == -1)
THEN
1775 cpassert(
ASSOCIATED(pos))
1792 REAL(kind=
dp),
dimension(:),
pointer,
contiguous :: el
1793 INTEGER,
INTENT(in) :: index
1798 IF (index == 1)
THEN
1801 IF (index == -1)
THEN
1806 cpassert(
ASSOCIATED(pos))
1823 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: el
1824 INTEGER,
INTENT(in) :: index
1829 IF (index == 1)
THEN
1832 IF (index == -1)
THEN
1837 cpassert(
ASSOCIATED(pos))
1855 INTEGER,
INTENT(in) :: index
1860 IF (index == 1)
THEN
1863 IF (index == -1)
THEN
1868 cpassert(
ASSOCIATED(pos))
1885 INTEGER,
INTENT(in)::index
1889 IF (index == 1)
THEN
1892 IF (index == -1)
THEN
1897 cpassert(
ASSOCIATED(pos))
1913 INTEGER,
INTENT(in)::index
1917 IF (index == 1)
THEN
1920 IF (index == -1)
THEN
1925 cpassert(
ASSOCIATED(pos))
1941 INTEGER,
INTENT(in)::index
1945 IF (index == 1)
THEN
1948 IF (index == -1)
THEN
1953 cpassert(
ASSOCIATED(pos))
1969 INTEGER,
INTENT(in)::index
1973 IF (index == 1)
THEN
1976 IF (index == -1)
THEN
1981 cpassert(
ASSOCIATED(pos))
1997 INTEGER,
INTENT(in)::index
2001 IF (index == 1)
THEN
2004 IF (index == -1)
THEN
2009 cpassert(
ASSOCIATED(pos))
2030 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2031 next_node => actual_node%rest
2032 CALL cp_sll_3d_r_dealloc_node(actual_node)
2033 actual_node => next_node
2053 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2054 next_node => actual_node%rest
2055 CALL cp_sll_3d_c_dealloc_node(actual_node)
2056 actual_node => next_node
2076 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2077 next_node => actual_node%rest
2078 CALL cp_sll_1d_r_dealloc_node(actual_node)
2079 actual_node => next_node
2099 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2100 next_node => actual_node%rest
2101 CALL cp_sll_1d_c_dealloc_node(actual_node)
2102 actual_node => next_node
2122 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2123 next_node => actual_node%rest
2124 CALL cp_sll_rs_dealloc_node(actual_node)
2125 actual_node => next_node
2151 res(i) %array=>iter%first_el
2153 cpassert(ok .OR. i == len)
2177 res(i) %array=>iter%first_el
2179 cpassert(ok .OR. i == len)
2203 res(i) %array=>iter%first_el
2205 cpassert(ok .OR. i == len)
2229 res(i) %array=>iter%first_el
2231 cpassert(ok .OR. i == len)
2255 res(i) %rs_grid=>iter%first_el
2257 cpassert(ok .OR. i == len)
various utilities that regard array of different kinds: output, allocation,... maybe it is not a good...
subroutine, public cp_sll_3d_c_rm_el_at(sll, index)
removes the element at the given index
integer function, public cp_sll_1d_r_get_length(sll)
returns the length of the list
real(kind=dp) function, dimension(:), pointer, contiguous, public cp_sll_1d_r_get_el_at(sll, index)
returns the element at the given index
subroutine, public cp_sll_1d_r_insert_el_at(sll, el, index)
inserts the element at the given index
subroutine, public cp_sll_1d_c_dealloc(sll)
deallocates the singly linked list starting at sll. Does not work if loops are present!
integer function, public cp_sll_3d_r_get_length(sll)
returns the length of the list
integer function, public cp_sll_3d_c_get_length(sll)
returns the length of the list
subroutine, public cp_sll_rs_insert_el(sll, el)
insert an element at the beginning of the list
subroutine, public cp_sll_3d_r_insert_el_at(sll, el, index)
inserts the element at the given index
subroutine, public cp_sll_3d_r_set_el_at(sll, index, value)
sets the element at the given index
subroutine, public cp_sll_1d_r_rm_first_el(sll)
remove the first element of the linked list
type(cp_3d_r_cp_type) function, dimension(:), pointer, public cp_sll_3d_r_to_array(sll)
returns a newly allocated array with the same contents as the linked list
subroutine, public cp_sll_1d_r_dealloc(sll)
deallocates the singly linked list starting at sll. Does not work if loops are present!
subroutine, public cp_sll_1d_c_insert_el(sll, el)
insert an element at the beginning of the list
subroutine, public cp_sll_rs_rm_all_el(sll)
removes all the elements from the list
subroutine, public cp_sll_3d_c_set_el_at(sll, index, value)
sets the element at the given index
subroutine, public cp_sll_3d_r_rm_all_el(sll)
removes all the elements from the list
subroutine, public cp_sll_1d_c_set_el_at(sll, index, value)
sets the element at the given index
subroutine, public cp_sll_3d_c_create(sll, first_el, rest)
allocates and initializes a single linked list
subroutine, public cp_sll_3d_c_rm_first_el(sll)
remove the first element of the linked list
type(cp_1d_r_cp_type) function, dimension(:), pointer, public cp_sll_1d_r_to_array(sll)
returns a newly allocated array with the same contents as the linked list
type(cp_sll_1d_r_type) function, pointer, public cp_sll_1d_r_get_rest(sll, iter)
returns the rest of the list
real(kind=dp) function, dimension(:), pointer, contiguous, public cp_sll_1d_r_get_first_el(sll)
returns the first element stored in the list
subroutine, public cp_sll_1d_c_rm_all_el(sll)
removes all the elements from the list
subroutine, public cp_sll_rs_dealloc(sll)
deallocates the singly linked list starting at sll. Does not work if loops are present!
subroutine, public cp_sll_3d_c_insert_el_at(sll, el, index)
inserts the element at the given index
logical function, public cp_sll_3d_c_next(iterator, el_att)
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next...
integer function, public cp_sll_rs_get_length(sll)
returns the length of the list
type(realspace_grid_type) function, pointer, public cp_sll_rs_get_first_el(sll)
returns the first element stored in the list
subroutine, public cp_sll_1d_r_rm_el_at(sll, index)
removes the element at the given index
subroutine, public cp_sll_1d_c_rm_el_at(sll, index)
removes the element at the given index
real(kind=dp) function, dimension(:,:,:), pointer, contiguous, public cp_sll_3d_r_get_el_at(sll, index)
returns the element at the given index
subroutine, public cp_sll_rs_rm_first_el(sll)
remove the first element of the linked list
complex(kind=dp) function, dimension(:,:,:), pointer, contiguous, public cp_sll_3d_c_get_el_at(sll, index)
returns the element at the given index
logical function, public cp_sll_rs_next(iterator, el_att)
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next...
logical function, public cp_sll_1d_r_next(iterator, el_att)
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next...
subroutine, public cp_sll_3d_c_rm_all_el(sll)
removes all the elements from the list
complex(kind=dp) function, dimension(:), pointer, contiguous, public cp_sll_1d_c_get_first_el(sll)
returns the first element stored in the list
subroutine, public cp_sll_1d_r_set_el_at(sll, index, value)
sets the element at the given index
complex(kind=dp) function, dimension(:), pointer, contiguous, public cp_sll_1d_c_get_el_at(sll, index)
returns the element at the given index
subroutine, public cp_sll_3d_r_rm_el_at(sll, index)
removes the element at the given index
subroutine, public cp_sll_3d_r_insert_el(sll, el)
insert an element at the beginning of the list
subroutine, public cp_sll_1d_c_create(sll, first_el, rest)
allocates and initializes a single linked list
subroutine, public cp_sll_rs_rm_el_at(sll, index)
removes the element at the given index
subroutine, public cp_sll_1d_c_rm_first_el(sll)
remove the first element of the linked list
subroutine, public cp_sll_3d_c_dealloc(sll)
deallocates the singly linked list starting at sll. Does not work if loops are present!
logical function, public cp_sll_3d_r_next(iterator, el_att)
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next...
subroutine, public cp_sll_rs_insert_el_at(sll, el, index)
inserts the element at the given index
subroutine, public cp_sll_rs_create(sll, first_el, rest)
allocates and initializes a single linked list
integer function, public cp_sll_1d_c_get_length(sll)
returns the length of the list
complex(kind=dp) function, dimension(:,:,:), pointer, contiguous, public cp_sll_3d_c_get_first_el(sll)
returns the first element stored in the list
type(cp_sll_1d_c_type) function, pointer, public cp_sll_1d_c_get_rest(sll, iter)
returns the rest of the list
type(realspace_grid_p_type) function, dimension(:), pointer, public cp_sll_rs_to_array(sll)
returns a newly allocated array with the same contents as the linked list
type(cp_3d_c_cp_type) function, dimension(:), pointer, public cp_sll_3d_c_to_array(sll)
returns a newly allocated array with the same contents as the linked list
real(kind=dp) function, dimension(:,:,:), pointer, contiguous, public cp_sll_3d_r_get_first_el(sll)
returns the first element stored in the list
type(cp_1d_c_cp_type) function, dimension(:), pointer, public cp_sll_1d_c_to_array(sll)
returns a newly allocated array with the same contents as the linked list
type(cp_sll_3d_c_type) function, pointer, public cp_sll_3d_c_get_rest(sll, iter)
returns the rest of the list
subroutine, public cp_sll_1d_r_insert_el(sll, el)
insert an element at the beginning of the list
subroutine, public cp_sll_3d_c_insert_el(sll, el)
insert an element at the beginning of the list
subroutine, public cp_sll_rs_set_el_at(sll, index, value)
sets the element at the given index
subroutine, public cp_sll_1d_c_insert_el_at(sll, el, index)
inserts the element at the given index
subroutine, public cp_sll_1d_r_rm_all_el(sll)
removes all the elements from the list
subroutine, public cp_sll_3d_r_rm_first_el(sll)
remove the first element of the linked list
subroutine, public cp_sll_1d_r_create(sll, first_el, rest)
allocates and initializes a single linked list
type(cp_sll_3d_r_type) function, pointer, public cp_sll_3d_r_get_rest(sll, iter)
returns the rest of the list
subroutine, public cp_sll_3d_r_dealloc(sll)
deallocates the singly linked list starting at sll. Does not work if loops are present!
type(cp_sll_rs_type) function, pointer, public cp_sll_rs_get_rest(sll, iter)
returns the rest of the list
type(realspace_grid_type) function, pointer, public cp_sll_rs_get_el_at(sll, index)
returns the element at the given index
logical function, public cp_sll_1d_c_next(iterator, el_att)
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next...
subroutine, public cp_sll_3d_r_create(sll, first_el, rest)
allocates and initializes a single linked list
Defines the basic variable types.
integer, parameter, public dp
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
represent a pointer to a contiguous 1d array
represent a pointer to a contiguous 1d array
represent a pointer to a contiguous 3d array
represent a pointer to a contiguous 3d array
pointer to a linked list (to make arrays of pointers)
represent a single linked list that stores pointers to the elements
pointer to a linked list (to make arrays of pointers)
represent a single linked list that stores pointers to the elements
pointer to a linked list (to make arrays of pointers)
represent a single linked list that stores pointers to the elements
pointer to a linked list (to make arrays of pointers)
represent a single linked list that stores pointers to the elements
pointer to a linked list (to make arrays of pointers)
represent a single linked list that stores pointers to the elements