Commit f208a6d5 authored by Luca's avatar Luca

get verbosity from cmd arg

parent 3fbebc8f
......@@ -6,7 +6,7 @@ PROGRAM eval
complex(kind=prec) :: res
print*, verbosity
call parse_cmd_args()
res = GPL(cmplx([1,2,5]))
print*, res
......
......@@ -8,6 +8,26 @@ MODULE globals
real, parameter :: zero = 1e-15 ! values smaller than this count as zero
real, parameter :: pi = 3.14159265358979323846
integer :: verbosity = 100
integer :: verbosity = 0
CONTAINS
SUBROUTINE parse_cmd_args
integer :: i
character(len=32) :: arg
i = 0
do
call get_command_argument(i, arg)
if (len_trim(arg) == 0) exit
! parse verbosity
if(trim(arg) == '-verb') then
call get_command_argument(i+1,arg)
read(arg,*) verbosity ! str to int
end if
i = i+1
end do
END SUBROUTINE parse_cmd_args
END MODULE globals
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