namespace rgpot_ferror¶
Overview¶
Error channel shared by the Fortran potentials’ C entry points. More…
namespace rgpot_ferror {
// global functions
subroutine, public set_error(character(len=*), intent(in) text);
subroutine, public clear_error();
integer(c_int) function, public rgpot_fortran_last_error(character(kind=c_char), dimension(*), intent(out) buffer, integer(c_int), intent(in), value buffer_len);
} // namespace rgpot_ferror
Detailed Documentation¶
Error channel shared by the Fortran potentials’ C entry points.
Legacy kernels reported failures by writing to unit 6 and calling stop, which takes the host process down. The ported kernels return a status instead and leave the message here for the C++ wrapper to turn into an exception. One buffer suffices: the Fortran potentials declare Reentrancy::ProcessSerial, so evaluations never overlap.
Global Functions¶
subroutine, public set_error(character(len=*), intent(in) text)
Record a failure message for the next rgpot_fortran_last_error.
subroutine, public clear_error()
Forget any recorded message.
integer(c_int) function, public rgpot_fortran_last_error(character(kind=c_char), dimension(*), intent(out) buffer, integer(c_int), intent(in), value buffer_len)
Copy the last message into buffer as a NUL-terminated C string.
Returns the number of characters written, excluding the terminator.