Difference between revisions 2747055 and 2759867 on enwikibooks{{split}} [[File:CCBYSA yellow.png]] =Preface= The goal of this Fortran tutorial is to give a quick introduction to the most common features of the Fortran 77 programming language. A companion tutorial introduces the key enhancements found in Fortran 90. It is not a complete reference! Many details have been omitted. The presentation focuses on scientific computations, mainly linear algebra. The outline of this tutorial was inspired by the book "Handbook for Matrix Computations" by T.F. Coleman a(contracted; show full) =Variables, Types, Declarations= ==Variable names== Variable names in Fortran consist of 1-6 characters chosen from the letters a-z and the digits 0-9. The first character must be a letter. Fortran 77 does not distinguish between upper and lower case, in fact, it assumes all input is upper case. However, nearly all Fortran 77 compilers will accept lower case. If you should ever encounter a Fortran 77 compiler that insists on upper case it is usually easy to convert the source code to all upper case. The words which make up the Fortran language are called reserved words and cannot be used as names of variable. Some of the reserved words which we have seen so far are "program", "real", "stop" and "end".Unlike most other languages, Fortran does not have any reserved words. Although it is possible to use words that the language is built upon as variable names if the context shows that it can't be meant as a keyword, this can become very confusing and is therefore not recommended.<ref>{{cite web | url=http://www.star.le.ac.uk/~cgp/prof77.html | title=Professional Programmer's Guide to Fortran77 | accessdate=2015-01-29 }}</ref> ==Types and declarations== Every variable should be defined in a declaration. This establishes the type of the variable. The most common declarations are: <source lang="fortran"> integer list of variables real list of variables (contracted; show full)96. It has been modified by Sarah T. Whitlock and Paul H. Hargrove for use in the Fortran courses which have been offered under different course numbers each subsequent year. The original source of the material is here http://www.stanford.edu/class/me200c/tutorial_77/ Stanford university has re-released the material under a creative commons 3.0 attribution license. The tutorial was transferred to mediawiki format by Houraa Daher. {{Subjects|Fortran programming language}} {{alphabetical|F}} {{status|100%}} All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://en.wikibooks.org/w/index.php?diff=prev&oldid=2759867.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|