New fortran

Download New fortran

Post on 02-Jul-2015

826 views

Category:

Documents

8 download

Embed Size (px)

TRANSCRIPT

<ul><li> 1. NGN NG LP TRNH FORTRAN V NG DNG TRONG KH TNG THY VN Phm Vn HunNXB Nng nghip - H Ni - 2005T kha: Ngn ng, lp trnh, Fortran, thut gii, gi trnh, lu , khai bo, hng, bin, file, lnh, tun t, r nhnh, lp, chng trnh con,th tc, hm.Ti liu trong Th vin in t Trng i hc Khoa hc T nhin c th c s dng cho mc ch hc tp v nghin cu cnhn. Nghim cm mi hnh thc sao chp, in n phc v cc mc ch khc nu khng c s chp thun ca nh xut bn vtc gi.</li></ul><p> 2. I HC QUC GIA H NIPHM VN HUN NGN NG LP TRNH FORTRANV NG DNG TRONG KH TNG THY VNNH XUT BN NNG NGHIP 20051 3. MC LCGii thiu .............................................................................................................................................................................................................................. 5Chng 1 - Khi nim v lp trnh my tnh gii cc bi ton ng dng................................................................................................................. 61.1. Phn cng v phn mm my tnh ........................................................................................................................................................................ 61.2. Thc hin mt chng trnh my tnh .................................................................................................................................................................. 71.3. Quy trnh gii bi ton trn my tnh.................................................................................................................................................................... 71.4. Nhng chng trnh Fortran hon chnh ........................................................................................................................................................... 101.5. Quy cch son tho mt chng trnh Fortran.................................................................................................................................................. 11Chng 2 - Nhng yu t c bn ca Fortran ............................................................................................................................................................... 122.1. D liu v cch biu din d liu trong Fortran ................................................................................................................................................ 122.2. Hng v bin .......................................................................................................................................................................................................... 132.2.1. Tn bin v tn hng...................................................................................................................................................................................... 132.2.2. M t (khai bo) kiu bin v kiu hng ..................................................................................................................................................... 142.3. Bin c ch s (mng)............................................................................................................................................................................................. 162.3.1. Khi nim mng............................................................................................................................................................................................. 162.3.2. M t mng..................................................................................................................................................................................................... 172.4. Cc hm chun ...................................................................................................................................................................................................... 172.5. Lnh gn v cc ton t s hc ............................................................................................................................................................................ 182.5.1. Lnh gn ......................................................................................................................................................................................................... 182.5.2. Cc php tnh s hc n gin...................................................................................................................................................................... 192.5.3. c lng biu thc s hc........................................................................................................................................................................... 192.5.4. Khi nim v ct v cc php tnh hn hp................................................................................................................................................. 202.5.5. Khi nim v s qu b v s qu ln (underflow v overflow) ................................................................................................................ 20Chng 3 - Nhp v xut d liu n gin..................................................................................................................................................................... 223.1. Cc lnh xut v nhp d liu.............................................................................................................................................................................. 223.2. Cc c t trong lnh FORMAT.......................................................................................................................................................................... 24Chng 4 - Cc cu trc iu khin................................................................................................................................................................................ 274.1. Khi nim v cu trc thut ton......................................................................................................................................................................... 274.1.1. Cc thao tc c bn. Gi trnh v lu ..................................................................................................................................................... 27 2 4. 4.1.2. Cc cu trc tng qut trong thut gii....................................................................................................................................................... 28 4.1.3. Th d ng dng thut ton cu trc........................................................................................................................................................... 284.2. Cu trc IF v cc lnh tng ng ...................................................................................................................................................................... 29 4.2.1. Biu thc lgic................................................................................................................................................................................................ 29 4.2.2. Lnh IF lgic ................................................................................................................................................................................................. 30 4.2.3. Lnh IF s hc............................................................................................................................................................................................... 32Chng 5 - Cu trc lp vi lnh DO ............................................................................................................................................................................. 445.1. Vng lp DO........................................................................................................................................................................................................... 44 5.1.1. C php ca lnh DO v vng lp DO......................................................................................................................................................... 44 5.1.2. Nhng quy tc cu trc v thc hin vng lp DO .................................................................................................................................... 45 5.1.3. Th d ng dng vng lp DO ...................................................................................................................................................................... 465.2. Vng DO lng nhau............................................................................................................................................................................................... 47Chng 6 - File d liu v t chc file d liu trong Fortran....................................................................................................................................... 516.1. Khi nim v file d liu v t chc lu tr d liu.......................................................................................................................................... 516.2. Cc lnh nhp, xut d liu vi file ..................................................................................................................................................................... 526.3. K thut c cc file d liu ................................................................................................................................................................................. 54 6.3.1. S dng ghi c ch nh............................................................................................................................................................................. 54 6.3.2. Dng k hiu kt thc d liu....................................................................................................................................................................... 55 6.3.3. S dng tu chn END.................................................................................................................................................................................. 566.4. To lp cc file d liu .......................................................................................................................................................................................... 586.5. K thut tr gip tm li chng trnh ............................................................................................................................................................... 58Chng 7 - S dng bin c ch s trong Fortran ......................................................................................................................................................... 607.1. Mng mt chiu ..................................................................................................................................................................................................... 617.2. Lnh DATA............................................................................................................................................................................................................ 627.3. Mng hai chiu....................................................................................................................................................................................................... 627.3. Mng nhiu chiu .................................................................................................................................................................................................. 647.4. Nhng iu cn ch khi s dng cc mng ..................................................................................................................................................... 67Chng 8 - Chng trnh con loi hm .......................................................................................................................................................................... 708.1. Cc hm chun ...................................................................................................................................................................................................... 708.2. Cc hm chng trnh con ................................................................................................................................................................................... 713 5. 8.2.1. Hm lnh......................................................................................................................................................................................................... 718.2.2. Hm chng trnh con .................................................................................................................................................................................. 728.3. Ch dn g ri v phong cch vit chng trnh c hm con............................................................................................................................ 76Chng 9 - Chng trnh con loi th tc ..................................................................................................................................................................... 789.1. Khai bo v gi chng trnh con th tc........................................................................................................................................................... 789.2. Nhng th d ng dng chng trnh con th tc ............................................................................................................................................. 799.3. Nhng ch dn g ri khi s dng cc th tc.................................................................................................................................................... 83Chng 10 - Kiu d liu vn bn................................................................................................................................................................................... 8510.1. Tp cc k t ca Fortran .................................................................................................................................................................................. 8510.2. Cc dng khai bo bin k t............................................................................................................................................................................. 8510.3. Nhp, xut d liu k t ..................................................................................................................................................................................... 8610.4. Nhng thao tc vi d liu k t ....................................................................................................................................................................... 8610.4.1. Gn cc gi tr k t .................................................................................................................................................................................... 8610.4.2. So snh cc gi tr k t .........................................................................</p>

Recommended

View more >