fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

CHECK UNITS

Syntax:

[DO NOT] CHECK UNITS

fpt Version

This command is implemented experimentally in version 3.6-b of fpt and later.

Function

fpt automatically determines the physical units of all scalar real and complex variables. It reports any inconsistencies in units detected during the analysis. A table of the different units identified and the relationships between them may be generated by the SHOW UNITS command. The report generated by CHECK UNITS is limited to the inconsistencies detected.

fpt infers units from the use of variables in algebraic expressions. It first analyses the use of every REAL or COMPLEX variable to determine which uses are independent of one another and are therefore not required to have the same units. The independent usages are termed "lives". Please see the command SHOW LIVES for a description of this analysis. The physical units and dimensions are then analysed as follows:

All inconsistencies between units could be resolved by the assumption that all units are dimensionless. fpt therefore assumes that no real or complex variables represent dimensionless quantities unless they have been declared to be dimensionless by the user, in a UNITS command, or they have been used in intrinsic functions in such a way that they must be dimensionless.

Notation:

The notation for the reported units is as follows:

  1. If the units are determined from the use of intrinsic functions they are reported as the unit name, for example, dimensionless, degrees_arc or seconds.
  2. If the units have been specified by UNITS statements in fsp files or in the code, they are reported by the name specified in the UNITS statement.
  3. Units for which no description is available are reported as, for example, units(gamma,5), where gamma is the name of the variable, and 5 is the life number. If the variable has only a single life, the life number is omitted, as in units(gamma). If a variable name is ambiguous because the name is used in two or more routines, the name is written, for example, as /coeffs/gamma or as dragsub\gamma where /coeffs/ is the name of the COMMON block containing gamma or dragsub is the name of the sub-program in which it occurs.

Format of the Report

Inconsistencies in units are detected during the analysis of algebraic expressions. When an inconsistency is detected, fpt reports an audit trail of the successive units substitutions made in analysing the expression. An inconsistency implies either the use of an undeclared dimensionless quantity, or an error in the code. The audit trail should assist in identifying the problem.

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

No check is made by default.

Example

A section of a report is shown below:

------------------------------------------------------------- WARNING Number 3253 Severity 1 (Worst 1) Count 48 File: e:\projects\fpt\fpttests\uh60a\original_source\bench.f C4Q=1.0-C1Q-C2Q-C3Q ^ Inconsistency detected in units and dimensions -------------------------------------------------------------- Units of the objects -------------------- C1Q Units(C2Q) C2Q Units(C2Q) C3Q Units(EZWNTQ) Successive substitutions in analysing units ------------------------------------------- Initial units of sub-expression: <Undetermined> - Units(C2Q) - Units(C2Q) - Units(EZWNTQ) Units(C2Q) + Units(C2Q) + Units(EZWNTQ) Units(C2Q) + Units(EZWNTQ) These units are inconsistent

See Also

SHOW LIVES

SHOW UNITS

UNITS

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