From ea9ed0eead8172a5cab60a81994a194852f3f5c0 Mon Sep 17 00:00:00 2001 From: Petra Date: Fri, 8 Dec 2023 17:44:02 +1300 Subject: [PATCH] Create a template for easier program creation --- 2023/src/template.f90 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 2023/src/template.f90 diff --git a/2023/src/template.f90 b/2023/src/template.f90 new file mode 100644 index 0000000..b3a94ef --- /dev/null +++ b/2023/src/template.f90 @@ -0,0 +1,18 @@ +program day + implicit none + integer, parameter :: max_chars = 300 + character(200) :: fname + character(max_chars) :: fline + integer :: n_arguments + n_arguments = command_argument_count() + integer :: istat + + if (n_arguments .eq. 1) then + call get_command_argument(1, fname) + print *, "File: ", trim(fname) + print * + else + print *, "Wrong number of arguments: ", n_arguments + stop + end if +end program day