Fortran90/95 2. (p 74) f g h x y z f x h x = f x + g x h y = f y + g y h z = f z + g z f x f y f y f h = f + g Fortran 1 3 a b c c(1) = a(1) + b(1) c(

Similar documents
1F90/kouhou_hf90.dvi

untitled

11042 計算機言語7回目 サポートページ:

all.dvi

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1

情報処理概論(第二日目)

インテル(R) Visual Fortran Composer XE 2013 Windows版 入門ガイド

( ) 1 Windows HTML ( ) ( ) ( ) WWW 10 ( )

01_OpenMP_osx.indd

情報科学概論 第1回資料

2 Excel =sum( ) =average( ) B15:D20 : $E$26 E26 $ =A26*$E$26 $ $E26 E$26 E$26 $G34 $ E26 F4

. (.8.). t + t m ü(t + t) + c u(t + t) + k u(t + t) = f(t + t) () m ü f. () c u k u t + t u Taylor t 3 u(t + t) = u(t) + t! u(t) + ( t)! = u(t) + t u(

プラズマ核融合学会誌5月号【81-5】/内外情報_ソフト【注:欧フォント特殊!】


コンピュータ概論

<4D F736F F F696E74202D D F95C097F D834F E F93FC96E5284D F96E291E85F8DE391E52E >

Fortran90/95 [9]! (1 ) " " 5 "Hello!"! 3. (line) Fortran Fortran 1 2 * (1 ) 132 ( ) * 2 ( Fortran ) Fortran ,6 (continuation line) 1

untitled

(2-1) x, m, 2 N(m, 2 ) x REAL*8 FUNCTION NRMDST (X, M, V) X,M,V REAL*8 x, m, 2 X X N(0,1) f(x) standard-norm.txt normdist1.f x=0, 0.31, 0.5

Microsoft Word - 資料 docx

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb

Microsoft Word - 03-数値計算の基礎.docx

改訂版 :基本的な文字化の原則(Basic Transcription System for Japanese: BTSJ)

D0020.PDF

Microsoft Word - 資料 (テイラー級数と数値積分).docx

情報活用資料

コンピュータ概論

120802_MPI.ppt

i


Wide Scanner TWAIN Source ユーザーズガイド

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

koji07-02.dvi

リファレンス

橡統計担当者のためのエクセル表紙.PDF

Microsoft PowerPoint _MPI-03.pptx

OHP.dvi

XMPによる並列化実装2

FORTRAN文法の基礎

II

広域防災拠点検討会報告書030723表紙_0829_.PDF


II III I ~ 2 ~

中堅中小企業向け秘密保持マニュアル


PR映画-1

- 2 -


1 (1) (2)

a n a n ( ) (1) a m a n = a m+n (2) (a m ) n = a mn (3) (ab) n = a n b n (4) a m a n = a m n ( m > n ) m n 4 ( ) 552

=

都道府県別経済財政モデル(平成27年度版)_02

Lecture on

REALV5_A4…p_Ł\1_4A_OCF

untitled

「都市から地方への人材誘致・移住促進に関する調査」

<91498EE88CA D815B2E786C73>

〔 大 会 役 員 〕

橡本体資料+参考条文.PDF

インターネット入門

D0050.PDF

untitled

Excel Excel Excel = Excel III 7 ( ) 1

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£²¡Ë

My関数の作成演習問題集

2X Y Y X θ 1, θ 2,... Y = f(x, θ 1, θ 2,...) θ k III 8 ( ) 1 / 39

CUDA 連携とライブラリの活用 2

2 2.1 Mac OS CPU Mac OS tar zxf zpares_0.9.6.tar.gz cd zpares_0.9.6 Mac Makefile Mekefile.inc cp Makefile.inc/make.inc.gfortran.seq.macosx make

Gauss

2/ 土 :30 11:20 似通った科目名がありますので注意してください. 受験許可されていない科目を解答した場合は無効 整理番号と科目コードは受験許可証とよく照合し正確に記入

n 第1章 章立ての部分は、書式(PC入門大見出し)を使います

エクセルカバー入稿用.indd

3. :, c, ν. 4. Burgers : u t + c u x = ν 2 u x 2, (3), ν. 5. : u t + u u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,.,

3. :, c, ν. 4. Burgers : t + c x = ν 2 u x 2, (3), ν. 5. : t + u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,., ν. t +

働く女性の母性健康管理、母性保護に関する法律のあらまし

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal

01_.g.r..

橡Taro9-生徒の活動.PDF



II 2 3.,, A(B + C) = AB + AC, (A + B)C = AC + BC. 4. m m A, m m B,, m m B, AB = BA, A,, I. 5. m m A, m n B, AB = B, A I E, 4 4 I, J, K

B 5 (2) VBA R / B 5 ( ) / 34

sim98-8.dvi

2 X Y Y X θ 1,θ 2,... Y = f (X,θ 1,θ 2,...) θ k III 8 ( ) 1 / 39


1


Sae x Sae x 1: 1. {x (i) 0 0 }N i=1 (x (i) 0 0 p(x 0) ) 2. = 1,, T a d (a) i (i = 1,, N) I, II I. v (i) II. x (i) 1 = f (x (i) 1 1, v(i) (b) i (i = 1,

困ったときのQ&A

178 5 I 1 ( ) ( ) ( ) ( ) (1) ( 2 )

PowerPoint プレゼンテーション

02_C-C++_osx.indd

リファレンス

<4D F736F F D208DEC90AC837D836A B81698F4390B394C5816A2E646F63>

MPI usage

演習2

1. 入力画面

Transcription:

Fortran90/95 4.1 1. n n = 5 x1,x2,x3,,x4,x5 5 average = ( x1 + x2 + x3 + x4 + x5 )/5.0 n n x (subscript) x 1 x 2 average = 1 n n x i i=1 Fortran ( ) x(1) x(2) x(n) Fortran ( ) average = sum(x(1:n))/real(n) x x(1) x(2) (p 61) x 2 y 5 z 3 z(3) = real(x(2)) + y(5) (extent) 3 x(1) x(2) x(3) x 3 (p 68) Fortran a i j a(i,j) (dimension) Fortran 7 (size) - 58 -

Fortran90/95 2. (p 74) f g h x y z f x h x = f x + g x h y = f y + g y h z = f z + g z f x f y f y f h = f + g Fortran 1 3 a b c c(1) = a(1) + b(1) c(2) = a(2) + b(2) c(3) = a(3) + b(3) c = a + b (p 76) 3 a b b = abs(a) Fortran b(1)=abs(a(1)) b(2)=abs(a(2)) b(3)=abs(a(3)) sum ( ) - 59 -

Fortran90/95 Fortran c c + 1 c 1 3. FORTRAN FORTRAN (array) (dimension) (tensor) (order) 0 = (scalar) 1 1 = (vector) 2 2 = (matrix) (extent) (size) (dimension) FORTRAN (i) 1 {x} x FORTRAN 1 1 y z z = y n 1 n FORTRAN (ii) (p 71) Fortran(90/95) 0 0 0-60 -

Fortran90/95 4.2 1. 4-1 n x n 10 Fortran90/95 :: ( ) integer real Fortran 4-1 1 program example4_01 3 real :: x(10) 4 real :: average, variance 5 integer :: n, i 6 7 average = 0.0 8 read(*,*) n 9 do i = 1, n 10 read(*,*) x(i) 11 average = average + x(i) 12 enddo 13 average = average/real(n) 14 15 variance = 0.0 16 do i = 1, n 17 variance = variance + (x(i)-average)**2 18 enddo 19 variance = variance/real(n) 20 21 write(*,*) "average=", average, " variance=", variance 22 23 stop 24 end program example4_01 3 10 1 10-61 -

Fortran90/95 4-2 n 2,1,0,-1,-2 n 1 1 n select case -2 2 ( ) ( : ) + 1 1 : 4-2 1 program example4_02 3 integer :: k(-2:2) 4 integer :: i, j, n 5 real :: average 6 7 do i = -2, 2 8 k(i) = 0 9 enddo 10 average = 0.0 11 12 read(*,*) n 13 do i = 1, n 14 read(*,*) j 15 k(j) = k(j) + 1 16 average= average + real(j) 17 enddo 18 19 do i = -2, 2 20 write(*,*) i, " ->",k(i) 21 enddo 22 write(*,*) "average=", average/real(n) 23 24 stop 25 end program example4_02 3-2 2-62 -

Fortran90/95 2. 4-3 10 (, ) 1 0 100 read(*,*) write(*,*) x 1 5 read(*,*) x read(*,*) x(1), x(2), x(3), x(4), x(5) 4-3 1 program example4_03 3 integer :: ip(10), max_point, min_point 4 real :: average 5 integer :: i 6 7 read(*,*) ip 8 9 max_point = 0 10 min_point = 100 11 average = 0.0 12 do i = 1, 10 13 if(ip(i) > max_point) max_point = ip(i) 14 if(ip(i) < min_point) min_point = ip(i) 15 average = average + real(ip(i)) 16 enddo 17 18 write(*,*) "max point=",max_point 19 write(*,*) "min point=",min_point 20 write(*,*) "average= ", average/10.0 21 22 stop 23 end program example4_03 13 14-63 -

Fortran90/95 do 4-4 4-1 1 1 n 1 1 do read(*,*) ( ( ), =,, ) 1, do (i) (ii) + (iii) + 2. do 4-4 1 program example4_04 3 real :: x(10) 4 real :: average, variance 5 integer :: n, i 6 7 average = 0.0 8 read(*,*) n, (x(i), i = 1, n) 9 10 do i = 1, n 11 average = average + x(i) 12 enddo 13 average = average/real(n) 14 15 variance = 0.0 16 do i = 1, n 17 variance = variance + (x(i)-average)**2 18 enddo 19 variance = variance/real(n) 20 write(*,*) "average=", average, " variance=", variance 21 22 stop 23 end program example4_04 8 n do - 64 -

Fortran90/95 3. 4-5 1 1 n, (/ /) (/ 1, 2,, n /) (/ /) 2 4-5 1 program example4_05 3 integer :: month_day(12)=(/31,28,31,30,31,30,31,31,30,31,30,31/) 4 integer :: month, day, day_year, i 5 6 read(*,*) month, day 7 8 day_year = 0 9 do i = 1, month-1 10 day_year = day_year + month_day(i) 11 enddo 12 day_year = day_year + day 13 14 write(*,*) "day of year=", day_year 15 16 stop 17 end program example4_05 3 (/ 1, 2, /) - 65 -

Fortran90/95 (i) ( ) (/ 2.2, x, 1.2 /) x (ii) ( ) do (/ (i, i=1,9,2) /) 5 i (iii) (/ a, b /) a b do (i ) ( ) real, parameter :: x = 1.7 real :: a(3) = (/ 2.2, x, 1.2 /) (ii ) ( ) do integer :: i integer :: k(5) = (/ (i, i=1,9,2) /) (iii ) integer, parameter :: ic(2) = (/ 1, 2 /) integer :: id(4) = (/ ic, (/ 3, 4 /) /) 1 4-5 program example4_05a implicit none integer :: month_day(12)=(/31,28,31,30,31,30,31,31,30,31,30,31/) integer :: month, day read(*,*) day do month = 1, 12 if( day <= month_day(month) ) exit day = day - month_day(month) enddo write(*,*) "month=", month, " day=", day stop end program example4_05a - 66 -

Fortran90/95 4. data 4-6 C H O C= 12 H= 1 O= 16 (i) read (ii) 3 (iii) data *1 data data 1 / 1 /, 2 / 2 /,, (a(i),i=5,10) data 1,2,0,0,0,0,3 * 1,2,4*0,3 data end 4-6 1 program example4_06 3 real :: w(3), w_mole 4 integer :: k(3), i 5 data w/12.0, 1.0, 16.0/ 6 7 read(*,*) k 8 w_mole = 0.0 9 do i = 1, 3 10 w_mole = w_mole + w(i)*real(k(i)) 11 enddo 12 write(*,*) "molecular weight=", w_mole 13 14 stop 15 end program example4_06 *1-67 -

Fortran90/95 4.3 1. 4-7 A 82 75 78 B 65 90 70 C 70 73 85 D 66 72 71 1 1 3 4 Excel 1 :: ( 1, 2 ) 4 3 1 2 1 4 2 3 82,75,78 ip(1,1) ip(1,2) ip(1,3) 65,90,70 -> ip(2,1) ip(2,2) ip(2,3) 70,73,85 ip(3,1) ip(3,2) ip(3,3) 66,72,71 ip(4,1) ip(4,2) ip(4,3) 4-7 1 program example4_07 3 integer :: ip(4,3) 4 real :: ave_subject(3) 5 integer :: i, j 6 7 do i = 1, 4 8 read(*,*) (ip(i,j), j= 1, 3) 9 enddo 10 11 do j = 1, 3 12 ave_subject(j) = 0.0 13 do i = 1, 4 14 ave_subject(j) = ave_subject(j) + ip(i,j) 15 enddo 16 ave_subject(j) = ave_subject(j)/4.0 17 enddo 18 19 write(*,*) (ave_subject(j), j = 1, 3) 20 21 stop 22 end program example4_07-68 -

Fortran90/95 Fortran 1 1 ( ) 2 * 2 3 4 2 ip * 3 ip(1,1), ip(2,1), ip(3,1), ip(4,1), ip(1,2),, ip(3,3), ip(4,3) read(*,*) ip write(*,*) ip Fortran (1) data data data integer :: ip(4,3) data ip/ 82, 65, 70, 66, 75, 90, 73, 72, 78, 70, 85, 71 / do data ((ip(i,j),j=1,3),i=1,4) / 82, 75, 78, 65, 90, 70, 70, 73, 85, 66, 72, 71 / (2) reshape reshape reshape( source, shape ) source shape (/ /) ( ) ( ) ip(4,3) = ip = reshape((/ 82, 65, 70, 66, 75, 90, 73, 72, 78, 70, 85, 71 /), (/ 4, 3 /)) *2 C *3-69 -

Fortran90/95 2. 4-8 3 1,2,4,7,8,10, n 3 1 1,4,7, 2 2,5,8, 3 3,6,9, do a a(n1:n2[:n3)] n1 a n2 a n3 n3=1 n3 1 do a n2 n1 n2 n3 (i) n1=1 1 (ii) n2 a n2 (iii) n3 1 :1 : 1 a(:) 4-8 1 program example4_08 3 integer, parameter :: m = 14 4 integer :: n(m) 5 6 read(*,*) n 7 8 write(*,*) n(1:m:3)! n(::3) 9 write(*,*) n(2:m:3) 10 write(*,*) n(3:m:3) 11 12 stop 13 end program example4_08 do - 70 -

Fortran90/95 (n1,n2[,n3]) (i) (ii) (iii) a(4,3) a(1,1) a(1,2) a(1,3) a(2,1) a(2,2) a(2,3) a(3,1) a(3,2) a(3,3) a(4,1) a(4,2) a(4,3) a(2:4:2,:) a(2,1) a(2,2) a(2,3) a(4,1) a(4,2) a(4,3) a(3,:) a(3,1) a(3,2) a(3,3) a(n1) a(n1:n1) 1 a(n1,n2) 2 a(n1:n1,n2:n2) 1 a(2,2) = a(2:2,2:2) a(n1,n2) n1>n2 (size) n a m num a num a(num) a(num(1)),a(num(2))...a(num(m)) m a write(*,*) (a(num(i)), i=1, m) do write(*,*) a(num(:)) num num a read - 71 -

Fortran90/95 3. 4-9 n x n 5 81, 72, 70, 64, 90 4-1 n ( x(10000) ) (i) (ii) (iii) n n step1: allocatable, allocatable :: (:) (:,:) step2: allocate allocate ( ( )) n allocate deallocate step3: deallocate deallocate ( ) deallocate deallocate allocate - 72 -

Fortran90/95 4-9 1 program example4_09 3 real, allocatable :: x(:) 4 real :: sum 5 integer :: n, i 6 7 read(*,*) n 8 allocate (x(n)) 9 read(*,*) x(:) 10 sum = 0.0 11 do i = 1, n 12 sum = sum + x(i) 13 enddo 14 write(*,*) "average =", sum/real(n) 15 16 deallocate (x) 17 stop 18 end program example4_09 3 8 16 9 do 9 read(*,*) x x 2 4-7 n n program example4_09a implicit none integer, allocatable :: ip(:,:) real :: average integer :: i, j, n read(*,*) n; allocate (ip(n,3)) read(*,*) ((ip(i,j), j =1, 3), i =1, n) do j = 1, 3 average = 0.0 do i = 1, n average = average + ip(i,j) enddo write(*,*) average/real(n) enddo deallocate (ip) stop end program example4_09a - 73 -

Fortran90/95 4.4 1. 4-10 2 2.0 a = 1.5 3.2 (1) a + b (2) 2 a 3 b (3) a b ( ) 1.2 b = 1.1 0.6 n Fortran n 1 3 1 a b data read a b c ( ) c = a + b ( ) c = a - b ( ) c = a * b ( ) c = a / b *4 c(i) = a(i) + b(i) a b c x a y y = a * x y = x * a x y *4 c(:) = a(:) + b(:) c(:,:) = a(:,:) + b(:,:) (2 ) - 74 -

Fortran90/95 d e f f = d ** e 4-10 1 program example4_10 3 real :: a(3)=(/2.0,1.5,3.2/), b(3)=(/1.2,-1.1,0.6/) 4 real :: c(3), sum 5 integer :: i 6 7 write(*,*) a(:) + b(:) 8 write(*,*) 2.0*a(:) - 3.0*b(:) 9 c(:) = a(:) * b(:) 10 sum = 0.0 11 do i = 1, 3 12 sum = sum + c(i) 13 enddo 14 write(*,*) sum 15 16 stop 17 end program example4_10 3 1.0 2.0 2.5 1.0 3.0 4.0 0.5 1.5 program example4_10a implicit none real :: a(2,2), b(2,2), c(2,2) data a/1.0,3.0,2.0,4.0/! data b/2.5,0.5,1.0,-1.5/! c(:,:) = a(:,:) + b(:,:) write(*,*) c(1,1), c(1,2) write(*,*) c(2,1), c(2,2) stop end program example4_10a - 75 -

Fortran90/95 2. 4-11 1.2 a = 0.5 0.9 do real :: a(3)=(/1.5,0.5,-0.9/) integer :: b(3), i do i=1,3 b(i) = nint((a(i)) enddo b 1 ( nint) 2 = ( 1) 1 2 ( ) 4-11 1 program example4_11 3 real :: a(3)=(/1.5,0.5,-0.9/) 4 integer :: b(3) 5 6 b(:) = nint(a(:)) 7 write(*,*) b(:) 8 9 stop 10 end program example4_11 6-76 -

Fortran90/95 4.5 1. where where where where Fortran90 if 4-12 n a 0.0 n a = (/2.5,1.2,-1.2,1.1,-0.5/) where where if where( mask ) where ().true.( ).false.( ) (mask ) ( a(:) < 1.0 ) where ( where ) where if * 5 where( ) 1 2 end where 1 2 1 2 4-12 1 program example4_12a 3 real :: a(5)=(/2.5,1.2,-1.2,1.1,-0.5/) 4 5 where( a(:)< 0.0 ) a(:) = 0.0 *5 elesewhere( ) elsewhere if elseif else - 77 -

Fortran90/95 6 write(*,*) a(:) 7 8 stop 9 end program example4_12a 2. forall forall (95) forall Fortran95 where do where forall forall forall forall(do 1 [ do 2 ]..[ ]) do = : : forall(i=1:n, a(i)>0) a(i)=1.0/a(i) forall forall(do 1 [ do 2 ]..[ ]) 1 2 end forall do loop do loop forall CPU forall 4-12 1 program example4_12b 3 real :: a(5)=(/2.5,1.2,-1.2,1.1,-0.5/) 4 integer :: i 5 6 forall(i=1:5, a(i)<0.0) a(i) = 0.0 7 write(*,*) a(:) 8 9 stop 10 end program example4_12b - 78 -

Fortran90/95 4.6 (90/95) fortran90/95 1. 1 2 Fortran(90/95) 3 4-13 (1) 2 2 a = 1 1 b = 1 a b 3 2 (2) C = 1 2 C 2 C t C (C t C ) 0 1 (dot_product) u v (u,v) dot_product(u,v) u v 1 u v u v u v u v u v u u (conjugate) u(i),v(i) u v u(i).and. v(i) 0 4-13 1 program example4_13a 2! 3 implicit none 4 integer :: a(3) = (/2, 1, 3/) 5 integer :: b(3) = (/1,-1, 2/) 6 integer :: p 7 8 p = dot_product(a,b) 9 write(*,*) p 10 11 stop 12 end program example4_13a i - 79 -

Fortran90/95 (matmul ) A B C=AB c = matmul(a,b) a k m 2 b m n 2 c k n 2 a b a b a b 2 b m 1 u v=au v = matmul(a,u) v k 1 2 a k 1 v u = t va v = matmul(v,a) u m 1 ( transpose ) A *6 C = t A c = transpose(a) a k m 2 m k 2 4-13 1 program example4_13b 2! 3 implicit none 4 integer :: c(2,2), d(2,2), e(2,2) 5 integer :: i, j 6 data c/1,0,2,1/ 7 8 d = matmul(c,c) 9 write(*,*) d(1,:) ; write(*,*) d(2,:) ; write(*,*) 10 11 e = matmul(transpose(c),c) 12 write(*,*) e(1,:) ; write(*,*) e(2,:) 13 14 stop 15 end program example4_13b *6 C = t A A i j = C ji - 80 -

Fortran90/95 2. 4-14 A n n m real :: a(2,-1:3,0:2) (shape) A shape(a) 1 A i A i (size) A size(a [,dim]) dim A dim dim A (ubound) A ubound(a [,dim]) dim A dim dim A A (lbound) A ubound lbound(a [,dim]) 4-14 1 program example4_14 3 real :: a(2,-1:3,0:2) 4 integer :: n, m(7)! 7 5 n = size(shape(a)) 6 m(1:n) = shape(a) 7 write(*,*) n 8 write(*,*) m(1:n) 9 stop 10 end program example4_14-81 -

Fortran90/95 3. 4-15 A 999.0 (1) n (2) ave real :: a(7) = (/1.2, 2.1, 3.0, 999.0, 2.0, 1.1, 999.0/) sum if FORTRAN77 Fortran90/95 mask mask A sum(a,mask=(a>0)) mask mask= mask mask ( A ) 1 1 (sum) sum(a[,dim][,mask]) A A ( ) dim dim A -1 mask mask (product) product(a[,dim][,mask]) sum (maxval) maxval(a[,dim][,mask]) A A ( ) dim dim A -1 mask mask - 82 -

Fortran90/95 (minval) minval(a[,dim][,mask]) maxval mask mask= (count) count(mask[,dim]) mask ( ) dim dim dim mask -1 (any) any(mask[,dim]) mask 1 ( ) dim dim 1 dim mask -1 (all) all(mask[,dim]) mask ( ) dim dim dim mask -1 4-15 1 program example4_15 3 real :: a(7) = (/1.2, 2.1, 3.0, 999.0, 2.0, 1.1, 999.0/), ave 4 integer :: n 5 6 n = count(a<999.0) 7 write(*,*) n 8 ave = sum(a, mask=(a<999.0) ) 9 write(*,*) ave/real(n) 10 11 stop 12 end program example4_15-83 -

Fortran90/95 4. 4-16 A 999.0 1 real :: a(-3:3) = (/1.2, 2.1, 3.0, 999.0, 2.0, 1.1, 999.0/) 1 (maxloc) maxloc(a[,mask]) A 1 mask mask (minloc) minloc(a[,mask]) maxloc 4-16 1 program example4_16 3 real :: a(-3:3) = (/1.2, 2.1, 3.0, 999.0, 2.0, 1.1, 999.0/) 4 integer :: m(1) 5 6 m = maxloc(a, mask=(a<999.0)) 7 write(*,*) lbound(a,1) + m(1) - 1 8 9 stop 10 end program example4_1-84 -

Fortran90/95 4 4-1 ( ) 1000 ( ) (1) 2 (2) 2 (3) 3 2 (4) 3 4-2 ( ) 6 1,2,3,6 6 1+2+3 6 6 4 (10000 ) 4-3 ( ) 4-4 ( ) 5 25, 12, 50, 35, 29 ( ) 0 4-5 1.0 4.0 7.0 A = 2.0 5.0 8.0 A 2 (= AA) t AA 3.0 6.0 9.0 4-6 1.0 1.0 a = 2.0 b = 0.0 a b 3.0 1.0 4-7 1.0 0.0 a = 2.0 b = 1.0 (a b) = t ab a t b 3.0 2.0 matmul 1 3 3 1 2-85 -