The form of a general directive is one of the id See the Sun Fortran User's Guide and the Fortran Programming Guide for details on the specific directives available with f77. Directives are also called compiler pragmas. '9' ) THEN ! EoL commentĭ PRINT *, S ! Debug comment & EoL commentĭ PRINT *, N! Debug comment & EoL commentĪ directive passes information to a compiler in a special form of comment. totally blank line is a comment line.Įxample: c, C, d, D, *, !, and blank comments: you put an exclamation mark (!) in any column of the statement field, except within character literals, then everything after the ! on that line is a comment. Padding is significant in lines such as the two in the following DATA statement:Ĭ23456789012345678901234567890123456789012345678901234567890123456789012Ī line with a c, C, *, d, D, or! in column one is a comment line, except that if the -xld option is set, then the lines starting with D or d are compiled as debug lines. To extend the source line length to 132 characters, use the -e Otherwise, by default, f77 ignores any characters after column 72.Įxample: Compile to allow extended lines: To change this number of lines, use the -Nl n option. The default maximum number of continuation lines is 99 (1 initial and 99 continuation). You can format lines both ways in one program unit, but not in the same line. If the tab is the first nonblank character, the text following the tab is scanned as if it started in column 7.Ī comment indicator or a statement number can precede the tab.Ĭontinuation lines are identified by an ampersand ( &) in column 1, or a nonzero digit after the first tab. The tab-format source lines are defined as follows: tab in any of columns 1 through 6, or an ampersand in column 1, establishes the line as a tab-format source line. The first five columns must be blank or contain a numeric label.Ĭontinuation lines are identified by a nonblank, nonzero in column 6. The first 72 columns of each line are scanned. The standard fixed format source lines are defined as follows: You can format a source line in either of two ways: Modules may be used to group related variables, subroutines and functions.A statement takes one or more lines the first line is called the initial line the subsequent lines are called the continuation lines. #BLANK LINE SIMPLY FORTRAN CODE#The only exception is for one line comments which can be indented within the code or placed after the statement.Įach subroutine, function and module should be in a separate file. A blank line should be left before (but not after) the comment line. The intended behaviour of the unit should be clearly described in the header.Ĭomments should start with a single ! at beginning of the line. It is not good for readability.Įach program unit (module, subroutine, function etc.) should follow a structure similar to the templates supplied in Standard code templates. Where possible, avoid using continuation lines in a statement.Īvoid putting multiple statements on the same line. Short and simple Fortran statements are easier to read and understand than long and complex ones. my_char & = 'This is a very very very very very very very ' & // 'very very very very very very very very very ' & // 'long character assignment' REAL, INTENT ( IN ) :: my_in (:) REAL, INTENT ( INOUT ) :: my_inout (:) REAL, INTENT ( OUT ) :: my_out (:) !.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |