Skip to content

Commit

Permalink
Merge pull request #1271 from ExtremeFLOW/arg_number
Browse files Browse the repository at this point in the history
Remove check for more arguments
  • Loading branch information
timfelle authored Nov 15, 2024
2 parents e99d44d + bf27dea commit 4c3a798
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/neko.f90
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ module neko

subroutine neko_init(C)
type(case_t), target, intent(inout), optional :: C
character(len=NEKO_FNAME_LEN) :: case_file
character(len=NEKO_FNAME_LEN) :: case_file, args
character(len=LOG_SIZE) :: log_buf
character(len=10) :: suffix
character(10) :: time
character(8) :: date
integer :: argc, nthrds, rw, sw
integer :: argc, nthrds, rw, sw, i

call date_and_time(time = time, date = date)

Expand All @@ -151,8 +151,8 @@ subroutine neko_init(C)

argc = command_argument_count()

if ((argc .lt. 1) .or. (argc .gt. 1)) then
if (pe_rank .eq. 0) write(*,*) 'Usage: ./neko < case file >'
if (argc .lt. 1) then
if (pe_rank .eq. 0) write(*,*) 'Usage: ./neko <case file>'
stop
end if

Expand All @@ -179,6 +179,14 @@ subroutine neko_init(C)
time(1:2), ':', time(3:4), &
'/', date(1:4), '-', date(5:6), '-', date(7:8)
call neko_log%message(log_buf, NEKO_LOG_QUIET)
if (argc .gt. 1) then
write(log_buf, '(a)') 'Running with command line arguments: '
call neko_log%message(log_buf, NEKO_LOG_QUIET)
do i = 2,argc
call get_command_argument(i, args)
call neko_log%message(args, NEKO_LOG_QUIET)
end do
end if
write(log_buf, '(a)') 'Running on: '
sw = 10
if (pe_size .lt. 1e1) then
Expand Down

0 comments on commit 4c3a798

Please sign in to comment.