untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 Fortran90 ( ) Fortran90 Fortran90 FORTRAN77 Fortran90 1 Fortran90 module 1.1 Windows Windows UNIX Cygwin ( C\: Install Cygwin f77 emacs latex ps2eps dvips Fortran90 Intel Fortran Compiler g95 ( f90 [ $HOME/bin ( $HOME/.cshrc setenv path=($home/bin) ) ln -s $CYGWINDIR/g95 f90 ] 1.2 Linux Intel Fortran Compiler( 1.3 Fortran90 Fortran $ EMACSDIR/20.7/lisp/progmode/f90.el 1

2 $HOME/.emacs in integer 1.4 A B 2 A B A B (1-1a.f90) 1: 1-1a.f90 1 program edu1 1a! program < > 2! USE ( ) 3 implicit none! 4 real ( kind=4) : : a, b, c! 5! A, B, C 4 ( ) 6! 7 read (, ) a, b! A B ( ; ) 8! (2 ) 9 c = a! C A 10 a = b! A B 11 b = c! B C A 12 write (, ) a, b! A B ( ; ) 13! 14 end program edu1 1a! end program < > > f90 1-1a.f90 >./a.out ( ) ( ) 1.5 c ( ) a b a b function subroutine function 1 subroutine subroutine (1-1b.f90) 2: 1-1b.f90 1 program edu1 1b! 2 a b 2! 1 3 implicit none! 4! 5 real ( kind=4) : : a, b! 1 2

3 6! function 7 read (, ) a, b! subroutine 8 9 call Swap Real ( a, b )! c a l l subroutine 10! 11 write (, ) a, b contains! 14! c o n t a i n s 15 subroutine Swap Real ( a, b ) 16! 17 implicit none! 18! 19 real ( kind=4), intent ( inout ) : : a, b 20! a b intent 21! : 22! intent (in) : 23! intent (out) : 24! intent (inout ): 25 real ( kind=4) : : c c = a 28 a = b 29 b = c end subroutine Swap Real end program edu1 1b 1-1a.f b.f90 subroutine module 1-1c.f90 1-1d.f90 3: 1-1c.f90 1 module algorithm! module <module > 2! use 3 implicit none! 4 5 private! p r i v a t e module 6! 7 public :: Swap Real! p u b l i c 8! 9 contains! function subroutine subroutine Swap Real ( a, b ) 12! 1 1b. f90 subroutine 13 implicit none 14 real ( kind=4), intent ( inout ) : : a, b 15 real ( kind=4) : : c c = a 18 a = b 19 b = c end subroutine Swap Real end module algorithm! end module <module > 3

4 4: 1-1d.f90 1 program edu1 1d 2 3 use algorithm, only : Swap Real 4! use <module >,only : ( function subroutine ) 5! module public 6 implicit none 7 8 real ( kind=4) : : a, b, c 9 10 read (, ) a, b call Swap Real ( a, b ) write (, ) a, b end program edu1 1d f90 -c -module -I > mkdir include > f90 -c -module./include 1-1c.f90 > ls * 1-1c.f90 1-1d.f90 1-1c.o (.o ) include: algorithm.mod ( ) > f90 -I./include 1-1d.f90 1-1c.o >./a.out ( ) ( ) > mkdir lib > f90 -c -module./include -o lib/1-1c.o 1-1c.f90 > ar rcv lib/libbasic.a lib/*.o (.a lib.a > ranlib lib/libbasic.a ) 1-1c.f90 algorithm.mod -L (.a) -l.a lib > f90 -I./include 1-1d.f90 -L./lib -lbasic >./a.out ( ) ( ) 4

5 interface Swap public (1-1e.f90) 5: 1-1e.f90 1 module algorithm 2 3 use typedef, only : byte, short, long, llong, & 4 & float, double, ldble 5 implicit none 6 private 7 8! module p r o c e d u r e 9! Swap 10 interface Swap 11 module procedure & 12 & Swap byte, Swap short, Swap long, Swap llong, & 13 & Swap float, Swap double, Swap ldble 14 end i n t e r f a c e public :: Swap 17 contains 18!! 19 subroutine Swap byte ( a, b ) implicit none 22 integer (byte), intent ( inout ) : : a, b 23 integer (byte) :: c c = a 26 a = b 27 b = c end subroutine Swap byte 30!! 31 subroutine Swap short ( a, b ) implicit none 34 integer (short), intent ( inout ) : : a, b 35 integer (short) :: c c = a 38 a = b 39 b = c end subroutine Swap short 42!! 43 subroutine Swap long ( a, b ) implicit none 46 integer ( long ), intent ( inout ) : : a, b 47 integer ( long ) : : c c = a 5

6 50 a = b 51 b = c end subroutine Swap long 54!! 55 subroutine Swap llong ( a, b ) implicit none 58 integer ( llong ), intent ( inout ) : : a, b 59 integer ( llong ) :: c c = a 62 a = b 63 b = c end subroutine Swap llong 66!! 67 subroutine Swap float ( a, b ) implicit none 70 real (float), intent ( inout ) : : a, b 71 real (float) :: c c = a 74 a = b 75 b = c end subroutine Swap float 78!! 79 subroutine Swap double ( a, b ) implicit none 82 real ( double ), intent ( inout ) : : a, b 83 real ( double ) : : c c = a 86 a = b 87 b = c end subroutine Swap double 90!! 91 subroutine Swap ldble ( a, b ) implicit none 94 real ( ldble ), intent ( inout ) : : a, b 95 real ( ldble ) :: c c = a 98 a = b 99 b = c end subroutine Swap ldble end module algorithm 1 8 (0/1 1 ) 32 (1-1f.f90) 1 module typedef 2 3 implicit none 4 5 private 6: 1-1f.f90 6

7 6! public 7 integer ( kind=4), parameter, public :: & 8 & byte = selected int kind (2), & 9 & short = selected int kind (4), & 10 & long = selected int kind (9), & 11 & llong = selected int kind (18), & 12! selected int kind ( ) = 13 & float = selected real kind (6), & 14 & double= selected real kind (15), & 15 & ldble = selected real kind (33) 16! selected real kind ( ) = end module typedef > f90 -c -module./include -o lib/1-1f.o 1-1f.f90 > f90 -c -module./include -o lib/1-1e.o 1-1e.f90 > rm lib/libbasic.a > ar rcv lib/libbasic.a lib/1-1{e,f}.o > ranlib lib/libbasic.a > f90 -I./include 1-1g.f90 -L./lib -lbasic >./a.out ( ) ( ) 1.8 (1-1h.f90) 7: 1-1h.f90 1 module algorithm 2 3 use typedef, only : byte, short, long, llong, & 4 & float, double, ldble 5 implicit none 6 private 7 interface Swap 8 module procedure & 9 & Swap byte, Swap short, Swap long, Swap llong, & 10 & Swap float, Swap double, Swap ldble, & 11 & Swap complex, Swap dcomplex, & 12 & Swap L1, Swap L2, Swap L4, & 13 & Swap char 14 end i n t e r f a c e 15 public :: Swap contains 18!! 19 subroutine Swap byte ( a, b ) implicit none 22 integer (byte), intent ( inout ) : : a, b 23 integer (byte) :: c 7

8 24 25 c = a 26 a = b 27 b = c end subroutine Swap byte 30!! 31 subroutine Swap short ( a, b ) implicit none 34 integer (short), intent ( inout ) : : a, b 35 integer (short) :: c c = a 38 a = b 39 b = c end subroutine Swap short 42!! 43 subroutine Swap long ( a, b ) implicit none 46 integer ( long ), intent ( inout ) : : a, b 47 integer ( long ) : : c c = a 50 a = b 51 b = c end subroutine Swap long 54!! 55 subroutine Swap llong ( a, b ) implicit none 58 integer ( llong ), intent ( inout ) : : a, b 59 integer ( llong ) :: c c = a 62 a = b 63 b = c end subroutine Swap llong 66!! 67 subroutine Swap float ( a, b ) implicit none 70 real (float), intent ( inout ) : : a, b 71 real (float) :: c c = a 74 a = b 75 b = c end subroutine Swap float 78!! 79 subroutine Swap double ( a, b ) implicit none 82 real ( double ), intent ( inout ) : : a, b 83 real ( double ) : : c c = a 86 a = b 87 b = c end subroutine Swap double 90!! 91 subroutine Swap ldble ( a, b ) 8

9 92 93 implicit none 94 real ( ldble ), intent ( inout ) : : a, b 95 real ( ldble ) :: c c = a 98 a = b 99 b = c end subroutine Swap ldble 102!! 103 subroutine Swap complex ( a, b ) implicit none 106 complex ( float 2), intent ( inout ) : : a, b 107 complex ( float 2) : : c c = a 110 a = b 111 b = c end subroutine Swap complex 114!! 115 subroutine Swap dcomplex ( a, b ) implicit none 118 complex ( double 2), intent ( inout ) : : a, b 119 complex ( double 2) : : c c = a 122 a = b 123 b = c end subroutine Swap dcomplex 126!! 127 subroutine Swap L1 ( a, b ) implicit none 130 logical (1), intent ( inout ) : : a, b 131 logical (1) :: c c = a 134 a = b 135 b = c end subroutine Swap L1 138!! 139 subroutine Swap L2 ( a, b ) implicit none 142 logical (2), intent ( inout ) : : a, b 143 logical (2) :: c c = a 146 a = b 147 b = c end subroutine Swap L2 150!! 151 subroutine Swap L4 ( a, b ) implicit none 154 logical (4), intent ( inout ) : : a, b 155 logical (4) :: c c = a 158 a = b 159 b = c 9

10 end subroutine Swap L4 162!! 163 subroutine Swap char ( a, b ) implicit none 166 character ( ), intent ( inout ) : : a, b! character ( len (a)) :: c 169! character ( ) : : 170! len ( ) a c 171 integer ( long ) : : n ! a b 174 if ( len (a) < len (b) ) then 175! 176 print, ( WARNING ) CHAR LEN(A) > LEN(B) ! ( : ) 179! repeat (, ) 180! a b 181 b( len (a)+1:len (b)) = repeat (, len (b) len (a)) ! b a 184 else if ( len (a) > len (b) ) then 185 print, ( WARNING ) CHAR LEN(A) > LEN(B). 186 a(len (b)+1:len (a)) = repeat (, len (a) len (b)) 187 end i f n = min( len (a),len (b))! a b 190 c(1:n) = a(1:n) 191 a(1:n) = b(1:n) 192 b(1:n) = c(1:n) end subroutine Swap char 195!! end module algorithm 2 2 if if 8: if 1 if ( 1 ) then! else if ( 2 ) then! 2 ( ) else! 6 7 end i f (1-1i.f90) 9: 1-1i.f90 1 program edu1 1i 2 3 use typedef, only : byte, short, long, llong, & 4 & float, double, ldble 5 use algorithm, only : Swap 6 7 implicit none 10

11 8 9 character (9) :: a = abcdefghi 10 character (3) :: b = jkl call Swap ( a, b ) write (, ) a, b end program edu1 1i > f90 -c -module./include -o lib/1-1f.o 1-1f.f90 > f90 -c -module./include -o lib/1-1h.o 1-1h.f90 > rm lib/libbasic.a > ar rcv lib/libbasic.a lib/1-1{f,h}.o > ranlib lib/libbasic.a > f90 -I./include 1-1i.f90 -L./lib -lbasic >./a.out (*** WARNING ***) CHAR LEN(A) > LEN(B). ( ) jkl abc ( ) 1.9 (do loop) 1, 2,... 2 ( ) a(1,1), a(2,1), a(3,1),... a(1), a(2),... a(1:n) a a(2:10:3) a(2), a(5), a(8) 3 ( ) do loop 10: do 1! i 2 do i = 1, n! i=1 end d o i=2 3! i= n 4 end do! i =1,n,3 3 i (1-1j.f90) 11: 1-1j.f90 1 program edu1 1j 2 use typedef, only : byte, short, long, llong, & 11

12 3 & float, double, ldble 4 implicit none 5! 6 integer ( long ), parameter :: n = 3 7! 8! (/,,..., /) 9 real ( float ) :: a(n) = (/ 1.0, 2.0, 3.0 /), & 10 & b(n) = (/ 3.0, 2.0, 1.0 /) 11! 12 call Swap Real Array1 ( a, b, n ) 13! 14 print, a 15 print, b 16! 17 contains 18!! 19 subroutine Swap Real Array1 ( a, b, n ) 20! 21 implicit none 22! subroutine 23 integer ( long ), intent ( in ) : : n 24 real (float), intent ( inout ) : : a(n), b(n) 25! 26 integer ( long ) :: i! 27 real (float) :: c! 28! 29 do i = 1, n! i=1 n 30 c = a( i ) 31 a( i ) = b( i ) 32 b( i ) = c 33 end do 34! 35 end subroutine Swap Real Array1 36!! 37 end program edu1 1j 2 12: 1-1j.f90 1 subroutine Swap Real Array3 ( a, b ) 2! 3 use algorithm, only : Swap! module a l g o r i t h m 4! 5 implicit none 6! (:) 2 (:,:) 7 real (float), intent ( inout ) : : a (:), b (:) 8! 9 integer ( long ) :: i, n 10! 11 n = min( size (a), size (b) )! size ( )= 12 do i = 1, n! swap 13 call Swap ( a(i), b(i) ) 14 end do 15! 16! A B 17 if ( size (a) > size (b) ) then 18! 19 print, ( WARNING ) SIZE (A) > SIZE (B). 20! a n 0.0 float ( f l o a t 21! 0.0) 22 a(n+1:size (a)) = 0.0 float 23! B A 24 else if ( size (b) > size (a) ) then 25 print, ( WARNING ) SIZE (B) > SIZE (A). 12

13 26 b(n+1:size (b)) = 0.0 float 27 end i f 28! 29 end subroutine Swap Real Array3 interface swap algorithm.f ( ) ( ) ( ) 13: 1-1j.f90 1 subroutine Swap Real Array4 ( a, b ) 2! 3 implicit none 4 real (float), intent ( inout ) : : a (:), b (:) 5! c ( ) 6! 1 7 real (float), allocatable :: c(:) 8! 9 integer ( long ) :: n 10 n = min( size (a), size (b) ) 11 allocate ( c(n) )! n 12! 13 c(1:n) = a(1:n) 14 a(1:n) = b(1:n) 15 b(1:n) = c(1:n) 16! 17! 18! (= ) 19 deallocate ( c ) 20! 21! if (1-1k.f90) 14: 1-1k.f90 1 program edu1 1k 2 use typedef, only : byte, short, long, llong, & 3 & float, double, ldble 4 implicit none 5 integer ( long ), parameter :: n1 = 3, n2 = integer ( long ) :: i1, i2 13

14 8 real ( float ) :: a(n1,n2), b(n1,n2) 9 10! 2 reshape 11! reshape ( 1 ) 12 a(:,:) = reshape( & 13 & (/ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 /), & 14 & (/ n1, n2 /) ) 15 b(:,:) = reshape( & 16 & (/ 6.0, 5.0, 4.0, 3.0, 2.0, 1.0 /), & 17 & (/ n1, n2 /) ) call Swap float2 ( a, b ) contains 22!! 23 subroutine Swap float2 ( a, b ) use algorithm, only : Swap implicit none 28 real (float), intent ( inout ) :: a(:,:), b(:,:) integer ( long ) :: i1, i2, n1, n2 31 logical (4), allocatable :: la (:,:), lb (:,:) 32 33! size (, dim= ) 34 n1 = min( size (a,dim=1), size (b,dim=1) ) 35 n2 = min( size (a,dim=2), size (b,dim=2) ) 36 do i2 = 1, n2 37 do i1 = 1, n1 38 call Swap ( a ( i1, i 2 ), b ( i1, i 2 ) ) 39 end do 40 end do 41 42! 43 allocate ( la ( size (a,dim=1),size (a,dim=2)) ) 44! a (1:ni,1:n2). false. 45 la (:,:) =. true. 46 la (1:n1,1:n2) =. false. 47 where ( la (:,:) )! where( ) 48 a(:,:) = 0.0 float! 49 end where! a(1:n1,1:n2) 50! ! b 53 allocate ( lb ( size (b,dim=1), size (b,dim=2)) ) 54 lb (:,:) =. true. 55 lb(1:n1,1:n2) =. false. 56 where ( lb (:,:) ) 57 b(:,:) = 0.0 float 58 end where deallocate ( la, lb )! la, l b end subroutine Swap float2 63!! 64 end program edu1 1k 65!! where /= 15: where 1 where ( 1 )! 1 2 1! 14

15 3 else where ( 2 )! 2 4 2! 5 else where! 6! 7 end where 1.12 (1-1m.f90) > f90 -c -module./include -o lib/1-1m.o 1-1m.f90 > rm lib/libbasic.a > ar rcv lib/libbasic.a lib/1-1{f,m}.o > ranlib lib/libbasic.a 1 2 ascii 3 1-1n.dat ascii > cat 1-1n.dat > ls -al -rw-rw-r-- 1 user user :23 1-1n.dat > hexdump e e e e e e36 0a30 2e e e e e e31 0a30 hexdump 0/ *3+1=47 ascii 1 2e 0a l.f90 1-1n.dat 2 (1-1l.f90) 15

16 16: 1-1l.f90 1 program edu1 1l 2 use typedef, only : byte, short, long, llong, & 3 & float, double, ldble 4 use algorithm, only : Swap 5 implicit none 6 integer ( long ), parameter :: n1 = 3, n2 = real ( float ) :: a(n1,n2), b(n1,n2) 9 10! ! 6 12 open ( 10, file = 1 1n. dat )! ASCII 13 read ( 10, ) a! a 14 read ( 10, ) b! b 15 close ( 10 )! write ( 6, ) a! print 18 write ( 6, ) b call Swap ( a, b ) 21 22! 23 open ( 20, file = 1 1o. dat, & 24 & form= unformatted, &! 25 & access = sequential, &! 26 & action = readwrite )! 27 write ( 20 ) a! write ( 20 ) b 29 close ( 20 ) end program edu1 1l > f90 -I./include 1-1l.f90 -L./lib -lbasic >./a.out > ls -al 1-1o.dat -rw-rw-r-- 1 user user :23 1-1o.dat > cat 1-1o.dat?@?@@@@@??@@@@?@?@ > hexdump 1-1o.dat c a f f a c (0/1) a ( )

17 1-1o.dat 1-1p.f90 1-1q.dat (1-1p.f90) 17: 1-1k.f90 1 program edu1 1p 2 use typedef, only : byte, short, long, llong, & 3 & float, double, ldble 4 use algorithm, only : Swap 5 implicit none 6 integer ( long ), parameter :: n1 = 3, n2 = 2 7 real ( float ) :: a(n1,n2), b(n1,n2) 8 9 open ( 10, file = 1 1o. dat, form= unformatted ) 10 read ( 10 ) a 11 read ( 10 ) b 12 close ( 10 ) 13 write ( 6, ) a! print 14 write ( 6, ) b 15 call Swap ( a, b ) open ( 10, file = 1 1q. dat, & 18 & form = binary, &! Intel F ! unformatted 20 & access = direct, &! 21 & action = readwrite, &! 22 & recl = 24 )! 23! 1 24 write ( 10, rec = 1 ) a! 1 25 write ( 10, rec = 2 ) b! 2 26 close ( 10 ) end program edu1 1p > f90 -I./include 1-1p.f90 -L./lib -lbasic >./a.out > ls -al 1-1q.dat -rw-rw-r-- 1 inaz inaz :52 1-1q.dat > hexdump 1-1q.dat f a c c a f f80 1-1o.dat

18 o.dat? ( + + ) 1 (1-1r.f90) 18: 1-1r.f90 1 program edu1 1r 2 use typedef, only : byte, short, long, llong, & 3 & float, double, ldble 4 use algorithm, only : Swap 5 implicit none 6 integer ( long ), parameter :: n1 = 3, n2 = 2 7 real ( float ) :: a(n1,n2), b(n1,n2) 8 9 integer ( long ) :: i, i1, i2, irec = 0, n 10 character (4) :: c 11 12! 1 recl 1 13 open ( 10, file = 1 1o. dat, form= binary, & 14 & access = direct, recl = 1) do i = 1, 4 17 irec = irec + 1! 1 18 read ( 10, rec = irec ) c(i:i)! i 19 end do 20 21! transfer (, ) 22 n = transfer ( c(1:4), 0 long ) 23 print, n 24 do i2 = 1, n2 25 do i1 = 1, n1 26 do i = 1, 4 27 irec = irec read ( 10, rec = irec ) c(i:i)! i 29 end do 30 a(i1, i2) = transfer ( c(1:4), 0.0 float ) 31 end do 32 end do 33 print, a 34 do i = 1, 4 35 irec = irec read ( 10, rec = irec ) c(i:i)! i 37 end do 38 n = transfer ( c(1:4), 0 long ) 39 print, n 40 41! b 42 close ( 10 ) end program edu1 1r > f90 -I./include 1-1r.f90 -L./lib -lbasic >./a.out 24 18

19 ( + + ) (1-1s.f90) 19: 1-1s.f90 1 program edu1 1s 2 use typedef, only : byte, short, long, llong, & 3 & float, double, ldble 4 use algorithm, only : Swap 5 implicit none 6 7 integer ( long ), parameter :: n1 = 3, n2 = 2 8 type dat 9 integer ( long ) :: nstart 10 real (float) :: dat(n1,n2) 11 integer ( long ) : : nend 12 end type dat 13 type (dat) :: sa, sb 14 15! ! r e c l open ( 10, file = 1 1o. dat, form= binary, & 18 & access = direct, recl = 24+8 ) 19 read ( 10, rec = 1 ) sa 20 read ( 10, rec = 2 ) sb 21 close ( 10 ) print, s a%n s t a r t, s a%dat ( :, : ), s a%nend 24 print, sb%n s t a r t, sb%d a t ( :, : ), sb%nend end program edu1 1s > f90 -I./include 1-1s.f90 -L./lib -lbasic >./a.out] m

20 (1-2) (1-3) (1-4) (1-5) (1-6) (1-7) 2 (2-1) 1 (2-2) (2-3) SOR (2-4) QR (3-1) (3-2) (3-3) (3-4) 5 (3-5) (3-6) (3-7) (4-1) 2 PDF (4-2) 1 (4-3) 20

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

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1 (Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1 17 Fortran Formular Tranlator Lapack Fortran FORTRAN, FORTRAN66, FORTRAN77, FORTRAN90, FORTRAN95 17.1 A Z ( ) 0 9, _, =, +, -, *,

More information

1F90/kouhou_hf90.dvi

1F90/kouhou_hf90.dvi Fortran90 3 33 1 2 Fortran90 FORTRAN 1956 IBM IBM704 FORTRAN(FORmula TRANslation ) 1965 FORTRAN66 1978 FORTRAN77 1991 Fortran90 Fortran90 Fortran Fortran90 6 Fortran90 77 90 90 Fortran90 [ ] Fortran90

More information

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

11042 計算機言語7回目  サポートページ: 11042 7 :https://goo.gl/678wgm November 27, 2017 10/2 1(print, ) 10/16 2(2, ) 10/23 (3 ) 10/31( ),11/6 (4 ) 11/13,, 1 (5 6 ) 11/20,, 2 (5 6 ) 11/27 (7 12/4 (9 ) 12/11 1 (10 ) 12/18 2 (10 ) 12/25 3 (11

More information

. (.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(

. (.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( 3 8. (.8.)............................................................................................3.............................................4 Nermark β..........................................

More information

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

インテル(R) Visual Fortran Composer XE 2013 Windows版 入門ガイド Visual Fortran Composer XE 2013 Windows* エクセルソフト株式会社 www.xlsoft.com Rev. 1.1 (2012/12/10) Copyright 1998-2013 XLsoft Corporation. All Rights Reserved. 1 / 53 ... 3... 4... 4... 5 Visual Studio... 9...

More information

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

プラズマ核融合学会誌5月号【81-5】/内外情報_ソフト【注:欧フォント特殊!】 PROGRAM PLOTDATA USE NUM_KINDS, ONLY : wp=>dp, i4b USE MYLIB, ONLY : GET_SIZE, GET_DATA INTEGER(i4b) :: ntime, nx REAL(wp), ALLOCATABLE :: time(:), x(:), Temp(:,:) Fortran Temp, temp, TEMP temporal REAL(wp)

More information

120802_MPI.ppt

120802_MPI.ppt CPU CPU CPU CPU CPU SMP Symmetric MultiProcessing CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CP OpenMP MPI MPI CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU MPI MPI+OpenMP CPU CPU CPU CPU CPU CPU CPU CP

More information

01_OpenMP_osx.indd

01_OpenMP_osx.indd OpenMP* / 1 1... 2 2... 3 3... 5 4... 7 5... 9 5.1... 9 5.2 OpenMP* API... 13 6... 17 7... 19 / 4 1 2 C/C++ OpenMP* 3 Fortran OpenMP* 4 PC 1 1 9.0 Linux* Windows* Xeon Itanium OS 1 2 2 WEB OS OS OS 1 OS

More information

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

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 Sakurai-Sugiura z-pares 26 9 5 1 1 2 2 2.1 Mac OS CPU......................................... 2 2.2 Linux MPI............................................ 2 3 3 4 6 4.1 MUMPS....................................

More information

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(

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( 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)

More information

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

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë 2012 5 24 scalar Open MP Hello World Do (omp do) (omp workshare) (shared, private) π (reduction) PU PU PU 2 16 OpenMP FORTRAN/C/C++ MPI OpenMP 1997 FORTRAN Ver. 1.0 API 1998 C/C++ Ver. 1.0 API 2000 FORTRAN

More information

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

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë 2011 5 26 scalar Open MP Hello World Do (omp do) (omp workshare) (shared, private) π (reduction) scalar magny-cours, 48 scalar scalar 1 % scp. ssh / authorized keys 133. 30. 112. 246 2 48 % ssh 133.30.112.246

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

Microsoft Word - C.....u.K...doc

Microsoft Word - C.....u.K...doc C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ

More information

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 September 2016 1 Windows Cygwin Mac *1 Emacs Ruby 1 1.1 ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 ~/16:00:20> ls 2 2 ls ls -a ~/16:00:20> ls -a

More information

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

Fortran90/95 [9]! (1 )   5 Hello!! 3. (line) Fortran Fortran 1 2 * (1 ) 132 ( ) * 2 ( Fortran ) Fortran ,6 (continuation line) 1 Fortran90/95 2.1 Fortran 2-1 Hello! 1 program example2_01! end program 2! first test program ( ) 3 implicit none! 4 5 write(*,*) "Hello!"! write Hello! 6 7 stop! 8 end program example2_01 1 program 1!

More information

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal Pascal Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS 2010 10 1 Pascal 2 1.1.......................... 2 1.2.................. 2 1.3........................ 3 2 4 2.1................................

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

all.dvi

all.dvi fortran 1996 4 18 2007 6 11 2012 11 12 1 3 1.1..................................... 3 1.2.............................. 3 2 fortran I 5 2.1 write................................ 5 2.2.................................

More information

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

( ) 1 Windows HTML ( ) ( ) ( ) WWW 10 ( ) ( ) 1 Windows HTML ( ) ( ) ( ) 1. 2. 3. 4. WWW 10 ( ) 2 1. 2. 1 3. ( ) 4. 5. 3 Windows 2 7 8 MS Word MS Excel 1. MS Word 600 2. MS Excel 1 34 2 83 3 23 4 70 5 100 6 45 7 58 8 29 9 68 10 72 11 37 12 12

More information

nakao

nakao Fortran+Python 4 Fortran, 2018 12 12 !2 Python!3 Python 2018 IEEE spectrum https://spectrum.ieee.org/static/interactive-the-top-programming-languages-2018!4 Python print("hello World!") if x == 10: print

More information

Informatics 2010.key

Informatics 2010.key http://math.sci.hiroshima-u.ac.jp/ ~ryo/lectures/informatics2010/ 1 2 C ATM etc. etc. (Personal Computer) 3 4 Input Output Device Central Processing Unit I/O CPU Memory 5 6 (CPU),,... etc. C, Java, Fortran...

More information

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

CUDA 連携とライブラリの活用 2 1 09:30-10:00 受付 10:00-12:00 Reedbush-H ログイン GPU 入門 13:30-15:00 OpenACC 入門 15:15-16:45 OpenACC 最適化入門と演習 17:00-18:00 OpenACC の活用 (CUDA 連携とライブラリの活用 ) CUDA 連携とライブラリの活用 2 3 OpenACC 簡単にGPUプログラムが作成できる それなりの性能が得られる

More information

xl 1 program Othello6; 2 {$APPTYPE CONSOLE} 3 uses SysUtils; 4 5 type 6 TMasuNo = 0..99; // 7 TYouso = (Soto,Kara,Kuro,Siro); // 8 TBan = array [TMasu

xl 1 program Othello6; 2 {$APPTYPE CONSOLE} 3 uses SysUtils; 4 5 type 6 TMasuNo = 0..99; // 7 TYouso = (Soto,Kara,Kuro,Siro); // 8 TBan = array [TMasu xl 1 program Othello6; 2 {$APPTYPE CONSOLE 3 uses SysUtils; 4 5 type 6 TMasuNo = 0..99; // 7 TYouso = (Soto,Kara,Kuro,Siro); // 8 TBan = array [TMasuNo] of TYouso; // 10 10 9 TPlayer = Kuro..Siro; // 10

More information

main.dvi

main.dvi 1 F77 5 hmogi-2008f@kiban.civil.saitama-u.ac.jp 2013/5/13 1 2 f77... f77.exe f77.exe CDROM (CDROM D D: setupond E E: setupone 5 C:work\T66160\20130422>f77 menseki.f -o menseki f77(.exe) f77 f77(.exe) C:work\T66160\20130422>set

More information

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

More information

Informatics 2014

Informatics 2014 C 計算機の歴史 手回し計算機 新旧のソロバン バベッジの階差機関 スパコン ENIAC (1946) パソコン 大型汎用計算機 電卓 現在のコンピュータ Input Output Device Central Processing Unit I/O CPU Memory OS (Operating System) OS Windows 78, Vista, XP Windows Mac OS X

More information

Microsoft Word - Sample_CQS-Report_English_backslant.doc

Microsoft Word - Sample_CQS-Report_English_backslant.doc ***** Corporation ANSI C compiler test system System test report 2005/11/16 Japan Novel Corporation *****V43/NQP-DS-501-1 Contents Contents......2 1. Evaluated compiler......3 1.1. smp-compiler compiler...3

More information

joho09.ppt

joho09.ppt s M B e E s: (+ or -) M: B: (=2) e: E: ax 2 + bx + c = 0 y = ax 2 + bx + c x a, b y +/- [a, b] a, b y (a+b) / 2 1-2 1-3 x 1 A a, b y 1. 2. a, b 3. for Loop (b-a)/ 4. y=a*x*x + b*x + c 5. y==0.0 y (y2)

More information

( ) Shift JIS ( ) ASCII ASCII ( ) 8bit = 1 Byte JIS(Japan Industrial Standard) X 0201 (X ) 2 Byte JIS ISO-2022-JP, Shift JIS, EUC 1 Byte 2 By

( ) Shift JIS ( ) ASCII ASCII ( ) 8bit = 1 Byte JIS(Japan Industrial Standard) X 0201 (X ) 2 Byte JIS ISO-2022-JP, Shift JIS, EUC 1 Byte 2 By 23 3 ( ( (binary file) UNIX CUI 3.1 = + 2 bit ) ( 3.1) bit bit 1 Byte=8 bit 1 Byte ASCII, JIS X 0201 ASCII(American Standard Code for Information Interchange) 7bit (;) (:) ( ) (") ) 7bit ( ) 24 3 3.1 (

More information

MPI usage

MPI usage MPI (Version 0.99 2006 11 8 ) 1 1 MPI ( Message Passing Interface ) 1 1.1 MPI................................. 1 1.2............................... 2 1.2.1 MPI GATHER.......................... 2 1.2.2

More information

OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a))

OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a)) OpenMP (1) 1, 12 1 UNIX (FUJITSU GP7000F model 900), 13 1 (COMPAQ GS320) FUJITSU VPP5000/64 1 (a) (b) 1: ( 1(a)) E-mail: {nanri,amano}@cc.kyushu-u.ac.jp 1 ( ) 1. VPP Fortran[6] HPF[3] VPP Fortran 2. MPI[5]

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

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

情報処理概論(第二日目) 情報処理概論 工学部物質科学工学科応用化学コース機能物質化学クラス 第 8 回 2005 年 6 月 9 日 前回の演習の解答例 多項式の計算 ( 前半 ): program poly implicit none integer, parameter :: number = 5 real(8), dimension(0:number) :: a real(8) :: x, total integer

More information

Microsoft Word - 資料 docx

Microsoft Word - 資料 docx y = Asin 2πt T t t = t i i 1 n+1 i i+1 Δt t t i = Δt i 1 ( ) y i = Asin 2πt i T 29 (x, y) t ( ) x = Asin 2πmt y = Asin( 2πnt + δ ) m, n δ (x, y) m, n 30 L A x y A L x 31 plot sine curve program sine implicit

More information

新・明解Java入門

新・明解Java入門 537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,

More information

(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

(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 2007/5/14 II II agata@k.u-tokyo.a.jp 0. 1. x i x i 1 x i x i x i x x+dx f(x)dx f(x) f(x) + 0 f ( x) dx = 1 (Probability Density Funtion 2 ) (normal distribution) 3 1 2 2 ( x m) / 2σ f ( x) = e 2πσ x m

More information

Microsoft PowerPoint - 03_What is OpenMP 4.0 other_Jan18

Microsoft PowerPoint - 03_What is OpenMP 4.0 other_Jan18 OpenMP* 4.x における拡張 OpenMP 4.0 と 4.5 の機能拡張 内容 OpenMP* 3.1 から 4.0 への拡張 OpenMP* 4.0 から 4.5 への拡張 2 追加された機能 (3.1 -> 4.0) C/C++ 配列シンタックスの拡張 SIMD と SIMD 対応関数 デバイスオフロード task 構 の依存性 taskgroup 構 cancel 句と cancellation

More information

Informatics 2015

Informatics 2015 C 計算機の歴史 新旧のソロバン バベッジの階差機関 19C前半 手回し計算機 19C後半 20C後半 スパコン 1960年代 ENIAC (1946) 大型汎用計算機 1950年代 1980年代 電卓 1964 パソコン 1970年代 現在のコンピュータ Input Output Device Central Processing Unit I/O CPU Memory OS (Operating

More information

フローチャートの書き方

フローチャートの書き方 アルゴリズム ( 算法 ) 入門 1 プログラムの作成 機械工学専攻泉聡志 http://masudahp.web.fc2.com/flowchart/index.html 参照 1 何をどのように処理させたいのか どのようなデータを入力し どのような結果を出力させるのか問題を明確にする 2 問題の内容どおりに処理させるための手順を考える ( フローチャートの作成 )~アルゴリズム( 算法 ) の作成

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 11 20 p.1/34 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

OHP.dvi

OHP.dvi 0 7 4 0000 5.. 3. 4. 5. 0 0 00 Gauss PC 0 Gauss 3 Gauss Gauss 3 4 4 4 4 3 4 4 4 4 3 4 4 4 4 3 4 4 4 4 u [] u [3] u [4] u [4] P 0 = P 0 (),3,4 (,), (3,), (4,) 0,,,3,4 3 3 3 3 4 4 4 4 0 3 6 6 0 6 3 6 0 6

More information

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225 Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1

More information

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

<4D F736F F F696E74202D D F95C097F D834F E F93FC96E5284D F96E291E85F8DE391E52E > SX-ACE 並列プログラミング入門 (MPI) ( 演習補足資料 ) 大阪大学サイバーメディアセンター日本電気株式会社 演習問題の構成 ディレクトリ構成 MPI/ -- practice_1 演習問題 1 -- practice_2 演習問題 2 -- practice_3 演習問題 3 -- practice_4 演習問題 4 -- practice_5 演習問題 5 -- practice_6

More information

インテル(R) Visual Fortran Composer XE

インテル(R) Visual Fortran Composer XE Visual Fortran Composer XE 1. 2. 3. 4. 5. Visual Studio 6. Visual Studio 7. 8. Compaq Visual Fortran 9. Visual Studio 10. 2 https://registrationcenter.intel.com/regcenter/ w_fcompxe_all_jp_2013_sp1.1.139.exe

More information

AJAN IO制御コマンド コマンドリファレンス

AJAN IO制御コマンド コマンドリファレンス - 1 - Interface Corporation 1 3 2 4 2.1...4 2.2...8 2.3...9 2.4...19 2.5...20 3 21 3.1...21 3.2...23 3.3...24 3.4...28 3.5...29 30 31 Interface Corporation - 2 - 1 AJANI/O Linux Web site GPG-2000 http://www.interface.co.jp/catalog/soft/prdc_soft_all.asp?name=gpg-2000

More information

cpp1.dvi

cpp1.dvi 2017 c 1 C++ (1) C C++, C++, C 11, 12 13 (1) 14 (2) 11 1 n C++ //, [List 11] 1: #include // C 2: 3: int main(void) { 4: std::cout

More information

応用数学特論.dvi

応用数学特論.dvi 1 1 1.1.1 ( ). P,Q,R,.... 2+3=5 2 1.1.2 ( ). P T (true) F (false) T F P P T P. T 2 F 1.1.3 ( ). 2 P Q P Q P Q P Q P or Q P Q P Q P Q T T T T F T F T T F F F. P = 5 4 Q = 3 2 P Q = 5 4 3 2 P F Q T P Q T

More information

<リスト1> AD コンバータへのデータの出力例 NEC PC98 用 mov al,22h // CLK -> 1, CS -> 0, DI -> 0 out 32h,al // シリアル ポートにデータ出力 PC/AT 互換機用 mov al,00h // CLK -> 1 mov dx,3fb

<リスト1> AD コンバータへのデータの出力例 NEC PC98 用 mov al,22h // CLK -> 1, CS -> 0, DI -> 0 out 32h,al // シリアル ポートにデータ出力 PC/AT 互換機用 mov al,00h // CLK -> 1 mov dx,3fb AD コンバータへのデータの出力例 NEC PC98 用 mov al,22h // CLK -> 1, CS -> 0, DI -> 0 out 32h,al // シリアル ポートにデータ出力 PC/AT 互換機用 mov al,00h // CLK -> 1 mov dx,3fbh out dx al // シリアル ポートにデータ出力 mov al,03h // CS -> 0,

More information

listings-ext

listings-ext (6) Python (2) ( ) ohsaki@kwansei.ac.jp 5 Python (2) 1 5.1 (statement)........................... 1 5.2 (scope)......................... 11 5.3 (subroutine).................... 14 5 Python (2) Python 5.1

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL 2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL   2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b II 5 (1 2005 5 26 http://www.math.meiji.ac.jp/~mk/syori2-2005/ UNIX (Linux Linux 1 : 2005 http://www.math.meiji.ac.jp/~mk/syori2-2005/jouhousyori2-2005-00/node2. html ( (Linux 1 2 ( ( http://www.meiji.ac.jp/mind/tool/internet-license/

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション 計算機実習 Ⅰ FORTRAN 担当 2018.05.29 本日の課題 プログラムの基本ルールを理解し 以下が含まれるプログラムを作成する (1) 文法の基礎 ( フローチャートなど ) (2) 変数宣言 (3) 入出力 (4) 四則演算 (5) 組込関数 (6) 判定文 (7) リダイレクション PROGRAM MAIN INTEGER I, J, K REAL A, B, C CHARACTER

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

D0020.PDF

D0020.PDF n 3 X n Y n = Z n 17 1995 300 n n 2 3 2 a b c c 2 a 2 b 2 600 2000 322 3 15 2 3 580 3 1 5 4 3 2 1 300 2 1 2 1 1 ExcelVBA 2 VBA 1 VBA 2 API Sleep ExcelVBA 2 100 60 80 50 ExcelVBA API Sleep 3 100 60 (80

More information

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」 ALTIMA Company, MACNICA, Inc Nios II HAL API Modular Scatter-Gather DMA Core Ver.17.1 2018 8 Rev.1 Nios II HAL API Modular Scatter-Gather DMA Core...3...3...4... 4... 5 3-2-1. msgdma... 6 3-2-2. On-Chip

More information

program.dvi

program.dvi 2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation

More information

情報活用資料

情報活用資料 y = Asin 2πt T t t = t i i 1 n+1 i i+1 Δt t t i = Δt i 1 ( ) y i = Asin 2πt i T 21 (x, y) t ( ) x = Asin 2πmt y = Asin( 2πnt + δ ) m, n δ (x, y) m, n 22 L A x y A L x 23 ls -l gnuplot gnuplot> plot "sine.dat"

More information

02_C-C++_osx.indd

02_C-C++_osx.indd C/C++ OpenMP* / 2 C/C++ OpenMP* OpenMP* 9.0 1... 2 2... 3 3OpenMP*... 5 3.1... 5 3.2 OpenMP*... 6 3.3 OpenMP*... 8 4OpenMP*... 9 4.1... 9 4.2 OpenMP*... 9 4.3 OpenMP*... 10 4.4... 10 5OpenMP*... 11 5.1

More information

XcalableMP入門

XcalableMP入門 XcalableMP 1 HPC-Phys@, 2018 8 22 XcalableMP XMP XMP Lattice QCD!2 XMP MPI MPI!3 XMP 1/2 PCXMP MPI Fortran CCoarray C++ MPIMPI XMP OpenMP http://xcalablemp.org!4 XMP 2/2 SPMD (Single Program Multiple Data)

More information

コンピュータ概論

コンピュータ概論 4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50 1. 2 1 10 3. 0 360 10 sin() 4.1.2 For

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

格子点データの解析 1 月平均全球客観解析データの解析 客観解析データや衛星観測データのような格子点データは バイナリ形式のデータファイルに記録されていることが多いです バイナリ形式のデータファイルは テキスト形式の場合とは異なり 直接中身を見ることができません プログラムを書いてデータを読み出して

格子点データの解析 1 月平均全球客観解析データの解析 客観解析データや衛星観測データのような格子点データは バイナリ形式のデータファイルに記録されていることが多いです バイナリ形式のデータファイルは テキスト形式の場合とは異なり 直接中身を見ることができません プログラムを書いてデータを読み出して 格子点データの解析 1 月平均全球客観解析データの解析 客観解析データや衛星観測データのような格子点データは バイナリ形式のデータファイルに記録されていることが多いです バイナリ形式のデータファイルは テキスト形式の場合とは異なり 直接中身を見ることができません プログラムを書いてデータを読み出して解析するのが普通です ここでは 全球客観解析データを用いてバイナリ形式のファイルに記録された格子点データの解析について学びたいと思います

More information

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

273? C

273? C TSG Theoretical Science Group 273? C 2-1.................................. 2 -1. Windows Mac Mac UNIX CUI bash >_ Finder TSG No.273? 2 3 pwd ls cd ( ) change directory 3 TSG No.273? cd hoge cd hoge cd....../

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

I httpd School of Information Science, Japan Advanced Institute of Science and Technology

I httpd School of Information Science, Japan Advanced Institute of Science and Technology I117 17 4 httpd School of Information Science, Japan Advanced Institute of Science and Technology httpd HTTP httpd log file access log access.log CERN httpd common format lighttpd common format 2 1000

More information

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ } C 2: A Pedestrian Approach to the C Programming Language 2 2-1 2.1........................... 2-1 2.1.1.............................. 2-1 2.1.2......... 2-4 2.1.3..................................... 2-6

More information

FORTRAN文法の基礎

FORTRAN文法の基礎 FORTRAN 文法の基礎 ( 初級編 ) 2009-04-16 泉聡志 1 はじめに FORTRAN は数あるプログラム言語の中で最も数値計算に適した言語であり かつ最もかんたんである 加えて FORTRAN を使って数値計算プログラムを作成する工学者は 最小限のことを知っていれば良く 高度な知識は要求されない また 多くのプログラミングは scratch から作らず ベースとなるものを真似て改造して使う場合が多い

More information

tebiki00.dvi

tebiki00.dvi (Linux) [ UNIX ] CMD Workshop ( ) 1 *********************************************************************** * Linux PC-UNIX UNIX * * 99% FreeBSD BSD PC-UNIX * * * ***********************************************************************

More information

ARM gcc Kunihiko IMAI 2009 1 11 ARM gcc 1 2 2 2 3 3 4 3 4.1................................. 3 4.2............................................ 4 4.3........................................

More information

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

Microsoft Word - 03-数値計算の基礎.docx δx f x 0 + δ x n=0 a n = f ( n) ( x 0 ) n δx n f x x=0 sin x = x x3 3 + x5 5 x7 7 +... x ( ) = a n δ x n ( ) = sin x ak = (-mod(k,2))**(k/2) / fact_k 10 11 I = f x dx a ΔS = f ( x)h I = f a h I = h b (

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

netcdf

netcdf 1. Anetcdf.rb netcdf C ruby open new create NetCDF C filename String NetCDF NetCDF_open mode r r, w share false true or false open open netcdf filename String NetCDF NetCDF_create noclobber false true

More information

Intel® Compilers Professional Editions

Intel® Compilers Professional Editions 2007 6 10.0 * 10.0 6 5 Software &Solutions group 10.0 (SV) C++ Fortran OpenMP* OpenMP API / : 200 C/C++ Fortran : OpenMP : : : $ cat -n main.cpp 1 #include 2 int foo(const char *); 3 int main()

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() 2 double *a[ ]; double 1 malloc() double 1 malloc() free() 3 #include #include

More information

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 : 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,., B:,, 2017 12 1, 8, 15, 22 1,.,,,,.,.,,,., 1,. 1. :, ν. 2. : u t = ν 2 u x 2, (1), c. u t + c u x = 0, (2), ( ). 1 3. :, c, ν. 4. Burgers : u t + c u x = ν 2 u x 2, (3), ν. 5. : u t + u u x = ν 2 u x 2,

More information

IDL_lecture_12Jan.ppt

IDL_lecture_12Jan.ppt NAOJ/ADC IDL (2012 Jan) IDL IDL ASIAA IDL RSI(->ITT) IDL IDL IDL IDL ADC IDL IDL ADC ADC Practical IDL programming By L. E. Gumley (MORGAN Kaufmann 8103 at Amazon IDLHELP (online ) Idlhelp on unix shell

More information

FORTRAN( と C) によるプログラミング 5 ファイル入出力 ここではファイルからデータを読みこんだり ファイルにデータを書き出したりするプログラムを作成してみます はじめに テキスト形式で書かれたデータファイルに書かれているデータを読みこんで配列に代入し 標準出力に書き出すプログラムを作り

FORTRAN( と C) によるプログラミング 5 ファイル入出力 ここではファイルからデータを読みこんだり ファイルにデータを書き出したりするプログラムを作成してみます はじめに テキスト形式で書かれたデータファイルに書かれているデータを読みこんで配列に代入し 標準出力に書き出すプログラムを作り FORTRAN( と C) によるプログラミング 5 ファイル入出力 ここではファイルからデータを読みこんだり ファイルにデータを書き出したりするプログラムを作成してみます はじめに テキスト形式で書かれたデータファイルに書かれているデータを読みこんで配列に代入し 標準出力に書き出すプログラムを作ります FORTRAN の場合 OPEN 文でファイルを開いた後 標準入力の場合と同様に READ 文でデータを読みこみます

More information

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

n 第1章 章立ての部分は、書式(PC入門大見出し)を使います FORTRAN FORTRAN FORTRAN ) DO DO IF IF FORTRAN FORTRAN(FORmula TRANslator)1956 IBM FORTRAN IV FORTRAN77 Fortran90 FORTRAN77 FORTRAN FORTARN IF, DO C UNIX FORTRAN PASCAL COBOL PL/I BASIC Lisp PROLOG Lisp

More information

情報活用資料-03-20150604

情報活用資料-03-20150604 cp hello.f90 echo.f90 mv echo.f90 echofile.f90 cp echofile.f90 echo.f90 7 8 9 Echo key input program echo character(80):: A read (5,*) A write (6,*) A stop end program echo chracter read 10 Echo key input

More information

Microsoft PowerPoint - fortran2.ppt [互換モード]

Microsoft PowerPoint - fortran2.ppt [互換モード] 大型計算機システム利用講習会 Fortran 90/95 入門 2 情報基盤センター 大型計算機システム Fortran 90/95 入門 2 2 講習内容 関数 サブルーチンの補足構造体モジュール演習課題 1 ファイル操作, 演習課題 2 文字列の処理演習課題 3 および 4 大型計算機システム Fortran 90/95 入門 2 3 関数 サブルーチンの補足 : 文関数 自分で定義した関数を文のように定義することができる

More information

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l C/C++ 2007 6 18 1 C STL(1) 2 1.1............................................... 2 1.2 stdio................................................ 3 1.3.......................................... 10 2 11 2.1 sizeof......................................

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション ループ ループとは? ある条件を満たすまで 指定の命令を繰り返す Do... Loop For Next For Each Next While WEnd ループの種類 Do Loop Do While 条件 ステートメント Loop Do ステートメント Loop While 条件 Do Until 条件 ステートメント Loop Do ステートメント Until Loop 条件 Do Loop

More information

RHEA key

RHEA key 2 $ cd RHEA $ git pull zsh $ for i in {009..049}; do curl -O https://raw.githubusercontent.com/akiraokumura/rhea-slides/master/photons/lat_photon_weekly_w${i} _p302_v001_extracted.root; done bash $ for

More information

橡vb_kikai0.PDF

橡vb_kikai0.PDF Visual Basic OS Windows Visual Basic GPIBRS232C A/D Visual Basic Windows Visual Basic Visual Basic Visual Basic Visual Basic Windows GUI( ) OS Visual Basic Form Form 1 Visual Basic Microsoft Visual Basic

More information

ストラドプロシージャの呼び出し方

ストラドプロシージャの呼び出し方 Release10.5 Oracle DataServer Informix MS SQL NXJ SQL JDBC Java JDBC NXJ : NXJ JDBC / NXJ EXEC SQL [USING CONNECTION ] CALL [.][.] ([])

More information

明解Javaによるアルゴリズムとデータ構造

明解Javaによるアルゴリズムとデータ構造 21 algorithm List 1-1 a, b, c max Scanner Column 1-1 List 1-1 // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); Chap01/Max3.java

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 1, 2 of 14 ( RD S ) I 1, 2 of 14 1 / 44 Ruby Ruby ( RD S ) I 1, 2 of 14 2 / 44 7 5 9 2 9 3 3 2 6 5 1 3 2 5 6 4 7 8 4 5 2 7 9 6 4 7 1 3 ( RD S ) I 1, 2

More information

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

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£²¡Ë 2013 5 30 (schedule) (omp sections) (omp single, omp master) (barrier, critical, atomic) program pi i m p l i c i t none integer, parameter : : SP = kind ( 1. 0 ) integer, parameter : : DP = selected real

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() malloc 2 #include #include #include enum LENGTH = 10 ; int

More information

1. 入力画面

1. 入力画面 指定した時刻に指定したマクロ (VBA) を実行するプログラム (VBA) 益永八尋 様々な業務を行っている場合には 指定した時刻に指定したマクロ (Macro VBA) を実行したくなる場合がある たとえば 9:00 17: 00 や 1 時間 6 時間間隔に指定したマクロ (Macro VBA) を実行する この様な場合に対応できるように汎用性の高いプログラムを作成した この場合に注意する必要があるのは

More information

第10回 コーディングと統合(WWW用).PDF

第10回 コーディングと統合(WWW用).PDF 10 January 8, 2004 algorithm algorithm algorithm (unit testing) (integrated testing) (acceptance testing) Big-Bang (incremental development) (goto goto DO 50 I=1,COUNT IF (ERROR1) GO TO 60 IF (ERROR2)

More information

¥Ñ¥Ã¥±¡¼¥¸ Rhpc ¤Î¾õ¶·

¥Ñ¥Ã¥±¡¼¥¸ Rhpc ¤Î¾õ¶· Rhpc COM-ONE 2015 R 27 12 5 1 / 29 1 2 Rhpc 3 forign MPI 4 Windows 5 2 / 29 1 2 Rhpc 3 forign MPI 4 Windows 5 3 / 29 Rhpc, R HPC Rhpc, ( ), snow..., Rhpc worker call Rhpc lapply 4 / 29 1 2 Rhpc 3 forign

More information

D0050.PDF

D0050.PDF Excel VBA 6 3 3 1 Excel BLOCKGAME.xls Excel 1 OK 2 StepA D B1 B4 C1 C2 StepA StepA Excel Workbook Open StepD BLOCKGAME.xls VBEditor ThisWorkbook 3 1 1 2 2 3 5 UserForm1 4 6 UsorForm2 StepB 3 StepC StepD

More information

PR300 電力モニタ 通信インタフェース (RS-485通信,Ethernet通信)

PR300 電力モニタ 通信インタフェース (RS-485通信,Ethernet通信) User s Manual 1 2 3 1 2 3 Ethernet 1 2 3 4 Ethernet (ST-NO) (PCLK1) (PCLK2) (COMM) (M ASC) (M RTU) (M TCP) (RS-485) (B-RT) (PR201) (NONE) (PRI) (EVEN) (ODD) (STP) (DLN) (RS-485) (Ethernet) (IP-1)

More information