ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/DarkSide/eam.F90
(Generate patch)

Comparing trunk/OOPSE-4/src/UseTheForce/DarkSide/eam.F90 (file contents):
Revision 1624 by chuckv, Thu Oct 21 15:25:30 2004 UTC vs.
Revision 2169 by chuckv, Tue Apr 12 17:12:27 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   module eam
43    use simulation
44    use force_globals
# Line 91 | Line 132 | module eam
132    public :: calc_eam_prepair_rho
133    public :: calc_eam_preforce_Frho
134    public :: clean_EAM
135 +  public :: destroyEAMTypes
136  
137   contains
138  
# Line 157 | Line 199 | contains
199    end subroutine newEAMtype
200  
201  
202 +  ! kills all eam types entered and sets simulation to uninitalized
203 +  subroutine destroyEAMtypes()
204 +    integer :: i
205 +    type(EAMType), pointer :: tempEAMType=>null()
206  
207 +    do i = 1, EAMList%n_eam_types
208 +       tempEAMType => eamList%EAMParams(i)
209 +       call deallocate_EAMType(tempEAMType)
210 +    end do
211 +    if(associated( eamList%EAMParams)) deallocate( eamList%EAMParams)
212 +    eamList%EAMParams => null()
213 +    
214 +    eamList%n_eam_types = 0
215 +    eamList%currentAddition = 0
216 +    
217 +  end subroutine destroyEAMtypes
218 +
219    subroutine init_EAM_FF(status)
220      integer :: status
221      integer :: i,j
# Line 461 | Line 519 | contains
519      type (EAMtype), pointer :: thisEAMType
520  
521      ! free Arrays in reverse order of allocation...
522 <    deallocate(thisEAMType%eam_phi_r_pp)      
523 <    deallocate(thisEAMType%eam_rho_r_pp)  
524 <    deallocate(thisEAMType%eam_Z_r_pp)  
525 <    deallocate(thisEAMType%eam_F_rho_pp)  
526 <    deallocate(thisEAMType%eam_phi_r)      
527 <    deallocate(thisEAMType%eam_rho_r)      
528 <    deallocate(thisEAMType%eam_Z_r)  
529 <    deallocate(thisEAMType%eam_F_rho)
530 <    deallocate(thisEAMType%eam_rhovals)
531 <    deallocate(thisEAMType%eam_rvals)
522 >    if(associated(thisEAMType%eam_phi_r_pp)) deallocate(thisEAMType%eam_phi_r_pp)      
523 >    if(associated(thisEAMType%eam_rho_r_pp)) deallocate(thisEAMType%eam_rho_r_pp)  
524 >    if(associated(thisEAMType%eam_Z_r_pp)) deallocate(thisEAMType%eam_Z_r_pp)  
525 >    if(associated(thisEAMType%eam_F_rho_pp)) deallocate(thisEAMType%eam_F_rho_pp)  
526 >    if(associated(thisEAMType%eam_phi_r)) deallocate(thisEAMType%eam_phi_r)      
527 >    if(associated(thisEAMType%eam_rho_r)) deallocate(thisEAMType%eam_rho_r)      
528 >    if(associated(thisEAMType%eam_Z_r)) deallocate(thisEAMType%eam_Z_r)  
529 >    if(associated(thisEAMType%eam_F_rho)) deallocate(thisEAMType%eam_F_rho)
530 >    if(associated(thisEAMType%eam_rhovals)) deallocate(thisEAMType%eam_rhovals)
531 >    if(associated(thisEAMType%eam_rvals)) deallocate(thisEAMType%eam_rvals)
532    
533    end subroutine deallocate_EAMType
534  
# Line 963 | Line 1021 | contains
1021      enddo
1022  
1023    end subroutine eam_spline
966
967
1024  
969
1025   end module eam
971
972  subroutine newEAMtype(lattice_constant,eam_nrho,eam_drho,eam_nr,&
973       eam_dr,rcut,eam_Z_r,eam_rho_r,eam_F_rho,&
974       eam_ident,status)
975       use definitions, ONLY : dp
976       use eam, ONLY : module_newEAMtype => newEAMtype
977    real (kind = dp )                      :: lattice_constant
978    integer                                :: eam_nrho
979    real (kind = dp )                      :: eam_drho
980    integer                                :: eam_nr
981    real (kind = dp )                     :: eam_dr
982    real (kind = dp )                      :: rcut
983    real (kind = dp ), dimension(eam_nr)    :: eam_Z_r
984    real (kind = dp ), dimension(eam_nr)   :: eam_rho_r
985    real (kind = dp ), dimension(eam_nrho) :: eam_F_rho
986    integer                                :: eam_ident
987    integer                                :: status
988
989    
990    call module_newEAMtype(lattice_constant,eam_nrho,eam_drho,eam_nr,&
991       eam_dr,rcut,eam_Z_r,eam_rho_r,eam_F_rho,&
992       eam_ident,status)
993      
994 end subroutine newEAMtype

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines