ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/calc_eam.F90
(Generate patch)

Comparing trunk/OOPSE/libmdtools/calc_eam.F90 (file contents):
Revision 747 by gezelter, Fri Sep 5 21:28:52 2003 UTC vs.
Revision 882 by chuckv, Wed Dec 17 20:13:33 2003 UTC

# Line 66 | Line 66 | module eam
66    real( kind = dp),save, dimension(:), allocatable :: frho_col
67    real( kind = dp),save, dimension(:), allocatable :: rho_row
68    real( kind = dp),save, dimension(:), allocatable :: rho_col
69 +  real( kind = dp),save, dimension(:), allocatable :: rho_tmp
70    real( kind = dp),save, dimension(:), allocatable :: d2frhodrhodrho_col
71    real( kind = dp),save, dimension(:), allocatable :: d2frhodrhodrho_row
72   #endif
# Line 164 | Line 165 | contains
165      integer :: alloc_stat
166      integer :: number_r, number_rho
167  
168 +
169 +    status = 0
170      if (EAMList%currentAddition == 0) then
171         call handleError("init_EAM_FF","No members in EAMList")
172         status = -1
173         return
174      end if
175  
176 <
174 <
176 >
177         do i = 1, EAMList%currentAddition
178  
179   ! Build array of r values
# Line 221 | Line 223 | contains
223                 0.0E0_DP, 0.0E0_DP, 'N')
224         enddo
225  
224
226   !       current_rcut_max = EAMList%EAMParams(1)%eam_rcut
227         !! find the smallest rcut for any eam atype
228   !       do i = 2, EAMList%currentAddition
# Line 234 | Line 235 | contains
235   !          EAMList%EAMParam(i)s%eam_atype_map(eam_atype(i)) = i
236   !       end do
237         !! Allocate arrays for force calculation
238 <          call allocateEAM(alloc_stat)
239 <          if (alloc_stat /= 0 ) then
240 <             status = -1
241 <             return
242 <          endif
243 <
238 >      
239 >       call allocateEAM(alloc_stat)
240 >       if (alloc_stat /= 0 ) then
241 >          write(*,*) "allocateEAM failed"
242 >          status = -1
243 >          return
244 >       endif
245 >    
246    end subroutine init_EAM_FF
247  
248   !! routine checks to see if array is allocated, deallocates array if allocated
# Line 256 | Line 259 | contains
259  
260  
261      nlocal = getNlocal()
262 <
262 >    status = 0
263   #ifdef IS_MPI
264      nrow = getNrow(plan_row)
265      ncol = getNcol(plan_col)
# Line 290 | Line 293 | contains
293      end if
294      
295   #ifdef IS_MPI
296 +
297 +    if (allocated(rho_tmp)) deallocate(rho_tmp)
298 +    allocate(rho_tmp(nlocal),stat=alloc_stat)
299 +    if (alloc_stat /= 0) then
300 +       status = -1
301 +       return
302 +    end if
303  
304 +
305      if (allocated(frho_row)) deallocate(frho_row)
306      allocate(frho_row(nrow),stat=alloc_stat)
307      if (alloc_stat /= 0) then
# Line 374 | Line 385 | contains
385      frho_col = 0.0_dp
386      rho_row  = 0.0_dp
387      rho_col  = 0.0_dp
388 +    rho_tmp  = 0.0_dp
389      dfrhodrho_row = 0.0_dp
390      dfrhodrho_col = 0.0_dp
391   #endif
# Line 522 | Line 534 | contains
534                 EAMList%EAMParams(myid_atom2)%eam_rho_r_pp, &
535                 r, rho_j_at_i,drho,d2rho)
536  
537 <
537 >    
538        
539        
540   #ifdef  IS_MPI
# Line 531 | Line 543 | contains
543            rho(atom1) = rho(atom1) + rho_j_at_i
544   #endif
545         endif
546 +
547 +
548 +
549 +
550  
551  
552    end subroutine calc_eam_prepair_rho
# Line 558 | Line 574 | contains
574        write(errMsg,*) " Error scattering rho_row into rho"
575        call handleError(RoutineName,errMesg)
576     endif      
577 <    call scatter(rho_col,rho,plan_col,eam_err)
577 >    call scatter(rho_col,rho_tmp,plan_col,eam_err)
578      if (eam_err /= 0 ) then
579        write(errMsg,*) " Error scattering rho_col into rho"
580        call handleError(RoutineName,errMesg)
581     endif
582 +
583 +      rho(1:nlocal) = rho(1:nlocal) + rho_tmp(1:nlocal)
584   #endif
585  
586  
587 +
588   !! Calculate F(rho) and derivative
589      do atom = 1, nlocal
590         me = atid(atom)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines