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 260 by chuckv, Fri Jan 31 21:04:27 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 >
78   !! Allocate space for pointer list.  
79    if (.not. associated(identPtrList)) then
80       allocate(identPtrList(list_size),stat=alloc_stat)
# Line 79 | Line 82 | subroutine create_identPtrList(ident,this_list,identPt
82          status = -1
83          return
84       end if
85 <     write(*,*) "Successfully allocated new list"
85 >
86    else if ( list_size > size(identPtrList)) then
87   !! We've already allocated this list and need to make it bigger
88 <     write(*,*) "Warning reallocating identPointerList"
88 >
89       deallocate(identPtrList)
90       allocate(identPtrList(list_size),stat=alloc_stat)
91       if (alloc_stat /= 0) then
# Line 99 | Line 102 | subroutine create_identPtrList(ident,this_list,identPt
102  
103    do i = 1, list_size
104       this_ident = ident(i)
105 <     write(*,*) "Finding atype for ident ", this_ident
105 >
106       call find_atype(this_ident,this_list,tmpPtr)
107   !! If we can't find the atype corresponding to the ident, return w/ error.
108       if (.not. associated(tmpPtr)) then
109          status = -1
107
110          write(*,*) "Could not find an atype for ident ", this_ident
111          return
112       end if

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines