DCL2INC(1)
π dcl2inc β the manual, but make it a group chat π
okay bestie so listen, this is the dcl2inc page from the General Commands Manual, and it's literally about postprocessing ftnchek .dcl files to create separate INCLUDE files. that's the whole name, that's the whole vibe. let's get into it π¦
β¨ SYNOPSIS β¨
dcl2inc *.dcl
that's it. that's the whole thing. she's simple, she's iconic π
πΈ DESCRIPTION πΈ
so dcl2inc does postprocessing on declaration files that got output by ftnchek(1), and what she does is replace unique COMMON block definitions with Fortran INCLUDE statements. no cap. for every single input .dcl file, you get a modified output .dcn file, plus include files that are named by the COMMON block name, with filename extension .inc. periodt π
also?? she produces a list of Makefile dependencies on stdout for the UNIX make(1) utility. you can append those to your project Makefile so that any subsequent changes to .inc files provoke recompilation of the source files that include them. the way she keeps your build honest πβ¨
now here's the part where you gotta pay attention bestie. dcl2inc warns about COMMONs which differ from their first occurrence, and just copies them straight to the output .dcn file instead of replacing them with an INCLUDE statement. so any COMMON statements that show up in the output .dcn files? examine those carefully to figure out why they differ, because they may well be in error. π not me being dramatic, that's literally what the manpage says.
Replication of identical data, and bugs arising from subsequent modification of only part of it, is a significant reason why Fortran programming projects should require that COMMON declarations occur in separate include files, so that there is only a single point of definition of any global object. one definition. one source of truth. we love a single point of definition π«Ά
and can we talk about the Fortran INCLUDE statement for a sec?? because it was tragically omitted from the 1977 Standard ππ like, robbed. BUT it has long been implemented by virtually all compiler vendors, and it's part of the 1990 Standard. so in practice there is therefore no portability problem associated with use of INCLUDE statements, provided that one avoids nonportable file names. and as long as the code obeys Fortran's limit of six-character alphanumeric names, the filenames generated by dcl2inc will be acceptable on all current popular operating systems. slay π
okay now Fortran's default, or IMPLICIT, variable typing? deprecated in modern programming languages. why? because it encourages sloppy documentation, and worse, bugs due to misspelled variables, or variables that have been truncated because they extend past column 72. π if all variables used are explicitly typed, and a compiler option is used to reject all program units with untyped variables, then variable spelling and truncation errors can be eliminated. that's the glow-up. that's the arc. π
and one last thing β variable declarations that have been produced automatically by a tool like ftnchek(1) or pfort(1) have a consistent format that facilitates application of stream editors (e.g. to change array dimensions or rename variables), and simple floating-point precision conversion tools like d2s(1), dtoq(1), dtos(1), qtod(1), s2d(1), and stod(1). consistent format = bestie behavior π
β οΈ CAVEAT β οΈ
The current version (2.9) offtnchek(1)does not produce Fortran EQUIVALENCE statements in.dclfiles, so you must be careful to preserve them when replacing original declarations with new ones from.dclor.dcnfiles.
fr fr, do not lose those EQUIVALENCE statements. protect them with your life π
π₯ SEE ALSO π₯
d2s(1)dtoq(1)dtos(1)ftnchek(1)make(1)pfort(1)qtod(1)s2d(1)stod(1)
π AUTHOR π
the icon, the legend, the main character who wrote this:
Nelson H. F. Beebe, Ph.D. Center for Scientific Computing Department of Mathematics University of Utah Salt Lake City, UT 84112 Tel: +1 801 581 5254 FAX: +1 801 581 4148 Email: <beebe@math.utah.edu>
and that's the page bestie!! this was Version 1.00, dated 12 March 1995 β yeah she's vintage, she's a classic, she ate and left no crumbs πβ¨ go forth and INCLUDE responsibly π
π¦ where this page comes from
- debian bookworm: ftnchek 3.3.1-6
- debian trixie: ftnchek 3.3.1-7
- fedora 43: ftnchek 3.3.1-44.fc43 Β· MIT
- fedora 44: ftnchek 3.3.1-45.fc44 Β· MIT
- ubuntu jammy: ftnchek 3.3.1-5build1
- ubuntu noble: ftnchek 3.3.1-6
- ubuntu questing: ftnchek 3.3.1-7
- ubuntu resolute: ftnchek 3.3.1-7build1
- ubuntu stonking: ftnchek 3.3.1-7build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms