get_case_filename Subroutine

subroutine get_case_filename(filename)

Parses command line arguments to find the case configuration file.

If no argument is provided, defaults to case.nml.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(out) :: filename

Source Code

   subroutine get_case_filename(filename)
      character(len=*), intent(out) :: filename

      integer :: argc

      argc = command_argument_count()
      if (argc >= 1) then
         call get_command_argument(1, filename)
      else
         filename = 'case.nml'
      end if

      if (len_trim(filename) == 0) call fatal_error('main', 'empty case filename')
   end subroutine get_case_filename