1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-08-16 18:38:28 +02:00

Fortran interface for qmckl_last_error

This commit is contained in:
Anthony Scemama 2022-08-10 14:30:04 +02:00
parent 92e67bec20
commit 725e488199
2 changed files with 19 additions and 3 deletions

View File

@ -668,7 +668,7 @@ qmckl_set_electron_coord(qmckl_context context,
qmckl_exit_code rc;
rc = qmckl_set_point(context, transp, walk_num*elec_num, coord, size_max);
assert (rc == QMCKL_SUCCESS);
if (rc != QMCKL_SUCCESS) return rc;
ctx->electron.walker.num = walk_num;
memcpy(&(ctx->electron.walker.point), &(ctx->point), sizeof(qmckl_point_struct));

View File

@ -360,6 +360,7 @@ void qmckl_string_of_error_f(const qmckl_exit_code error, char result[<<MAX_STRI
subroutine qmckl_string_of_error (error, string) bind(C, name='qmckl_string_of_error_f')
use, intrinsic :: iso_c_binding
import
implicit none
integer (qmckl_exit_code), intent(in), value :: error
character, intent(out) :: string(<<MAX_STRING_LENGTH()>>)
end subroutine qmckl_string_of_error
@ -592,6 +593,21 @@ qmckl_last_error(qmckl_context context, char* buffer) {
return QMCKL_SUCCESS;
}
#+end_src
** Fortran inteface
#+begin_src f90 :tangle (eval fh_func) :exports none :noweb yes
interface
subroutine qmckl_last_error (context, string) bind(C, name='qmckl_last_error')
use, intrinsic :: iso_c_binding
import
implicit none
integer (c_int64_t) , intent(in), value :: context
character, intent(out) :: string(*)
end subroutine qmckl_last_error
end interface
#+end_src
* End of files :noexport:
#+begin_src c :comments link :tangle (eval h_private_type)
@ -621,7 +637,7 @@ qmckl_last_error(qmckl_context context, char* buffer) {
}
#+end_src
# -*- mode: org -*-
# vim: syntax=c
# -*- mode: org -*-
# vim: syntax=c