Commit eb58b347 authored by ulrich_y's avatar ulrich_y

Improved reading of integers

parent cd88f721
......@@ -26,9 +26,7 @@ PROGRAM TEST
select case(trim(arg))
#ifdef DEBUG
call get_command_argument(i,arg)
read(arg,*) verb ! str to int
verb = readint(trim(arg),i)
call errprint("Argument -verb is not available, compile with --debug")
......@@ -47,10 +45,7 @@ PROGRAM TEST
tol = 8.0e-7
call do_ginac_tests
case ('-speed-tests')
call get_command_argument(i,arg)
read(arg,*) verb
call do_timing_tests(i)
call do_timing_tests(readint(trim(arg),i))
case ('-hw-tests')
tol = 8.0e-7
call do_high_weight_tests
......@@ -105,6 +100,17 @@ CONTAINS
stop 1
end subroutine
function readint(prev,i)
integer i, readint, st
character(len=32) :: arg
character(len=*) :: prev
call get_command_argument(i,arg)
if (len_trim(arg) == 0) call errprint("Argument "//prev//" requires a number")
read(arg,*,iostat=st) readint
if (st .ne. 0) call errprint("For argument "//prev//": "//trim(arg)//" is not a number")
end function
subroutine check(res, ref)
complex(kind=prec) :: res, ref
real(kind=prec) :: delta
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment