yaminabe fortran

Download Yaminabe fortran

Post on 24-Jul-2015

2.065 views

Category:

Technology

1 download

Embed Size (px)

TRANSCRIPT

  • Fortran / @n_scattering 1

    FORTRAN @n_scattering2012/9/15

  • 2

    [Twitter] @n_scattering

    [facebook]http://www.facebook.com/seiichi.tanabetanabu

    ()

    2012/9/15Fortran / @n_scattering

    HPC (High-Performance Computing)

    ()

  • Agenda3

    1. 2. Fortran3. Fortran4. Fortran

    2012/9/15Fortran / @n_scattering

    4. Fortran5. Fortran6.

  • 3/31(@))

    2012/9/15Fortran /

    @n_scattering4

  • 5

    twitter name

    2012/9/15Fortran / @n_scattering

    Fortran ()

  • 6

    HPCFortran

    2012/9/15Fortran / @n_scattering

    Fortran

  • 7

    2012/9/15Fortran / @n_scattering

    CAE

    L

    m

  • 8

    2012/9/15Fortran / @n_scattering

    3

    Fortran

  • Fortran 1954IBM

    FORTRAN formula translation

    2012/9/15Fortran /

    @n_scattering9

  • Fortran10

    FORTRAN/Fortran

    2012/9/15Fortran / @n_scattering

    ()

  • Fortran11

    FORTRAN77

    2012/9/15Fortran / @n_scattering

    FORMATC

  • Fortran12

    / COMMONBLOCK DATASAVE

    2012/9/15Fortran / @n_scattering

  • Fortran13

    Fortran 90/95

    2012/9/15Fortran / @n_scattering

    ()

    gFortran, g95, Intel Fortran Composer

  • Fortran IBM John Warner Backus, 1924123 - 2007317

    14

    IBM 704 FORTRAN(1954)

    2012/9/15Fortran / @n_scattering

  • Fortran15

    1957 IBM704FORTRAN 1966 American Standards Association

    (ANSI)FORTRAN66

    2012/9/15Fortran / @n_scattering

    1978 FORTRAN77

    1991 Fortran90

    95, 2003, 2008

    ()

  • Fortran16

    FORTRAN77

    Fortran90/95

    2012/9/15Fortran / @n_scattering

    Fortran90/95 /

  • Fortran17

    FORTRAN77Fortran90Fortran780

    2012/9/15Fortran / @n_scattering

    32OK() Do While

    FORTRANFortran

  • Fortran18

    Fortran

    GfortranG95

    Fortran

    2012/9/15Fortran / @n_scattering

    GfortranG95 Intel Fortran Composer ()

    Intel Visual Fortran

    PGI Fortran

    NAG Fortran etc.

    Linux

  • Fortran19

    (linear)() N(doenddo)

    2012/9/15Fortran / @n_scattering

    N(doenddo) If-Then-Else

    () (While) GOTO

  • Fortran20

    r

    Program area

    c

    c area of circle, input r

    implicit none

    REAL*8 pi ,r, a

    c calculate pi

    pi=3.1415926535d0

    2012/9/15Fortran / @n_scattering

    pi=3.1415926535d0c read r from standard input (terminal)

    write(*,*) 'Input Radius'

    read(*,*) r

    c calculate area

    a = pi * r**2

    c write area onto terminal screen

    write (*,10) 'radius r=',r, 'a =',a

    10 Format (a10, e20.10, a5, e22.12)

    Stop 'area'

    End

  • Fortran21

    N

    do i = i1, i2

    2012/9/15Fortran / @n_scattering

    do i = i1, i2

    ()end do

  • Fortran22

    Program diff

    Implicit None

    c Declarations

    c h stepsize for approximation, xrange and xstepsize

    c

    2012/9/15Fortran / @n_scattering

    c

    Real*8 f, h, result(3), x, xmin, xmax, xstep

    Open(6, File='diff.dat', Status='Unknown')

    h = 1.e-3

    xmin = 0.0

    xmax = 7.0

    xstep = 0.01

    Do 10 x=xmin, xmax, xstep

    result(1) = (f(x+h) - f(x))/h

    result(2) = (f(x+h/2) - f(x-h/2))/h

    result(3) = (8*(f(x+h/4)-f(x-h/4)) - (f(x+h/2)-f(x-h/2)))/(3*h)

    Write (6, 20) x, result(1), result(2), result(3)

    10 Continue

  • Fortran23

    f(x)(3)

    2012/9/15Fortran / @n_scattering

    10 Format(F5.3, TR4, F10.8, TR4, F10.8, TR4, F10.8)

    Close(6)

    Stop 'data saved in diff.dat'

    End

    c

    c the function we want to integrate

    Function f(x)

    Implicit none

    Real*8 f, x

    f = cos(x)

    Return

    End

  • Fortran24

    result(1) = (f(x+h) - f(x))/h

    result(2) = (f(x+h/2) - f(x-h/2))/h

    2012/9/15Fortran / @n_scattering

    result(3) = (8*(f(x+h/4)-f(x-h/4)) -

    (f(x+h/2)-f(x-h/2)))/(3*h)

  • Fortran25

    If-Then-Else

    if (1) then(1)

    elseif (2) then

    2012/9/15Fortran / @n_scattering

    elseif (2) then(2)

    else

    (3)endif

  • Fortran26

    Fizz-Buzz

    Program fizzbuzz

    C

    implicit none

    integer i,fb

    do i=1,30

    fb=0

    if(mod(i,3).eq.0) then

    write(*,*) 'fizz'

    fb=1

    2012/9/15Fortran / @n_scattering

    fb=1endif

    if(mod(i,5).eq.0) then

    write(*,*) 'buzz'

    fb=1

    endif

    if (fb.eq.0) then

    write(*,*) i

    endif

    enddo

    Stop 'fizzbuzz'

    End

  • Fortran27

    do while (1)(1)

    2012/9/15Fortran / @n_scattering

    Fortran90FORTRAN77

    ( 1)

    end do

  • Fortran28

    BLAS ()

    LAPACK ()

    FFTW ()

    2012/9/15Fortran / @n_scattering

    FFTW ()

    AMD ACML

    Intel MKL

  • 29

    1CPU

    OpenMP

    2012/9/15Fortran / @n_scattering

    OpenMP

    OpenMPFortran

  • 30

    2012/9/15Fortran / @n_scattering

  • 31

    CPU

    1/N()

    2012/9/15Fortran / @n_scattering

    1/N

  • 32

    PCPC

    2012/9/15Fortran / @n_scattering

    MPI (Message Passing Interface)

    MPIMPICH2OpenMPI

  • 33

    2012/9/15Fortran / @n_scattering

  • 34

    CPU

    1/N()

    2012/9/15Fortran / @n_scattering

    1/N

  • 35

    1. 2. Fortran3. Fortran4. Fortran

    2012/9/15Fortran / @n_scattering

    4. Fortran5. Fortran6.

  • ()36

    2012/9/15Fortran / @n_scattering

  • 37

    Wikipedia FORTRAN ()(2001)

    Fortran77

    2012/9/15Fortran / @n_scattering

    Fortran77 (1986)

    (MPI)http://accc.riken.jp/HPC/training/

Recommended

View more >