Re: [問題] 連續變數名稱跟加法的設定
program test
integer,parameter :: i=11,j=13,ij_avg=9
real*8 :: s1(i,j),s11(i-ij_avg+1,j-ij_avg+1)
do mm=1,i
do nn=1,j
s1(mm,nn)=(mm+nn/2.d0)*sqrt(mm*1.d0)
enddo
enddo
s11=0.d0
k1=ij_avg-1
print*,s1
print*,'-------------'
s11=reshape((/ ((/ (sum(s1(ii:(ii+k1),jj:(jj+k1))),jj=1,j-k1) /),ii=1,i-k1)
/),(/i-ij_avg+1,j-ij_avg+1/))
print*,s11
end
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.109.82.216
※ 編輯: onezillion 來自: 140.109.82.216 (05/15 12:43)
推
05/15 13:10, , 1F
05/15 13:10, 1F
→
05/15 13:10, , 2F
05/15 13:10, 2F
→
05/15 13:11, , 3F
05/15 13:11, 3F
→
05/15 13:13, , 4F
05/15 13:13, 4F
→
05/15 13:14, , 5F
05/15 13:14, 5F
→
05/15 13:17, , 6F
05/15 13:17, 6F
→
05/15 13:18, , 7F
05/15 13:18, 7F
→
05/15 13:38, , 8F
05/15 13:38, 8F
→
05/15 13:58, , 9F
05/15 13:58, 9F
推
05/15 17:01, , 10F
05/15 17:01, 10F
→
05/15 17:51, , 11F
05/15 17:51, 11F
→
05/15 17:53, , 12F
05/15 17:53, 12F
→
05/15 17:55, , 13F
05/15 17:55, 13F
→
05/15 17:57, , 14F
05/15 17:57, 14F
※ 編輯: onezillion 來自: 140.109.82.216 (05/15 18:33)
討論串 (同標題文章)
完整討論串 (本文為第 3 之 5 篇):
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章