27 class(*),
pointer :: data => null()
28 logical :: memory_allocation_automatic
33 logical :: memory_allocation_automatic
35 character(len=STRING_LENGTH) :: key
37 class(*),
pointer ::
value => null()
43 character(len=STRING_LENGTH) :: key
47 character(len=STRING_LENGTH) :: key
48 class(*),
pointer ::
value => null()
53 type(
list_type),
dimension(:),
pointer :: hash_structure
64 integer,
private :: size=0
96 type(
list_type),
pointer,
dimension(:),
private :: map_ds => null()
97 integer,
private :: size=0
103 type(
list_type),
pointer,
dimension(:),
private :: set_ds => null()
104 integer,
private :: size=0
628 type(
map_type),
intent(inout) :: specificmap
645 type(
map_type),
intent(inout) :: specificmap
646 integer,
intent(in) :: int_data
647 character(len=*),
intent(in) :: key
649 class(*),
pointer :: generic
651 generic=>conv_to_generic(int_data, .true.)
665 type(
map_type),
intent(inout) :: specificmap
666 character(len=STRING_LENGTH),
intent(in) :: str_data
667 character(len=*),
intent(in) :: key
669 class(*),
pointer :: generic
671 generic=>conv_to_generic(str_data, .true.)
685 type(
map_type),
intent(inout) :: specificmap
686 real(kind=default_precision),
intent(in) :: real_data
687 character(len=*),
intent(in) :: key
689 class(*),
pointer :: generic
691 generic=>conv_to_generic(real_data, .true.)
705 type(
map_type),
intent(inout) :: specificmap
706 logical,
intent(in) :: logical_data
707 character(len=*),
intent(in) :: key
709 class(*),
pointer :: generic
711 generic=>conv_to_generic(logical_data, .true.)
726 type(
map_type),
intent(inout) :: specificmap
727 class(*),
pointer,
intent(in) :: data
728 character(len=*),
intent(in) :: key
729 logical,
intent(in) :: memory_allocation_automatic
731 class(*),
pointer :: raw_map_node, generic_map_node
737 if (
associated(raw_map_node))
then
738 select type(raw_map_node)
740 raw_map_node%value =>
data
744 newmapnode%value =>
data
746 newmapnode%memory_allocation_automatic=memory_allocation_automatic
749 allocate(generic_map_node, source=newmapnode)
750 deallocate(newmapnode)
762 type(
map_type),
intent(inout) :: specificmap
763 character(len=*),
intent(in) :: key
765 integer :: key_location
766 class(*),
pointer :: raw_map_node
768 raw_map_node =>
map_getnode(specificmap, key, key_location)
778 character(len=STRING_LENGTH) function map_key_at(specificmap, i)
779 type(
map_type),
intent(inout) :: specificmap
780 integer,
intent(in) :: i
782 class(*),
pointer :: raw_map_node
783 integer :: the_map_size
785 the_map_size =
map_size(specificmap)
786 if (i .le. the_map_size)
then
788 if (
associated(raw_map_node))
then
789 select type(raw_map_node)
806 type(
map_type),
intent(inout) :: specificmap
807 integer,
intent(in) :: i
810 class(*),
pointer :: generic
813 if (.not.
associated(generic))
call log_log(log_error,
"Can not find integer at "//trim(conv_to_string(i)))
824 type(
map_type),
intent(inout) :: specificmap
825 integer,
intent(in) :: i
828 class(*),
pointer :: generic
831 if (.not.
associated(generic))
call log_log(log_error,
"Can not find string at "//trim(conv_to_string(i)))
832 map_string_at=conv_to_string(generic, .false., string_length)
842 type(
map_type),
intent(inout) :: specificmap
843 integer,
intent(in) :: i
846 class(*),
pointer :: generic
849 if (.not.
associated(generic))
call log_log(log_error,
"Can not find real at "//trim(conv_to_string(i)))
850 select type(vr=>generic)
851 type is (real(kind=default_precision))
856 map_real_at=conv_single_real_to_double(conv_to_real(vr))
867 type(
map_type),
intent(inout) :: specificmap
868 integer,
intent(in) :: i
871 class(*),
pointer :: generic
874 if (.not.
associated(generic))
call log_log(log_error,
"Can not find logical at "//trim(conv_to_string(i)))
885 type(
map_type),
intent(inout) :: specificmap
886 integer,
intent(in) :: i
889 integer :: the_map_size
891 the_map_size =
map_size(specificmap)
892 if (i .le. the_map_size)
then
894 if (
associated(raw_map_node))
then
895 select type(raw_map_node)
913 type(
map_type),
intent(inout) :: specificmap
914 integer,
intent(in) :: i
915 character(len=*),
intent(out) :: key
916 integer,
intent(out) :: int_val
918 class(*),
pointer :: generic
921 if (.not.
associated(generic))
call log_log(log_error,
"Can not find integer entry with key '"//trim(key)//
"'")
922 int_val=conv_to_integer(generic, .false.)
933 type(
map_type),
intent(inout) :: specificmap
934 integer,
intent(in) :: i
935 character(len=*),
intent(out) :: key
936 character(len=STRING_LENGTH),
intent(out) :: str_val
938 class(*),
pointer :: generic
941 if (.not.
associated(generic))
call log_log(log_error,
"Can not find string entry with key '"//trim(key)//
"'")
942 str_val=conv_to_string(generic, .false., string_length)
953 type(
map_type),
intent(inout) :: specificmap
954 integer,
intent(in) :: i
955 character(len=*),
intent(out) :: key
956 real(kind=default_precision),
intent(out) :: real_val
958 class(*),
pointer :: generic
961 if (.not.
associated(generic))
call log_log(log_error,
"Can not find real entry with key '"//trim(key)//
"'")
962 select type(vr=>generic)
963 type is (real(kind=default_precision))
966 real_val=conv_single_real_to_double(vr)
968 real_val=conv_single_real_to_double(conv_to_real(vr))
980 type(
map_type),
intent(inout) :: specificmap
981 integer,
intent(in) :: i
982 character(len=*),
intent(out) :: key
983 logical,
intent(out) :: logical_val
985 class(*),
pointer :: generic
988 if (.not.
associated(generic))
call log_log(log_error,
"Can not find logical entry with key '"//trim(key)//
"'")
989 logical_val=conv_to_logical(generic, .false.)
1000 type(
map_type),
intent(inout) :: specificmap
1001 integer,
intent(in) :: i
1002 character(len=*),
intent(out) :: key
1003 class(*),
pointer,
intent(out) :: val
1005 class(*),
pointer :: raw_map_node
1006 integer :: the_map_size
1008 the_map_size =
map_size(specificmap)
1009 if (i .le. the_map_size)
then
1011 if (
associated(raw_map_node))
then
1012 select type(raw_map_node)
1014 val=>raw_map_node%value
1015 key=raw_map_node%key
1031 type(
map_type),
intent(inout) :: specificmap
1032 character(len=*),
intent(in) :: key
1034 integer :: key_location
1035 class(*),
pointer :: raw_map_node
1037 raw_map_node=>
map_getnode(specificmap, key, key_location)
1039 if (key_location .gt. 0)
then
1040 select type (raw_map_node)
1042 if (raw_map_node%memory_allocation_automatic)
then
1043 if (
associated(raw_map_node%value))
deallocate(raw_map_node%value)
1045 deallocate(raw_map_node)
1047 call list_remove(specificmap%map_ds, key_location)
1058 type(
map_type),
intent(inout) :: specificmap
1059 character(len=*),
intent(in) :: key
1062 class(*),
pointer :: generic
1065 if (.not.
associated(generic))
call log_log(log_error,
"Can not find integer entry with key '"//trim(key)//
"'")
1076 type(
map_type),
intent(inout) :: specificmap
1077 character(len=*),
intent(in) :: key
1080 class(*),
pointer :: generic
1083 if (.not.
associated(generic))
call log_log(log_error,
"Can not find string entry with key '"//trim(key)//
"'")
1094 type(
map_type),
intent(inout) :: specificmap
1095 character(len=*),
intent(in) :: key
1098 class(*),
pointer :: generic
1101 if (.not.
associated(generic))
call log_log(log_error,
"Can not find real entry with key '"//trim(key)//
"'")
1102 select type(vr=>generic)
1103 type is (real(kind=default_precision))
1108 map_get_real=conv_single_real_to_double(conv_to_real(vr))
1119 type(
map_type),
intent(inout) :: specificmap
1120 character(len=*),
intent(in) :: key
1123 class(*),
pointer :: generic
1126 if (.not.
associated(generic))
call log_log(log_error,
"Can not find logical entry with key '"//trim(key)//
"'")
1137 type(
map_type),
intent(inout) :: specificmap
1138 character(len=*),
intent(in) :: key
1142 if (
associated(raw_map_node))
then
1143 select type (raw_map_node)
1161 type(
map_type),
intent(inout) :: specificmap
1162 integer,
intent(out),
optional :: foundindex
1163 character(len=*),
intent(in) :: key
1170 node=>specificmap%map_ds%head
1171 if (
associated(node))
then
1174 if (
associated(raw_data))
then
1175 select type (raw_data)
1177 if (raw_data%key .eq. key)
then
1179 if (
present(foundindex)) foundindex=i
1186 if (.not.
associated(node))
exit
1190 if(
present(foundindex)) foundindex = 0
1199 type(
map_type),
intent(inout) :: specificmap
1210 type(
map_type),
intent(inout) :: specificmap
1222 type(
map_type),
intent(inout) :: specificmap
1226 node=>specificmap%map_ds%head
1227 previousnode=>null()
1229 if (
associated(node))
then
1233 if (
associated(previousnode%data))
then
1234 select type (n=>previousnode%data)
1236 if (n%memory_allocation_automatic)
then
1237 if (
associated(n%value))
deallocate(n%value)
1240 deallocate(previousnode%data)
1242 deallocate(previousnode)
1243 if (.not.
associated(node))
exit
1247 specificmap%map_ds%tail=>null()
1248 specificmap%map_ds%head=>null()
1249 specificmap%map_ds%size=0
1261 if (
associated(specificmap%map_ds))
then
1264 do i=1,
size(specificmap%map_ds)
1265 if (specificmap%map_ds(i)%size .gt. 0)
then
1285 integer,
intent(in) :: int_data
1286 character(len=*),
intent(in) :: key
1288 class(*),
pointer :: generic
1290 generic=>conv_to_generic(int_data, .true.)
1305 character(len=STRING_LENGTH),
intent(in) :: str_data
1306 character(len=*),
intent(in) :: key
1308 class(*),
pointer :: generic
1310 generic=>conv_to_generic(str_data, .true.)
1325 real(kind=default_precision),
intent(in) :: real_data
1326 character(len=*),
intent(in) :: key
1328 class(*),
pointer :: generic
1330 generic=>conv_to_generic(real_data, .true.)
1345 logical,
intent(in) :: logical_data
1346 character(len=*),
intent(in) :: key
1348 class(*),
pointer :: generic
1350 generic=>conv_to_generic(logical_data, .true.)
1366 class(*),
pointer,
intent(in) :: data
1367 character(len=*),
intent(in) :: key
1368 logical,
intent(in) :: memory_allocation_automatic
1370 class(*),
pointer :: raw_map_node, generic_map_node
1373 if (.not.
associated(specificmap%map_ds))
allocate(specificmap%map_ds(
hash_size))
1378 if (
associated(raw_map_node))
then
1379 select type(raw_map_node)
1381 raw_map_node%value=>
data
1384 allocate(newmapnode)
1385 newmapnode%value=>
data
1387 newmapnode%memory_allocation_automatic=memory_allocation_automatic
1390 allocate(generic_map_node, source=newmapnode)
1391 deallocate(newmapnode)
1393 specificmap%size=specificmap%size+1
1405 character(len=*),
intent(in) :: key
1407 class(*),
pointer :: raw_map_node
1422 integer,
intent(in) :: i
1424 class(*),
pointer :: raw_map_node
1427 if (
associated(raw_map_node))
then
1428 select type(raw_map_node)
1447 integer,
intent(in) :: i
1450 class(*),
pointer :: generic
1453 if (.not.
associated(generic))
call log_log(log_error,
"Can not find integer at "//trim(conv_to_string(i)))
1466 integer,
intent(in) :: i
1469 class(*),
pointer :: generic
1472 if (.not.
associated(generic))
call log_log(log_error,
"Can not find string at "//trim(conv_to_string(i)))
1485 integer,
intent(in) :: i
1488 class(*),
pointer :: generic
1491 if (.not.
associated(generic))
call log_log(log_error,
"Can not find real at "//trim(conv_to_string(i)))
1492 select type(vr=>generic)
1493 type is (real(kind=default_precision))
1511 integer,
intent(in) :: i
1514 class(*),
pointer :: generic
1517 if (.not.
associated(generic))
call log_log(log_error,
"Can not find logical at "//trim(conv_to_string(i)))
1530 integer,
intent(in) :: i
1535 if (
associated(raw_map_node))
then
1536 select type(raw_map_node)
1555 integer,
intent(in) :: i
1556 character(len=*),
intent(out) :: key
1557 integer,
intent(out) :: int_val
1559 class(*),
pointer :: generic
1562 if (.not.
associated(generic))
call log_log(log_error,
"Can not find integer entry with key '"//trim(key)//
"'")
1563 int_val=conv_to_integer(generic, .false.)
1575 integer,
intent(in) :: i
1576 character(len=*),
intent(out) :: key
1577 character(len=STRING_LENGTH),
intent(out) :: str_val
1579 class(*),
pointer :: generic
1582 if (.not.
associated(generic))
call log_log(log_error,
"Can not find string entry with key '"//trim(key)//
"'")
1583 str_val=conv_to_string(generic, .false., string_length)
1595 integer,
intent(in) :: i
1596 character(len=*),
intent(out) :: key
1597 real(kind=default_precision),
intent(out) :: real_val
1599 class(*),
pointer :: generic
1602 if (.not.
associated(generic))
call log_log(log_error,
"Can not find real entry with key '"//trim(key)//
"'")
1603 select type(vr=>generic)
1604 type is (real(kind=default_precision))
1607 real_val=conv_single_real_to_double(vr)
1609 real_val=conv_single_real_to_double(conv_to_real(vr))
1622 integer,
intent(in) :: i
1623 character(len=*),
intent(out) :: key
1624 logical,
intent(out) :: logical_val
1626 class(*),
pointer :: generic
1629 if (.not.
associated(generic))
call log_log(log_error,
"Can not find logical entry with key '"//trim(key)//
"'")
1630 logical_val=conv_to_logical(generic, .false.)
1642 integer,
intent(in) :: i
1643 character(len=*),
intent(out) :: key
1644 class(*),
pointer,
intent(out) :: val
1646 class(*),
pointer :: raw_map_node
1649 if (
associated(raw_map_node))
then
1650 select type(raw_map_node)
1652 val=>raw_map_node%value
1653 key=raw_map_node%key
1669 character(len=*),
intent(in) :: key
1671 integer :: key_location
1672 class(*),
pointer :: raw_map_node
1676 if (key_location .gt. 0)
then
1677 select type (raw_map_node)
1679 if (raw_map_node%memory_allocation_automatic)
then
1680 if (
associated(raw_map_node%value))
deallocate(raw_map_node%value)
1682 deallocate(raw_map_node)
1685 specificmap%size=specificmap%size-1
1697 character(len=*),
intent(in) :: key
1700 class(*),
pointer :: generic
1703 if (.not.
associated(generic))
call log_log(log_error,
"Can not find integer entry with key '"//trim(key)//
"'")
1715 character(len=*),
intent(in) :: key
1718 class(*),
pointer :: generic
1721 if (.not.
associated(generic))
call log_log(log_error,
"Can not find string entry with key '"//trim(key)//
"'")
1733 character(len=*),
intent(in) :: key
1736 class(*),
pointer :: generic
1739 if (.not.
associated(generic))
call log_log(log_error,
"Can not find real entry with key '"//trim(key)//
"'")
1740 select type(vr=>generic)
1741 type is (real(kind=default_precision))
1758 character(len=*),
intent(in) :: key
1761 class(*),
pointer :: generic
1764 if (.not.
associated(generic))
call log_log(log_error,
"Can not find logical entry with key '"//trim(key)//
"'")
1776 character(len=*),
intent(in) :: key
1780 if (
associated(raw_map_node))
then
1781 select type (raw_map_node)
1800 character(len=*),
intent(in) :: key
1801 integer,
intent(out),
optional :: key_location
1808 if (
present(key_location)) key_location=0
1810 if (.not.
associated(specificmap%map_ds))
return
1815 node=>specificmap%map_ds(hash)%head
1816 if (
associated(node))
then
1819 if (
associated(raw_data))
then
1820 select type (raw_data)
1822 if (raw_data%key .eq. key)
then
1824 if (
present(key_location)) key_location=i
1831 if (.not.
associated(node))
exit
1834 if (
present(key_location)) key_location=0
1844 integer,
intent(in) :: index
1847 integer :: i, current_size, prev
1850 if (.not.
associated(specificmap%map_ds) .or. index .gt. specificmap%size)
return
1855 current_size=current_size+
list_size(specificmap%map_ds(i))
1856 if (current_size .ge. index)
then
1898 if (
associated(specificmap%map_ds))
then
1900 node=>specificmap%map_ds(i)%head
1901 previousnode=>null()
1903 if (
associated(node))
then
1907 if (
associated(previousnode%data))
then
1908 select type (n=>previousnode%data)
1910 if (n%memory_allocation_automatic)
then
1911 if (
associated(n%value))
deallocate(n%value)
1914 deallocate(previousnode%data)
1916 deallocate(previousnode)
1917 if (.not.
associated(node))
exit
1921 specificmap%map_ds(i)%tail=>null()
1922 specificmap%map_ds(i)%head=>null()
1923 specificmap%map_ds(i)%size=0
1926 deallocate(specificmap%map_ds)
1939 if (
associated(specificset%set_ds))
then
1942 do i=1,
size(specificset%set_ds)
1943 if (specificset%set_ds(i)%size .gt. 0)
then
1960 character(len=*),
intent(in) :: key
1962 class(*),
pointer :: generic
1964 integer :: hash, location
1966 if (.not.
associated(specificset%set_ds))
allocate(specificset%set_ds(
hash_size))
1970 if (hash .gt. 0 .and. location .eq. 0)
then
1971 allocate(newsetnode)
1975 allocate(generic, source=newsetnode)
1976 deallocate(newsetnode)
1978 specificset%size=specificset%size+1
1989 character(len=*),
intent(in) :: key
1991 integer :: location, hash
1994 if (hash .gt. 0 .and. location .gt. 0)
then
1995 call list_remove(specificset%set_ds(hash), location)
1996 specificset%size=specificset%size-1
2007 character(len=*),
intent(in) :: key
2009 integer :: hash, key_location
2025 character(len=*),
intent(in) :: key
2026 integer,
intent(out) :: hash, key_location
2027 class(*),
pointer :: raw_data
2035 if (.not.
associated(specificset%set_ds))
return
2040 node=>specificset%set_ds(hash)%head
2041 if (
associated(node))
then
2044 if (
associated(raw_data))
then
2045 select type (raw_data)
2047 if (raw_data%key .eq. key)
then
2055 if (.not.
associated(node))
exit
2080 integer,
intent(in) :: index
2081 class(*),
pointer :: generic
2083 integer :: i, current_size, prev
2086 if (.not.
associated(specificset%set_ds) .or. index .gt. specificset%size)
return
2091 current_size=current_size+
list_size(specificset%set_ds(i))
2092 if (current_size .ge. index)
then
2094 if (
associated(generic))
then
2095 select type (generic)
2101 call log_log(log_error,
"Can not find hashset entry at index "//trim(conv_to_string(index)))
2120 if (
associated(specificset%set_ds))
then
2122 node=>specificset%set_ds(i)%head
2123 previousnode=>null()
2125 if (
associated(node))
then
2129 if (
associated(previousnode%data))
then
2130 deallocate(previousnode%data)
2132 deallocate(previousnode)
2133 if (.not.
associated(node))
exit
2137 specificset%set_ds(i)%tail=>null()
2138 specificset%set_ds(i)%head=>null()
2139 specificset%set_ds(i)%size=0
2142 deallocate(specificset%set_ds)
2162 character(len=*),
intent(in) :: key
2167 do i=1, len(trim(key))
2177 type(
stack_type),
intent(inout) :: specificstack
2190 type(
stack_type),
intent(inout) :: specificstack
2191 integer,
intent(in) :: int_data
2193 class(*),
pointer :: generic
2195 generic=>conv_to_generic(int_data, .true.)
2205 type(
stack_type),
intent(inout) :: specificstack
2206 character(len=STRING_LENGTH),
intent(in) :: str_data
2208 class(*),
pointer :: generic
2210 generic=>conv_to_generic(str_data, .true.)
2220 type(
stack_type),
intent(inout) :: specificstack
2221 real(kind=default_precision),
intent(in) :: real_data
2223 class(*),
pointer :: generic
2225 generic=>conv_to_generic(real_data, .true.)
2235 type(
stack_type),
intent(inout) :: specificstack
2236 logical,
intent(in) :: logical_data
2238 class(*),
pointer :: generic
2240 generic=>conv_to_generic(logical_data, .true.)
2251 type(
stack_type),
intent(inout) :: specificstack
2252 class(*),
pointer,
intent(in) :: data
2253 logical,
intent(in) :: memory_allocation_automatic
2264 type(
stack_type),
intent(inout) :: specificstack
2267 class(*),
pointer :: generic
2270 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop integer from stack")
2280 type(
stack_type),
intent(inout) :: specificstack
2283 class(*),
pointer :: generic
2286 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop string from stack")
2296 type(
stack_type),
intent(inout) :: specificstack
2299 class(*),
pointer :: generic
2302 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop real from stack")
2303 select type(vr=>generic)
2304 type is (real(kind=default_precision))
2319 type(
stack_type),
intent(inout) :: specificstack
2322 class(*),
pointer :: generic
2325 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop logical from stack")
2335 type(
stack_type),
intent(inout) :: specificstack
2349 type(
stack_type),
intent(inout) :: specificstack
2350 integer,
intent(in) :: i
2353 class(*),
pointer :: generic
2356 if (.not.
associated(generic))
call log_log(log_error,
"Can not get integer from stack at index "//trim(conv_to_string(i)))
2367 type(
stack_type),
intent(inout) :: specificstack
2368 integer,
intent(in) :: i
2371 class(*),
pointer :: generic
2374 if (.not.
associated(generic))
call log_log(log_error,
"Can not get string from stack at index "//trim(conv_to_string(i)))
2385 type(
stack_type),
intent(inout) :: specificstack
2386 integer,
intent(in) :: i
2389 class(*),
pointer :: generic
2392 if (.not.
associated(generic))
call log_log(log_error,
"Can not get real from stack at index "//trim(conv_to_string(i)))
2393 select type(vr=>generic)
2394 type is (real(kind=default_precision))
2410 type(
stack_type),
intent(inout) :: specificstack
2411 integer,
intent(in) :: i
2414 class(*),
pointer :: generic
2417 if (.not.
associated(generic))
call log_log(log_error,
"Can not get logical from stack at index "//trim(conv_to_string(i)))
2428 type(
stack_type),
intent(inout) :: specificstack
2429 integer,
intent(in) :: i
2441 type(
stack_type),
intent(inout) :: specificstack
2452 type(
stack_type),
intent(inout) :: specificstack
2464 type(
stack_type),
intent(inout) :: specificstack
2473 type(
queue_type),
intent(inout) :: specificqueue
2486 type(
queue_type),
intent(inout) :: specificqueue
2487 integer,
intent(in) :: int_data
2489 class(*),
pointer :: generic
2491 generic=>conv_to_generic(int_data, .true.)
2501 type(
queue_type),
intent(inout) :: specificqueue
2502 character(len=STRING_LENGTH),
intent(in) :: str_data
2504 class(*),
pointer :: generic
2506 generic=>conv_to_generic(str_data, .true.)
2516 type(
queue_type),
intent(inout) :: specificqueue
2517 real(kind=default_precision),
intent(in) :: real_data
2519 class(*),
pointer :: generic
2521 generic=>conv_to_generic(real_data, .true.)
2531 type(
queue_type),
intent(inout) :: specificqueue
2532 logical,
intent(in) :: logical_data
2534 class(*),
pointer :: generic
2536 generic=>conv_to_generic(logical_data, .true.)
2547 type(
queue_type),
intent(inout) :: specificqueue
2548 class(*),
pointer,
intent(in) :: data
2549 logical,
intent(in) :: memory_allocation_automatic
2551 call list_add_generic(specificqueue%queue_ds,
data, memory_allocation_automatic)
2560 type(
queue_type),
intent(inout) :: specificqueue
2563 class(*),
pointer :: generic
2566 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop integer from queue")
2576 type(
queue_type),
intent(inout) :: specificqueue
2579 class(*),
pointer :: generic
2582 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop string from queue")
2592 type(
queue_type),
intent(inout) :: specificqueue
2595 class(*),
pointer :: generic
2598 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop real from queue")
2599 select type(vr=>generic)
2600 type is (real(kind=default_precision))
2615 type(
queue_type),
intent(inout) :: specificqueue
2618 class(*),
pointer :: generic
2621 if (.not.
associated(generic))
call log_log(log_error,
"Can not pop logical from queue")
2631 type(
queue_type),
intent(inout) :: specificqueue
2645 type(
queue_type),
intent(inout) :: specificqueue
2646 integer,
intent(in) :: i
2649 class(*),
pointer :: generic
2652 if (.not.
associated(generic))
call log_log(log_error,
"Can not get integer from queue at index "//trim(conv_to_string(i)))
2663 type(
queue_type),
intent(inout) :: specificqueue
2664 integer,
intent(in) :: i
2667 class(*),
pointer :: generic
2670 if (.not.
associated(generic))
call log_log(log_error,
"Can not get string from queue at index "//trim(conv_to_string(i)))
2681 type(
queue_type),
intent(inout) :: specificqueue
2682 integer,
intent(in) :: i
2685 class(*),
pointer :: generic
2688 if (.not.
associated(generic))
call log_log(log_error,
"Can not get real from queue at index "//trim(conv_to_string(i)))
2689 select type(vr=>generic)
2690 type is (real(kind=default_precision))
2706 type(
queue_type),
intent(inout) :: specificqueue
2707 integer,
intent(in) :: i
2710 class(*),
pointer :: generic
2713 if (.not.
associated(generic))
call log_log(log_error,
"Can not get logical from queue at index "//trim(conv_to_string(i)))
2724 type(
queue_type),
intent(inout) :: specificqueue
2725 integer,
intent(in) :: i
2737 type(
queue_type),
intent(inout) :: specificqueue
2748 type(
queue_type),
intent(inout) :: specificqueue
2760 type(
queue_type),
intent(inout) :: specificqueue
2769 type(
list_type),
intent(inout) :: specificlist
2783 type(
list_type),
intent(inout) :: specificlist
2784 integer,
intent(in) :: i, int_data
2786 class(*),
pointer :: generic
2788 generic=>conv_to_generic(int_data, .true.)
2799 type(
list_type),
intent(inout) :: specificlist
2800 integer,
intent(in) :: i
2801 character(len=STRING_LENGTH),
intent(in) :: str_data
2803 class(*),
pointer :: generic
2805 generic=>conv_to_generic(str_data, .true.)
2816 type(
list_type),
intent(inout) :: specificlist
2817 integer,
intent(in) :: i
2818 real(kind=default_precision),
intent(in) :: real_data
2820 class(*),
pointer :: generic
2822 generic=>conv_to_generic(real_data, .true.)
2833 type(
list_type),
intent(inout) :: specificlist
2834 integer,
intent(in) :: i
2835 logical,
intent(in) :: logical_data
2837 class(*),
pointer :: generic
2839 generic=>conv_to_generic(logical_data, .true.)
2850 type(
list_type),
intent(inout) :: specificlist
2851 integer,
intent(in) :: i
2852 class(*),
pointer,
intent(in) :: data
2853 logical,
intent(in) :: memory_allocation_automatic
2859 newnode%data =>
data
2862 node => specificlist%head
2863 if (
associated(node))
then
2865 if (.not.
associated(node%next))
exit
2871 newnode%next => node
2872 newnode%prev => node%prev
2873 newnode%memory_allocation_automatic=memory_allocation_automatic
2874 if (
associated(node%prev)) node%prev%next=>newnode
2875 node%prev => newnode
2876 if (
associated(node,
target=specificlist%head)) specificlist%head=>newnode
2879 newnode%prev=>specificlist%tail
2880 if (
associated(specificlist%tail))
then
2881 specificlist%tail%next => newnode
2883 specificlist%tail => newnode
2885 if (
associated(specificlist%head) .eqv. .false.)
then
2886 specificlist%head=>newnode
2891 specificlist%head => newnode
2892 specificlist%tail => newnode
2894 specificlist%size=specificlist%size+1
2903 type(
list_type),
intent(inout) :: specificlist
2904 integer,
intent(in) :: int_data
2906 class(*),
pointer :: generic
2908 generic=>conv_to_generic(int_data, .true.)
2918 type(
list_type),
intent(inout) :: specificlist
2919 character(len=STRING_LENGTH),
intent(in) :: str_data
2921 class(*),
pointer :: generic
2923 generic=>conv_to_generic(str_data, .true.)
2933 type(
list_type),
intent(inout) :: specificlist
2934 real(kind=default_precision),
intent(in) :: real_data
2936 class(*),
pointer :: generic
2938 generic=>conv_to_generic(real_data, .true.)
2948 type(
list_type),
intent(inout) :: specificlist
2949 logical,
intent(in) :: logical_data
2951 class(*),
pointer :: generic
2953 generic=>conv_to_generic(logical_data, .true.)
2964 type(
list_type),
intent(inout) :: specificlist
2965 class(*),
pointer,
intent(in) :: data
2966 logical,
intent(in) :: memory_allocation_automatic
2971 newnode%data =>
data
2973 newnode%prev=>specificlist%tail
2974 newnode%memory_allocation_automatic=memory_allocation_automatic
2975 if (
associated(specificlist%tail))
then
2976 specificlist%tail%next => newnode
2978 specificlist%tail => newnode
2980 if (
associated(specificlist%head) .eqv. .false.)
then
2981 specificlist%head=>newnode
2984 specificlist%size=specificlist%size+1
2993 type(
list_type),
intent(inout) :: specificlist
2994 integer,
intent(in) :: i
3000 if (i .le. specificlist%size)
then
3001 node => specificlist%head
3003 if (.not.
associated(node))
exit
3007 if (
associated(node))
then
3008 if (
associated(node%prev)) node%prev%next => node%next
3009 if (
associated(node%next)) node%next%prev => node%prev
3010 if (
associated(node,
target=specificlist%head)) specificlist%head => node%next
3011 if (
associated(node,
target=specificlist%tail)) specificlist%tail => node%prev
3012 if (node%memory_allocation_automatic)
then
3013 if (
associated(node%data))
deallocate(node%data)
3016 specificlist%size = specificlist%size - 1
3027 type(
list_type),
intent(in) :: specificlist
3039 type(
list_type),
intent(inout) :: specificlist
3040 integer,
intent(in) :: i
3043 class(*),
pointer :: generic
3046 if (.not.
associated(generic))
call log_log(log_error,
"Can not get integer from list at index "//trim(conv_to_string(i)))
3057 type(
list_type),
intent(inout) :: specificlist
3058 integer,
intent(in) :: i
3061 class(*),
pointer :: generic
3064 if (.not.
associated(generic))
call log_log(log_error,
"Can not get string from list at index "//trim(conv_to_string(i)))
3075 type(
list_type),
intent(inout) :: specificlist
3076 integer,
intent(in) :: i
3079 class(*),
pointer :: generic
3082 if (.not.
associated(generic))
call log_log(log_error,
"Can not get real from list at index "//trim(conv_to_string(i)))
3083 select type(vr=>generic)
3084 type is (real(kind=default_precision))
3100 type(
list_type),
intent(inout) :: specificlist
3101 integer,
intent(in) :: i
3104 class(*),
pointer :: generic
3107 if (.not.
associated(generic))
call log_log(log_error,
"Can not get logical from list at index "//trim(conv_to_string(i)))
3118 type(
list_type),
intent(inout) :: specificlist
3119 integer,
intent(in) :: i
3126 if (specificlist%size .lt. i)
then
3130 node => specificlist%head
3132 if (.not.
associated(node))
exit
3146 type(
list_type),
intent(inout) :: specificlist
3150 node=>specificlist%head
3151 previousnode=>null()
3153 if (
associated(node))
then
3157 if (previousnode%memory_allocation_automatic)
then
3158 if (
associated(previousnode%data))
deallocate(previousnode%data)
3160 deallocate(previousnode)
3161 if (.not.
associated(node))
exit
3165 specificlist%tail=>null()
3166 specificlist%head=>null()
3176 type(
list_type),
intent(in) :: specificlist
3196 class(*),
pointer :: generic
3199 if (
associated(generic))
then
3202 call log_log(log_error,
"Can not get next integer in iterator as iterator has reached end of collection")
3212 class(*),
pointer :: generic
3215 if (
associated(generic))
then
3216 select type(generic)
3223 call log_log(log_error,
"Can not get next string in iterator as iterator has reached end of collection")
3234 class(*),
pointer :: generic
3237 if (
associated(generic))
then
3238 select type(vr=>generic)
3239 type is (real(kind=default_precision))
3247 call log_log(log_error,
"Can not get next real in iterator as iterator has reached end of collection")
3257 class(*),
pointer :: generic
3260 if (
associated(generic))
then
3263 call log_log(log_error,
"Can not get next logical in iterator as iterator has reached end of collection")
3275 class(*),
pointer :: generic
3278 if (
associated(generic))
then
3279 select type(generic)
3284 call log_log(log_error,
"Next item in iterator is not a map entry")
3287 call log_log(log_error,
"Can not get next map entry in iterator as iterator has reached end of collection")
3300 if (
associated(iterator%next_item))
then
3302 iterator%next_item=>iterator%next_item%next
3303 if (.not.
associated(iterator%next_item) .and.
associated(iterator%hash_structure) .and. &
3304 iterator%hash_ptr .le.
size(iterator%hash_structure))
then
3305 do i=iterator%hash_ptr,
size(iterator%hash_structure)
3306 if (iterator%hash_structure(i)%size .gt. 0)
then
3307 iterator%next_item=>iterator%hash_structure(i)%head
3311 iterator%hash_ptr=i+1
3324 class(*),
pointer :: generic
3326 generic=>mapentry_item%value
3327 if (.not.
associated(generic))
call log_log(log_error,
"Can not get integer from map entry")
3337 class(*),
pointer :: generic
3339 generic=>mapentry_item%value
3340 if (.not.
associated(generic))
call log_log(log_error,
"Can not get string from map entry")
3350 class(*),
pointer :: generic
3352 generic=>mapentry_item%value
3353 if (.not.
associated(generic))
call log_log(log_error,
"Can not get real from map entry")
3354 select type(vr=>generic)
3355 type is (real(kind=default_precision))
3370 class(*),
pointer :: generic
3372 generic=>mapentry_item%value
3373 if (.not.
associated(generic))
call log_log(log_error,
"Can not get logical from map entry")