FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


Output File Handling

Files Output by fpt

The files output by fpt are:

 

Directories

The output files are written to the directories:

For example, a simple fpt run is made on the file aero.f which references two include files, coords.inc and atmos.inc. All files are in the current working directory.

> fpt aero.f %i

The fpt output files are written to the current working directory, and if the default file name extensions are used, fpt writes:

      aero.fpl              The listing file
      aero.fpt              Primary file corresponding to aero.f
      coords.fpi            Include file corresponding to coords.inc
      atmos.fpi             Include file corresponding to atmos.inc

No directory specifications were needed.

In a much larger project, the working directory structure might be:

/home/chris/helisim/fpt/
        helisim.fsp         The specification file for the project
/home/chris/helisim/original_source/
        initial/
                heli_init.f90, atm_init.f90, module_atm.f90
        dynamic/
                kinematic.f90, module_rkrt2.f90, control.f90
        terminal/
                heli_term.f90
        inc/
                const.i90
/home/chris/helisim/modified_source/
        initial/
                module_atm.f90
        dynamic/
                kinematic.f90
/home/chris/helisim/fpt_output/
        initial/
                <Empty>
        dynamic/
                <Empty>
        terminal/
                <Empty>
        inc/
                <Empty>

Suppose that we want to keep this directory structure and to merge the original_source/ and modified_source/ files. We work in the directory /home/chris/helisim/fpt/. That is the current working directory. The input file specification for the project is set up with specifications, for example:

% primary input path: "../modified_source/dynamic/" "../original_source/dynamic"
kinematic.f90
module_rkrt2.f90
control.f90

Please see "Running Command-line fpt" for a description of these commands. We will then read kinematic.f90 from the modified_source/ directory and module_rkrt2.f90 and control.f90 from the original_source/ directory.

We want to write the output files with the same directory organisation, but under a new base directory named fpt_output/. The output directory handling is therefore written:

% keep output directories
% edit output file names: replace "modified_source" by "fpt_output"
% edit output file names: replace "original_source" by "fpt_output"
% keep file name extensions

The new output files are written to:

/home/chris/helisim/fpt/
        helisim.fpl         The listing file
/home/chris/helisim/fpt_output/
        initial/
                heli_init.f90, atm_init.f90, module_atm.f90
        dynamic/
                kinematic.f90, module_rkrt2.f90, control.f90
        terminal/
                heli_term.f90
        inc/
                const.i90

 

File Name Extensions

If no commands are made to specify the output file name extensions, fpt writes primary Fortran files with the extension ".fpt" and include files with the extension ".fpi". This may be changed by the commands:
PRIMARY OUTPUT FILE NAME EXTENSION
INCLUDE OUTPUT FILE NAME EXTENSION
OUTPUT FILE NAME EXTENSION
KEEP FILE NAME EXTENSIONS
EDIT OUTPUT FILE NAMES

Care should be taken to avoid overwriting the input files if the input and output file name extensions are the same.

Note that unless the command KEEP FILE NAME EXTENSIONS is made, fpt uses only one file name extension for primary files and one for include files. This can cause file name conflicts if there are multiple input files with the same base file name but different extensions. For this reason, any file name extension which does not match the default input file name extension is appended to the base file name. Thus, if a project contains the primary files: heli.f, heli.bda and heli.ctrl and the default primary input file name extension is ".f", the corresponding output files will be, for example, heli.f, heli_bda.fand heli_ctrl.f.

 

Maximum Base File Name Length

Some operating systems impose a maximum length for the base file name (The characters between the directory specification and the extension). In old versions of Unix this can be as small as 40 characters. By default, the maximum base file name length accepted by fpt is 140. A lower limit may be set by the command:
MAXIMUM BASE FILE NAME LENGTH
File names which exceed this length are renamed as described below.

 

Overwriting of Files

If the output file name and directory controls cause name collisions between two or more output files, fpt renames the second and subsequent output file(s) affected. The file names in INCLUDE statements are modified to reflect the change.

If a name collision taked place between an old, existing file in the output directory and a new output file, the behaviour is controlled by the commands:
[DO NOT] OVERWRITE EXISTING FILES
OVERWRITE CHANGED FILES
OVERWRITE ALL FILES
The default behaviour is not to overwrite files, but the defaults these commands are usually set up in the configuration file.

 

Renaming Files

Files are automatically renamed:

When a file is renamed automatically, the base name is truncated, if necessary, to 3 characters less than the length specified by the command MAXIMUM BASE FILE NAME LENGTH. An underscore character followed by a 2 digit number is appended to the base name, and the number is incremented until a unique name is found. If no unique name exists with a two digit number the length of the number is increased.


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