subroutine nbimsg_exit(zmsg)

  use nbi_com
  implicit none
  
  character*(*), intent(in) :: zmsg    ! nubeam-supplied error message

  write(nonlin,*) '=========> nubeam exit with message (nbimsg_exit) <==='
  write(nonlin,*) ' error message: '
  write(nonlin,*) ' '
  write(nonlin,*) trim(zmsg)
  write(nonlin,*) ' '

  call nbi_exit

end subroutine nbimsg_exit

subroutine nbi_message(zmsg)

  use nbi_com
  implicit none
  
  character*(*), intent(in) :: zmsg    ! nubeam-supplied error message
  write(nonlin,*) '=========> nubeam warning message (nbi_message) <==='
  write(nonlin,*) ' '
  write(nonlin,*) trim(zmsg)
  write(nonlin,*) ' '

end subroutine nbi_message
