Commit ee18c65c authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

added -n command line argument

parent a118273e
...@@ -42,8 +42,6 @@ use host_hooks ...@@ -42,8 +42,6 @@ use host_hooks
implicit none implicit none
integer,parameter :: ntest = 1
#if _FABM_DIMENSION_COUNT_>0 #if _FABM_DIMENSION_COUNT_>0
integer :: _LOCATION_ integer :: _LOCATION_
#endif #endif
...@@ -135,12 +133,35 @@ character(len=20) :: arg ...@@ -135,12 +133,35 @@ character(len=20) :: arg
integer :: ivar integer :: ivar
integer :: i integer :: i
integer :: mode = 1 integer :: mode = 1
integer :: ntest = -1
! Parse command line arguments
i = 1
do
call get_command_argument(i, arg)
if (arg == '') exit
select case (arg)
case ('-s', '--simulate')
mode = 2
i = i + 1
case ('-n')
call get_command_argument(i + 1, arg)
read (arg,*) ntest
i = i + 2
case default
write (*,'(a)') 'Unknown command line argument: ' // trim(arg)
stop 2
end select
end do
call get_command_argument(1, arg) ! Set defaults
select case (arg) if (ntest == -1) then
case ('-s', '--simulate') if (mode == 1) then
mode = 2 ntest = 1
end select else
ntest = 1000
end if
end if
#if _FABM_DIMENSION_COUNT_>0 #if _FABM_DIMENSION_COUNT_>0
i__=50 i__=50
...@@ -315,7 +336,7 @@ case (1) ...@@ -315,7 +336,7 @@ case (1)
call test_update call test_update
end do end do
case(2) case(2)
call simulate(1000) call simulate(ntest)
end select end select
contains contains
......
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