ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/utils/vector_class.F90
(Generate patch)

Comparing trunk/OOPSE-2.0/src/utils/vector_class.F90 (file contents):
Revision 1490 by gezelter, Fri Sep 24 04:16:43 2004 UTC vs.
Revision 2166 by chuckv, Tue Apr 12 00:28:29 2005 UTC

# Line 1 | Line 1
1 + !!
2 + !! Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3 + !!
4 + !! The University of Notre Dame grants you ("Licensee") a
5 + !! non-exclusive, royalty free, license to use, modify and
6 + !! redistribute this software in source and binary code form, provided
7 + !! that the following conditions are met:
8 + !!
9 + !! 1. Acknowledgement of the program authors must be made in any
10 + !!    publication of scientific results based in part on use of the
11 + !!    program.  An acceptable form of acknowledgement is citation of
12 + !!    the article in which the program was described (Matthew
13 + !!    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 + !!    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 + !!    Parallel Simulation Engine for Molecular Dynamics,"
16 + !!    J. Comput. Chem. 26, pp. 252-271 (2005))
17 + !!
18 + !! 2. Redistributions of source code must retain the above copyright
19 + !!    notice, this list of conditions and the following disclaimer.
20 + !!
21 + !! 3. Redistributions in binary form must reproduce the above copyright
22 + !!    notice, this list of conditions and the following disclaimer in the
23 + !!    documentation and/or other materials provided with the
24 + !!    distribution.
25 + !!
26 + !! This software is provided "AS IS," without a warranty of any
27 + !! kind. All express or implied conditions, representations and
28 + !! warranties, including any implied warranty of merchantability,
29 + !! fitness for a particular purpose or non-infringement, are hereby
30 + !! excluded.  The University of Notre Dame and its licensors shall not
31 + !! be liable for any damages suffered by licensee as a result of
32 + !! using, modifying or distributing the software or its
33 + !! derivatives. In no event will the University of Notre Dame or its
34 + !! licensors be liable for any lost revenue, profit or data, or for
35 + !! direct, indirect, special, consequential, incidental or punitive
36 + !! damages, however caused and regardless of the theory of liability,
37 + !! arising out of the use of or inability to use software, even if the
38 + !! University of Notre Dame has been advised of the possibility of
39 + !! such damages.
40 + !!
41 +
42   ! vector_class.F90
43   !! Module Vector_class
44   !! Fortran 95 Vector class module. Similar to java.util vector class.
# Line 19 | Line 60
60   !! @author J. Daniel Gezelter
61   !! @author Charles F. Vardeman II
62   !! @author Matthew Meineke
63 < !! @version $Id: vector_class.F90,v 1.1.1.1 2004-09-24 04:16:37 gezelter Exp $, $Date: 2004-09-24 04:16:37 $, $Name: not supported by cvs2svn $, $Revision: 1.1.1.1 $
63 > !! @version $Id: vector_class.F90,v 1.3 2005-04-12 00:28:29 chuckv Exp $, $Date: 2005-04-12 00:28:29 $, $Name: not supported by cvs2svn $, $Revision: 1.3 $
64  
65   module Vector_class
66    
# Line 27 | Line 68 | module Vector_class
68    PRIVATE
69    
70    public :: initialize
71 +  public :: destroy
72    public :: getSize
73    public :: getElementAt
74    public :: getPropertyListSize
# Line 36 | Line 78 | module Vector_class
78    public :: getElementProperty
79    public :: getMatchingElementList
80    public :: getFirstMatchingElement
81 +  
82  
83    integer, parameter :: logical_data_type = 1
84    integer, parameter :: integer_data_type = 2
# Line 783 | Line 826 | contains
826    end function initialize_3i
827  
828    function initialize_4i(cap, nprop, capinc, propinc) result(this)
829 <    integer, intent(in) :: cap, nprop, capinc, propinc
829 >     integer, intent(in) :: cap, nprop, capinc, propinc
830      integer :: error
831      type(Vector), pointer :: this
832  
# Line 834 | Line 877 | contains
877      if(error .ne. 0) write(*,*) 'Could not allocate logicalElementProperties!'
878  
879    end function initialize_4i
880 <    
880 >
881 >    !! This function destroys the vector components....
882 >  function destroy(this) result(null_this)
883 >    logical :: done
884 >    type(Vector), pointer :: this
885 >    type(Vector), pointer :: null_this
886 >
887 > !! Walk down the list and deallocate each of the vector components
888 >     if(associated(this%elementData)) then
889 >        deallocate(this%elementData)
890 >        this%elementData=>null()
891 >     endif
892 >
893 >
894 >     if(associated(this%PropertyDescriptions)) then
895 >        deallocate(this%PropertyDescriptions)
896 >        this%PropertyDescriptions=>null()
897 >     endif
898 >    
899 >    
900 >    
901 >     if(associated(this%PropertyDataType)) then
902 >        deallocate(this%PropertyDataType)
903 >        this%PropertyDataType=>null()
904 >     endif
905 >    
906 >    
907 >     if(associated(this%integerElementProperties)) then
908 >        deallocate(this%integerElementProperties)
909 >        this%integerElementProperties=>null()
910 >     endif
911 >    
912 >
913 >     if(associated(this%realElementProperties)) then
914 >        deallocate(this%realElementProperties)
915 >        this%realElementProperties=>null()
916 >     endif
917 >
918 >     if(associated(this%logicalElementProperties)) then
919 >        deallocate(this%logicalElementProperties)
920 >        this%logicalElementProperties=>null()
921 >     endif
922 >     null_this => null()
923 >  end function destroy
924    
839  
925   end module Vector_class

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines