MODULE inputpower
IMPLICIT NONE
REAL k(50,152)
END MODULE
SUBROUTINE getpow(xx,yy)
USE inputpower
IMPLICIT NONE
INTEGER i,j
OPEN(unit=99,file='test1.txt',status='old',form = 'formatted')
DO i=1,xx
READ(99,*) (k(j,i) ,j=1,yy)
!print*, (k(j,i) ,j=1,yy)
END DO
CLOSE(99)
END SUBROUTINE getpow(xx,yy)
PROGRAM inpow
USE inputpower
IMPLICIT NONE
INTEGER na,nr
na = 7
nr = 7
!read the input data
CALL getpow(na,nr)
END PROGRAM inpow
TIM截图20190219193504.png (182.28 KB, 下载次数: 291)
TIM截图20190219193442.png (151.55 KB, 下载次数: 256)
TIM截图20190219193321.png (57.29 KB, 下载次数: 294)
MODULE inputpower
IMPLICIT NONE
REAL k(50,152)
END MODULE
SUBROUTINE getpow(xx,yy)
USE inputpower
IMPLICIT NONE
INTEGER i,j,xx,yy!//XX,YY需要定义
OPEN(unit=99,file='test1.txt',status='old',form = 'formatted')
DO i=1,xx
READ(99,*) (k(j,i) ,j=1,yy)
!print*, (k(j,i) ,j=1,yy)
END DO
CLOSE(99)
END SUBROUTINE getpow!//这里不写括号
PROGRAM inpow
USE inputpower
IMPLICIT NONE
INTEGER na,nr
na = 7
nr = 7
!read the input data
CALL getpow(na,nr)
END PROGRAM inpow
fcode 发表于 2019-2-19 22:02
[mw_shl_code=fortran,true]MODULE inputpower
IMPLICIT NONE
REAL k(50,152)
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |