subroutine mat_getval(s)
! ident_14="@(#) M_matrix mat_getval(3fp) form numerical value from string of "integer" characters"
doubleprecision,intent(out) :: s
s = 0.0d0
INFINITE: do
select case(G_CHRA)
case(iachar('0')); s = 10.0d0*s + 0.0d0
case(iachar('1')); s = 10.0d0*s + 1.0d0
case(iachar('2')); s = 10.0d0*s + 2.0d0
case(iachar('3')); s = 10.0d0*s + 3.0d0
case(iachar('4')); s = 10.0d0*s + 4.0d0
case(iachar('5')); s = 10.0d0*s + 5.0d0
case(iachar('6')); s = 10.0d0*s + 6.0d0
case(iachar('7')); s = 10.0d0*s + 7.0d0
case(iachar('8')); s = 10.0d0*s + 8.0d0
case(iachar('9')); s = 10.0d0*s + 9.0d0
case default
exit INFINITE
end select
call mat_getch() ! get next character
enddo INFINITE
end subroutine mat_getval