fpt has extensive reformatting facilities. It should be compatible with most of the recent Fortran standards, and legacy constructs from VMS, MPX, HP-UX, HP3000 etc. which can usually be converted to current standards. However there are things in Fortran 2018 we have not fully handled yet. To give a flavo(u)r of the formatting commands:
LAYOUT:
keep layout - As input file
set layout - As below
fixed format
tab format - the VMS style with a tab as the leading character
free format
LINE LENGTH:
output code line length
page width - controls comments as well as code
INDENTATION:
indent spaces for each level of nesting
maximum indent
maximum indentation nesting level
indent sub-program code by spaces
indent labels by columns
indent continuation lines by columns
CONTINUATION COLUMN (free format):
write continuation character in column
SPACING:
space before keywords - or no space …
space after keywords
space before intrinsics
space after intrinsics
space before numbers
space after numbers
space before HEX - also octals, binary
space after HEX
space before symbols - User-defined symbols
space after symbols
space before operators - including delimiters
space after operators
space before strings
space after strings
space after labels
space after continuation
space before trailing comment
space before - specific keyword
space after
space before - specific operator/delimiter
space after operator
CASE:
upper case keywords
lower case keywords
upper case symbols
lower case symbols
upper case operators - e.g. .NOT.
lower case operators
upper case exponent characters
lower case exponent characters
upper case kind tags
lower case kind tags
default case kind tags - then as parameters
upper case parameters
lower case parameters
default case parameters - then as symbols
upper case file names - in INCLUDE statements
lower case file names
upper case symbols with write access
CONTINUATION CHARACTER (fixed format)
continuation character
CONTINUATION LINES
ignore continuation lines
maximum number of continuation lines
HEADERS:
[do not] indent header comments
[do not] format format specifications
SPECIAL CASES:
no trailing comments - change to line comments
remove embedded tabs
translate high valued characters in comments
translate high valued characters in strings
remove comments after end
keep line comments after end
You will find documentation of most of these commands at
http://simconglobal.com/fpt_ref_alphabetic_command_list.html
There are more formatting features - and please tell me of any you need that we have missed!
Best wishes,
John