1517468789(1).jpg (53.7 KB, 下载次数: 309)
program Compute
implicit none
integer,parameter::M=1,N=2
real,dimension(:,:),allocatable::C1
integer i,j,k,m1,n1,a1,a2,ETL(M*N,5)
real aa(4,4)
allocate(C1((M+1)*(N+1),(M+1)*(N+1)))
open(unit=15,file='storett3',access='sequential',action='write')
open(unit=14,file='storeaa3',access='sequential',action='write')
data aa/4,2,1,2,2,4,2,1,1,2,4,2,2,1,2,4/
k=0
do j=1,M
do i=1,N
k=k+1
ETL(k,1)=k
m1=mod(i,N)
if(m1==0) then
n1=j*(N+1)-1
else
n1=(j-1)*(N+1)+m1
end if
ETL(k,2)=n1
ETL(k,3)=n1+1
ETL(k,4)=n1+N+2
ETL(k,5)=n1+N+1
end do
end do
do k=1,M*N
do i=1,4
do j=1,4
a1=ETL(k,i+1)
a2=ETL(k,j+1)
C1(a1,a2)=C1(a1,a2)+aa(i,j)
end do
end do
end do
write(14,"(<4>('',f,''))")((aa(i,j),i=1,4),j=1,4)
write(15,"(<6>('',f,''))")((C1(i,j),i=1,6),j=1,6)
end
-finit-local-zero
-finit-derived
-finit-integer=n
-finit-real=<zero|inf|-inf|nan|snan>
-finit-logical=<true|false>
-finit-character=n
The -finit-local-zero option instructs the compiler to initialize local INTEGER, REAL, and COMPLEX variables to zero, LOGICAL variables to false, and CHARACTER variables to a string of null bytes. Finer-grained initialization options are provided by the -finit-integer=n, -finit-real=<zero|inf|-inf|nan|snan> (which also initializes the real and imaginary parts of local COMPLEX variables), -finit-logical=<true|false>, and -finit-character=n (where n is an ASCII character value) options. Components of derived type variables will be initialized according to these flags only with -finit-derived. These options do not initialize
allocatable arrays
variables that appear in an EQUIVALENCE statement.
(These limitations may be removed in future releases).
Note that the -finit-real=nan option initializes REAL and COMPLEX variables with a quiet NaN. For a signalling NaN use -finit-real=snan; note, however, that compile-time optimizations may convert them into quiet NaN and that trapping needs to be enabled (e.g. via -ffpe-trap).
Finally, note that enabling any of the -finit-* options will silence warnings that would have been emitted by -Wuninitialized for the affected local variables.
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |