FINDENT(1) | User Commands | FINDENT(1) |
findent - Indents, converts and relabels Fortran programs.
findent [OPTION]...
Findent reads from STDIN and writes to STDOUT.
Findent indents and optionally relabels a Fortran source. Findent
can convert from fixed form to free form and vice-versa, and can supplement
single END statements, see 'Refactor' below. Comment lines with '!' in
column one are not indented.
You can correct findent related indenting errors by inserting comment lines:
! findentfix: <fortran statement>
where <fortran statement> is for example DO, END, WHERE() etcetera.
Findent will adjust the indentation according to <fortran statement>.
Errors in OPTIONS are silently ignored.
Options marked with [NO_ENV] are ignored if given via environment variable
FINDENT_FLAGS.
In the long options, you can replace '_' with '-'.
Below: <n> denotes an unsigned decimal number.
<c> denotes a character.
findent parses the environment variable FINDENT_FLAGS before the command-line flags.
The following constructs are candidates for relabeling:
- 100,110,120,130: label
- X: integer or real or logical expression
- I: identifier
- [,]: optional comma
- ...: not parsed by findent, can be anything except '=...'
- [IF]: optional IF(...)
100 ... ! statement or format label
IF(...) 110,120,130
IF(...) 110,120
DO 100[,] I=X,...
DO 100[,] WHILE(...)
DO 100[,] CONCURRENT(...)
DO 100
[IF] ACCEPT 100...
[IF] ASSIGN 100 TO I
[IF] BACKSPACE(...,ERR=100,...)
[IF] CALL I(...,*100,...,$110,...,&120,...)
[IF] CLOSE(...,ERR=100,...)
[IF] DECODE(...,100,...,ERR=110,...)
[IF] DELETE(...,ERR=110,...)
[IF] ENCODE(...,100,...,ERR=110,...)
[IF] ENDFILE(...,ERR=100,...)
[IF] FIND(...,ERR=110,...)
[IF] FLUSH(...,ERR=100,...)
[IF] GOTO 100
[IF] GOTO I[,](100,110,120)
[IF] GOTO(100,110,120)...
[IF] INQUIRE(...,ERR=100,...)
[IF] OPEN(...,ERR=100,...)
[IF] PRINT 100...
[IF] READ 100...
[IF] READ(...,100,...)
[IF] READ(...,ERR=100,...,END=110,EOR=120,...,FMT=130)...
[IF] REREAD 100...
[IF] REREAD(...,100,...)
[IF] REREAD(...,ERR=100,...,END=110,EOR=120,...,FMT=130)...
[IF] REWIND(...,ERR=100,...)
[IF] REWRITE(...,100) ...
[IF] REWRITE(...,ERR=100,...,FMT=110,...,EOR=120)...
[IF] TYPE 100...
[IF] WAIT(...,ERR=100,...,END=110,...,EOR=120,...)
[IF] WRITE(...,100) ...
[IF] WRITE(...,ERR=100,...,FMT=110,...,EOR=120)...
Indent: findent < in.f > out.f
findent -i2 -r0 < in.f > out.f
Relabel: findent --relabel < in.f > out.f
Convert fixed to free form: findent -ofree < prog.f > prog.f90
Convert free to fixed form: findent -ofixed < prog.f90 > prog.f
Refactor 'end': findent -Rr < in.f90 > out.f90
123&
4 continue
The problems arise because it is not possible to define a statement label in a continuation in fixed format.
is converted to:
print *,"a&
&b"
Donations to support the maintenance of this program are welcome: https://paypal.me/wvermin
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2023 | findent-4.3.2 |