-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_hmap.F90
42 lines (34 loc) · 1 KB
/
test_hmap.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
program test_hmap
use dm_hmap_mod, only: dm_hash_map
use dm_hmap_interface, only : create_hmap_c
implicit none
type(dm_hash_map) :: hm
character(len=:), allocatable :: key
integer :: val
!!hm = dm_hash_map() !!Intel does not understand constructors ?
call hm%init_() !!To be deprecated
key = "help"
val = 5
print *, "test_hmap inserting key,val:", key, ", ", val
val = hm%insert(key, val)
key = "and"
val = 2
print *, "test_hmap inserting key,val:", key, ", ", val
val = hm%insert(key, val)
val = hm%insert("z", 9)
val = hm%insert("Yes", 8)
print *, "test_hmap finding Yes"
val = hm%find("Yes")
print *, "find(Yes)=", val
val = hm%find("yes")
print *, "find(yes)=", val
val = hm%find("K")
print *, "find(K)", val
val = hm%find("and")
print *, "find(and)=", val
val = hm%find("an")
print *, "find(an)=", val
val = hm%find("help")
print *, "find(help)", val
call hm%delete
end program