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 2168 by gezelter, Fri Jan 14 20:31:16 2005 UTC vs.
Revision 2169 by chuckv, Tue Apr 12 17:12:27 2005 UTC

# Line 132 | 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 198 | 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
# Line 502 | 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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines