[Fortran] 纯文本查看 复制代码 Program www_fcode_cn
Implicit None
Integer , parameter :: DP = Selected_Real_Kind( p = 13 ) !// 需保留13位有效数字
Integer , parameter :: NC = 18 !// 列
Integer , parameter :: NR = 14 !// 行
Real(Kind = DP ) :: rData(NC,NR) , rDataLite(NC/2,NR/2)
integer :: i , j
Open( 12 , File = "1.dat" )
Open( 13 , File = "输出.dat" )
Do i = 1 , NR
Read( 12 , * ) rData( : , i )
End Do
Do i = 1 , size(rDataLite,dim=2)
Do j = 1 , size(rDataLite,dim=1)
rDataLite( j , i ) = sum( rData( 2*j-1:2*j , 2*i-1:2*i ) ) / 4.0_DP
End Do
Write( 13 , '(100f16.8)' ) rDataLite( : , i )
End Do
Close( 13 )
Close( 12 )
End Program www_fcode_cn |