3 |
|
|
4 |
|
|
5 |
|
!! generic routine to add an atype to a list |
6 |
< |
subroutine add_atype(this_node,head,tail,status) |
6 |
> |
subroutine add_item(this_node,head,tail,status) |
7 |
|
!! atype node to be added to a list |
8 |
< |
type (generic_atype), pointer :: this_node |
8 |
> |
type (generic_item), pointer :: this_node |
9 |
|
!! list to which atype is added, if null, we allocate a new list |
10 |
< |
type (generic_atype), pointer :: head |
11 |
< |
type (generic_atype), pointer :: tail |
10 |
> |
type (generic_item), pointer :: head |
11 |
> |
type (generic_item), pointer :: tail |
12 |
|
|
13 |
|
!! status 0 = success, -1 = failure |
14 |
|
integer, intent(out) :: status |
15 |
|
|
16 |
< |
type (generic_atype), pointer :: current => null() |
16 |
> |
type (generic_item), pointer :: current => null() |
17 |
|
|
18 |
|
status = 0 |
19 |
|
|
33 |
|
tail => this_node |
34 |
|
|
35 |
|
endif |
36 |
< |
end subroutine add_atype |
36 |
> |
end subroutine add_item |
37 |
|
|
38 |
< |
subroutine find_atype(ident,this_list, atype) |
38 |
> |
subroutine find_item(ident,this_list, atype) |
39 |
|
integer, intent(in) :: ident |
40 |
< |
type (generic_atype), pointer :: this_list |
41 |
< |
type (generic_atype), pointer :: atype |
40 |
> |
type (generic_item), pointer :: this_list |
41 |
> |
type (generic_item), pointer :: atype |
42 |
|
|
43 |
< |
type (generic_atype), pointer :: temp |
43 |
> |
type (generic_item), pointer :: temp |
44 |
|
|
45 |
|
atype => null() |
46 |
|
if (.not. associated(this_list)) return |
56 |
|
temp => temp%next |
57 |
|
end do |
58 |
|
|
59 |
< |
end subroutine find_atype |
59 |
> |
end subroutine find_item |
60 |
|
|
61 |
|
subroutine create_identPtrList(ident,this_list,identPtrList,status) |
62 |
|
use definitions |
63 |
|
integer, dimension(:) :: ident |
64 |
< |
type(generic_atype), pointer :: this_list |
65 |
< |
type(generic_atype), pointer :: tmpPtr |
64 |
> |
type(generic_item), pointer :: this_list |
65 |
> |
type(generic_item), pointer :: tmpPtr |
66 |
|
type(generic_identPtrList), dimension(:),pointer :: identPtrList |
67 |
|
integer, intent(out), optional :: status |
68 |
|
|
117 |
|
end subroutine create_identPtrList |
118 |
|
|
119 |
|
function getListLen(this_list) result(listLen) |
120 |
< |
type( generic_atype ), pointer :: this_list |
121 |
< |
type( generic_atype ), pointer :: tmpPtr |
120 |
> |
type( generic_item ), pointer :: this_list |
121 |
> |
type( generic_item ), pointer :: tmpPtr |
122 |
|
|
123 |
|
integer :: listLen |
124 |
|
|
133 |
|
end function getListLen |
134 |
|
|
135 |
|
subroutine print_list(head) |
136 |
< |
type( generic_atype ), pointer :: head |
137 |
< |
type( generic_atype ), pointer :: tmpLstPointer |
136 |
> |
type( generic_item ), pointer :: head |
137 |
> |
type( generic_item ), pointer :: tmpLstPointer |
138 |
|
|
139 |
|
write(*,*) " Printing atype_list" |
140 |
|
if (.not. associated(head)) then |