1
0
mirror of https://github.com/TREX-CoE/irpjast.git synced 2024-12-25 13:53:59 +01:00
irpjast/deriv_num.irp.f

53 lines
967 B
FortranFixed
Raw Normal View History

2020-12-15 17:06:55 +01:00
program jastrow
implicit none
2020-12-16 19:38:41 +01:00
print *, 'Derivatives test'
2020-12-16 13:22:42 +01:00
integer :: k
2020-12-15 17:06:55 +01:00
double precision :: j1, j2, j0, deriv, dt, lapl
2020-12-16 19:38:41 +01:00
dt = 1.0d-4
2020-12-15 17:06:55 +01:00
BEGIN_TEMPLATE
2020-12-16 13:22:42 +01:00
lapl = 0.0d0
j0 = $X $Y
do k = 1, 3
elec_coord(1, k) -= dt
TOUCH elec_coord
j1 = $X $Y
elec_coord(1, k) += 2.0d0*dt
TOUCH elec_coord
j2 = $X $Y
deriv = (j2 - j1) / (2.0d0 * dt)
lapl += (j2 - 2.0d0*j0 + j1) / (dt*dt)
print *, 'Deriv $X '
print *, deriv
print *, $X_deriv_e(k, $Z)
print *, ''
elec_coord(1, k) -= dt
TOUCH elec_coord
2020-12-15 17:06:55 +01:00
enddo
2020-12-16 13:22:42 +01:00
print *, 'Lapl $X '
print *, lapl
print *, $X_deriv_e(4, $Z)
print *, ''
SUBST [X, Y, Z]
factor_ee ; ; 1;;
2020-12-15 17:06:55 +01:00
END_TEMPLATE
2021-01-04 16:45:32 +01:00
2020-12-16 19:38:41 +01:00
!factor_een ; ; 1;;
2020-12-15 17:06:55 +01:00
!rescale_een_e ; (1,3,1) ; 1,3,1 ;;
!rescale_een_n ; (1,1,2) ; 1,1,2 ;;
2020-12-16 13:22:42 +01:00
!rescale_een_e ; (1, 2, 2) ; 1, 2, 2 ;;
2020-12-16 19:38:41 +01:00
!factor_en ; ; 1;;
!rescale_en ; (1, 2) ; 1, 2 ;;
!factor_ee ; ; 1;;
!rescale_ee ; (1, 2) ; 1, 2 ;;
2020-12-15 17:06:55 +01:00
!elnuc_dist ; (1,1); 1,1 ;;
!elec_dist ; (1,2); 1,2 ;;
end program