[Fortran] 纯文本查看 复制代码
program main22
dimension a(7,7)
open (1,file='E:\1.txt')
do 10 i=1,7
read(1,*)(a(i,j),j=1,7)
10 continue
write(*,*)((a(i,j),j=1,7),i=1,7)
call FMAXA(NN1, NE, LMT, MAXA, NWK, NPF, NDF)
END
SUBROUTINE FMAXA(NN1, NE, LMT, MAXA, NWK, NPF, NDF)
!This program forms the MDE address matrix MAXA of [K]
IMPLICIT REAL*8(A-H,O-Z)
IMPLICIT INTEGER*4(I-N)
DIMENSION MAXA(NPF), LMT(NDF,NE)
MAXA=0; NWK=0
MAXA(1)=1
DO I=2, NN1
IP=I-1
IG=IP
DO IE=1, NE
DO J=1, NDF
IF(LMT(J,IE).EQ.IP)THEN
DO K=1, NDF
IF(LMT(K,IE).GT.0.AND.LMT(K,IE).LE.IG) IG=LMT(K,IE)
ENDDO
END IF
ENDDO
ENDDO
MAXA(I)=MAXA(I-1)+IP-IG+1
ENDDO
NWK=MAXA(NN1)-1
RETURN
write(*,*)MAXA(I)
END