小的初来乍道,希望得到大神的帮助。程序如下: [Fortran] 纯文本查看 复制代码 program attempt_initial_fai
dimension fai(300,300)
!open(101,file='E:\试验程序\one dimension random seed\test_fai.dat')
open(101,file='E:\试验程序\one dimension random seed\fai.dat')
call initial_data(fai(i,j))
write(101,20) ((fai(i,j),j=1,300),i=1,300)
20 FORMAT (1X,300D15.6)
!end do
end program attempt_initial_fai
subroutine initial_data(a(i,j))
open(1,file='E:\试验程序\one dimension random seed\data1.dat')
DO i=1,300
READ(1,'(300D15.6)') fai(:,i)
end do
do i=1,300
do j=1,300
a(i,j)=mod(a(i,j),1.0)
end do
end do
close(1)
return
end subroutine
1里面是300*300的数据,想实现的是用子程序把1里面的值赋到二维数组fai(i,j)并输出到101里面。
还有,小弟用的是visual studio 2012,代码写出来提示错误,但是不提示在哪一行了,很苦恼。比如上面这段,就有一下错误。
错误 1 error #5082: Syntax error, found '(' when expecting one of: ) , E:\\mass of disorder\mass of disorder\Source1.for
错误 2 error #5082: Syntax error, found ')' when expecting one of: , : ] E:\\mass of disorder\mass of disorder\Source1.for
错误 3 error #7271: Not a valid attribute for the DEC$ ATTRIBUTES directive. [I] E:\\mass of disorder\mass of disorder\Source1.for
错误 4 error #6911: The syntax of this substring is invalid. [FAI] E:\\mass of disorder\mass of disorder\Source1.for
错误 5 Compilation Aborted (code 1) E:\试验程序\mass of disorder\mass of disorder\Source1.for 1
|