[PDF] [PDF] 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 http://www stolaf edu/people/humke/UNIX/emacs-tutorial html To explore the more advanced functions of Emacs, consult the original Emacs manual at



Previous PDF Next PDF





[PDF] Interactive Fortran 77 - Department of Computer Science, University

solving with Fortran 77 using an interactive timesharing computer system The Adobe Systems Incorporated, Postscript Language Tutorial and Cookbook, Ad- Jenson K , Wirth N , Pascal: User Manual and Report, Springer Verlag



[PDF] Professional Programmers Guide to Fortran77 - University of Leicester

7 jui 2005 · One of the attractions of Fortran77 is that a good free compiler exists in the several topics which are often omitted from much larger textbooks because The purpose of this License is to make a manual, textbook, or other 



[PDF] Fortran 77 textbook pdf - Squarespace

Fortran 77 textbook pdf Processing The Fortran Programming Language Related Book Categories: Computational Physics and Scientific Computing in 



[PDF] FORTRAN 77 40 Users Guide - Institute of Physics, Bhubaneswar

This manual does not teach programming or the FORTRAN 77 language For details on a and syntax It assumes you knew and forgot, and is not a tutorial



[PDF] fortran 77 tutorial

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 format



[PDF] 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 http://www stolaf edu/people/humke/UNIX/emacs-tutorial html To explore the more advanced functions of Emacs, consult the original Emacs manual at



[PDF] Fortran 77 Programmers Guide

() Surround arguments or are empty if the function has no arguments following function/subroutine names Surround manual page section in which the command 



[PDF] Introduction to Programming with Fortran - ResearchGate

6 oct 2010 · through the first standard in 1966, the Fortran 77 standard, the Fortran 90 stan- dard, the http://gcc gnu org/onlinedocs/gcc-4 5 2/gfortran pdf is a 236 page pdf 1 3 3 3 for many teachers to expand it into valuable textbooks



[PDF] Fortran for Scientists and Engineers; Fourth Edition

swers to all exercises are included in the Instructor's Manual Good programming FIGURE 1-6 A FORTRAN 77 program to solve for the roots of the quadratic equation ax2 + bx + c = 0 kelvins (K) can be found in any physics textbook It is



[PDF] FORTRAN 77 40 Reference Manual

tutorial Its function and purpose are solely to help you find features or routines, not to teach you FORTRAN 77, programming, or programming style This book is  

[PDF] fortran 77 write

[PDF] fortran 90

[PDF] fortran 90 basics pdf

[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

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