write_get_arguments Subroutine

public subroutine write_get_arguments()

Arguments

None

Contents


Variables

TypeVisibilityAttributesNameInitial
integer, public :: i
character(len=132), public, parameter:: text(*) =[character(len=132)::"function get_arguments()", "character(len=255)           :: message ! use for I/O error messages", "character(len=:),allocatable :: string  ! stores command line argument", "integer                      :: get_arguments", "integer :: command_line_length", "   call get_command(length=command_line_length)   ! get length needed to hold command", "   allocate(character(len=command_line_length) :: string)", "   call get_command(string)", "   ! trim off command name and get command line arguments", "   string=adjustl(string)//' '                    ! assuming command verb does not have spaces in it", "   string=string(index(string,' '):)", "   string='&cmd '//string//' /'                   ! add namelist prefix and terminator", "   read(string,nml=cmd,iostat=get_arguments,iomsg=message) ! internal read of namelist", "   if(get_arguments.ne.0)then", "      write(*,'(''ERROR:'',i0,1x,a)')get_arguments, trim(message)", "      write(*,*)'COMMAND OPTIONS ARE'", "      write(*,nml=cmd)", "      stop 1", "   endif", "end function get_arguments", ""]