Unit of measure reference class.
It is the reference unit class composed by only 1 symbol, but with many possible aliases that can be used for conversions.
Provide math operations on symbols necessary to build complex (derived) units.
The string format definition of a valid FURY unit reference definition is as following:
uom_symbolA = uom_symbolB = uom_symbolC = ... [dimensionsA]
where
uom_symbolA is the main symbol of the unit reference; it is stored as the first reference alias and must respect:uom_symbolA%offset_ = 0uom_symbolA%factor_ = 1uom_symbolB, uom_symbolC, ... are the defined aliases and they are optional; they could be totally general with offset
and factor used for conversion formulas, until they respect the uom_symbol syntax;[dimensions] is the last optional term that defines the symbol dimensions (if dimensions exponent is passed it must be
equal to the one of the main symbol.For example, valid definition are:
s-1 = Hz = hertz [time-1]kHz< = 1000.0 * Hz = kilohertz> [frequency]degC< = celsius = 273.15 + K> [temperature]These terms can be separated by any white spaces number (even zero), but the dimensions must be enclosed into [] brackets
at the end of the string.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(uom_symbol), | private, | allocatable | :: | aliases(:) | Uom symbol aliases, e.g. "m = meter = metre" for metres. |
||
| integer(kind=I_P), | private | :: | aliases_number | = | 0_I_P | Number of defined symbol aliases. |
|
| type(uom_symbol), | private | :: | dimensions | Dimensions of the symbol, e.g. "length" for meter. |
Overloading uom_reference name with a creator function.
Create an instance of uom_reference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | source | Source input string definition of the symbol. |
The uom reference.
Return a string representation of the symbol dimensions.
Return a string representation of uom_reference dimensions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
Raw characters data.
Return the aliases list.
Return the aliases list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_symbol), | intent(out), | allocatable | :: | aliases(:) | Aliases. |
Return the dimensions.
Return the dimensions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_symbol), | intent(out) | :: | dimensions | Dimensions. |
Return the main symbol, i.e. aliases(1).
Return the main symbol, i.e. aliases(1).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
First compatible alias.
Check if the reference is defined.
Check if uom_reference is defined.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
Check result.
Parse reference from string.
Parse uom_reference definition from string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(inout) | :: | self | The uom reference. |
||
| character(len=*), | intent(in) | :: | source | Source input string definition of symbol. |
Return a prefixed reference.
Return a prefixed reference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_reference), | intent(in) | :: | prefixes | Other reference used for prefixing. |
The prefixed reference.
Set reference.
Set reference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(inout) | :: | self | The uom reference. |
||
| type(uom_symbol), | intent(in), | optional | :: | aliases(1:) | Reference aliases. |
|
| type(uom_symbol), | intent(in), | optional | :: | dimensions | Dimensions of the reference, e.g. "frequency" for Hz. |
Set alias conversion formula.
Set alias conversion formula.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(inout) | :: | self | The uom reference. |
||
| integer(kind=I_P), | intent(in) | :: | alias_index | Index of the alias to which set the conversion formula. |
||
| class(uom_converter), | intent(in) | :: | convert | Generic conversion alias formula user-supplied. |
Return a string representation of the reference.
Return a string representation of uom_reference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| logical, | intent(in), | optional | :: | with_dimensions | Flag to activate dimensions printing. |
|
| logical, | intent(in), | optional | :: | with_aliases | Flag to activate aliases printing. |
|
| logical, | intent(in), | optional | :: | protect_aliases | Flag to activate aliases printing in protected mode. |
|
| logical, | intent(in), | optional | :: | compact_reals | Flag to activate real numbers compacting. |
Raw characters data.
Convert magnitude with respect another alias.
Convert magnitude with respect another alias.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_reference), | intent(in) | :: | other | Other unit reference used for conversion. |
||
| real(kind=RKP), | intent(in) | :: | magnitude | Magnitude to be converted. |
||
| real(kind=RKP), | intent(out) | :: | converted | Converted magnitude. |
||
| logical, | intent(out) | :: | is_found | Flag to check if a conversion alias has been found. |
Unset reference.
Unset reference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(inout) | :: | self | The uom reference. |
Overloading = assignment.
uom_reference = uom_reference assignment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(inout) | :: | lhs | Left hand side. |
||
| type(uom_reference), | intent(in) | :: | rhs | Right hand side. |
Overloading / operator.
uom_reference / uom_reference operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| type(uom_reference), | intent(in) | :: | rhs | Right hand side. |
Operator result.
Overloading * operator.
uom_reference * uom_reference operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| type(uom_reference), | intent(in) | :: | rhs | Right hand side. |
Operator result.
Overloading ** operator.
uom_reference ** real(R8P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| real(kind=R8P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** real(R4P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| real(kind=R4P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I8P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I8P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I4P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I4P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I2P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I2P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I1P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I1P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
Overloading == operator.
Check if uom_reference is equal with another one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_reference), | intent(in) | :: | other | The other reference. |
Check result.
Definition of .compatible. operator.
Check if uom_reference is compatible with another one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_reference), | intent(in) | :: | other | The other reference. |
Check result.
Check if the reference is compatible with another one.
Check if uom_reference is compatible with another one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_reference), | intent(in) | :: | other | The other reference. |
Check result.
Check if the reference is equal with another one.
Check if uom_reference is equal with another one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | self | The uom reference. |
||
| type(uom_reference), | intent(in) | :: | other | The other reference. |
Check result.
uom_reference = uom_reference assignment.
uom_reference = uom_reference assignment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(inout) | :: | lhs | Left hand side. |
||
| type(uom_reference), | intent(in) | :: | rhs | Right hand side. |
uom_reference / uom_reference operator.
uom_reference / uom_reference operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| type(uom_reference), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference * uom_reference operator.
uom_reference * uom_reference operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| type(uom_reference), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** real(R16P) operator.
uom_reference ** real(R16P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| real(kind=R16P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** real(R8P) operator.
uom_reference ** real(R8P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| real(kind=R8P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** real(R4P) operator.
uom_reference ** real(R4P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| real(kind=R4P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I8P) operator.
uom_reference ** integer(I8P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I8P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I4P) operator.
uom_reference ** integer(I4P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I4P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I2P) operator.
uom_reference ** integer(I2P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I2P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
uom_reference ** integer(I1P) operator.
uom_reference ** integer(I1P) operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom_reference), | intent(in) | :: | lhs | Left hand side. |
||
| integer(kind=I1P), | intent(in) | :: | rhs | Right hand side. |
Operator result.