Integers are usually stored as 32 bits (4 bytes) variables. Integers and floating point variablesFortran 77 has only one type for integer variables. This means all variables startingwith the letters i-n are integers and all others are real.Many old Fortran 77 programs uses these implicit rules, but you should not! The probability of errors in your programgrows dramatically if you do not consistently declare your variables. Each variable should be declared exactly once.If a variable is undeclared, Fortran 77 uses a set of implicitrules to establish the type. The most commondeclarations are: integer list of variables real list of variables double precision list of variables complex list of variables logical list of variables character list of variablesThe list of variables should consist of variable names separatedby commas. Types and declarationsEvery variable should be defined in a declaration.This establishes the type of the variable. If you should ever encounter a Fortran 77 compilerthat insists on upper case it is usually easy to convert the source code to all upper case. However, nearly all Fortran 77 compilerswill accept lower case. (Note: Fortran 90 allows variablenames of arbitrary length).Fortran 77 does not distinguish between upper and lower case, in fact,it assumes all input is upper case. Variables, types, and declarations Variable namesVariable names in Fortran consist of 1-6 characters chosen from theletters a-z and the digits 0-9.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |