1DCL2INC(1) General Commands Manual DCL2INC(1)
2
3
4
6 dcl2inc - postprocess ftnchek .dcl files to create separate INCLUDE
7 files
8
10 dcl2inc *.dcl
11
13 dcl2inc postprocessing declaration files output by ftnchek(1), replac‐
14 ing unique COMMON block definitions by Fortran INCLUDE statements. For
15 each input .dcl file, a modified output .dcn file is produced, together
16 with include files named by the COMMON block name, with filename exten‐
17 sion .inc.
18
19 In addition, dcl2inc produces on stdout a list of Makefile dependencies
20 for the UNIX make(1) utility. These can be appended to the project
21 Makefile to ensure that any subsequent changes to .inc files provoke
22 recompilation of source files that include them.
23
24 dcl2inc warns about COMMONs which differ from their first occurrence,
25 and simply copies them to the output .dcn file, instead of replacing
26 them with an INCLUDE statement. Thus, any COMMON statements that are
27 found in the output .dcn files should be examined carefully to deter‐
28 mine why they differ: they may well be in error.
29
30 Replication of identical data, and bugs arising from subsequent modifi‐
31 cation of only part of it, is a significant reason why Fortran program‐
32 ming projects should require that COMMON declarations occur in separate
33 include files, so that there is only a single point of definition of
34 any global object.
35
36 Even though the Fortran INCLUDE statement was tragically omitted from
37 the 1977 Standard, it has long been implemented by virtually all com‐
38 piler vendors, and is part of the 1990 Standard. In practice, there is
39 therefore no portability problem associated with use of INCLUDE state‐
40 ments, provided that one avoids nonportable file names. As long as the
41 code obeys Fortran's limit of six-character alphanumeric names, the
42 filenames generated by dcl2inc will be acceptable on all current popu‐
43 lar operating systems.
44
45 Fortran's default, or IMPLICIT, variable typing is deprecated in modern
46 programming languages, because it encourages sloppy documentation, and
47 worse, bugs due to misspelled variables, or variables that have been
48 truncated because they extend past column 72. If all variables used
49 are explicitly typed, and a compiler option is used to reject all pro‐
50 gram units with untyped variables, variable spelling and truncation
51 errors can be eliminated.
52
53 Variable declarations that have been produced automatically by a tool
54 like ftnchek(1) or pfort(1) have a consistent format that facilitates
55 application of stream editors (e.g. to change array dimensions or
56 rename variables), and simple floating-point precision conversion tools
57 like d2s(1), dtoq(1), dtos(1), qtod(1), s2d(1), and stod(1).
58
60 The current version (2.9) of ftnchek(1) does not produce Fortran EQUIV‐
61 ALENCE statements in .dcl files, so you must be careful to preserve
62 them when replacing original declarations with new ones from .dcl or
63 .dcn files.
64
66 d2s(1), dtoq(1), dtos(1), ftnchek(1), make(1), pfort(1), qtod(1),
67 s2d(1), stod(1).
68
70 Nelson H. F. Beebe, Ph.D.
71 Center for Scientific Computing
72 Department of Mathematics
73 University of Utah
74 Salt Lake City, UT 84112
75 Tel: +1 801 581 5254
76 FAX: +1 801 581 4148
77 Email: <beebe@math.utah.edu>
78
79
80
81Version 1.00 12 March 1995 DCL2INC(1)