In general, inside a FORMAT statement, any integer constant can be replaced by an arbitrary expression. @
The expression itself must be enclosed in angle brackets.
1 FORMAT( 3F6.1 )
can be replaced by the variable N, as in:
1 FORMAT( 3F<N>.1 )
or by the slightly more complicated expression 2*N+M, as in:
1 FORMAT( 3F<2*N+M>.1 )
Similarly, the 3 or 1 can be replaced by any expression.
The single exception is the n in an nH... edit descriptor.
The rules and restrictions for variable format expressions are:
The expression is reevaluated each time it is encountered in a format scan.
If necessary, the expression is converted to integer type.
Any valid FORTRAN expression is allowed, including function calls.
Variable expressions are not allowed in formats generated at runtime.
The n in an nH... edit descriptor cannot be a variable expression.