fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

SEPARATE FSP FILES

Syntax:

[DO NOT] SEPARATE FSP [FILES] [DO NOT] WRITE SEPARATE FSP FILES [FOR EACH PROGRAM]

Function:

The easiest way to set up an fsp analysis for a large project is to collect all of the files into a single specification (fsp) file. If the project is made up of multiple programs, a disadvantage is that the same sub-program or COMMON block names may be used for different objects in different programs, and this may lead to surious error reports.

This command splits an fsp structure, which may be made up of several fsp files, into separate fsp scripts for the different programs. The fsp files are named <program-name>_only.fsp

The new fsp files are constructed:

  1. By merging the input stream of fsp files into a single file;
  2. By rewriting the single file for each program in the original project;
  3. By commenting out all files which are not required to build the target program.

Hitch-hikers

Each new fsp file may contain sub-programs which are not in the call tree of the target program. They may even contain files which do not have any components used by the target program. This arises because:

  1. The unused sub-programs are in the same files as sub-programs in the call tree;
  2. The unused sub-programs and files are called from, used by or included in sub-programs in the same files as sub-programs which are in the call tree.

These unused components are "hitch-hikers". The program cannot be linked unless they are present.

Where to Use this Command

This command operates on all fsp files and command-line commands which follow it. It must therefore be written on the command-line before the fsp files to be merged and split. Any command-line commands written after this command will be merged into the daughter fsp files.

Operating system command line Yes
Configuration file, config.fsp No
Specification (fsp) files, *.fsp No
Interactively, to FPT> prompt No
Interactive command files No
Embedded in the Fortran code No

Default

DO NOT SEPARATE FSP FILES

Example

The following fsp file contains two main programs, one in t_separate_fsp_1.f90 and one in t_separate_fsp_2.f90.

! ***************************************************************************** ! t_separate_fsp.fsp 10-Jan-19 John Collins ! Editing command to test that all commands are replicated % edit input file names: replace "?" by "fsp" t_separate_?_1.f90 t_separate_?_2.f90 t_separate_1_s1.f90 t_separate_2_s2.f90 t_separate_2_s4.f90 ! A second-level fsp file which provides a data only module t_separate_m1.fsp ! A module which contains an unused routine with a hitch-hiker t_separate_m2.f90 ! BLOCK DATA, the second is only used by a hitch-hiker t_separate_2_bda_1.f90 t_separate_2_bda_2.f90 % free format % lower case symbols % overwrite changed files ! End of t_separate_fsp.fsp

The fsp file is split into two files:

!H!**************************************************************************** !H! File: t_separate_1_only.fsp !H! Output by FPT 4.0-j Win32 On 11-JAN-19 At 12:34:13 !H!**************************************************************************** ! ***************************************************************************** ! t_separate_fsp.fsp 10-Jan-19 John Collins ! Editing command to test that all commands are replicated % edit input file names: replace "?" by "fsp" t_separate_?_1.f90 ! unused t_separate_?_2.f90 t_separate_1_s1.f90 ! unused t_separate_2_s2.f90 ! unused t_separate_2_s4.f90 ! A second-level fsp file which provides a data only module ! t_separate_m1.fsp t_separate_m1.f90 ! End of t_separate_m1.fsp ! A module which contains an unused routine with a hitch-hiker t_separate_m2.f90 ! BLOCK DATA, the second is only used by a hitch-hiker ! unused t_separate_2_bda_1.f90 ! unused t_separate_2_bda_2.f90 % free format % lower case symbols % overwrite changed files ! End of t_separate_fsp.fsp ! End of t_separate_1_only.fsp ! ******************************************************************************

The main program t_separate_?_2.f90 is commented-out. The files containing the subroutines and block data t_separate_2_s2.f90, t_separate_2_s4.f90, t_separate_2_bda_1.f90 and t_separate_2_bda_2.f90 are all commented-out because they are not required to build t_separate_fsp_1.f90.

!H!**************************************************************************** !H! File: t_separate_2_only.fsp !H! Output by FPT 4.0-j Win32 On 11-JAN-19 At 12:34:13 !H!**************************************************************************** ! ***************************************************************************** ! t_separate_fsp.fsp 10-Jan-19 John Collins ! Editing command to test that all commands are replicated % edit input file names: replace "?" by "fsp" ! unused t_separate_?_1.f90 t_separate_?_2.f90 ! unused t_separate_1_s1.f90 t_separate_2_s2.f90 t_separate_2_s4.f90 ! A second-level fsp file which provides a data only module ! t_separate_m1.fsp ! unused t_separate_m1.f90 ! End of t_separate_m1.fsp ! A module which contains an unused routine with a hitch-hiker ! unused t_separate_m2.f90 ! BLOCK DATA, the second is only used by a hitch-hiker t_separate_2_bda_1.f90 ! unused t_separate_2_bda_2.f90 % free format % lower case symbols % overwrite changed files ! End of t_separate_fsp.fsp ! End of t_separate_2_only.fsp ! ******************************************************************************

In the fsp file for t_separate_fsp_2.f90 the main program t_separate_?_1.f90 and the subroutine t_separate_1_s1.f90 are commented-out. The two module files used only by t_separate_fsp_1.f90, t_separate_m1.f90 and t_separate_m2.f90 are commented-out. The second of the two block data files is commented-out because this is only used to initialise a COMMON block in a hitch-hiker. It is therefore not required to build the program.

See Also

fsp files

Copyright ©1995 to 2022 Software Validation Ltd. All rights reserved.