fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

CHECK FORMATS

Syntax:

[DO NOT] CHECK FORMATS [DO NOT] CHECK FORMATS IN I/O STATEMENTS

fpt Version

This command is implemented in fpt v4.344 and later.

Function:

fpt checks that format specifications in I/O statements correspond correctly to the objects in the I/O lists. There are two possible issues:

  1. The data type required by a format descriptor may differ from the type of the object to be read or written;
  2. The field width, and where appropriate the decimal and exponent widths of the L, I, F, E, ES and EN edit descriptors may be omitted.

The Rules for Formats and the Checks

The L edit descriptor requires a logical I/O list object. The F, E, ES and EN require real or complex objects. The I edit descriptor requires an integer object on most systems, but some systems write the integer value which corresponds to the bit pattern of the I/O list object. B, O and Z descriptors usually write the bit pattern of the I/O list object but require the appropriate format when reading input. fpt reports any violation of these rules, requiring that the I edit descriptor references an integer object.

The DEC legacy compilers, VMS, Compaq Visual Fortran, HP-UX, ifort and ifx, and also gfortran with the -dec switch allow the field widths to be omitted. This is non-standard and is not accepted by all systems. Default values are tabulated below.

Default Field Widths

Where field widths are defaulted for edit descriptors tha default field widths depend on the data size of the I/O list objects. The values are:

Data Type Descriptor Data Size Field widths
 
LOGICAL L All sizes L2
 
INTEGER I *1 and *2 I7
*4 I12
*8 I23
 
REAL F *4 F15.7
*8 F25.16
*16 F42.33
E, D, EN and ES *4 E15.7E+2
*8 E25.16E+2
*16 E42.33E+3
 
All Types B *1 and *2 B17
*4 B33
*8 B65
*16 B129
O *1 and *2 O7
*4 O12
*8 O23
*16 O44
Z *1 and *2 Z7
*4 Z12
*8 Z23
*16 Z44

The Formats Checked

Formats in READ, WRITE, REWRITE, ACCEPT, PRINT and TYPE statements may be specified in:

fpt checks the formats in FORMAT statements and those written as strings in the I/O statements. The current version, fpt v4.344, does not check formats written as Fortran parameters or expressions. This is planned for a future version.

Where to Use this Command

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

Default

Formats are not checked by default. (Note that defaults may be changed in the configuration file).

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