| 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. |
| 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.5 2005-04-12 17:45:31 chuckv Exp $, $Date: 2005-04-12 17:45:31 $, $Name: not supported by cvs2svn $, $Revision: 1.5 $ |
| 64 |
|
|
| 65 |
|
module Vector_class |
| 66 |
|
|
| 68 |
|
PRIVATE |
| 69 |
|
|
| 70 |
|
public :: initialize |
| 71 |
+ |
public :: destroy |
| 72 |
|
public :: getSize |
| 73 |
|
public :: getElementAt |
| 74 |
|
public :: getPropertyListSize |
| 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 |
| 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 |
|
|
| 877 |
|
if(error .ne. 0) write(*,*) 'Could not allocate logicalElementProperties!' |
| 878 |
|
|
| 879 |
|
end function initialize_4i |
| 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 |
+ |
|
| 888 |
+ |
if (.not. associated(this)) then |
| 889 |
+ |
null_this => null() |
| 890 |
+ |
return |
| 891 |
+ |
end if |
| 892 |
|
|
| 893 |
+ |
!! Walk down the list and deallocate each of the vector components |
| 894 |
+ |
if(associated(this%elementData)) then |
| 895 |
+ |
deallocate(this%elementData) |
| 896 |
+ |
this%elementData=>null() |
| 897 |
+ |
endif |
| 898 |
+ |
|
| 899 |
+ |
|
| 900 |
+ |
if(associated(this%PropertyDescriptions)) then |
| 901 |
+ |
deallocate(this%PropertyDescriptions) |
| 902 |
+ |
this%PropertyDescriptions=>null() |
| 903 |
+ |
endif |
| 904 |
+ |
|
| 905 |
+ |
|
| 906 |
+ |
|
| 907 |
+ |
if(associated(this%PropertyDataType)) then |
| 908 |
+ |
deallocate(this%PropertyDataType) |
| 909 |
+ |
this%PropertyDataType=>null() |
| 910 |
+ |
endif |
| 911 |
+ |
|
| 912 |
+ |
|
| 913 |
+ |
if(associated(this%integerElementProperties)) then |
| 914 |
+ |
deallocate(this%integerElementProperties) |
| 915 |
+ |
this%integerElementProperties=>null() |
| 916 |
+ |
endif |
| 917 |
+ |
|
| 918 |
+ |
|
| 919 |
+ |
if(associated(this%realElementProperties)) then |
| 920 |
+ |
deallocate(this%realElementProperties) |
| 921 |
+ |
this%realElementProperties=>null() |
| 922 |
+ |
endif |
| 923 |
+ |
|
| 924 |
+ |
if(associated(this%logicalElementProperties)) then |
| 925 |
+ |
deallocate(this%logicalElementProperties) |
| 926 |
+ |
this%logicalElementProperties=>null() |
| 927 |
+ |
endif |
| 928 |
+ |
deallocate(this) |
| 929 |
+ |
null_this => null() |
| 930 |
+ |
end function destroy |
| 931 |
|
|
| 839 |
– |
|
| 932 |
|
end module Vector_class |