Computer Programming I, II, and III

Size: px
Start display at page:

Download "Computer Programming I, II, and III"

Transcription

1 FORTRAN 90 and Python KRISS Stay hungry, stay foolish.

2 Language is the house of the truth of Being. -Martin Heidegger.

3 Computer programming (often shortened to programming or coding) is the process of writing, testing, debugging/troubleshooting, and maintaining the source code of computer programs. A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. A prominent purpose of programming languages is to provide instructions to a computer. Efficiency, reliability, robustness, portability, readability :!,. Fortran 90 and Python. -Martin Heidegger debugging Science..

4 Debugging is a very important task for every programmer, because an erroneous program is often useless. Bugs - Compile-time Errors Bugs - Run-time Errors bug; `debugging`..

5 Why FORTRAN 90? FORTRAN ( ;.) 2.. (, 113, ) 3.. (,, ) 4.. (,, ) 5.. ( 77.) ()?: (object), ( /...) data abstraction -- user-defined types 2. data hiding -- private and public attributes 3. encapsulation -- modules and data hiding facilities 4. inheritance and extensibility -- generic procedures 5. polymorphism -- generic overloading 6. reusability -- modules, ( ) John Backus

6 ! program HW implicit none write(6,*) 'Hello World!' 77. C c *! Comment F90.! comment. end program hw ihlee@cetus0:~/lecture_programming$ a.out Hello World! ihlee@cetus0:~/lecture_programming$ 90 :

7 . FORTRNA 90.

8 abc=1.0d0 abc 1.d0. 1.e0 (single precision) vs 1.d0 (double precision) 1.d0. (,,,,,,.) () Implicit Typing Undeclared variables have an implicit type, if first letter is I, J, K, L, M or N then type is INTEGER; any other letter then type is REAL s. Operator precedence pi*radius**2 = pi*(radius**2) x*y/z+a= (x*y/z)+a

9 , Intrinsic Logical Operations A LOGICAL or boolean expression returns a.true. /.FALSE. result. The following are valid with LOGICAL operands,.not. --.TRUE. if operand is.false...and. --.TRUE. if both operands are.true.;.or. --.TRUE. if at least one operand is.true.;.eqv. --.TRUE. if both operands are the same;.neqv. --.TRUE. if both operands are different. For example, if T is.true. and F is.false. FORTRAN 77 do while.. while (logical expr) do statements enddo do while (logical expr) statements enddo integer n n = 1 10 if (n.le. 100) then n = 2*n write (*,*) n goto 10 endif

10 IF (I > 17) THEN Print*, "I > 17" ELSE Print*, "I <= 17" END IF IF (I > 17) THEN Print*, "I > 17" ELSEIF (I == 17) THEN Print*, "I == 17" ELSE Print*, "I < 17" END IF outa: IF (a.ne. 0) THEN PRINT*, "a /= 0" IF (c.ne. 0) THEN PRINT*, "a /= 0 AND c /= 0" ELSE PRINT*, "a /= 0 BUT c == 0" ENDIF ELSEIF (a.gt. 0) THEN outa PRINT*, "a > 0" ELSE outa PRINT*, "a must be < 0" ENDIF outa [name:] IF (expression) THEN block ENDIF [name] [name:] IF (expression) THEN block1 ELSE [name] block2 ENDIF [name] elseif.. IF ( n == 1 ) THEN discount = 0.0d0 ELSEIF ( n <=5 ) THEN discount = 0.1d0 ELSEIF ( n>5.and. n <=10) THEN discount = 0.15d0 ELSE discount = 0.25d0 ENDIF

11 INTEGER :: month season: SELECT CASE( month ) CASE(4,5) WRITE(*,*) `Spring' CASE(6,7) WRITE(*,*) `Summer' CASE(8:10) WRITE(*,*) `Autumn' CASE(11,1:3,12) WRITE(*,*) `Winter' CASE DEFAULT WRITE(*,*) `not a month' END SELCET season Conditional statements IF statement IF construct CASE construct Repetition DO constructs GOTO outer: DO... inner: DO k=1,5 IF ( a(k)==0 ) CYCLE IF ( a(k)<0 ) EXIT outer... END DO inner END DO outer Exit from loop with EXIT. Begin another iteration with CYCLE. By default EXIT and CYCLE apply to the inner-most loop containing the statement, but can refer to a specific, named loop. INTEGER :: x... IF ( x.lt.1 ) GOTO x = 1

12 , integer i,j,k,nn integer mm real*8 abc real*8 cde(100),vec(3),xaa(3,3) real*8, allocatable :: dd(:,:), ee(:) integer, allocatable :: kkx(:) : FORTRAN 90 FORTRAN 77.,., FORTRAN 77. allocate( dd(-10:10,3) ) allocate( ee(mm) ). deallocate(dd) ; deallocate(ee),,..,..

13 C vs FORTRAN F:,. short int x; long int x; int x; char x; char *x; char x[7]; float x; double x; INTEGER*2 X INTEGER*4 X INTEGER*4 X BYTE X or LOGICAL*1 X CHARACTER*n X CHARACTER*7 X REAL X DOUBLE PRECISION X (), C FORTRAN.. a(3,3), a(1,1), a(2,1), a(3,1), a(1,2), a(2,2), a(3,2), a(1,3),a(2,3),a(3,3).,,, b(9)., aaa(100)1,2,3,,,100. C 0,1,2,3.99. FORTRAN bbb(0:99)., FORTRAN, bbb(1:100) bbb(100)., ccc(-100:100).

14 Slices, section A(:)! the whole array A(3:9)! A(m) to A(n) in steps of 1 A(3:9:1)! as above A(m:n)! A(m) to A(n) A(m:n:k)! A(m) to A(n) in steps of k A(8:3:-1)! A(8) to A(3) in steps of -1 A(8:3)! A(8) to A(3) step 1 => Zero size A(m:)! from A(m) to default UPB A(:n)! from default LWB to A(n) A(::2)! from default LWB to UPB step 2 A(m:m)! 1 element section A(m)! scalar element - not a section aaa(:,3)=bb(:) abc=maxval(aaa(:,2)) abc=minval(abs(aaa(:,:)). (?) FORTRAN 90.

15

16 program area implicit none real*8 a,b,c real*8 s,p,aaa read(5,*) a,b,c p=a+b+c s=p/2.0d0 aaa=sqrt(s*(s-a)*(s-b)*(s-c)) write(6,*) aaa stop end program area (5 ), read(5,*) (6 ), write(6,*) a.out < input > output.. implicit none real*8 a,b,c real*8 d read(5,*) a,b,c d=b**2-4.d0*a*c if(d < 0.0d0)then write(6,*) 'NO REAL ROOTS' end if if(d == 0.0d0)then write(6,*) 'two identical roots' write(6,*) -b/(2.d0*a) endif if(d> 0.0d0)then write(6,*) 'two distinct roots' write(6,*) (-b+sqrt(d))/(2.0d0*a) write(6,*) (-b-sqrt(d))/(2.0d0*a) endif stop end

17 a.out Enter nn 10 nn aaa a.out < input > output., interactive.,.

18 a.out Enter nn 10 nn aaa :,,. :,. Subroutine.,.,. Subroutine.

19 ! program i_sum implicit none integer mm real*8 bbb write(6,*) ' Enter nn' read(5,*) mm write(6,*) 'nn ',mm call int_sum(mm,bbb) write(6,*) bbb,' aaa' end program i_sum subroutine int_sum(nn,aaa) implicit none integer nn real*8 aaa integer i! write(6,*) ' Enter nn'! read(5,*) nn! write(6,*) 'nn ',nn aaa=0.0d0 do i=1,nn aaa=aaa+float(i) end do! write(6,*) aaa,' aaa' end subroutine int_sum pgf90 a.f90 sub1.f90 a.out Enter nn 100 nn aaa

20 ! implicit none integer mm real*8 bbb! write(6,*) ' Enter nn' read(5,*) mm write(6,*) 'nn ',mm call int_sum(mm,bbb) write(6,*) bbb,' aaa' call inv_sum(mm,bbb) write(6,*) bbb,' aaa' end subroutine int_sum(nn,aaa) implicit none integer nn real*8 aaa integer i! write(6,*) ' Enter nn'! read(5,*) nn! write(6,*) 'nn ',nn aaa=0.0d0 do i=1,nn aaa=aaa+float(i) end do! write(6,*) aaa,' aaa' end subroutine int_sum pgf90 a.f90 sub1.f90 sub2.f90 a.out Enter nn 10 nn aaa aaa (subroutine, function).

21 implicit none integer n,nn real*8 a,b real(8) x,f,area,h,s integer k f(x)=x*x! write(6,*) 'a,b,n' read(5,*) a,b,n h=(b-a)/float(n) nn=n-1 s=f(a)+f(b) do k=1,nn s=s+2.0d0*f(a+float(k)*h) enddo area=h*s/2.0d0 write(6,*) a,b,area stop end ihlee@cetus0:~/lecture_programming$ a.out a,b,n 0.d0 1.d FORTRAN STOP ihlee@cetus0:~/lecture_programming$ ihlee@cetus0:~/lecture_programming$ a.out a,b,n 0.d0 1.d FORTRAN STOP ihlee@cetus0:~/lecture_programming$

22 pgf90 *.f90 pgf90 a.f90 b.f90 c.f90 d.f e.f pgf90 a.f90 b.o c.o d.o e.o makefile

23 IMPLICIT NONE? IMPLICIT NONE :.,.. REAL*8, INTEGER, CHARACTER*3, LOGICAL, COMPLEX*16. TYPO..,., USE,. IMPLICIT REAL*8 (A-H,O-Z), A-H O-Z., implicit none.... INTEGER, DIMENSION(:), ALLOCATABLE, SAVE, PRIVATE :: ivari_name.,.. INTEGER, ALLOCATABLE :: ivari_name(:) private save,. public private. implicit none private save integer... real*8... real*8, allocatable :: integer, allocatable :: logical... public ::...( ),, ().. Implicit none -.

24 ! PROGRAM xxx_1 IMPLICIT NONE INTEGER, PARAMETER :: idp=kind(0.d0)! CHARACTER*8 fnnd ; CHARACTER*10 fnnt CHARACTER(8) fnnd ; CHARACTER(10) fnnt LOGICAL ll1,ll2 INTEGER ii,jj,i,nn INTEGER :: kk,npt! REAL*8 aa,pi REAL(8) bb,dx,xx REAL(idp) cc REAL(KIND=idp) dd REAL(KIND=idp) :: ee REAL(8) ff! COMPLEX(idp) zz1,zz2,zz3 COMPLEX(idp) :: zz4! REAL(8), ALLOCATABLE :: xvector(:),xmatrix(:,:) REAL(8), ALLOCATABLE :: yvector(:) REAL(8), ALLOCATABLE :: ymatrix(:,:) REAL(8), ALLOCATABLE :: qvector(:)! REAL(8) :: sma(3) REAL(8) smb(3)! CALL DATE_AND_TIME(DATE=fnnd,TIME=fnnt) WRITE(6,*) ' ',' date ',fnnd,' time ',fnnt,' '! INQUIRE(FILE='input_file',EXIST=ll1)! pi=4.0d0*atan(1.0d0) WRITE(6,*) 'pi ',pi pi=acos(-1.0d0) WRITE(6,*) 'pi ',pi IF(ll1)THEN WRITE(6,*) 'file is present' ELSE WRITE(6,*) 'file is absent' ENDIF WRITE(6,*) idp,' idp' ll1=.true. ll2=.false. WRITE(6,*) ll1,' ll1' WRITE(6,*) ll2,' ll2' ii=0 jj=1 kk=-1 ll1= (1 == 2) ll2= (1 /= 2) IF(ii >= jj) ll1=.true. IF(ii == jj) ll2=.false. WRITE(6,*) ii,' ii' WRITE(6,*) jj,' jj' aa=0.0_idp! note bb=0.0d0 cc=0.0d0 dd=0.0d0 zz1=0.0_idp zz2=cmplx(1.0_idp,2.0_idp)! note zz3=zz1+zz2 zz3=zz1-zz2 zz3=zz1*zz2 zz3=zz1/zz2 zz3=zz1**2 aa=real(zz3) bb=imag(zz3) cc=abs(zz3) zz4=conjg(zz3) WRITE(6,*) aa,' aa' WRITE(6,*) bb,' bb' WRITE(6,*) cc,' cc' WRITE(6,*) dd,' dd' WRITE(6,*) zz1,' zz1' WRITE(6,*) zz2,' zz2' OPEN(1,FILE='output1',FORM='FORMATTED') WRITE(1,'(i8)') ii WRITE(1,'(2i8)') ii,jj WRITE(1,'(i8,2x,i8)') ii,jj WRITE(1,'(i8,2x,i8,3x,a5)') ii,jj,'ii,jj' WRITE(1,*) aa,' aa' WRITE(1,*) bb,' bb' WRITE(1,*) cc,' cc' WRITE(1,*) dd,' dd' WRITE(1,*) zz1,' zz1' WRITE(1,*) zz2,' zz2' CLOSE(1)

25 OPEN(2,FILE='output2',FORM='FORMATTED') WRITE(2,'(i8)') ii WRITE(2,'(2i8)') ii,jj CLOSE(2) sma=0.0d0 smb=1.0d0 ii=10 jj=10 nn=ii ALLOCATE(xvector(nn)) ; ALLOCATE(yvector(nn)) ALLOCATE(xmatrix(nn,nn)) ALLOCATE(ymatrix(nn,nn)) ALLOCATE(qvector(0:nn)) IF(ALLOCATED(xvector))THEN WRITE(6,*) 'xvector is allocated' WRITE(6,*) 'size ', SIZE(xvector) DO i=1,nn xvector(i)=float(i) ENDDO yvector=-xvector ENDIF WRITE(6,*) 'sum ', SUM(xvector) WRITE(6,*) 'sum ', SUM(yvector) yvector=sqrt(abs(xvector)) IF(ALLOCATED(xmatrix))THEN WRITE(6,*) 'xmatrix is allocated' WRITE(6,*) 'size ', SIZE(xmatrix) ENDIF xvector=0.0d0 yvector=0.0d0 xmatrix=0.0d0 ymatrix=transpose(xmatrix) ymatrix(:,1)=yvector(:) yvector=matmul(xmatrix,xvector) dd=dot_product(xvector,yvector) dd=maxval(xvector) ee=minval(yvector) dd=maxval(abs(xvector)) dd=maxval(abs(xvector-yvector))/(maxval(abs(xvector))+maxval(abs(yvector))+1.0d-8) aa=sum(xvector)/float(size(xvector)) bb=product(yvector) DEALLOCATE(xvector) ; DEALLOCATE(yvector) DEALLOCATE(xmatrix) DEALLOCATE(ymatrix) DEALLOCATE(qvector) INQUIRE(FILE='del',EXIST=ll1) IF(LL1)THEN WRITE(6,*) 'del is present' OPEN(11,FILE='del') CLOSE(31,STATUS='DELETE') ENDIF aa=0.0d0 bb=1.0d0 npt= dx=(bb-aa)/float(npt-1) cc=0.0d0 DO i=1,npt xx=aa+float(i-1)*dx cc=cc+ff(xx) ENDDO cc=cc*dx write(6,*) cc,' cc' STOP END PROGRAM xxx_1 FUNCTION ff(x) REAL(8) ff REAL(8) x ff=x*x RETURN END FUNCTION ff

26 a.out date time pi pi file is absent 8 idp T ll1 F ll2 0 ii 1 jj aa bb cc dd ( , ) zz1 ( , ) zz2 xvector is allocated size 10 sum sum xmatrix is allocated size cc FORTRAN STOP ihlee@cetus0:~/lecture_programming$

27 20 TOP 10 Fortran Calls C C Calls Fortran

28 Fortran Calls C void simref_ ( b4, i4, r4, d8 ) /* Simple types, passed by reference, from f90 (f90 calls C)*/ int * b4 ; int * i4 ; float * r4 ; double * d8 ; { *b4 = 1 ; *i4 = 9 ; *r4 = 9.9f ; *d8 = 9.9F ; } PROGRAM SimpleRef! Pass some simple types, by reference, to C (f90 calls C) LOGICAL b4! Default kind is 4-byte INTEGER i4! Default kind is 4-byte REAL r4! Default kind is 4-byte DOUBLE PRECISION d8! This is 8-byte CALL SimRef ( b4, i4, r4, d8 ) WRITE( *, '(L4,I4,F6.1,F6.1)') b4, i4, r4, d8 END PROGRAM SimpleRef ihlee@cetus0:~/lecture_programming$ vi simref.c ihlee@cetus0:~/lecture_programming$ vi simplref.f90 ihlee@cetus0:~/lecture_programming$ cc -c simref.c ihlee@cetus0:~/lecture_programming$ pgf90 simplref.f90 simref.o ihlee@cetus0:~/lecture_programming$ a.out T

29 ,,.,..,.??. : (class) : (object, instance)

30 -C ( ) -c object. real*8 a(3,2),yone(6) 3*2=6. (row) (column). 1. a(1,1) a(2,1) a(3,1) a(1,2) a(2,2) a(3,2)ij=3*(j-1)+i a(i,j) (yone,, 6.). do i=1,3 do j=1,2 ij=3*(j-1)+i yone(ij)=a(i,j) enddo enddo akvector(natom,3,nk) 1 ( ). do iatom=1,natom kp=3*nk*(iatom-1) do k=1,nk xone(kp+3*(k-1)+1)=akvector(iatom,1,k) xone(kp+3*(k-1)+2)=akvector(iatom,2,k) xone(kp+3*(k-1)+3)=akvector(iatom,3,k) enddo enddo..,, 1..

31 Subroutine, function( ),. double precision, double precision.. (.) A(3,2). subroutine abc1(a) implicit none real*8 a(3,1) subroutine abc2(a) implicit none real*8 a(3,2).,.,.,. (.) subroutine abc3(a) implicit none real*8 a(1,2) ( 77) subroutine abc4(a,lda) implicit none integer lda real*8 a(lda,1). a(3,3), a(1,1), a(2,1), a(3,1), a(1,2), a(2,2), a(3,2), a(1,3),a(2,3),a(3,3).,,, b(9).

32 implicit none integer m integer j! read(5,*) m do j=2,m call test_prime(j) end do stop end subroutine test_prime(n) implicit none integer n integer k if( n <=1 ) return if( n == 2) write(6,*) n,' is a prime' if( n == 2) return k=2 30 if (n/k*k == n) goto 70 k=k+1 if(k <= n/2) go to 30 write(6,*) n,' is a prime' return 70 continue write(6,*) n, ' is not a prime' return end ihlee@cetus0:~/lecture_programming$ a.out 20 2 is a prime 3 is a prime 4 is not a prime 5 is a prime 6 is not a prime 7 is a prime 8 is not a prime 9 is not a prime 10 is not a prime 11 is a prime 12 is not a prime 13 is a prime 14 is not a prime 15 is not a prime 16 is not a prime 17 is a prime 18 is not a prime 19 is a prime 20 is not a prime FORTRAN STOP ihlee@cetus0:~/lecture_programming$

33 ! implicit none integer nm,n,matz,ierr real*8, allocatable :: ar(:,:),ai(:,:),w(:),zr(:,:),zi(:,:),fv1(:),fv2(:),fm1(:,:) real*8 tmp integer i,j,k matz=0 matz=1 nm=3 n=nm open(1,file='input',form='formatted') read(1,*) n close(1) write(6,*) n,' n' allocate(ar(nm,n),ai(nm,n),w(n),zr(nm,n),zi(nm,n),fv1(n),fv2(n),fm1(2,n)) do i=1,n do j=1,i! lower-triangular-form.!------[ set up the hermitian matrix : lower triangular form ar(i,j)=dfloat(i+j)**2 ai(i,j)=1.d0/dfloat(i-j) if(i == j) ai(i,j)=0.0d0 hermitian enddo enddo do i=1,n do j=1,i ar(j,i)=ar(i,j) ai(j,i)=-ai(i,j) enddo enddo call ch(nm,n,ar,ai,w,matz,zr,zi,fv1,fv2,fm1,ierr) write(6,*) 'eigenvalues' do i=1,n write(6,*) w(i) enddo write(6,*) 'eigenvectors' do j=1,n write(6,*) (dcmplx(zr(k,j),zi(k,j)),k=1,n) enddo do i=1,n do j=1,n tmp=0.0d0 do k=1,n tmp=tmp+dcmplx(zr(k,i),-zi(k,i))*dcmplx(zr(k,j),zi(k,j)) enddo write(6,*) i,j,tmp enddo endd deallocate(ar,ai,w,zr,zi,fv1,fv2,fm1)!. stop end 3 3 n eigenvalues eigenvectors ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , E-002) ( , E-002) ( , ) E E E E E E

34 program conjugate_gradient implicit none integer iters, its, n logical :: converged real*8 :: tol, up, alpha, beta real*8, allocatable :: a(:,:), b(:), x(:), r(:), u(:), p(:), xnew(:) read(5,*) n, tol, its allocate( a(n,n), b(n), x(n), r(n), u(n), p(n), xnew(n) ) open(10, file='data') read(10,*) a read(10,*) b close(10) x=1.d0! 1.d0. r=b-matmul(a,x)!.. p=r!. iters=0 do! do loop. iters=iters+1 u=matmul(a,p) up=dot_product(r,r)! (inner product). alpha=up/dot_product(p,u) xnew=x+p*alpha r=r-u*alpha!. beta=dot_product(r,r)/up p=r+p*beta! beta. converged=(maxval(abs(xnew-x))/maxval(abs(x)) < tol)!. x=xnew!. if( converged.or. iters == its) exit! do. enddo write(6,*) iters write(6,*) x deallocate( a,b,x,r,u,p,xnew ) end program conjugate_gradient!.

35 module common_data implicit none private!.. ( default.) save integer iii1,jjj1 real*, allocatable :: aa1(:,:),bb1(:) logical first_call!.!..true.,.false.. character*2, allocatable :: ccc1(:)... public :: aa1,bb1,iii1!,. (.) end module common_data,.,,,, public. public.,, default public. module common_data2 implicit none private save... public ::... end module common_data2 :. :. Interface.,,. :

36 ( ) CONTAINS (, ). END FUNCTION SUBROUTINE. End function fname,, end subroutine sname...

37

38 ..! MODULE wf_wr IMPLICIT NONE save public integer nsim real*8 temper real*8, allocatable :: wf(:),wr(:) END MODULE wf_wr!. USE wf_wr IMPLICIT NONE real*8 tol,sol,sol1,sol2 real*8 tmp integer i real*8 bennetteq,zeroin temper=1.d0 ; nsim=10 allocate(wf(nsim),wr(nsim)) wf=1. ; wr=-1. do i=1,nsim call random_number(tmp) wf(i)=wf(i)+0.2*(tmp-0.5) call random_number(tmp) wr(i)=wr(i)+0.2*(tmp-0.5) enddo sol1=maxval(wf) ; sol2=minval(wf) write(6,*) sol1,bennetteq(sol1) write(6,*) sol2,bennetteq(sol2) tol=1.d-16 sol=zeroin(sol1,sol2,bennetteq,tol)! netlib. root finding. : bennetteq. write(6,*) sol,bennetteq(sol) deallocate(wf,wr) stop end

39 USE, ONLY :, public,. USE USE ONLY.. save, public ( private),. implicit none implicit none.,,,,,.. -C.. USE stack, local_use_pop => pop pop, stack pop local_pop. USE stack, ONLY: pos, local_pop=> pop stack pos pop., pop local_pop.. makefile., ximage_lbfgs.f90 timpose.f90.. USE aaa USE bbb! bbb public,, (function, subroutine). USE ccc USE ddd, ONLY: qqq,ppp! ddd,, (subroutine, function).

40 implicit none,, ()..,...,., = {}+{ }. (contain)..,. (, ) USE. 77,, common common ,.,.,.,,,, public. public.,, default public.

41 cmpl=pgf90 segl=pgf90 Ocft= -c -fast cft= -c #LINK=-L/usr/lib/xmm -L/usr/lib/xmm/atlas LINK= -L/usr/lib/sse2 LIBS = -llapack -lf77blas -latlas -lf2c AMD= amd.o predictor_corrector_nose.o energy_force.o tight_binding_lapack_c.o \ mini_driver.o minimization.o lbfgs.o bond_boost.o erf.o maxwell_boltzmann.o \ check_transition.o rmarin.o angle_boost.o dihedral.o dihedral_boost.o amd.x: $(AMD) $(segl) -o amd.x $(AMD) $(LINK) $(LIBS) amd.o:amd.f90 predictor_corrector_nose.o bond_boost.o angle_boost.o dihedral_boost.o $(cmpl) $(Ocft) amd.f90 energy_force.o:energy_force.f90 tight_binding_lapack_c.o $(cmpl) $(Ocft) energy_force.f90 tight_binding_lapack_c.o:tight_binding_lapack_c.f90 $(cmpl) $(Ocft) tight_binding_lapack_c.f90 predictor_corrector_nose.o:predictor_corrector_nose.f90 $(cmpl) $(Ocft) predictor_corrector_nose.f90 mini_driver.o:mini_driver.f90 $(cmpl) $(Ocft) mini_driver.f90 minimization.o:minimization.f90 $(cmpl) $(Ocft) minimization.f90 bond_boost.o:bond_boost.f90 $(cmpl) $(Ocft) bond_boost.f90 angle_boost.o:angle_boost.f90 $(cmpl) $(Ocft) angle_boost.f90 dihedral_boost.o:dihedral_boost.f90 dihedral.o $(cmpl) $(Ocft) dihedral_boost.f90 dihedral.o:dihedral.f90 erf.o:erf.f $(cmpl) $(Ocft) erf.f clean: rm -f *.x *.o *.mod *.M core* touch: touch *.f90 *.i makefile ; chmod 600 *.f90 *.i makefile ; ls -l *.f90 *.i makefile rmo: rm -f *.o *.mod *.M core* lsl: ls -l *.f90 makefile *.i, makefile. make. ls -ltra. ls -Fs make clean make

42 ! module metric implicit none real*8 aa,bb,cc,dd end module metric program abc USE metric implicit none real*8 sol1,sol2,tol real*8 sol,x real*8, external :: func,zeroin integer i aa=0.d0 bb=-2.d0 cc= 1.d0 dd=2.d0 sol1=-1.0d0 sol2= 0.1d0 write(6,*) sol1,func(sol1) write(6,*) sol2,func(sol2) tol=1.d-16 ; sol=zeroin(sol1,sol2,func,tol) write(6,*) sol,func(sol),' sol, f(sol)' sol1=-3.0d0 sol2=-1.9d0 write(6,*) sol1,func(sol1) write(6,*) sol2,func(sol2) tol=1.d-16 ; sol=zeroin(sol1,sol2,func,tol) write(6,*) sol,func(sol),' sol, f(sol)' sol1= 0.9d0 sol2= 1.1d0 write(6,*) sol1,func(sol1) write(6,*) sol2,func(sol2) tol=1.d-16 ; sol=zeroin(sol1,sol2,func,tol) write(6,*) sol,func(sol),' sol, f(sol)' sol1= 1.9d0 sol2= 2.1d0 write(6,*) sol1,func(sol1) write(6,*) sol2,func(sol2) tol=1.d-16 ; sol=zeroin(sol1,sol2,func,tol) write(6,*) sol,func(sol),' sol, f(sol)' stop end program abc real*8 function func(x) USE metric implicit none real*8 x func=(x-dd)*(x-aa)*(x-bb)*(x-cc) return end E E-018 sol, f(sol) sol, f(sol) sol, f(sol) sol, f(sol) FORTRAN STOP.,,.,, (.). Cf. 77 common. :

43 module dihedral_angle! Written by In-Ho Lee, KRISS, October 4 (2003). implicit none private save real*8 diangle,dadi(3),dadj(3),dadk(3),dadl(3) public :: mk_diangle,diangle,dadi,dadj,dadk,dadl contains subroutine mk_diangle(ri,rj,rk,rl) implicit none real*8 ri(3),rj(3),rk(3),rl(3) real*8 rij(3),rkj(3),rkl(3),xnorm_ij_kj,xnorm_kj_kl real*8 rij_kj(3),rkj_kl(3),rtmp(3),xnorm_kj,xnorm_mj,xnorm_nk real*8 rmj(3),rnk(3),xxr,xxi real*8 argu,qsign rij=ri-rj ; rkj=rk-rj ; rkl=rk-rl call cross(rij,rkj,rij_kj) call cross(rkj,rkl,rkj_kl) call cross(rij_kj,rkj_kl,rtmp) xnorm_ij_kj=sqrt(dot_product(rij_kj,rij_kj)) xnorm_kj_kl=sqrt(dot_product(rkj_kl,rkj_kl)) argu=dot_product(rij_kj,rkj_kl)/(xnorm_ij_kj*xnorm_kj_kl) ; argu=min(1.0d0,max(-1.0d0,argu)) qsign=1.0d0 ; if(dot_product(rkj,rtmp) < 0.0d0) qsign=-1.0d0 diangle=qsign*acos(argu) call cross(rij,rkj,rmj) call cross(rkj,rkl,rnk) xnorm_kj=sqrt(dot_product(rkj,rkj)) xnorm_mj=sqrt(dot_product(rmj,rmj)) xnorm_nk=sqrt(dot_product(rnk,rnk)) dadi(:)=rmj(:)*xnorm_kj/xnorm_mj**2 dadl(:)=-rnk(:)*xnorm_kj/xnorm_nk**2 xxr=dot_product(rij,rkj)/xnorm_kj**2-1.0d0 xxi=dot_product(rkl,rkj)/xnorm_kj**2 dadj(:)=xxr*dadi(:)-xxi*dadl(:) xxr=dot_product(rkl,rkj)/xnorm_kj**2-1.0d0 xxi=dot_product(rij,rkj)/xnorm_kj**2 dadk(:)=xxr*dadl(:)-xxi*dadi(:) dadi=dadi*qsign dadj=dadj*qsign dadk=dadk*qsign dadl=dadl*qsign end subroutine mk_diangle subroutine cross(r1,r2,r3) implicit none real*8 r1(3),r2(3),r3(3) r3(1) = r1(2)*r2(3)-r1(3)*r2(2) r3(2) = r1(3)*r2(1)-r1(1)*r2(3) r3(3) = r1(1)*r2(2)-r1(2)*r2(1) end subroutine cross end module dihedral_angle Dihedral angle

44 ! implicit none real*8, external :: func real*8 rslt,aa,bb integer n n=100 aa=0.0d0 bb=1.0d0 call simpson(func,n,aa,bb,rslt) write(6,*) rslt,' rslt' stop end subroutine simpson(func,n,aa,bb,rslt) implicit none real*8 func integer n real*8 rslt,aa,bb real*8 h,xx integer j logical lodd h=(bb-aa)/float(n) rslt=(func(aa)+func(bb)) lodd=.true. do j=1,n-1 xx=aa+h*float(j) if(lodd)then rslt=rslt+4.0d0*func(xx) else rslt=rslt+2.0d0*func(xx) endif lodd=(.not. lodd) enddo rslt=rslt*h/3.0d0 return end real*8 function func(x) implicit none real*8 x func=x*x return end rslt FORTRAN STOP n even number. Composite Simpson's rule : [a,b] step length: h=(b-a)/n x_i=a+i h i=0,1,2,3,...,n-1,n n. x_0=a x_n=b :

45 , Fornberg ( ) Uniform grid. (nonuniform grid),. (.),. 0 =(k=0) k=1 () k grid. f(x) :

46 subroutine weights(xi,x,n,m,c)! purpose: computes weights for the mth derivative on arbitrarily! spaced points! Jan 04, 1996 declare all variables! date: Nov 15, 1995 (copied from Fornberg)! written by In-Ho Lee, Beckman Inst., UIUC, April ! +real_constant=double option in HP f90! ! INPUT PARAMETERS:! xi point at which the approximations are to be accurate! x x-coordinates for the grid points, array dimensioned x(0:n)! n the grid points are at x(0),x(1),...x(n) (i.e. n+1 in all)! m highest order of derivative to be approximated!! OUTPUT PARAMETERS! c weights, array dimensioned c(0:n,0:n,0:m)! on return, the element c(j,k,i) contains the weight to be! applied at x(k) when the i:th derivative is approximated! by a stencil extending over x(0),x(1),...,x(j).! ! implicit real*8 (a-h,o-z) dimension x(0:n),c(0:n,0:n,0:m) c(0,0,0)= 1.0d0 c1 = 1.0d0 c4 = x(0)-xi do 40 j=1,n mn = min(j,m) c2 = 1.0d0 c5 = c4 c4 = x(j)-xi do 20 k=0,j-1 c3=x(j)-x(k) c2=c2*c3 if (j.le.m) c(k,j-1,j)=0.0d0 c(k,j,0) =c4*c(k,j-1,0)/c3 do 10 i=1,mn 10 c(k,j,i)=(c4*c(k,j-1,i)-i*c(k,j-1,i-1))/c3 20 continue c(j,j,0)=-c1*c5*c(j-1,j-1,0)/c2 do 30 i=1,mn 30 c(j,j,i)=c1*(i*c(j-1,j-1,i-1)-c5*c(j-1,j-1,i))/c2 40 c1=c2 return end, Fornberg ( ) Fornberg Finite difference., high-order.. Finite-difference. 10.,. (, : ).,, m.,,... Finite difference:

47 ! module rk_df implicit none public save integer neq,info(15),idid,lrw,liw real*8 t, tout integer, allocatable :: iwork(:),ipar(:) real*8, allocatable :: y(:), rwork(:), rtol(:), atol(:), rpar(:) contains subroutine initial implicit none t=0.0d0 tout=0.1d0 neq=3 allocate(y(neq)) y(1)=0.d0 y(2)=1.d0 y(3)=1.d0 info(1)=0 lrw= 33+7*neq ; liw= 34 allocate(iwork(liw)) ; allocate(rwork(lrw)) allocate(atol(neq),rtol(neq)) rtol=1.d-10 ; atol=1.d-10 allocate(rpar(neq)) ; allocate(ipar(neq)) end subroutine initial subroutine final implicit none deallocate(y) ; deallocate(rwork) ; deallocate(iwork) deallocate(atol,rtol) ; deallocate(rpar) ; deallocate(ipar) end subroutine final! DF(X,U,UPRIME,RPAR,IPAR) x, u.! uprime(). subroutine df(x,u,uprime,rpar_z,ipar_z) implicit none real*8 x,u(1) real*8 rpar_z(1) integer ipar_z(1) real*8 uprime(1) uprime(1)=u(2)*u(3) uprime(2)=-u(1)*u(3) uprime(3)=-0.522d0*u(1)*u(2) end subroutine df end module rk_df! program rk_test USE rk_df, ONLY : neq, t, y, tout, info, rtol, atol, idid, rwork, lrw, iwork, liw, rpar, ipar USE rk_df, ONLY : df,initial,final implicit none call initial call dderkf(df, neq, t, y, tout, info, rtol, atol, idid, rwork, lrw, iwork, liw, rpar, ipar)! write(6,*) t,' t' write(6,*) tout,' tout' write(6,*) y,' y' write(6,'(i5,1x,a4)') idid,'idid' write(6,'(15i5,1x,a4)') info,'info' tout=tout+0.1d0 call dderkf(df, neq, t, y, tout, info, rtol, atol, idid, rwork, lrw, iwork, liw, rpar, ipar)! write(6,*) t,' t' write(6,*) tout,' tout' write(6,*) y,' y' write(6,'(i5,1x,a4)') idid,'idid' write(6,'(15i5,1x,a4)') info,'info' tout=tout+0.1d0 call dderkf(df, neq, t, y, tout, info, rtol, atol, idid, rwork, lrw, iwork, liw, rpar, ipar)! write(6,*) t,' t' write(6,*) tout,' tout' write(6,*) y,' y' write(6,'(i5,1x,a4)') idid,'idid' write(6,'(15i5,1x,a4)') info,'info' call final end program rk_test allocate(vector(-89:100)). -89, -88, -87,...98, 99, 100., allocate(vector(100)) 100 vector., allocate(vector(1:100)). 1. :

48 implicit none integer j,i integer narr,mref real*8, allocatable :: xarr(:,:) real*8, allocatable :: yarr(:,:) logical lexist narr=10 mref=3 allocate(xarr(narr,mref)) allocate(yarr(narr,mref)) inquire(file='fort.2',exist=lexist) if(lexist)then open(2,file='fort.2',access='direct',recl=8*narr,form='unformatted') do j=1,mref read(2,rec=j) yarr(:,j) enddo close(2) endif do j=1,mref do i=1,narr xarr(i,j)=float(i)**2/float(j) enddo enddo write(6,*) maxval(abs(xarr-yarr)) open(2,file='fort.2',access='direct',recl=8*narr,form='unformatted') do j=1,mref write(2,rec=j) xarr(:,j) enddo close(2) deallocate(xarr) deallocate(yarr) stop end implicit none integer j,i integer narr,mref real*8, allocatable :: xarr(:,:) real*8, allocatable :: yarr(:,:) logical lexist narr=10 mref=3 allocate(xarr(narr,mref)) allocate(yarr(narr,mref)) inquire(file='fort.12',exist=lexist) if(lexist)then open(12,file='fort.12',form='unformatted') read(12) yarr(:,:) close(12) endif do j=1,mref do i=1,narr xarr(i,j)=float(i)**2/float(j) enddo enddo write(6,*) maxval(abs(xarr-yarr)) open(12,file='fort.12',form='unformatted') write(12) xarr(:,:) close(12) deallocate(xarr) deallocate(yarr) stop end :

49 READ(*,100) i,j WRITE(*,100) i,j READ(*,FMT=200) x,y WRITE(*,200) x,y 100 FORMAT(2I) 200 FORMAT(2F10.6) READ(*,'(2I)') i,j WRITE(*,'(2F12.6)') x,y WRITE(6,`(2F12.6)`) 12.6, INTEGER :: i, j REAL, DIMENSION(10) :: a REAL, DIMENSION(10,10) :: b READ(*,*) (a(j),j=1,10) WRITE(*,*) (a(j), j=10,1,-1) WRITE(*,*) ((b(i,j),i=1,10), j=1,10). formatted, unformatted. Unformatted. /... form= formatted serial, direct. Direct CD, 3 7. access= direct,. recl. Record length.

50 open(11,file= abcd.txt, form= unformatted, access= direct, recl=8*nnsszz) Unformatted... write(11,rec=k) (aa(i),i=1,nnsszz) Unit number... read(11,rec=kk) (bb(j),j=1,nnsszz) /(record length). Unformatted read/write... cf. netcdf, HDF hdf.ncsa.uiuc.edu/products/hd5/index.html

51 Inquiry list EXIST=lex!.true. or.false. OPENED=lod!.true. or.false. NUMBER=unum! unit number NAME=fnm! filename ACCESS=acc! 'DIRECT' or 'SEQUENTIAL' SEQUENTIAL=seq! 'YES or 'NO' DIRECT=dir! 'YES' or 'NO' FORMATTED=fmt! 'YES' or 'NO' UNFORMATTED=unfmt! 'YES' or 'NO' FORM=frm! 'FORMATTED' or 'UNFORMATTED' NEXTREC=recn! number of next record RECL=recl! record length inquire(file='fort.40',exist=lexist) if(lexist)then else. endif allocated(abc) abc..true.,.false.. if(allocated(abc)) deallocate(abc) if(.not. allocated(abc)) allocate(abc(0:100)).

52 implicit none real*8, allocatable :: xdata(:),ydata(:) character*15, file_a,file_b integer j,jtemp,ndata real*8 rr,prob,zz write(6,*) 'Enter: ndata' read(5,*) ndata write(6,*) 'Enter: file_a' read(5,*) file_a write(6,*) file_a write(6,*) 'Enter: file_b' read(5,*) file_b write(6,*) file_b allocate(xdata(ndata),ydata(ndata)) open(11,file=file_a,form='formatted') do j=1,ndata read(11,*) jtemp,xdata(j) enddo close(11) open(21,file=file_b,form='formatted') do j=1,ndata read(21,*) jtemp,ydata(j) enddo close(21) call pearsn(xdata,ydata,ndata,rr,prob,zz) write(6,*) rr,rr**2, ' r, r^2' write(6,*) prob, ' prob' write(6,*) zz, ' z' deallocate(xdata,ydata) STOP END Linear correlation -1.1 :

53 implicit none integer j, k,i real*8 tmp real cpu_diff real cpu_time1 real cpu_time2 real ( kind = 8 ) real_diff real ( kind = 8 ) real_time1 real ( kind = 8 ) real_time2 call cpu_time (cpu_time1 )! call real_time ( real_time1 ) tmp=0.0d0 do i=1,1000 do j=1,1000 do k=1,100 tmp=tmp+sin(float(j*i))*cos(float(i*j)) enddo enddo enddo ihlee@cetus0:~/lecture_programming$ a.out FORTRAN STOP ihlee@cetus0:~/lecture_programming$ ihlee@cetus0:~/lecture_programming$ time a.out FORTRAN STOP real 0m16.031s user 0m16.028s sys 0m0.001s ihlee@cetus0:~/lecture_programming$ call cpu_time ( cpu_time2 )! call real_time ( real_time2 ) cpu_diff = cpu_time2 - cpu_time1! real_diff = real_time2 - real_time1 write(6,*) cpu_diff! write(6,*) real_diff stop end :

54 subroutine timestamp ( )!*****************************************************************************80!!! TIMESTAMP prints the current YMDHMS date as a time stamp.!!example:!! May :45: AM!! Modified:!! 31 May 2001!! Author:!! John Burkardt!! Parameters:!! None! implicit none character ( len = 8 ) ampm integer d character ( len = 8 ) date integer h integer m integer mm character ( len = 9 ), parameter, dimension(12) :: month = (/ & 'January ', 'February ', 'March ', 'April ', & 'May ', 'June ', 'July ', 'August ', & 'September', 'October ', 'November ', 'December ' /) integer n integer s character ( len = 10 ) time integer values(8) integer y character ( len = 5 ) zone call date_and_time ( date, time, zone, values ) y = values(1) m = values(2) d = values(3) h = values(5) n = values(6) s = values(7) mm = values(8) if ( h < 12 ) then ampm = 'AM' else if ( h == 12 ) then if ( n == 0.and. s == 0 ) then ampm = 'Noon' else ampm = 'PM' end if else h = h - 12 if ( h < 12 ) then ampm = 'PM' else if ( h == 12 ) then if ( n == 0.and. s == 0 ) then ampm = 'Midnight' else ampm = 'AM' end if end if end if! implicit none call timestamp() stop end March :58: PM FORTRAN STOP write ( *, '(a,1x,i2,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) & trim ( month(m) ), d, y, h, ':', n, ':', s, '.', mm, trim ( ampm ) return end :

55 subroutine lbfgs_mini(object,posi,grad,nn)! Written by In-Ho Lee, KRISS, March 3 (2003). implicit none integer nn real*8 object,posi(nn),grad(nn) integer n_local,m,msave real*8, allocatable :: diag(:),w(:) real*8 eps,xtol,gtol,t1,t2,stpmin,stpmax integer iprint(2),iflag,icall,mp,lp,nwork integer jnatom,j logical diagco real*8, allocatable :: xyz(:,:),fxyz(:,:)! The driver for LBFGS must always declare LB2 as EXTERNAL external lb2 common /lb3/mp,lp,gtol,stpmin,stpmax n_local=nn m=5 ; msave=7 ; nwork=n_local*(2*msave+1)+2*msave allocate(diag(n_local),w(nwork)) iprint(1)= 1 ; iprint(2)= 0!! We do not wish to provide the diagonal matrices Hk0, and! therefore set DIAGCO to FALSE. diagco=.false. ; eps= 1.0d-4 ; xtol= 1.0d-16 ; icall=0 ; iflag=0! jnatom=nn/3 allocate(xyz(jnatom,3),fxyz(jnatom,3))! 20 continue do j=1,jnatom xyz(j,1)=posi(3*(j-1)+1) xyz(j,2)=posi(3*(j-1)+2) xyz(j,3)=posi(3*(j-1)+3) enddo call energy_force(xyz,fxyz,object,jnatom) do j=1,jnatom grad(3*(j-1)+1)=-fxyz(j,1) grad(3*(j-1)+2)=-fxyz(j,2) grad(3*(j-1)+3)=-fxyz(j,3) enddo! call lbfgs(n_local,m,posi,object,grad,diagco,diag,iprint,eps,xtol,w,iflag) if(iflag <= 0) go to 50 icall=icall + 1! We allow at most 2000 evaluations of Function and Gradient if(icall > 2000) go to 50 go to continue deallocate(diag,w) deallocate(xyz,fxyz) return end ( ) 2 1 lbfgs Gradient, function : :

56 ! implicit none integer nm,n,matz,ierr real*8, allocatable :: ar(:,:),ai(:,:),w(:),zr(:,:),zi(:,:),fv1(:),fv2(:),fm1(:,:) real*8 tmp integer i,j,k matz=0 matz=1 nm=3 n=nm open(1,file='input',form='formatted') read(1,*) n close(1) write(6,*) n,' n' allocate(ar(nm,n),ai(nm,n),w(n),zr(nm,n),zi(nm,n),fv1(n),fv2(n),fm1(2,n)) do i=1,n do j=1,i! lower-triangular-form.!------[ set up the hermitian matrix : lower triangular form ar(i,j)=dfloat(i+j)**2 ai(i,j)=1.d0/dfloat(i-j)!------] if(i == j) ai(i,j)=0.0d0 hermitian enddo enddo do i=1,n do j=1,i ar(j,i)=ar(i,j) ai(j,i)=-ai(i,j) enddo enddo call ch(nm,n,ar,ai,w,matz,zr,zi,fv1,fv2,fm1,ierr) write(6,*) 'eigenvalues' do i=1,n write(6,*) w(i) enddo write(6,*) 'eigenvectors' do j=1,n write(6,*) (dcmplx(zr(k,j),zi(k,j)),k=1,n) enddo do i=1,n do j=1,n tmp=0.0d0 do k=1,n tmp=tmp+dcmplx(zr(k,i),-zi(k,i))*dcmplx(zr(k,j),zi(k,j)) enddo write(6,*) i,j,tmp enddo enddo deallocate(ar,ai,w,zr,zi,fv1,fv2,fm1)!. stop end Matrix diagonalization( )

57 ! implicit none integer i,j,k character*32 filename character*4 fn integer nsize nsize=4 do j=0,3 call numeral (j,fn,nsize) write(6,*) fn filename=' del'//fn write(6,*) filename! call system("cp admd.seq"//filename) end do stop end a.out 0000 del del del del0003 FORTRAN STOP :

58 ! implicit none integer i,j,k character*32 subcommand character*32 subcommand2 character*4 fn character*9 fm integer nsize nsize=4 do j=0,3 call numeral (j,fn,nsize) write(6,*) fn fm=' admd'//fn subcommand=fm//'.pdb' write(6,*) subcommand! call system("cp admd.pdb"//subcommand) subcommand2=fm//'.dssp' subcommand2=trim(subcommand)//fm//'.dssp' write(6,*) subcommand2! call system("~/dssp/dsspcmbi "//subcommand2) end do stop end :

59 MODULE cartesian TYPE point REAL :: x, y END TYPE point INTERFACE OPERATOR (.DIST. ) MODULE PROCEDURE dist END INTERFACE CONTAINS REAL FUNCTION dist( a, b ) TYPE(point), INTENT(IN) :: a, b dist = SQRT( (a%x-b%x)**2 + (a%y-b%y)**2 ) END FUNCTION dist END MODULE cartesian ihlee@cetus0:~/lecture_programming$ a.out FORTRAN STOP ihlee@cetus0:~/lecture_programming$ program over2 USE cartesian IMPLICIT NONE TYPE(point) :: a, b REAL distance a%x=0.0d0 a%y=0.0d0 b%x=1.0d0 b%y=1.0d0 distance = a.dist. b write(6,*) distance stop end program over2

60 MODULE cartesian TYPE point REAL*8 :: x, y, z END TYPE point INTERFACE OPERATOR (.DIST. ) MODULE PROCEDURE dist END INTERFACE CONTAINS REAL*8 FUNCTION dist( a, b ) TYPE(point), INTENT(IN) :: a, b dist = SQRT( (a%x-b%x)**2 + (a%y-b%y)**2 + (a%z-b%z)**2 ) END FUNCTION dist END MODULE cartesian program over2 USE cartesian IMPLICIT NONE TYPE(point) :: a, b REAL*8 distance a%x=0.0d0 a%y=0.0d0 a%z=0.0d0 b%x=1.0d0 b%y=1.0d0 b%z=1.0d0 ihlee@cetus0:~/lecture_programming$ a.out FORTRAN STOP ihlee@cetus0:~/lecture_programming$ TYPE COORDS_3D REAL :: x, y, z END TYPE COORDS_3D TYPE(COORDS_3D) :: pt1, pt2 distance = a.dist. b write(6,*) distance stop end program over2

61 MODULE cartesian TYPE point REAL*8 :: x, y END TYPE point INTERFACE ASSIGNMENT( = ) MODULE PROCEDURE max_point END INTERFACE CONTAINS SUBROUTINE max_point( a, pt ) REAL*8, INTENT(OUT) :: a TYPE(point), INTENT(IN) :: pt a = MAX( pt%x, pt%y ) END SUBROUTINE max_point END MODULE cartesian ihlee@cetus0:~/lecture_programming$ a.out FORTRAN STOP ihlee@cetus0:~/lecture_programming$ program over4 USE cartesian IMPLICIT NONE TYPE(point) :: a = point(1.7d0, 4.2d0) REAL*8 :: coord coord = a write(6,*) coord stop end program over4

62 PROGRAM test INTERFACE REAL*8 FUNCTION ratio(x, y) REAL*8 ::x, y END FUNCTION ratio END INTERFACE ihlee@cetus0:~/lecture_programming$ a.out The ratio is ihlee@cetus0:~/lecture_programming$ INTEGER :: i=3, j=25 PRINT *,'The ratio is ',ratio(dfloat(i),dfloat(j)) END PROGRAM test REAL*8 FUNCTION ratio(x, y) REAL*8 :: x, y ratio=x/y END FUNCTION ratio

63 PROGRAM test!interface! REAL*8 FUNCTION ratio(x, y)! REAL*8 ::x, y! END FUNCTION ratio!end INTERFACE a.out The ratio is INTEGER :: i=3, j=25 real*8 ratio PRINT *,'The ratio is ',ratio(dfloat(i),dfloat(j)) END PROGRAM test REAL*8 FUNCTION ratio(x, y) REAL*8 :: x, y ratio=x/y END FUNCTION ratio Procedure interface.

64 SUBROUTINE invert(a, inverse, count) REAL, INTENT(IN) :: a REAL, INTENT(OUT) :: inverse INTEGER, INTENT(INOUT) :: count inverse = 1/a count = count+1 END SUBROUTINE invert PROGRAM test INTERFACE REAL FUNCTION func( x ) REAL, INTENT(IN) ::x END FUNCTION func END INTERFACE... CALL sub1( a, b, func(2) )... END PROGRAM test REAL FUNCTION func( x )! external REAL, INTENT(IN) :: x func = 1/x END FUNCTION func

65 MODULE strings INTERFACE OPERATOR ( / ) MODULE PROCEDURE num END INTERFACE CONTAINS INTEGER FUNCTION num( s, c ) CHARACTER(len=*), INTENT(IN) :: s CHARACTER, INTENT(IN) :: c num = 0 DO i=1,len( s ) IF( s(i:i)==c ) num=num+1 END DO END FUNCTION num END MODULE strings program ov1 USE strings implicit none character*32, ch1,ch2,ch3 integer ii,jj,kk ihlee@cetus0:~/lecture_programming$ a.out FORTRAN STOP ihlee@cetus0:~/lecture_programming$ Operator overloading ch1='hello world' ch2='my name is in-ho lee' ch3='who are you' ii = ch1/'l' jj = ch2/'o' kk = ch3/'a' write(6,*) ii write(6,*) jj write(6,*) kk stop end program ov1

66 MODULE SWAPPER INTERFACE SWAP MODULE PROCEDURE SWAP_R, SWAP_I, SWAP_C END INTERFACE CONTAINS SUBROUTINE SWAP_R(A, B) IMPLICIT NONE REAL, INTENT (INOUT) :: A, B REAL :: TEMP TEMP = A ; A = B ; B = TEMP END SUBROUTINE SWAP_R ihlee@cetus0:~/lecture_programming$ a.out ab1" ba"1 ihlee@cetus0:~/lecture_programming$ SUBROUTINE SWAP_I(A, B) IMPLICIT NONE INTEGER, INTENT (INOUT) :: A, B INTEGER :: TEMP TEMP = A ; A = B ; B = TEMP END SUBROUTINE SWAP_I SUBROUTINE SWAP_C(A, B) IMPLICIT NONE CHARACTER, INTENT (INOUT) :: A, B CHARACTER :: TEMP TEMP = A ; A = B ; B = TEMP END SUBROUTINE SWAP_C END MODULE SWAPPER PROGRAM SWAP_MAIN USE SWAPPER IMPLICIT NONE INTEGER :: I, J, K, L REAL :: A, B, X, Y CHARACTER :: C, D, E, F I = 1 ; J = 2 ; K = 100 ; L = 200 A = 7.1 ; B = 10.9 ; X = 11.1; Y = 17.0 C = 'a' ; d = 'b' ; E = '1' ; F = '"' WRITE (*,*) I, J, K, L, A, B, X, Y, C, D, E, F CALL SWAP (I, J) ; CALL SWAP (K, L) CALL SWAP (A, B) ; CALL SWAP (X, Y) CALL SWAP (C, D) ; CALL SWAP (E, F) WRITE (*,*) I, J, K, L, A, B, X, Y, C, D, E, F END

67 Derived Type TYPE COORDS_3D REAL :: x, y, z END TYPE COORDS_3D TYPE(COORDS_3D) :: pt1, pt2 TYPE SPHERE TYPE (COORDS_3D) :: centre REAL :: radius END TYPE SPHERE TYPE (SPHERE) :: bubble, ball pt1%x = 1.0 bubble%radius = 3.0 bubble%centre%x = 1.0 pt1 = COORDS_3D(1.,2.,3.) bubble%centre = COORDS_3D(1.,2.,3.) bubble = SPHERE(bubble%centre,10.) bubble = SPHERE(COORDS_3D(1.,2.,3.),10.)

68 Multiple Precision Computation. 2**200 = (prime number)? The same example using derived types:... USE FMZM TYPE ( FM ) A,B,C,D... D = SQRT( A**2 + B**2 + C**2 )...

69 References pdf Pointer to everything Fortran Pointer to a list of tutorials Cray's Manual Short optimization guide from IBM DEC's Digital Visual Fortran Page ftp://mycroft.plk.af.mil/pub/fortran_90/tutorial A tutorial by Zane Dodson Postscript plotting library Subroutines to do unformatted I/O across platforms, provided by David Pierce at UCSD A good reference for intrinsic functions Fortran 90 for the Fortran 77 Programmer

70 (?)

71 Very-high-level language (shell) (very-high-level language). (.). (!). (; ; object-oriented)..... No compile Monty Python's Flying Circus. No type declarations No memory allocation control High level data structure : (Guido van Rossum)

72 . (dynamic typing),., (),,. (glue language)..,. (dynamic typing). (.).,,. ("Battery Included"),.. (MS windows,,,.,.)! :

73 Python Control-d exit(). python Python (#2, Oct , 19:59:54) [GCC (Debian 1: )] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print "Hello world" python Python (#2, Oct , 19:59:54) [GCC (Debian 1: )] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a=1. ; b=2.d0 File "<stdin>", line 1 a=1. ; b=2.d0 ^ SyntaxError: invalid syntax >>> a=1 ; b=2. >>> c=a+b >>> print c 3.0 >>> bc l. quit. ihlee@cetus0:~$ bc -l bc 1.06 Copyright , 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 12.* quit ihlee@cetus0:~$

74 * (indentation) python.! *# comment. ``. * \.) "". * (,,,. *. #!/usr/bin/env python. * "def" ":".. if for. *for i in range(100): i 0 0,1,2,3,4,...99 for loop 100. range range(1,101) i. range(10) ( ). [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] *FORTRAN 90.. * return.,... return. return a,b,c,d. a, b 1, c 2 ( ) d.. abcd() aa,bb,cc,dd=abcd().

75 #!/usr/bin/env python #from Numeric import * #from string import atof,atoi,split #from posix import getpid,rename,remove,mkdir,rmdir,system #from shutil import copyfile #import os,sys,time,random version ="1.0.0" counter=0 acc = 0 for n in xrange(1, ): num1 = str(n).count('5') if num1 > 0 : acc = acc+num1 if acc == n: counter=counter+1 print "counter = ",counter,n if counter == 2 : break,. chmod 755 abc.py

76 system( )... ` `;? CALL SYSTEM('application.py'). call system. ( ).... : / == call system('python_driver.py') ==. : / ==

77 sad.x 2000.,.. for i in range(2000): # 2000 gen_sad_input() # sad.i system('sad.x >TMPFILE') # sad.x copyfile('dim.dat', ascnum('dimer.',i)) copyfile('mid.xyz', ascnum_xyz('midpt.',i)) # system('rm dim.dat') # system('rm TMPFILE') os.path.exists >>> from os import * >>> system('ls') abc.py HFB PBS_script_examples tr.py action_protein_draco JOB_ID_PRINTED swkim_mpi VASP_example admd_cluster matplot_test test v_tubes dssp onion test1 ykm 0 >>> system(), system('qsub work.0003/pbs_script_file') pbs. j=3 ; f_name=ascnum('work.',j)+'/pbs_script_file' ; system('qsub '+f_name+'') import glob,time import os.path file_list=glob.glob('*') for f_name in file_list: if os.path.isfile(f_name): print f_name,' is a regular file' print os.path.getsize(f_name) print os.path.getatime(f_name) print time.ctime(os.path.getatime(f_name)) elif os.path.isdir(f_name): print f_name,' is a directory' elif os.path.islink(f_name): print f_name,' is a symbolic link'

78 #!/usr/bin/env python faren_old = float(raw_input("enter yesterday's temperature ")) faren_new = float(raw_input("enter today's temperature ")) if faren_new > 90 and faren_old < 90: print "First day of a heatwave" elif faren_new > 90: print "Subsequent day of a heatwave" elif faren_old < 90: print "Not the hot season" else: print "Bye, bye heatwave" print "Program completed" >>> raw_input() 3 '3' >>> input() 4 4 ihlee@cetus0:~/lecture_programming$ py1.py Enter yesterday's temperature 99 Enter today's temperature 98. Subsequent day of a heatwave Program completed ihlee@cetus0:~/lecture_programming$

79 phi_trj=[[0.]*(iidd) for j in xrange(np+1)] psi_trj=[[0.]*(iidd) for j in xrange(np+1)] for ifile in range(0,np+1): tmp_file=asc2num('rama',ifile)+'.txt' fp_rama=open(tmp_file,'r') jth=0 while 1: line=fp_rama.readline() if not line : break else: token=line.split() phi_trj[ifile][jth]=float(token[0]) psi_trj[ifile][jth]=float(token[1]) jth=jth+1 fp_rama.close()

80 def wwait(file_name): while 1 : time.sleep(60.) if os.path.exists(file_name) : remove(file_name) break return # 60 # def mkdir_series(n_dir): for j in range(n_dir): char=ascnum('test_dir.',j) # test_dir.0001 n_dir mkdir(char) return touch abcd

81 #!/usr/bin/env python from Numeric import * from string import atof,atoi,split from posix import getpid,rename,remove,mkdir,rmdir,system from shutil import copyfile import os,sys,time,random version ="1.0.0" if name == " main ": # # *.bin # convert.x #. convert.x "convert.x test.bin test". # # yeskim98, March/26/2003 # system('ls *.bin >namelist') # f=open('namelist','r') for line in f: name=line.split()[0] name1=name[:-4] # 4 system('./convert.x '+name+' '+name1+'') f.close()

82 #!/usr/bin/env python from Numeric import * # from string import atof,atoi,split from posix import getpid,rename,remove,mkdir,rmdir,system from shutil import copyfile import os,sys,time,random version ="1.0.0" def prtjobid(): # written by In-Ho Lee, KRISS, Jan. 12, f=open('job_id_printed','w') f.write('%15d \n' % os.getpid()) # st=time.asctime() # f.write('%23s \n' % st) f.close() return def num2char(i): # ic=str(i) ic='0' if i == 1 : ic='1' if i == 2 : ic='2' if i == 3 : ic='3' if i == 4 : ic='4' if i == 5 : ic='5' if i == 6 : ic='6' if i == 7 : ic='7' if i == 8 : ic='8' if i == 9 : ic='9' return ic def ascnum(ichar,number): # written by In-Ho Lee, KRISS, Jan. 12, i=int(float(number)/1000.) j=int((number-i*1000.)/100.) k=int((number-j*100.-i*1000.)/10.) l=int(number-k*10.-j*100.-i*1000.) ic=num2char(i) jc=num2char(j) kc=num2char(k) lc=num2char(l) fname=ichar+ic+jc+kc+lc # abc.0001 return fname ihlee@cetus0:~/lecture_programming$ num.py abc0000.xyz abc0001.xyz abc0002.xyz abc0003.xyz abc0004.xyz abc0005.xyz abc0006.xyz abc0007.xyz abc0008.xyz abc0009.xyz ihlee@cetus0:~/lecture_programming$ >>> a=1 >>> b=str(a).zfill(4) >>> print b 0001 >>> c=str(a).zfill(5) >>> print c >>> c=str(c) >>> print c >>> >>> from string import * >>> a=1 >>> b=str(a) >>> print b 1 >>> a=1.e0 >>> c=str(222) >>> a=complex(a) >>> print c >>> print a 222 (1+0j) >>> >>> def ascnum_xyz(ichar,number): # written by In-Ho Lee, KRISS, Jan. 12, fname=ascnum(ichar,number)+'.xyz' # abc.0001.xyz return fname prtjobid() ichar='abc' for i in range(10): print ascnum_xyz(ichar,i) >>> print atof(c) >>> print atoi(c) 222 >>> print float(c) >>> print int(c) 222

83 Prime number? #!/usr/bin/env python for i in range(2,10): for x in range(2,i): if i % x == 0 : print i, 'equals', x, '*', i/x break else: print i, 'is a prime number' ihlee@cetus0:~/lecture_programming$ prime.py 3 is a prime number 4 equals 2 * 2 5 is a prime number 5 is a prime number 5 is a prime number 6 equals 2 * 3 7 is a prime number 7 is a prime number 7 is a prime number 7 is a prime number 7 is a prime number 8 equals 2 * 4 9 is a prime number 9 equals 3 * 3 ihlee@cetus0:~/lecture_programming$

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf(hihi\n); } warning: conflicting types for functiona 이름 : 학번 : A. True or False: 각각항목마다 True 인지 False 인지적으세요. 1. (Python:) randint 함수를사용하려면, random 모듈을 import 해야한다. 2. (Python:) '' (single quote) 는한글자를표현할때, (double quote) 는문자열을표현할때사용한다. B. 다음에러를수정하는방법을적으세요.

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어 개나리 연구소 C 언어 노트 (tyback.egloos.com) 프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어먹고 하더라구요. 그래서,

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

K&R2 Reference Manual 번역본

K&R2 Reference Manual 번역본 typewriter structunion struct union if-else if if else if if else if if if if else else ; auto register static extern typedef void char short int long float double signed unsigned const volatile { } struct

More information

물리학자를 위한 포트란 90

물리학자를 위한 포트란 90 물리학자를 위한 FORTRAN90 이인호 ihlee@kriss.re.kr 한국표준과학연구원 2003년 2월 23일 출발 FORTRAN (FORmula TRANslation, 포트란)이란 무엇인가? 포트란은 엔지니어, 이공학자 및 기타 다른 과학적 알고리즘의 제작자나 사용자들을 위해 설계된 3세대 프로 그래밍 언어이다. 1950년대 말에 IBM의 John Backus에

More information

C++-¿Ïº®Çؼ³10Àå

C++-¿Ïº®Çؼ³10Àå C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include

More information

Microsoft PowerPoint - 기계공학실험1-1MATLAB_개요2D.pptx

Microsoft PowerPoint - 기계공학실험1-1MATLAB_개요2D.pptx 1. MATLAB 개요와 활용 기계공학실험 I 2013년 2학기 MATLAB 시작하기 이장의내용 MATLAB의여러창(window)들의 특성과 목적 기술 스칼라의 산술연산 및 기본 수학함수의 사용. 스칼라 변수들(할당 연산자)의 정의 및 변수들의 사용 방법 스크립트(script) 파일에 대한 소개와 간단한 MATLAB 프로그램의 작성, 저장 및 실행 MATLAB의특징

More information

Microsoft PowerPoint - PL_03-04.pptx

Microsoft PowerPoint - PL_03-04.pptx Copyright, 2011 H. Y. Kwak, Jeju National University. Kwak, Ho-Young http://cybertec.cheju.ac.kr Contents 1 프로그래밍 언어 소개 2 언어의 변천 3 프로그래밍 언어 설계 4 프로그래밍 언어의 구문과 구현 기법 5 6 7 컴파일러 개요 변수, 바인딩, 식 및 제어문 자료형 8

More information

07.... 01V28.

07.... 01V28. National Election Commission 9 September S M T W T F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23/30 24 25 26 27 28 29 11 November S M T W T F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

More information

6자료집최종(6.8))

6자료집최종(6.8)) Chapter 1 05 Chapter 2 51 Chapter 3 99 Chapter 4 151 Chapter 1 Chapter 6 7 Chapter 8 9 Chapter 10 11 Chapter 12 13 Chapter 14 15 Chapter 16 17 Chapter 18 Chapter 19 Chapter 20 21 Chapter 22 23 Chapter

More information

Week5

Week5 Week 05 Iterators, More Methods and Classes Hash, Regex, File I/O Joonhwan Lee human-computer interaction + design lab. Iterators Writing Methods Classes & Objects Hash File I/O Quiz 4 1. Iterators Array

More information

untitled

untitled Push... 2 Push... 4 Push... 5 Push... 13 Push... 15 1 FORCS Co., LTD A Leader of Enterprise e-business Solution Push (Daemon ), Push Push Observer. Push., Observer. Session. Thread Thread. Observer ID.

More information

해양모델링 2장5~18 2012.7.27 12:26 AM 페이지6 6 오픈소스 소프트웨어를 이용한 해양 모델링 2.1.2 물리적 해석 식 (2.1)의 좌변은 어떤 물질의 단위 시간당 변화율을 나타내며, 우변은 그 양을 나타낸 다. k 5 0이면 C는 처음 값 그대로 농

해양모델링 2장5~18 2012.7.27 12:26 AM 페이지6 6 오픈소스 소프트웨어를 이용한 해양 모델링 2.1.2 물리적 해석 식 (2.1)의 좌변은 어떤 물질의 단위 시간당 변화율을 나타내며, 우변은 그 양을 나타낸 다. k 5 0이면 C는 처음 값 그대로 농 해양모델링 2장5~18 2012.7.27 12:26 AM 페이지5 02 모델의 시작 요약 이 장에서는 감쇠 문제를 이용하여 여러분을 수치 모델링 세계로 인도한다. 유한 차분법 의 양해법과 음해법 그리고 일관성, 정확도, 안정도, 효율성 등을 설명한다. 첫 번째 수치 모델의 작성과 결과를 그림으로 보기 위해 FORTRAN 프로그램과 SciLab 스크립트가 사용된다.

More information

6주차.key

6주차.key 6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running

More information

untitled

untitled Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II

More information

T100MD+

T100MD+ User s Manual 100% ) ( x b a a + 1 RX+ TX+ DTR GND TX+ RX+ DTR GND RX+ TX+ DTR GND DSR RX+ TX+ DTR GND DSR [ DCE TYPE ] [ DCE TYPE ] RS232 Format Baud 1 T100MD+

More information

SIGPLwinterschool2012

SIGPLwinterschool2012 1994 1992 2001 2008 2002 Semantics Engineering with PLT Redex Matthias Felleisen, Robert Bruce Findler and Matthew Flatt 2009 Text David A. Schmidt EXPRESSION E ::= N ( E1 O E2 ) OPERATOR O ::=

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

歯엑셀모델링

歯엑셀모델링 I II II III III I VBA Understanding Excel VBA - 'VB & VBA In a Nutshell' by Paul Lomax, October,1998 To enter code: Tools/Macro/visual basic editor At editor: Insert/Module Type code, then compile by:

More information

chap10.PDF

chap10.PDF 10 C++ Hello!! C C C++ C++ C++ 2 C++ 1980 Bell Bjarne Stroustrup C++ C C++ C, C++ C C 3 C C++ (prototype) (type checking) C C++ : C++ 4 C C++ (prototype) (type checking) [ 10-1] #include extern

More information

4 CD Construct Special Model VI 2 nd Order Model VI 2 Note: Hands-on 1, 2 RC 1 RLC mass-spring-damper 2 2 ζ ω n (rad/sec) 2 ( ζ < 1), 1 (ζ = 1), ( ) 1

4 CD Construct Special Model VI 2 nd Order Model VI 2 Note: Hands-on 1, 2 RC 1 RLC mass-spring-damper 2 2 ζ ω n (rad/sec) 2 ( ζ < 1), 1 (ζ = 1), ( ) 1 : LabVIEW Control Design, Simulation, & System Identification LabVIEW Control Design Toolkit, Simulation Module, System Identification Toolkit 2 (RLC Spring-Mass-Damper) Control Design toolkit LabVIEW

More information

Java

Java Java http://cafedaumnet/pway Chapter 1 1 public static String format4(int targetnum){ String strnum = new String(IntegertoString(targetNum)); StringBuffer resultstr = new StringBuffer(); for(int i = strnumlength();

More information

4.18.국가직 9급_전산직_컴퓨터일반_손경희_ver.1.hwp

4.18.국가직 9급_전산직_컴퓨터일반_손경희_ver.1.hwp 2015년도 국가직 9급 컴퓨터 일반 문 1. 시스템 소프트웨어에 포함되지 않는 것은? 1 1 스프레드시트(spreadsheet) 2 로더(loader) 3 링커(linker) 4 운영체제(operating system) - 시스템 소프트웨어 : 운영체제, 데이터베이스관리 프로그램,, 컴파일러, 링커, 로더, 유틸리티 소프트웨 어 등 - 스프레드시트 : 일상

More information

Orcad Capture 9.x

Orcad Capture 9.x OrCAD Capture Workbook (Ver 10.xx) 0 Capture 1 2 3 Capture for window 4.opj ( OrCAD Project file) Design file Programe link file..dsn (OrCAD Design file) Design file..olb (OrCAD Library file) file..upd

More information

Columns 8 through while expression {commands} 예제 1.2 (While 반복문의이용 ) >> num=0

Columns 8 through while expression {commands} 예제 1.2 (While 반복문의이용 ) >> num=0 for loop array {commands} 예제 1.1 (For 반복변수의이용 ) >> data=[3 9 45 6; 7 16-1 5] data = 3 9 45 6 7 16-1 5 >> for n=data x=n(1)-n(2) -4-7 46 1 >> for n=1:10 x(n)=sin(n*pi/10); n=10; >> x Columns 1 through 7

More information

13주-14주proc.PDF

13주-14주proc.PDF 12 : Pro*C/C++ 1 2 Embeded SQL 3 PRO *C 31 C/C++ PRO *C NOT! NOT AND && AND OR OR EQUAL == = SQL,,, Embeded SQL SQL 32 Pro*C C SQL Pro*C C, C Pro*C, C C 321, C char : char[n] : n int, short, long : float

More information

slide2

slide2 Program P ::= CL CommandList CL ::= C C ; CL Command C ::= L = E while E : CL end print L Expression E ::= N ( E + E ) L &L LefthandSide L ::= I *L Variable I ::= Numeral N ::=

More information

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for 2003 Development of the Software Generation Method using Model Driven Software Engineering Tool,,,,, Hoon-Seon Chang, Jae-Cheon Jung, Jae-Hack Kim Hee-Hwan Han, Do-Yeon Kim, Young-Woo Chang Wang Sik, Moon

More information

슬라이드 1

슬라이드 1 / 유닉스시스템개요 / 파일 / 프로세스 01 File Descriptor file file descriptor file type unix 에서의파일은단지바이트들의나열임 operating system 은파일에어떤포맷도부과하지않음 파일의내용은바이트단위로주소를줄수있음 file descriptor 는 0 이나양수임 file 은 open 이나 creat 로 file

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

휠세미나3 ver0.4

휠세미나3 ver0.4 andromeda@sparcs:/$ ls -al dev/sda* brw-rw---- 1 root disk 8, 0 2014-06-09 18:43 dev/sda brw-rw---- 1 root disk 8, 1 2014-06-09 18:43 dev/sda1 brw-rw---- 1 root disk 8, 2 2014-06-09 18:43 dev/sda2 andromeda@sparcs:/$

More information

歯9장.PDF

歯9장.PDF 9 Hello!! C printf() scanf() getchar() putchar() gets() puts() fopen() fclose() fprintf() fscant() fgetc() fputs() fgets() gputs() fread() fwrite() fseek() ftell() I/O 2 (stream) C (text stream) : `/n'

More information

03장.스택.key

03장.스택.key ---------------- DATA STRUCTURES USING C ---------------- 03CHAPTER 1 ? (stack): (LIFO:Last-In First-Out) 2 : top : ( index -1 ),,, 3 : ( ) ( ) -> ->. ->.... 4 Stack ADT : (LIFO) : init():. is_empty():

More information

Sena Technologies, Inc. HelloDevice Super 1.1.0

Sena Technologies, Inc. HelloDevice Super 1.1.0 HelloDevice Super 110 Copyright 1998-2005, All rights reserved HelloDevice 210 ()137-130 Tel: (02) 573-5422 Fax: (02) 573-7710 E-Mail: support@senacom Website: http://wwwsenacom Revision history Revision

More information

01-OOPConcepts(2).PDF

01-OOPConcepts(2).PDF Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)

More information

예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = B = >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = >> tf = (A==B) % A

예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = B = >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = >> tf = (A==B) % A 예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = 1 2 3 4 5 6 7 8 9 B = 8 7 6 5 4 3 2 1 0 >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = 0 0 0 0 1 1 1 1 1 >> tf = (A==B) % A 의원소와 B 의원소가똑같은경우를찾을때 tf = 0 0 0 0 0 0 0 0 0 >> tf

More information

Microsoft Word - ExecutionStack

Microsoft Word - ExecutionStack Lecture 15: LM code from high level language /* Simple Program */ external int get_int(); external void put_int(); int sum; clear_sum() { sum=0; int step=2; main() { register int i; static int count; clear_sum();

More information

DE1-SoC Board

DE1-SoC Board 실습 1 개발환경 DE1-SoC Board Design Tools - Installation Download & Install Quartus Prime Lite Edition http://www.altera.com/ Quartus Prime (includes Nios II EDS) Nios II Embedded Design Suite (EDS) is automatically

More information

5.스택(강의자료).key

5.스택(강의자료).key CHP 5: https://www.youtube.com/watch?v=ns-r91557ds ? (stack): (LIFO:Last-In First-Out):. D C B C B C B C B (element) C (top) B (bottom) (DT) : n element : create() ::=. is_empty(s) ::=. is_full(s) ::=.

More information

지속가능경영보고서도큐_전체

지속가능경영보고서도큐_전체 C o n t e n t s 03 06 07 10 30 38 43 55 56 60 62 70 71 Korea Foundation for Women Annual Report 2010 SLOGAN VISION 2 3 MISSION 1 MISSION 3 MISSION 2 4 5 Korea Foundation for Women Annual Report 2010 Korea

More information

초보자를 위한 C# 21일 완성

초보자를 위한 C# 21일 완성 C# 21., 21 C#., 2 ~ 3 21. 2 ~ 3 21.,. 1~ 2 (, ), C#.,,.,., 21..,.,,, 3. A..,,.,.. Q&A.. 24 C#,.NET.,.,.,. Visual C# Visual Studio.NET,..,. CD., www. TeachYour sel f CSharp. com., ( )., C#.. C# 1, 1. WEEK

More information

<B3EDB9AEC1FD5F3235C1FD2E687770>

<B3EDB9AEC1FD5F3235C1FD2E687770> 경상북도 자연태음악의 소박집합, 장단유형, 전단후장 경상북도 자연태음악의 소박집합, 장단유형, 전단후장 - 전통 동요 및 부녀요를 중심으로 - 이 보 형 1) * 한국의 자연태 음악 특성 가운데 보편적인 특성은 대충 밝혀졌지만 소박집합에 의한 장단주기 박자유형, 장단유형, 같은 층위 전후 구성성분의 시가( 時 價 )형태 등 은 밝혀지지 않았으므로

More information

IASB( ) IASB (IASB ),, ( ) [] IASB( ), IASB 1

IASB( ) IASB (IASB ),, ( ) [] IASB( ), IASB 1 IASB( ) IASB (IASB ),, 2007 8 31 ( ) [] IASB( ), IASB 1 ,,,,,,,, 2 IASB IFRS(International Financial Reporting Standards) IASB, IASB IASC(International Accounting Standards Committee) IAS(International

More information

본문01

본문01 Ⅱ 논술 지도의 방법과 실제 2. 읽기에서 논술까지 의 개발 배경 읽기에서 논술까지 자료집 개발의 본래 목적은 초 중 고교 학교 평가에서 서술형 평가 비중이 2005 학년도 30%, 2006학년도 40%, 2007학년도 50%로 확대 되고, 2008학년도부터 대학 입시에서 논술 비중이 커지면서 논술 교육은 학교가 책임진다. 는 풍토 조성으로 공교육의 신뢰성과

More information

CD-RW_Advanced.PDF

CD-RW_Advanced.PDF HP CD-Writer Program User Guide - - Ver. 2.0 HP CD-RW Adaptec Easy CD Creator Copier, Direct CD. HP CD-RW,. Easy CD Creator 3.5C, Direct CD 3.0., HP. HP CD-RW TEAM ( 02-3270-0803 ) < > 1. CD...3 CD...5

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 4 (Object) (Class) (Instance) (Method) (Constructor) Memory 1 UML 1 @ & 1 (Real World) (Software World) @ &.. () () @ & 2 (Real World) (Software World) OOA/ Modeling Abstraction Instantiation

More information

2013........10

2013........10 06 07 04 13 14 18 22 26 28 32 36 40 44 72 86 87 88 48 80 82 90 GongGam Human Rights Law Foundation 02+03 인사글 하늘은 욕망 없는 생명을 만들지 아니하고 대지는 이름 없는 풀을 키우지 아니한다. (天不 세월과 권력과 부침에 흔들리지 않고 한국 사회에 뿌리 깊이 내린 한 그루 나무가

More information

08년요람001~016

08년요람001~016 Challenge to the Greatness, Beautiful Leader 2008 2009 06 07 JANUARY 01 JUNE 06 FEBRUARY MARCH 02 03 JULY AUGUST 07 08 APRIL MAY 04 05 SEPTEMBER OCTOBER 09 10 2008 schooling schedule 08 09 2008 schooling

More information

ºÎ·ÏB

ºÎ·ÏB B B.1 B.2 B.3 B.4 B.5 B.1 2 (Boolean algebra). 1854 An Investigation of the Laws of Thought on Which to Found the Mathematical Theories of Logic and Probabilities George Boole. 1938 MIT Claude Sannon [SHAN38].

More information

No Slide Title

No Slide Title Copyright, 2001 Multimedia Lab., CH 3. COM object (In-process server) Eun-sung Lee twoss@mmlab.net Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea 0. Contents 1.

More information

MAX+plus II Getting Started - 무작정따라하기

MAX+plus II Getting Started - 무작정따라하기 무작정 따라하기 2001 10 4 / Version 20-2 0 MAX+plus II Digital, Schematic Capture MAX+plus II, IC, CPLD FPGA (Logic) ALTERA PLD FLEX10K Series EPF10K10QC208-4 MAX+plus II Project, Schematic, Design Compilation,

More information

MPLAB C18 C

MPLAB C18 C MPLAB C18 C MPLAB C18 MPLAB C18 C MPLAB C18 C #define START, c:\mcc18 errorlevel{0 1} char isascii(char ch); list[list_optioin,list_option] OK, Cancel , MPLAB IDE User s Guide MPLAB C18 C

More information

LXR 설치 및 사용법.doc

LXR 설치 및 사용법.doc Installation of LXR (Linux Cross-Reference) for Source Code Reference Code Reference LXR : 2002512( ), : 1/1 1 3 2 LXR 3 21 LXR 3 22 LXR 221 LXR 3 222 LXR 3 3 23 LXR lxrconf 4 24 241 httpdconf 6 242 htaccess

More information

歯7장.PDF

歯7장.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

More information

歯처리.PDF

歯처리.PDF E06 (Exception) 1 (Report) : { $I- } { I/O } Assign(InFile, InputName); Reset(InFile); { $I+ } { I/O } if IOResult 0 then { }; (Exception) 2 2 (Settling State) Post OnValidate BeforePost Post Settling

More information

chap7.PDF

chap7.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

More information

Javascript.pages

Javascript.pages JQuery jquery part1 JavaScript : e-mail:leseraphina@naver.com http://www.webhard.co.kr I.? 2 ......,,. : : html5 ; ; .

More information

DIY 챗봇 - LangCon

DIY 챗봇 - LangCon without Chatbot Builder & Deep Learning bage79@gmail.com Chatbot Builder (=Dialogue Manager),. We need different chatbot builders for various chatbot services. Chatbot builders can t call some external

More information

07 자바의 다양한 클래스.key

07 자바의 다양한 클래스.key [ 07 ] . java.lang Object, Math, String, StringBuffer Byte, Short, Integer, Long, Float, Double, Boolean, Character. java.util Random, StringTokenizer Calendar, GregorianCalendar, Date. Collection, List,

More information

Solaris Express Developer Edition

Solaris Express Developer Edition Solaris Express Developer Edition : 2008 1 Solaris TM Express Developer Edition Solaris OS. Sun / Solaris, Java, Web 2.0,,. Developer Solaris Express Developer Edition System Requirements. 768MB. SPARC

More information

분 기 보 고 서 (제34기 1분기) 사업연도 2016.01.01 부터 2016.03.31 까지 금융위원회 한국거래소 귀중 2016년 5월 16일 제출대상법인 유형 : 면제사유발생 : 주권상장법인 해당사항 없음 회 사 명 : (주)웅진 대 표 이 사 : 이 재 진 본

분 기 보 고 서 (제34기 1분기) 사업연도 2016.01.01 부터 2016.03.31 까지 금융위원회 한국거래소 귀중 2016년 5월 16일 제출대상법인 유형 : 면제사유발생 : 주권상장법인 해당사항 없음 회 사 명 : (주)웅진 대 표 이 사 : 이 재 진 본 목 분 기 보 고 서...1 대표이사 등의 확인...2 I. 회사의 개요...3 1. 회사의 개요...3 2. 회사의 연혁...6 3. 자본금 변동사항...8 4. 주식의 총수 등...9 5. 의결권 현황...10 6. 배당에 관한 사항 등...10 II. 사업의 내용...12 III. 재무에 관한 사항...49 1. 요약재무정보...49 2. 연결재무제표...51

More information

HWP Document

HWP Document 만델브로트 집합은 이주 간단한 복소수 점화식 (정확히 표현하면 이나 프로그래밍 편의상 간단히 로 표현하는 것으로 한다)에서 출발한다. 에서 의 초기값을 로 하여 점화식을 계속 반복하여 계산한다. 그 결과 는 값에 따라 하나의 값으로 수렴하기도 하고, 여러 값 사이를 순환적으로 왔다 갔다 하기도 하고 카오스적인 값이 반복되기도 한다. 만델브로트 집합에서도 기본

More information

<31342D3034C0E5C7FDBFB52E687770>

<31342D3034C0E5C7FDBFB52E687770> 아카데미 토론 평가에 대한 재고찰 - 토론승패와 설득은 일치하는가 - 장혜영 (명지대) 1. 들어가는 말 토론이란 무엇일까? 토론에 대한 정의는 매우 다양하다. 안재현 과 오창훈은 토론에 대한 여러 정의들을 검토한 후 이들을 종합하 여 다음과 같이 설명하고 있다. 토론이란 주어진 주제에 대해 형 식과 절차에 따라 각자 자신의 의견을 합리적으로 주장하여 상대

More information

µðÇÃÇ¥Áö±¤°í´Ü¸é

µðÇÃÇ¥Áö±¤°í´Ü¸é Review 2 2013 JAN.FEB. vol. 23 Display Focus 3 Review 4 2013 JAN.FEB. vol. 23 Display Focus 5 Review 6 2013 JAN.FEB. vol. 23 Display Focus 7 Review 8 2013 JAN.FEB. vol. 23 Display Focus 9 Preview 2013.1

More information

Modern Javascript

Modern Javascript ES6 - Arrow Function Class Template String Destructuring Default, Rest, Spread let, const for..of Promises Module System Map, Set * Generator * Symbol * * https://babeljs.io/ Babel is a JavaScript compiler.

More information

0125_ 워크샵 발표자료_완성.key

0125_ 워크샵 발표자료_완성.key WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. WordPress is installed on a web server, which either is part of an Internet hosting service or is a network host

More information

歯메뉴얼v2.04.doc

歯메뉴얼v2.04.doc 1 SV - ih.. 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 - - - 23 24 R S T G U V W P1 P2 N R S T G U V W P1 P2 N R S T G U V W P1 P2 N 25 26 DC REACTOR(OPTION) DB UNIT(OPTION) 3 φ 220/440 V 50/60

More information

C프로-3장c03逞풚

C프로-3장c03逞풚 C h a p t e r 03 C++ 3 1 9 4 3 break continue 2 110 if if else if else switch 1 if if if 3 1 1 if 2 2 3 if if 1 2 111 01 #include 02 using namespace std; 03 void main( ) 04 { 05 int x; 06 07

More information

PL10

PL10 assert(p!=null); *p = 10; assert(0

More information

step 1-1

step 1-1 Written by Dr. In Ku Kim-Marshall STEP BY STEP Korean 1 through 15 Action Verbs Table of Contents Unit 1 The Korean Alphabet, hangeul Unit 2 Korean Sentences with 15 Action Verbs Introduction Review Exercises

More information

09-interface.key

09-interface.key 9 Database insert(record r): boolean find(key k): Record 1 Record getkey(): Key * Record Key Database.? Key equals(key y): boolean Database insert(record r): boolean find(key k): Record * Database OK 1

More information

歯111

歯111 2003. 3 4 1 Co n t e n t s 02 05 08 12 14 16 18 22 26 2 8 3 1 33 36 4 0 4 2 44 2003. 3 4 2 3 4 5 6 7 8 9 10 11 12 13 14 15 b o d y? 16 17 b o d y? 18 19 20 21 22 P h i l i p p i n e s 23 24 25 26 27 28

More information

다음 사항을 꼭 확인하세요! 도움말 안내 - 본 도움말에는 iodd2511 조작방법 및 활용법이 적혀 있습니다. - 본 제품 사용 전에 안전을 위한 주의사항 을 반드시 숙지하십시오. - 문제가 발생하면 문제해결 을 참조하십시오. 중요한 Data 는 항상 백업 하십시오.

다음 사항을 꼭 확인하세요! 도움말 안내 - 본 도움말에는 iodd2511 조작방법 및 활용법이 적혀 있습니다. - 본 제품 사용 전에 안전을 위한 주의사항 을 반드시 숙지하십시오. - 문제가 발생하면 문제해결 을 참조하십시오. 중요한 Data 는 항상 백업 하십시오. 메 뉴 다음 사항을 꼭 확인하세요! --------------------------------- 2p 안전을 위한 주의 사항 --------------------------------- 3p 구성품 --------------------------------- 4p 각 부분의 명칭 --------------------------------- 5p 제품의 규격

More information

8장 문자열

8장 문자열 8 장문자열 박창이 서울시립대학교통계학과 박창이 ( 서울시립대학교통계학과 ) 8 장문자열 1 / 24 학습내용 문자열 (string) 훑기 (traversal) 부분추출 (slicing) print 함수불변성 (immutablity) 검색 (search) 세기 (count) Method in 연산자비교 박창이 ( 서울시립대학교통계학과 ) 8 장문자열 2 /

More information

슬라이드 1

슬라이드 1 Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화 2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 1,..... @ 1 Green Project 1991 Oak Java 1995. 5 December '90 by Patrick Naughton, Mike Sheridan and James Gosling Embedded in various consumer electronic device 1992. 9. 3 Star 7 1993 www portability

More information

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not, Page 1 of 5 Learn Korean Ep. 4: To be and To exist Of course to be and to exist are different verbs, but they re often confused by beginning students when learning Korean. In English we sometimes use the

More information

2011 PLSI 병렬컴퓨팅경진대회문제 01. 대학원팀 02. 학부팀 - 경진내용 - 경진환경 주어진순차코드를병렬화하여성능향상도 ( 획득점수 ) 를측정 점수 = ( 순차코드수행시간 ) / ( 병렬화코드수행시간 ) 프로그래밍언어 : C, Fortran 순차코드는 50 라

2011 PLSI 병렬컴퓨팅경진대회문제 01. 대학원팀 02. 학부팀 - 경진내용 - 경진환경 주어진순차코드를병렬화하여성능향상도 ( 획득점수 ) 를측정 점수 = ( 순차코드수행시간 ) / ( 병렬화코드수행시간 ) 프로그래밍언어 : C, Fortran 순차코드는 50 라 2011 PLSI 병렬컴퓨팅경진대회문제 01. 대학원팀 02. 학부팀 - 경진내용 - 경진환경 주어진순차코드를병렬화하여성능향상도 ( 획득점수 ) 를측정 점수 = ( 순차코드수행시간 ) / ( 병렬화코드수행시간 ) 프로그래밍언어 : C, Fortran 순차코드는 50 라인내외로작성하여제공됨 참가자들은컴파일러 (intel, gnu, pgi) 선택가능 시간제한 6

More information

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사) Java Program Performance Tuning ( ) n (Primes0) static List primes(int n) { List primes = new ArrayList(n); outer: for (int candidate = 2; n > 0; candidate++) { Iterator iter = primes.iterator(); while

More information

12-file.key

12-file.key 11 (String).. java.lang.stringbuffer. s String s = "abcd"; s = s + "e"; a b c d e a b c d e ,., "910359,, " "910359" " " " " (token) (token),, (delimiter). java.util.stringtokenizer String s = "910359,,

More information

歯15-ROMPLD.PDF

歯15-ROMPLD.PDF MSI & PLD MSI (Medium Scale Integrate Circuit) gate adder, subtractor, comparator, decoder, encoder, multiplexer, demultiplexer, ROM, PLA PLD (programmable logic device) fuse( ) array IC AND OR array sum

More information

µðÇÃÇ¥Áö±¤°í´Ü¸é

µðÇÃÇ¥Áö±¤°í´Ü¸é 2013. JAN. FEB. VOL.23 2013. JAN. FEB. VOL.23 Review Preview Company Technical Point Focus Issue Market Trend Industrial Trend Policy Report KDIA News Tour Statistics KDIA 02 10 11 12 15 16 22 28 36 38

More information

106 107, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float

106 107, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float Part 2 31 32 33 106 107, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float f[size]; /* 10 /* c 10 /* f 20 3 1

More information

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

Microsoft Word - FS_ZigBee_Manual_V1.3.docx FirmSYS Zigbee etworks Kit User Manual FS-ZK500 Rev. 2008/05 Page 1 of 26 Version 1.3 목 차 1. 제품구성... 3 2. 개요... 4 3. 네트워크 설명... 5 4. 호스트/노드 설명... 6 네트워크 구성... 6 5. 모바일 태그 설명... 8 6. 프로토콜 설명... 9 프로토콜 목록...

More information

을 할 때, 결국 여러 가지 단어를 넣어서 모두 찾아야 한다는 것이다. 그 러나 가능한 모든 용어 표현을 상상하기가 쉽지 않고, 또 모두 찾기도 어 렵다. 용어를 표준화하여 한 가지 표현만 쓰도록 하여야 한다고 하지만, 말은 쉬워도 모든 표준화된 용어를 일일이 외우기는

을 할 때, 결국 여러 가지 단어를 넣어서 모두 찾아야 한다는 것이다. 그 러나 가능한 모든 용어 표현을 상상하기가 쉽지 않고, 또 모두 찾기도 어 렵다. 용어를 표준화하여 한 가지 표현만 쓰도록 하여야 한다고 하지만, 말은 쉬워도 모든 표준화된 용어를 일일이 외우기는 특집 전문 용어와 국어생활 전문 용어의 표준화 -남북 표준에서 시맨틱 웹까지- 최기선 한국과학기술원 전산학과 교수 1. 전문 용어 표준화가 사회 문화를 향상시키는가? 전문 용어 는 우리에게 어떤 의미가 있는가? 이 질문은 매일 마시는 공기 는 우리에게 어떤 의미가 있느냐고 묻는 것과 같다. 있을 때에는 없 는 듯하지만, 없으면 곧 있어야 함을 아는 것이 공기이다.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 KeyPad Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 에는 16 개의 Tack Switch 를사용하여 4 행 4 열의 Keypad 가장착 4x4 Keypad 2 KeyPad 를제어하기위하여 FPGA 내부에 KeyPad controller 가구현 KeyPad controller 16bit 로구성된

More information

hlogin2

hlogin2 0x02. Stack Corruption off-limit Kernel Stack libc Heap BSS Data Code off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code : off-limit Kernel Kernel : OS

More information

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770>

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770> i ii iii iv v vi 1 2 3 4 가상대학 시스템의 국내외 현황 조사 가상대학 플랫폼 개발 이상적인 가상대학시스템의 미래상 제안 5 웹-기반 가상대학 시스템 전통적인 교수 방법 시간/공간 제약을 극복한 학습동기 부여 교수의 일방적인 내용전달 교수와 학생간의 상호작용 동료 학생들 간의 상호작용 가상대학 운영 공지사항,강의록 자료실, 메모 질의응답,

More information

int main(void) int a; int b; a=3; b=a+5; printf("a : %d \n", a); printf("b : %d \n", b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf(" a : %x \

int main(void) int a; int b; a=3; b=a+5; printf(a : %d \n, a); printf(b : %d \n, b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf( a : %x \ ? 1 int main(void) int a; int b; a=3; b=a+5; printf("a : %d \n", a); printf("b : %d \n", b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf(" a : %x \n", &a); printf(" b : %x \n", &b); * : 12ff60,

More information

[ReadyToCameral]RUF¹öÆÛ(CSTA02-29).hwp

[ReadyToCameral]RUF¹öÆÛ(CSTA02-29).hwp RUF * (A Simple and Efficient Antialiasing Method with the RUF buffer) (, Byung-Uck Kim) (Yonsei Univ. Depth of Computer Science) (, Woo-Chan Park) (Yonsei Univ. Depth of Computer Science) (, Sung-Bong

More information

자바 프로그래밍

자바 프로그래밍 5 (kkman@mail.sangji.ac.kr) (Class), (template) (Object) public, final, abstract [modifier] class ClassName { // // (, ) Class Circle { int radius, color ; int x, y ; float getarea() { return 3.14159

More information

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information

05-class.key

05-class.key 5 : 2 (method) (public) (private) (interface) 5.1 (Method), (public method) (private method) (constructor), 3 4 5.2 (client). (receiver)., System.out.println("Hello"); (client object) (receiver object)

More information

B _01_M_Korea.indb

B _01_M_Korea.indb DDX7039 B64-3602-00/01 (MV) SRC... 2 2 SRC % % % % 1 2 4 1 5 4 5 2 1 2 6 3 ALL 8 32 9 16:9 LB CD () : Folder : Audio fi SRC 0 0 0 1 2 3 4 5 6 3 SRC SRC 8 9 p q w e 1 2 3 4 5 6 7 SRC SRC SRC 1 2 3

More information

B _02_M_Ko.indd

B _02_M_Ko.indd DNX SERIES DNX560 DNX560M DDX SERIES DDX506 DDX506M B64-467-00/0 (MW) DNX560/DNX560M/DDX506/DDX506M 4 DNX560/DNX560M/DDX506/DDX506M NAV TEL AV OUT % % % % CD () : Folder : Audio fi 5 6 DNX560/DNX560M/DDX506/DDX506M

More information

untitled

untitled PowerBuilder 連 Microsoft SQL Server database PB10.0 PB9.0 若 Microsoft SQL Server 料 database Profile MSS 料 (Microsoft SQL Server database interface) 行了 PB10.0 了 Sybase 不 Microsoft 料 了 SQL Server 料 PB10.0

More information