FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


SHOW UNITS

Syntax:

[DO NOT] SHOW 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:

  1. Any inconsistencies in units detected during the analysis. Please see the command CHECK UNITS for a description of this report.

  2. A table of the different units identified and the relationships between them.

  3. A table of the different lives of the variables and the units which they have. Please see the command SHOW LIVES for a description of variable lives.

FPT infers units from the use of variables in algebraic expressions. If two variable lives are connected by assignment, addition, subtraction or relational operators they must have the same units. If two variable lives are connected by multiplication, division or exponentiation operators, a relationship is inferred between the units associated with the lives. The arguments and reslts of many intrinsic functions have predeterined units. For example, the argument to SIND has units of degrees of arc and the result is dimensionless.

Pattern matching is used to identify equivalence between units. If two different units are found to equivalent to the same algebraic combination of other unts, the two units are recognised as equivalent.

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 written within 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.

Precedence: When two units are found to be equivalent, a single name is used to represent them. The names take precedence in the order:

  1. dimensionless;

  2. Other pre-determined units, such as degrees_arc;

  3. Unit names specified in UNITS statements in FSP files or the code;

  4. The names of Fortran parameters;

  5. The names of lives which have been set equal to constant values;

  6. The names of lives which have not been set equal to constants;

  7. Intermediate values in expressions.

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


Example:

Parts of an example listing are shown below:

Units(T_OMEGA)
   ==    Units(TIME)            ** -1
 
   ==    Units(TVEL)            ** 1
      *  Units(T_RADIUS)        ** -1
 
   Variables or variable lives
    Life(M_OMEGA,0) Life(M_OMEGA,1) T_OMEGA         SHAFT_W
 
Units(TIME)
 
   Variables or variable lives
    DT              RPT_TIME
    TIME
 
UNITS OF SYMBOLS
================
 
AZCLM                             Undetermined
AZIN                              Dimensionless
AZP                               Units(/XFLOAT/AX,1)
BSP                               has multiple units.  Lives:
------------------------------------------------------------------------------
Life: 1                           Units(SPAN),   Assignments:
 
Line:  5626,   File: e:\projects\fpt\fpttests\hel1\original_source\bench.f
         BSP=8.322
------------------------------------------------------------------------------
Life: 2                           Units(CRPSI),   Assignments:
 
**** Uninitialised state ****
 
Line:  5691,   File: e:\projects\fpt\fpttests\hel1\original_source\bench.f
         BSP=BR*SRPSI
------------------------------------------------------------------------------


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