module error_out
  implicit none

  private
  public error_check

contains

  subroutine error_check (err, msg)
     use io_units, only: fo
     integer, intent(in)          :: err ! flag
     character(len=*), intent(in) :: msg   ! error message
     integer                      :: no

     if (err /= 0) then
       write (fo, fmt='(a)') msg
     end if
   end subroutine error_check
end module error_out



