MAN page from Fedora Other ftnchek-4beta_r132-61.1.x86_64.rpm
DCL2INC
Section: User Commands (1)
Updated: 12 March 1995
Index NAME
dcl2inc - postprocess ftnchek .dcl files to create separate INCLUDE files
SYNOPSIS
dcl2inc*.dcl DESCRIPTION
dcl2incpostprocessing declaration files output by
ftnchek(1),replacing unique COMMON block definitions by Fortran
INCLUDEstatements. For eachinput
.dclfile, a modified output
.dcnfile is produced, together with include files named by the COMMONblock name, with filename extension
.inc.
In addition,dcl2incproduces onstdouta list ofMakefiledependencies for the UNIXmake(1)utility. These can be appended to the projectMakefileto ensure that any subsequent changes to.incfiles provoke recompilation of source files that include them.
dcl2incwarns about COMMONs which differ from their first occurrence, andsimply copies them to the output.dcnfile, instead of replacing them with an INCLUDE statement. Thus, anyCOMMON statements that are found in the output.dcnfiles should be examined carefully to determine why they differ: theymay well be in error.
Replication of identical data, and bugs arising from subsequentmodification of only part of it, is a significant reason why Fortranprogramming projects shouldrequirethat COMMON declarations occur in separate include files, so thatthere is only asinglepoint of definition of any global object.
Even though the FortranINCLUDEstatement was tragically omitted from the 1977 Standard, it has longbeen implemented by virtually all compiler vendors, and is part of the1990 Standard. In practice, there is therefore no portability problemassociated with use of INCLUDE statements,providedthat one avoids nonportable file names. As long as the code obeysFortran's limit of six-character alphanumeric names, the filenamesgenerated bydcl2incwill be acceptable on all current popular operating systems.
Fortran's default, or IMPLICIT, variable typing is deprecated inmodern programming languages, because it encourages sloppydocumentation, and worse, bugs due to misspelled variables, orvariables that have been truncated because they extend past column 72.If all variables used are explicitly typed, and a compiler option isused to reject all program units with untyped variables, variablespelling and truncation errors can be eliminated.
Variable declarations that have been produced automatically by a toollikeftnchek(1)orpfort(1)have a consistent format that facilitates application of streameditors (e.g. to change array dimensions or rename variables), andsimple floating-point precision conversion tools liked2s(1),dtoq(1),dtos(1),qtod(1),s2d(1),andstod(1).
CAVEAT
The current version (2.9) of
ftnchek(1)does not produce Fortran EQUIVALENCE statements in
.dclfiles, so you must be careful to preserve them when replacing originaldeclarations with new ones from
.dclor
.dcnfiles.
SEE ALSO
d2s(1),
dtoq(1),
dtos(1),
ftnchek(1),
make(1),
pfort(1),
qtod(1),
s2d(1),
stod(1).
AUTHOR
Nelson H. F. Beebe, Ph.D.Center for Scientific ComputingDepartment of MathematicsUniversity of UtahSalt Lake City, UT 84112Tel: +1 801 581 5254FAX: +1 801 581 4148Email: <beebeAATTmath.utah.edu>
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- CAVEAT
- SEE ALSO
- AUTHOR
This document was created byman2html,using the manual pages.