Calculate dispersion
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | value | :: | verror | |||
type(c_ptr), | value | :: | vmol | |||
type(c_ptr), | value | :: | vgcp | |||
real(kind=c_double), | intent(out) | :: | energy | |||
real(kind=c_double), | intent(out), | optional | :: | c_gradient(3,*) | ||
real(kind=c_double), | intent(out), | optional | :: | c_sigma(3,3) |
subroutine get_counterpoise_api(verror, vmol, vgcp, & & energy, c_gradient, c_sigma) & & bind(C, name=namespace//"get_counterpoise") type(c_ptr), value :: verror type(vp_error), pointer :: error type(c_ptr), value :: vmol type(vp_structure), pointer :: mol type(c_ptr), value :: vgcp type(vp_gcp), pointer :: gcp real(c_double), intent(out) :: energy real(c_double), intent(out), optional :: c_gradient(3, *) real(wp), allocatable :: gradient(:, :) real(c_double), intent(out), optional :: c_sigma(3, 3) real(wp), allocatable :: sigma(:, :) type(realspace_cutoff) :: cutoff if (.not.c_associated(verror)) return call c_f_pointer(verror, error) if (.not.c_associated(vmol)) then call fatal_error(error%ptr, "Molecular structure data is missing") return end if call c_f_pointer(vmol, mol) if (.not.c_associated(vgcp)) then call fatal_error(error%ptr, "Counter-poise parameters are missing") return end if call c_f_pointer(vgcp, gcp) if (present(c_gradient)) then gradient = c_gradient(:3, :mol%ptr%nat) endif if (present(c_gradient)) then sigma = c_sigma(:3, :3) endif cutoff = realspace_cutoff() if (allocated(gcp%cutoff)) then cutoff = gcp%cutoff end if call get_geometric_counterpoise(mol%ptr, gcp%ptr, cutoff, & & energy, gradient, sigma) if (present(c_gradient)) then c_gradient(:3, :mol%ptr%nat) = gradient endif if (present(c_gradient)) then c_sigma(:3, :3) = sigma endif end subroutine get_counterpoise_api