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()
415 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: first_el
418 IF (.NOT.
PRESENT(first_el))
THEN
420 IF (
PRESENT(rest)) sll => rest
423 sll%first_el =>first_el
425 IF (
PRESENT(rest)) sll%rest => rest
439 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: first_el
442 IF (.NOT.
PRESENT(first_el))
THEN
444 IF (
PRESENT(rest)) sll => rest
447 sll%first_el =>first_el
449 IF (
PRESENT(rest)) sll%rest => rest
463 REAL(kind=
dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: first_el
466 IF (.NOT.
PRESENT(first_el))
THEN
468 IF (
PRESENT(rest)) sll => rest
471 sll%first_el =>first_el
473 IF (
PRESENT(rest)) sll%rest => rest
487 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: first_el
490 IF (.NOT.
PRESENT(first_el))
THEN
492 IF (
PRESENT(rest)) sll => rest
495 sll%first_el =>first_el
497 IF (
PRESENT(rest)) sll%rest => rest
514 IF (.NOT.
PRESENT(first_el))
THEN
516 IF (
PRESENT(rest)) sll => rest
519 sll%first_el =>first_el
521 IF (
PRESENT(rest)) sll%rest => rest
615 SUBROUTINE cp_sll_3d_r_dealloc_node(sll)
619 END SUBROUTINE cp_sll_3d_r_dealloc_node
627 SUBROUTINE cp_sll_3d_c_dealloc_node(sll)
631 END SUBROUTINE cp_sll_3d_c_dealloc_node
639 SUBROUTINE cp_sll_1d_r_dealloc_node(sll)
643 END SUBROUTINE cp_sll_1d_r_dealloc_node
651 SUBROUTINE cp_sll_1d_c_dealloc_node(sll)
655 END SUBROUTINE cp_sll_1d_c_dealloc_node
663 SUBROUTINE cp_sll_rs_dealloc_node(sll)
667 END SUBROUTINE cp_sll_rs_dealloc_node
681 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous :: res
695 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: res
709 REAL(kind=
dp),
dimension(:),
pointer,
contiguous :: res
723 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: res
756 INTEGER,
OPTIONAL :: iter
762 IF (.NOT.
ASSOCIATED(sll))
THEN
765 IF (
PRESENT(iter))
THEN
768 IF (
ASSOCIATED(res%rest))
THEN
771 cpabort(
"tried to go past end")
776 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
799 INTEGER,
OPTIONAL :: iter
805 IF (.NOT.
ASSOCIATED(sll))
THEN
808 IF (
PRESENT(iter))
THEN
811 IF (
ASSOCIATED(res%rest))
THEN
814 cpabort(
"tried to go past end")
819 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
842 INTEGER,
OPTIONAL :: iter
848 IF (.NOT.
ASSOCIATED(sll))
THEN
851 IF (
PRESENT(iter))
THEN
854 IF (
ASSOCIATED(res%rest))
THEN
857 cpabort(
"tried to go past end")
862 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
885 INTEGER,
OPTIONAL :: iter
891 IF (.NOT.
ASSOCIATED(sll))
THEN
894 IF (
PRESENT(iter))
THEN
897 IF (
ASSOCIATED(res%rest))
THEN
900 cpabort(
"tried to go past end")
905 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
928 INTEGER,
OPTIONAL :: iter
934 IF (.NOT.
ASSOCIATED(sll))
THEN
937 IF (
PRESENT(iter))
THEN
940 IF (
ASSOCIATED(res%rest))
THEN
943 cpabort(
"tried to go past end")
948 IF (.NOT.
ASSOCIATED(res%rest))
EXIT
977 IF (
ASSOCIATED(iterator))
THEN
979 iterator => iterator%rest
1004 IF (
ASSOCIATED(iterator))
THEN
1006 iterator => iterator%rest
1031 IF (
ASSOCIATED(iterator))
THEN
1033 iterator => iterator%rest
1058 IF (
ASSOCIATED(iterator))
THEN
1060 iterator => iterator%rest
1085 IF (
ASSOCIATED(iterator))
THEN
1087 iterator => iterator%rest
1106 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous :: res
1108 INTEGER,
INTENT(in) :: index
1112 IF (index == -1)
THEN
1117 cpassert(
ASSOCIATED(pos))
1133 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: res
1135 INTEGER,
INTENT(in) :: index
1139 IF (index == -1)
THEN
1144 cpassert(
ASSOCIATED(pos))
1160 REAL(kind=
dp),
dimension(:),
pointer,
contiguous :: res
1162 INTEGER,
INTENT(in) :: index
1166 IF (index == -1)
THEN
1171 cpassert(
ASSOCIATED(pos))
1187 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: res
1189 INTEGER,
INTENT(in) :: index
1193 IF (index == -1)
THEN
1198 cpassert(
ASSOCIATED(pos))
1216 INTEGER,
INTENT(in) :: index
1220 IF (index == -1)
THEN
1225 cpassert(
ASSOCIATED(pos))
1243 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous ::
value
1245 INTEGER,
INTENT(in) :: index
1249 IF (index == -1)
THEN
1254 cpassert(
ASSOCIATED(pos))
1256 pos%first_el =>
value
1271 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: value
1273 INTEGER,
INTENT(in) :: index
1277 IF (index == -1)
THEN
1282 cpassert(
ASSOCIATED(pos))
1284 pos%first_el =>
value
1299 REAL(kind=
dp),
dimension(:),
pointer,
contiguous ::
value
1301 INTEGER,
INTENT(in) :: index
1305 IF (index == -1)
THEN
1310 cpassert(
ASSOCIATED(pos))
1312 pos%first_el =>
value
1327 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: value
1329 INTEGER,
INTENT(in) :: index
1333 IF (index == -1)
THEN
1338 cpassert(
ASSOCIATED(pos))
1340 pos%first_el =>
value
1357 INTEGER,
INTENT(in) :: index
1361 IF (index == -1)
THEN
1366 cpassert(
ASSOCIATED(pos))
1368 pos%first_el =>
value
1385 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: el_att
1388 IF (
ASSOCIATED(iterator))
THEN
1390 if (
present(el_att)) el_att =>iterator%first_el
1391 iterator => iterator%rest
1408 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous,
OPTIONAL :: el_att
1411 IF (
ASSOCIATED(iterator))
THEN
1413 if (
present(el_att)) el_att =>iterator%first_el
1414 iterator => iterator%rest
1431 REAL(kind=
dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: el_att
1434 IF (
ASSOCIATED(iterator))
THEN
1436 if (
present(el_att)) el_att =>iterator%first_el
1437 iterator => iterator%rest
1454 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous,
OPTIONAL :: el_att
1457 IF (
ASSOCIATED(iterator))
THEN
1459 if (
present(el_att)) el_att =>iterator%first_el
1460 iterator => iterator%rest
1480 IF (
ASSOCIATED(iterator))
THEN
1482 if (
present(el_att)) el_att =>iterator%first_el
1483 iterator => iterator%rest
1504 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous:: el
1527 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous:: el
1550 REAL(kind=
dp),
dimension(:),
pointer,
contiguous:: el
1573 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous:: el
1622 IF (
ASSOCIATED(sll))
THEN
1624 CALL cp_sll_3d_r_dealloc_node(node_to_rm)
1626 cpabort(
"tried to remove first el of an empty list")
1644 IF (
ASSOCIATED(sll))
THEN
1646 CALL cp_sll_3d_c_dealloc_node(node_to_rm)
1648 cpabort(
"tried to remove first el of an empty list")
1666 IF (
ASSOCIATED(sll))
THEN
1668 CALL cp_sll_1d_r_dealloc_node(node_to_rm)
1670 cpabort(
"tried to remove first el of an empty list")
1688 IF (
ASSOCIATED(sll))
THEN
1690 CALL cp_sll_1d_c_dealloc_node(node_to_rm)
1692 cpabort(
"tried to remove first el of an empty list")
1710 IF (
ASSOCIATED(sll))
THEN
1712 CALL cp_sll_rs_dealloc_node(node_to_rm)
1714 cpabort(
"tried to remove first el of an empty list")
1731 REAL(kind=
dp),
dimension(:,:,:),
pointer,
contiguous :: el
1732 INTEGER,
INTENT(in) :: index
1737 IF (index == 1)
THEN
1740 IF (index == -1)
THEN
1745 cpassert(
ASSOCIATED(pos))
1762 COMPLEX(kind=dp),
dimension(:,:,:),
pointer,
contiguous :: el
1763 INTEGER,
INTENT(in) :: index
1768 IF (index == 1)
THEN
1771 IF (index == -1)
THEN
1776 cpassert(
ASSOCIATED(pos))
1793 REAL(kind=
dp),
dimension(:),
pointer,
contiguous :: el
1794 INTEGER,
INTENT(in) :: index
1799 IF (index == 1)
THEN
1802 IF (index == -1)
THEN
1807 cpassert(
ASSOCIATED(pos))
1824 COMPLEX(kind=dp),
dimension(:),
pointer,
contiguous :: el
1825 INTEGER,
INTENT(in) :: index
1830 IF (index == 1)
THEN
1833 IF (index == -1)
THEN
1838 cpassert(
ASSOCIATED(pos))
1856 INTEGER,
INTENT(in) :: index
1861 IF (index == 1)
THEN
1864 IF (index == -1)
THEN
1869 cpassert(
ASSOCIATED(pos))
1886 INTEGER,
INTENT(in)::index
1890 IF (index == 1)
THEN
1893 IF (index == -1)
THEN
1898 cpassert(
ASSOCIATED(pos))
1914 INTEGER,
INTENT(in)::index
1918 IF (index == 1)
THEN
1921 IF (index == -1)
THEN
1926 cpassert(
ASSOCIATED(pos))
1942 INTEGER,
INTENT(in)::index
1946 IF (index == 1)
THEN
1949 IF (index == -1)
THEN
1954 cpassert(
ASSOCIATED(pos))
1970 INTEGER,
INTENT(in)::index
1974 IF (index == 1)
THEN
1977 IF (index == -1)
THEN
1982 cpassert(
ASSOCIATED(pos))
1998 INTEGER,
INTENT(in)::index
2002 IF (index == 1)
THEN
2005 IF (index == -1)
THEN
2010 cpassert(
ASSOCIATED(pos))
2031 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2032 next_node => actual_node%rest
2033 CALL cp_sll_3d_r_dealloc_node(actual_node)
2034 actual_node => next_node
2054 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2055 next_node => actual_node%rest
2056 CALL cp_sll_3d_c_dealloc_node(actual_node)
2057 actual_node => next_node
2077 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2078 next_node => actual_node%rest
2079 CALL cp_sll_1d_r_dealloc_node(actual_node)
2080 actual_node => next_node
2100 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2101 next_node => actual_node%rest
2102 CALL cp_sll_1d_c_dealloc_node(actual_node)
2103 actual_node => next_node
2123 IF (.NOT.
ASSOCIATED(actual_node))
EXIT
2124 next_node => actual_node%rest
2125 CALL cp_sll_rs_dealloc_node(actual_node)
2126 actual_node => next_node
2152 res(i) %array=>iter%first_el
2154 cpassert(ok .OR. i == len)
2178 res(i) %array=>iter%first_el
2180 cpassert(ok .OR. i == len)
2204 res(i) %array=>iter%first_el
2206 cpassert(ok .OR. i == len)
2230 res(i) %array=>iter%first_el
2232 cpassert(ok .OR. i == len)
2256 res(i) %rs_grid=>iter%first_el
2258 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