!------------------------------------------------------------------- ! function : pfunc ! ! package : Li3 Potential ! ! Language : Fortran 77 - freeform ! ! author : F. Colavecchia (flavioc@lanl.gov) ! ! date : 03/10/03 version: ! revision : version: ! ! purpose : Compute the P function eq. (18) of the paper JCP 118 5484 (2003). ! ! input : t -> (dim=3) integrity basis eq. (16) ! x -> (dim=n) vector of coefficients of the expansion (20). ! n -> number of coefficients ! ! output : pfunc -> P function eq. (18) ! !------------------------------------------------------------------- real*8 function Pfunc(t,x,n) implicit none integer n real*8 t(3),x(n) real*8 tmp1 integer i tmp1 = 1d0-tanh(t(1)*x(2)/2d0) Pfunc = tmp1 return end !------------------------------------------------------------------- ! subroutine: dPfunc ! ! package : Li3 Potential ! ! Language : Fortran 77 - freeform ! ! author : F. Colavecchia (flavioc@lanl.gov) ! ! date : 03/10/03 version: ! revision : version: ! ! purpose : Compute the gradient respect to ! the parameters of P function eq. (18) of the paper JCP 118 5484 (2003) ! ! input : t -> (dim=3) integrity basis eq. (16) ! x -> (dim=n) vector of coefficients of the expansion (20). ! n -> number of coefficients ! ! output : grad -> gradient of P function eq. (18) ! !------------------------------------------------------------------- subroutine dPfunc(t,x,grad,n) implicit none integer n real*8 t(3),x(n),grad(n) real*8 dtmp integer i dtmp = -t(1)/2d0*(1d0/cosh(t(1)*x(2)/2d0))**2d0 grad(2) = dtmp return end