ForTran?? - PowerPoint PPT Presentation

About This Presentation
Title:

ForTran??

Description:

Title: ForTran Subject: Chapter 3 Author: Sibevin Wang Last modified by: Wang Created Date: 7/19/2003 2:48:05 PM Document presentation format – PowerPoint PPT presentation

Number of Views:123
Avg rating:3.0/5.0
Slides: 38
Provided by: Sibe9
Category:
Tags: fortran | input | output

less

Transcript and Presenter's Notes

Title: ForTran??


1
Chapter 3 ??????
2
1 write, print????
3
1 write, print????
  • ????
  • write (,) "hello, world!"

4
1 write, print????
  • ????
  • write (unit , FMT ) "hello, world"
  • print??(??????)
  • print , "hello, world"

5
2 ??(Declaration)
?????,??????????????,?????????,??????????????????
6
2 ??(Declaration)
  • ?????????
  • integer
  • integer A ??????A?????

7
2 ??(Declaration)
  • integer A,B,C ??A,B,C??????
  • integer (kind2) A??????????????
  • integer (kind4) A??????????????

8
2 ??(Declaration)
  • real
  • real a ??????a??????????
  • real (kind4) a ??????a??????????
  • real (kind8) a ??????a??????????

9
2 ??(Declaration)
10
2 ??(Declaration)
  • complex
  • complex a??????a?????????
  • complex (kind4) a ??????a?????????
  • complex (kind8) a ??????a?????????

11
2 ??(Declaration)
  • character
  • character (len 1) a
  • character (1) a
  • character1 a
  • character (len 80) a
  • character (80) a
  • character80 a

12
2 ??(Declaration)
  • logical
  • logical a??????a?????

13
2 ??(Declaration)
  • ?????????
  • ?????????????,???????(_)???,??????????
  • ???????,???31??????
  • ????????Fortran????????
  • ????????,??????????
  • ??????????,?????????

14
3 read ????
15
3 read ????
  • ????
  • read (,) A

16
3 read ????
  • ????
  • read (unit , FMT ) A
  • ?????
  • ???????( )???(,)??

17
4 ?????? (Format)
18
4 ?????? (Format)
  • ????????
  • Ap?p??????????
  • Dp.q?p?????????????????,?????q???? ?(p?q7)

19
4 ?????? (Format)
  • ????????
  • Ep.q ?p?????????????????,?????q????? (p?q7)
  • Fp.q?p????????????,?????q?????

20
4 ?????? (Format)
  • ????????
  • Ip?p????????????
  • Lp?p?????????T?F?????
  • pX??????????p???,?????????

21
4 ?????? (Format)
  • ????????????
  • ????,????
  • ???????????,????????
  • ???? write(,'( 3(2X, F5.2) )') A, B, C
    write(,'( 2X, F5.2, 2X, F5.2, 2X, F5.2 )') A, B,
    C
  • ????

22
5 ???????
  • implicit????
  • implict
  • ??????I,J,K,L,M,N??????????,??????
  • ??????????
  • implict integer (A-F, I, K)
  • ?A?F???I, K???????????
  • implict integer (A-F, I, K)
  • ?F?K????????????
  • implict integer (A-F, I, K)
  • ???????????

23
5 ???????
  • parameter????

24
5 ???????
  • parameter????
  • real, parameter pi 3.14159

25
5 ???????
  • ???????

26
5 ???????
  • ?????????

27
5 ???????
  • ??????

28
5 ???????
  • ??????
  • type person
  • character(len30) name
  • end type person
  • type(person) a
  • read(,) a name

29
5 ???????
  • ?????????
  • a person("Tom", 15, 170, 60, "Taipei")

30
5 ???????
  • module??

31
5 ???????
  • module??
  • module constants
  • implicit none
  • end module constants
  • program ex0311
  • use constants

32
5 ???????
  • module??

33
5 ???????
  • module??

34
5 ???????
  • kind ???
  • ?PC????????????????
  • integer(kind1) -127127
  • integer(kind2) -3276732767
  • integer(kind4) -21474836472147483647
  • real(kind4)
  • real(kind8)

35
5 ???????
  • kind ???
  • selected_int_kind(p)
  • ????p????,?????kind??
  • selected_real_kind(p,q)
  • ????p?????,????q???????kind??

36
5 ???????
  • kind ???

37
5 ???????

  • kind ???
Write a Comment
User Comments (0)
About PowerShow.com