fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
INSERT CONTAINED INCLUDE
Syntax:
INSERT CONTAINED INCLUDE [FILE] IN [ALL] SUB-PROGRAMS [:] <file> INSERT CONTAINED INCLUDE [FILE] IN [ALL] SUBPROGRAMS [:] <file> INSERT INCLUDE FILE AFTER CONTAINS IN [ALL] SUB-PROGRAMS [:] <file> INSERT INCLUDE FILE AFTER CONTAINS IN [ALL] SUBPROGRAMS [:] <file>
Function:
Some programs have large numbers of simple service routines. fpt (which is written in Fortran) for example has over 500. It is good practice to place these routines in the CONTAINS section of a module. This module is then used by all of the major sub-programs in the code.
When small sub-programs are placed in a used module they are not visible to the compiler as it compiles the major sub-programs, and cannot therefore be expanded in-line. The in-line expansion provides a significant improvement in speed of execution.
The strategy used in fpt development is to place the service routines in an include file. During development the include file is included in a module, used by all of the major routines. In the production code the include file is included in the CONTAINS section of every major routine. The improvement in speed achieved is about 30%.
The command INSERT CONTAINED INCLUDE FILE IN ALL SUB-PROGRAMS inserts a CONTAINS statement in every major sub-program which does not have one, and inserts the INCLUDE statement for the named file.
The CONTAINS and INCLUDE statements are not inserted into the sub-programs in the include file itself.
Where to Use this Command
| Operating system command line | Yes |
| Configuration file, config.fsp | No |
| Specification (fsp) files, *.fsp | Yes |
| Interactively, to FPT> prompt | No |
| Interactive command files | No |
| Embedded in the Fortran code | No |
Default
The CONTAINS and INCLUDE statements are not inserted by default.
Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.