ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/md_code/generic_list_functions.i90
(Generate patch)

Comparing trunk/mdtools/md_code/generic_list_functions.i90 (file contents):
Revision 247 by chuckv, Mon Jan 27 18:28:11 2003 UTC vs.
Revision 254 by chuckv, Thu Jan 30 20:03:37 2003 UTC

# Line 46 | Line 46 | subroutine find_atype(ident,this_list, atype)
46    if (.not. associated(this_list)) return
47  
48    temp => this_list
49 <
49 >
50    do while (associated(temp))
51       if (temp%atype_ident == ident) then
52          atype => temp
53          exit
54       endif
55 +
56       temp => temp%next
57    end do
58  
59   end subroutine find_atype
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
# Line 71 | Line 73 | subroutine create_identPtrList(ident,this_list,identPt
73  
74    status = 0
75    list_size = size(ident)
76 <  write(*,*) "Creating identPtrList for size: ", list_size
76 >
77   !! Allocate space for pointer list.  
78    if (.not. associated(identPtrList)) then
79       allocate(identPtrList(list_size),stat=alloc_stat)
# Line 79 | Line 81 | subroutine create_identPtrList(ident,this_list,identPt
81          status = -1
82          return
83       end if
84 <     write(*,*) "Successfully allocated new list"
84 >
85    else if ( list_size > size(identPtrList)) then
86   !! We've already allocated this list and need to make it bigger
87 <     write(*,*) "Warning reallocating identPointerList"
87 >
88       deallocate(identPtrList)
89       allocate(identPtrList(list_size),stat=alloc_stat)
90       if (alloc_stat /= 0) then
# Line 99 | Line 101 | subroutine create_identPtrList(ident,this_list,identPt
101  
102    do i = 1, list_size
103       this_ident = ident(i)
104 <     write(*,*) "Finding atype for ident ", this_ident
104 >
105       call find_atype(this_ident,this_list,tmpPtr)
106   !! If we can't find the atype corresponding to the ident, return w/ error.
107       if (.not. associated(tmpPtr)) then
108          status = -1
107
109          write(*,*) "Could not find an atype for ident ", this_ident
110          return
111       end if

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines