From 7cb8812302dec9e0c04fa2c65c8d577743fe368c Mon Sep 17 00:00:00 2001 From: Martin Karp Date: Tue, 7 May 2024 13:20:35 +0200 Subject: [PATCH 1/2] remove check for more arguments --- src/neko.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neko.f90 b/src/neko.f90 index bfef342f551..0a33e842b6f 100644 --- a/src/neko.f90 +++ b/src/neko.f90 @@ -141,7 +141,7 @@ subroutine neko_init(C) argc = command_argument_count() - if ((argc .lt. 1) .or. (argc .gt. 1)) then + if ((argc .lt. 1)) then if (pe_rank .eq. 0) write(*,*) 'Usage: ./neko ' stop end if From d30fac120c5c9431069218a9308ca78da471afb8 Mon Sep 17 00:00:00 2001 From: Martin Karp Date: Thu, 9 May 2024 19:23:01 +0200 Subject: [PATCH 2/2] preliminary fix --- src/neko.f90 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/neko.f90 b/src/neko.f90 index 0a33e842b6f..ab2fe81520d 100644 --- a/src/neko.f90 +++ b/src/neko.f90 @@ -108,12 +108,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) @@ -141,7 +141,7 @@ subroutine neko_init(C) argc = command_argument_count() - if ((argc .lt. 1)) then + if (argc .lt. 1) then if (pe_rank .eq. 0) write(*,*) 'Usage: ./neko ' stop end if @@ -161,6 +161,14 @@ subroutine neko_init(C) write(log_buf, '(A,A,A,A,1x,A,1x,A,A,A,A,A)') 'Start time: ',& 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