subroutine log_error(source, message, log, i1, i2, int, real, ints, reals)
! Writes error information to STDERR, STDOUT, and/or a log-file.
! The name of the procedure which produced the error
character(len=*), intent(in) :: source
! The information to be written.
character(len=*), intent(in) :: message
! optional logger, defaults to master_log
type(logger), intent(in), optional :: log
! optional index, single int/real or 1D arrays to append to message
integer, intent(in), optional :: i1, i2, int, ints(:)
real(dp), intent(in), optional :: real, reals(:)
call log_message(source, log_error_level, message, log, i1, i2, int, real, ints, reals)
! close log and stop execution
if (log%fileunit > 0) close(log%fileunit)
call abort
end subroutine log_error