! ! moldyPSI : A Fortran90/95 molecular dynamics/statics packaged based on ! MOLDY/MDCASK (developed at LLNL) based on MPI ! ! by Peter Derlet, Paul Scherrer Institute, Switzerland (email: peter.derlet@psi.ch) ! !************************************************************************ ! ! Interatomic functions supplied by user. These functions are tabulated at the beginning ! of a simulation and therefore need not be efficiently evaluated. Any function parameters ! must be stored in the local module 'potential_params'. ! !************************************************************************ ! ! DD Fe Potential (in development) ! module potential_params integer, save :: n_V_DD,n_phi_DD double precision, allocatable, dimension(:), save :: a_phi_DD,a_V_DD,r_phi_DD,r_V_DD double precision, save :: mu_DD,A_DD,B_DD,C_DD end module potential_params ! ! User supplied start routine ! subroutine start_potentials() use globals use potential_params implicit none integer :: i,idummy logical :: ldummy write (out_file,*) 'start_potentials(): Using Dudarev-Derlet Fe potential' open (unit=10,file='fe_dd.dat') read (10,*) n_phi_DD,n_V_DD read (10,*) read (10,*) idummy,A_DD read (10,*) idummy,B_DD allocate (a_phi_DD(n_phi_DD),a_V_DD(n_V_DD)) allocate (r_phi_DD(n_phi_DD),r_V_DD(n_V_DD)) do i=1,n_phi_DD read (10,*) idummy,a_phi_DD(i),ldummy,r_phi_DD(i) end do do i=1,n_V_DD read (10,*) idummy,a_V_DD(i),ldummy,r_V_DD(i) end do close (10) end subroutine start_potentials ! ! User supplied finish routine ! subroutine finish_potentials() use globals use potential_params implicit none deallocate (a_phi_DD,a_V_DD,r_phi_DD,r_V_DD) end subroutine finish_potentials ! ! pair potential ! function phi_function(element_a,element_b,r) use potential_params implicit none integer :: element_a,element_b double precision :: phi_function,r integer :: i phi_function=0e0 do i=1,n_V_DD if (r