我需要x1/x2,x1/x3.....x5/x6
我有15x5的数字,例如:
x1 = 3.98 x2 =4.09 x3 = 3.11 x4 =1.23 x5= 2.54 x6= 5.78
和14个x1,x2,x3,x4,x5,x6
更多
我的问题是我如何接受list (15,5)
元素list(1,1)/list(1,2), list(1,1)/list(1,3)....
PROGRAM coef
REAL, DIMENSION(15,5):: list
REAL, DIMENSION(15,10):: y
INTEGER i,j
OPEN (11, FILE='datoscoeficientes.dat')
OPEN (12, FILE='resultadoscoeficientes.sal')
READ (11, '(2/)')
DO i=1,15
READ (11, '(6X,5(3X,F4.2)/)') (list(i,j),j=1,5)
WRITE (12, '(6X,5(3X,F4.2))') (list(i,j), j=1,5)
call division(list,y)
WRITE (12, '(40X,5(3X,F8.20))') sol
ENDDO
ENDPROGRAM
SUBROUTINE division(lista,y)
REAL, DIMENSION (15,5):: list
REAL, DIMENSION (15,10):: y
INTEGER m,n
DO m=1,15
IF(i/=j) THEN
y(m,n)=(lista(m,n),(n=1,5))
sol=y(m)/y(n)
ENDIF
ENDDO
ENDSUBROUTINE
如何执行子程序以便引用列表行的元素?