diff --git a/libdlfind/callback.py b/libdlfind/callback.py index a44af41..689de0e 100644 --- a/libdlfind/callback.py +++ b/libdlfind/callback.py @@ -66,7 +66,7 @@ def wrapper( status: pointer[c_int], ) -> None: coords_ = as_array(coords, shape=(nvar,)).reshape((-1, 3)) - hessian_ = as_array(hessian, shape=(nvar,)) + hessian_ = as_array(hessian, shape=(nvar,nvar)) hessian = func(coords_) hessian_[:, :] = hessian status[0] = c_int(0) diff --git a/src/mod_api.f90 b/src/mod_api.f90 index 49d8178..b503436 100644 --- a/src/mod_api.f90 +++ b/src/mod_api.f90 @@ -46,7 +46,7 @@ subroutine dlf_get_hessian_interface(nvar, coords, hessian, status) bind(c) import c_double, c_int implicit none - integer(c_int), intent(in) :: nvar + integer(c_int), intent(in), value :: nvar real(c_double), intent(in) :: coords(nvar) real(c_double), intent(out) :: hessian(nvar, nvar) integer, intent(out) :: status