The output is also in GRIB. In addition, generic 1 megabyte 4 integer and real arrays are declared to handle all GRIB input, processing, and output. We have found that 1 megabyte arrays are more than sufficient to handle all ERA GRIB records, and alleviates potential difficulties if the arrays are declared with insufficient lengths.
Namely, the number of east-west grid points decrease as one approaches the poles. A statement may be continued on the next line by placing any symbol like the currency symbol in the sixth column preceding the continuation.
Up to 19 continuations are permitted for a single statement; hence, a single statement can cover up to 20 lines. Finally, the statement itself is placed within columns 7 to Any characters that stray past the last allowed column will be ignored by the compiler and will almost certainly cause an error in the program.
It is imperative to document your programs. A piece of code that is clear today will be difficult if not impossible to understand six months down the road so you should include comments in your program explaining what it does.
The text of the comment follows. Like statements, comments should not extend past column 72 but this rule is rarely enforced. A comment may appear anywhere in a program except after the END statement. There are two other formats accepted by the Fortran compiler: unnumbered free format and line-numbered free format. To indicate unnumbered free format, specify the -Formatted option.
With this format, a Fortran statement may start anywhere between columns 1 and The compiler still ignores everything after column This format is similar to unnumbered free format, except that each line must begin with a line number. This is useful for source files that were created with build mode. Lines may have any length; the compiler does NOT ignore text after column Fortran column 1 is taken to be the first position after the line number.
You need at least one space between the line number and any Fortran statement number. This also applies to assignment statements whose variables begin with C. We start by looking at a simple example:. The lines that begin with with a "c" are comments and have no purpose other than to make the program more readable for humans.
Originally, all Fortran programs had to be written in all upper-case letters. Most people now write lower-case since this is more legible, and so will we. You may wish to mix case, but Fortran is not case-sensitive, so "X" and "x" are the same variable. A Fortran program generally consists of a main program or driver and possibly several subprograms procedures or subroutines.
0コメント