MULT

 !name of the program:MULT

!Building two 3x3 matrices F, G and their multiplication FG

  INTEGER*4 F(3,3),G(3,3), FG(3,3)

 Print *, 'Enter the matrix elements column by column for F: '

  Read *, F

  Print *, 'Matrix F 3x3: '

  Print *, F(1,1),F(1,2),F(1,3)

  Print *, F(2,1),F(2,2),F(2,3)

  Print *, F(3,1),F(3,2),F(3,3)

 Print *, 'Enter the matrix elements column by column for G: '

  Read *, G

  Print *, 'Matrix G 3x3: '

  Print *, G(1,1),G(1,2),G(1,3)

  Print *, G(2,1),G(2,2),G(2,3)

  Print *, G(3,1),G(3,2),G(3,3)

  Call MATMPY(F,G,FG)

  Print *, 'Matrix multiplication FG 3x3: '

  Print *, FG(1,1),FG(1,2),FG(1,3)

  Print *, FG(2,1),FG(2,2),FG(2,3)

  Print *, FG(3,1),FG(3,2),FG(3,3)

  stop

  end

 

  Subroutine MATMPY(F,G,FG)

  Integer*4 F(3,3),G(3,3),FG(3,3)

  Do 2 J=1,3

  Do 2 I=1,3

     FG(I,J)=0

     Do 3 K=1,3

        FG(I,J)= FG(I,J)+F(I,K)*G(K,J)

3    continue

2 continue

  return

  end

Comentários

Postagens mais visitadas deste blog

RECURSIVE

HYDROGEN-RADIAL

RUNGE-KUTTA