[PDF] Introduction to programming in Fortran 77 for students of Science





Previous PDF Next PDF



Interactive Fortran 77

The aim of this book is to introduce the concepts and ideas involved in problem solving with Fortran 77 using an interactive timesharing computer system. The.



fortran 77 tutorial.pdf

Most lines in a Fortran 77 program starts with 6 blanks and ends before column 72 i.e. only the statement field is used. Note that Fortran 90 allows free 



Professional Programmers Guide to Fortran77

07-Jun-2005 Fortran which make programming easier and programs more reliable. One of the attractions of Fortran77 is that a good free compiler exists in ...



Introduction to programming in Fortran 77 for students of Science

In this course we will use g77 (GNU Fortran) compiler which can be downloaded from the Internet for both Windows and MacOS. If you intend to use Linux



FORTRAN 77 4.0 Users Guide

Some of the material in this manual is based on the Bell Laboratories document entitled “A Portable Fortran 77 Compiler” by S. I. Feldman.



Numerical Recipes in FORTRAN 77

06-Feb-2017 Numerical recipes in Fortran 77 : the art of scientific computing ... Forman Acton whose 1970 textbook Numerical Methods that Work (New ...



Introduction to Fortran 90

At present an ANSI standard Fortran 77 program should compile successfully with any Fortran 90 compiler without change. However the structure of a Fortran 



Introductory Fortran Programming

Gentle introduction to Fortran 77 and 95 programming. File I/O. Arrays and loops This course just get you started - use textbooks reference manuals.



Fortran 90 Handbook.pdf

Fortran 90 including those familiar with programming language concepts but unfamiliar with Fortran. Experienced Fortran 77 programmers will be able to.



Introduction to Programming with Fortran

18-Nov-2004 Another problem is backwards compatibility with Fortran 77. Existing Fortran 77 ... for many teachers to expand it into valuable textbooks.

IntroductiontoprogramminginFortran77

forstudentsofScienceandEngineering

RomanGrÄoger

Revision1.2(September27,2004)

1Introduction

bookisborrowedfromalibrary. guages: code. needthem. 1 lookslike. underLinuxorontheMacinyourlab. problemcanbesolvedmanydi®erentways. 2

2Settingupyourcommand-lineterminal

Terminal.Openupyourterminalwindow.

3Downloadandsetup

distributionofemacsforWindows. 3 thecommand renameemacs-*emacs oftheasterisk.

Windows95/98/NT:

setPATH=%PATH%;c:\emacs\bin;c:\g77\bin setLIBRARY_PATH=c:\g77\lib

Restartyourmachine.

Windows2k/Me/XP:

on(underWindowsXP). c:\emacs\bin\runemacs.exe know.

X(Jaguar/Panther)system.

4Introductiontoemacs

4 contextsensitiveindentationandlayout.

4.1Notation

whichyoucan¯ndontheInternet.

C-x=presstheCtrlkey,holditandpressx.

theend.

RET=EnterorReturnkey.

SPC=thespacebar

ESC=theescapekey

4.2BasicEmacscommands

like:

Emacs.

5

Enter{newline

C-xC-s{savesthebu®er

C-xC-c{quitsemacs

C-a{jumptothebeginningofthecurrentline

C-e{jumptotheendofthecurrentline

M-f{moveforwardoneword

M-b{movebackwardoneword

M-<{movetothetopofthebu®er

M->{movetothebottomofthebu®er

C-d{deletethecharacteratthecursor

M-%{replaceforward

C-w{cutthetextfrombu®ertotheclipboard

C-_{undothelastchange

byclickingonfolders.

4.3Emacsdocumentation

6

5IntroductiontoFortran77

5.1F77indentationrules

writingyourF77codes. understandwhatthecodereallydoes.

Examplesofcommentedlines:

res=res*i enddo

156res=res*i

Exampleofthelinebreak:

write(*,'("Factorialof",I3,"is",I5)') +number,res 7 choiceisuptoyou!

5.2The¯rstF77program

mkdirc:\work cdc:\work mkdirwork cdwork

Findfile:c:\work\

yourscreenshouldlookasfollows:

Findfile:c:\work\fact.f

8 theFortranmode. programFACTORIAL !definitionofvariables integeri,res,number parameter(number=5) res=1 res=res*i enddo write(*,'("Factorialof",I3,"is",I5)') +number,res end above;moreonthisshortly. 9 partand,therefore,leavethenextlineblank. multiplicationstoredinres.

Wrotec:\work\fact.f

section.

5.3Compilingandrunningthecode

g77fact.f-ofact.exe

Factorialof5is120

5.4Fortran77documentation

10

6FundamentalconstructionsofF77

6.1Structureoftheprogrampart

programMY_PROGRAM declarationofvariables de¯nitionofparameters initialde¯nitionofvariables instructionpart end

6.2Declarationofvariables

11 integernumber,val realresult usedinyourcalculations. symbolicnamesizedescription byte1byteintegralnumbersfrom-128to127 character1byteonealphanumericcharacter character*NNbytesNalphanumericcharacters declaring: integervect(5) realmat(4,10),tmat(2,5,9) accordingly,e.g.tmat(1,3,7).

6.3Implicitdeclarationofvariables

implicitnone 12

6.4De¯nitionofvariables

younottocountonit! count=0 result=5.3 flag=.false. univ='upenn'

6.5De¯nitonofparameters

realpi,e parameter(pi=3.2415927,e=2.7182818)

6.6Intrinsicfunctions

13 functiondescription

SQRT(x)calculatesthesquarerootofx

EXP(x)raisesbaseetothexpower(ex)

REAL(x)convertstheargumenttoarealvalue

NINT(x)roundsxtothenearestintegervalue

ABS(x)calculatestheabsolutevalueofx

Á(x)=1

p2¼e¡x2=2 inarrayphi.Displaytheresults.

Solution:

realphi(50),x,pi parameter(pi=3.1415927) x=-3.0 dowhile(x.le.3.0) phi(idx)=1.0/SQRT(2*pi)*EXP(-x**2/2.0) +x,phi(idx) x=x+0.2 enddo thecorrectaverageifsumwereoftypereal. 14

6.7do-enddoloops

F77automaticallysubstitutesstep=1.

Solution:

don=1,1e4,100 eval=(1+1.0/n)**n write(*,'("n=",I5,",e=",F6.4)') +n,eval enddo

6.8dowhile-enddoloops

individualloop. dowhile(logicalexpression) statements enddo 15 accuracy"·10¡6.

Solution:

eps=1.0e-6 xleft=0.0 xright=1.0 fmid=eps+1.0!executethefirstcycle dowhile(ABS(fmid).gt.eps) xmid=(xleft+xright)/2.0 fleft=xleft**3+4*xleft**2-1 fmid=xmid**3+4*xmid**2-1 fright=xright**3+4*xright**2-1 if(fleft*fmid.le.0)then xright=xmid else xleft=xmid endifquotesdbs_dbs3.pdfusesText_6
[PDF] fortran 77 write

[PDF] fortran 90

[PDF] fortran 90 example

[PDF] fortran 90 function

[PDF] fortran 90 handbook pdf

[PDF] fortran 90 pi

[PDF] fortran 90 programming pdf

[PDF] fortran 90 read

[PDF] fortran 90 standard pdf

[PDF] fortran 90 textbook

[PDF] fortran 90 textbook pdf

[PDF] fortran 90 tutorial pdf

[PDF] fortran 90 write format

[PDF] fortran 90/95 pdf

[PDF] fortran 95 compiler