Software Archive
Read-only legacy content
17061 Discussions

Module will not compile

Intel_C_Intel
Employee
274 Views
The following module will not compile; I am probably missing something simple. Appreciate someone pointing out the error of my ways.

	MODULE command_line_arguments 
 
	CONTAINS 
 
	   SUBROUTINE get_arguments (num_arguments, strings, 
     &	                         num_strings, error) 
 
	   IMPLICIT NONE 
 
	   INCLUDE 'flib.fd'          ! include for GETARG and NARGS functions 
 
!---------------------------------------------------------------------- 
!        Calling arguments 
!---------------------------------------------------------------------- 
 
	   INTEGER, INTENT(out) :: num_arguments	! Number of arguments returned 
	   INTEGER, INTENT(in)  :: num_strings		! Number of strings to hold 
	   INTEGER, INTENT(out) ::	error			! Error flag:	0 = no error 
											    !				-1 = system library error 
											    !				> 0 = too many arguments 
	   CHARACTER(len=*), DIMENSION (num_strings),  
     &	                  INTENT(out) :: strings 
!										    	! Array to hold arguments 
!---------------------------------------------------------------------- 
!	Type local variables 
!---------------------------------------------------------------------- 
 
	   INTEGER(2) :: i 
	   INTEGER(2) status 
 
!	   Get number of arguments 
	   num_arguments = nargs() 
!	   Check for too many argumeents 
	   IF(num_arguments > num_strings) THEN ! too many arguments 
		  error         = num_arguments 
		  num_arguments = num_strings 
	   ELSE 
		  error = 0 
	   ENDIF 
!	   Get arguments 
 
	   DO i =0, num_arguments - 1 
		  CALL getarg(i, strings(i + 1), status) 
			IF(status < 0) THEN 
			   error = status 
			   EXIT 
	        ENDIF 
	   ENDDO 
 
	   END SUBROUTINE get_arguments 
 
	END MODULE command_line_arguments
0 Kudos
1 Reply
Steven_L_Intel1
Employee
274 Views
Hmm - Replace the INCLUDE with USE DFLIB - but what you have should work. I'll look into this.

Steve
0 Kudos
Reply