PROGRAM P2M

PARAMETER (MAX = 10) ! maximum row/column dimension is 10

REAL A(MAX,MAX) ! initialize three matrices

REAL B(MAX,MAX)

REAL C(MAX,MAX)

c Begin main......................

INTEGER I,J,N

CHARACTER P,Y

CALL GETARG(1,Y)

READ(Y,*),N

IF (N.GT.MAX) THEN

PRINT*,'n greater than',MAX,', program will exit'

STOP

ENDIF

DO I=1,N

DO J=1,N

CALL GETARG(N*(I-1)+J+1,P)

READ(P,*),A(I,J)

ENDDO

ENDDO

CALL FILLB(A,B,N,MAX) ! call to fillb

CALL MULTIPLY(A,B,C,N,MAX) ! call to multiply

DO I=1,N

DO J=1,N

WRITE (6,10) C(I,J) ! print product matrix2

10 FORMAT(F9.3,$)

ENDDO

PRINT*

PRINT*

ENDDO

END

SUBROUTINE FILLB(X,Y,N,MAX) ! fill matrix b

REAL X(MAX,MAX), Y(MAX,MAX), TEMP

PRINT*

DO I=1,N

DO J=1,N

Y(I,J)=SQRT(X(I,J)) ! fill with square roots of matrix a

ENDDO

ENDDO

END

SUBROUTINE MULTIPLY(X,Y,Z,N,MAX) ! multiply two matrices

REAL X(MAX,MAX), Y(MAX,MAX), Z(MAX,MAX)

DO I=1,N

DO J=1,N

Z(I,J)=X(I,J)*Y(I,J) ! fill third matrix with products

ENDDO ! of the first and second matrices

ENDDO

END

The code compiles with no errors. The only problem is with the moving of args form the command line into the first matrix. Thanks again, Supr