FURY definition of unit of measure class with float64 real kind.
FURY implementation of unit of measure class of generic kind.
Ovearloading uom name with a set of creator functions.
Create an instance of uom from an input source string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | source | Source input string definition of the unit. |
||
| type(uom_reference), | intent(in), | optional | :: | alias | Alias of the unit, e.g Pa (kg.m-1.s-2) for Pascal [pressure]. |
|
| character(len=*), | intent(in), | optional | :: | name | Unit name. |
The unit.
Unit of measure (UOM) class.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | name | Unit name. |
||
| type(uom_reference), | private, | allocatable | :: | alias | Alias of the unit, e.g Pa (kg.m-1.s-2) for Pascal. |
||
| type(uom_reference), | private, | allocatable | :: | references(:) | Reference units of the unit. |
||
| integer(kind=I_P), | private | :: | references_number | = | 0_I_P | References number. |
Ovearloading uom name with a set of creator functions.
| private function creator_from_string(source, alias, name) | Create an instance of uom from an input source string. |
| procedure, public, pass(self) :: get_alias | Return the alias. |
| procedure, public, pass(self) :: get_main_reference | Return the main reference. |
| procedure, public, pass(self) :: get_main_symbol | Return the main symbol. |
| procedure, public, pass(self) :: get_references | Return the references. |
| procedure, public, pass(self) :: has_alias | Check if the unit has an alias. |
| procedure, public, pass(self) :: has_name | Check if the unit has a name. |
| procedure, public, pass(self) :: has_reference | Check if the unit has a queried reference unit. |
| procedure, public, pass(self) :: is_defined | Check if the unit is defined. |
| procedure, public, pass(self) :: prefixed | Return prefixed unit. |
| procedure, public, pass(self) :: set | Set the unit. |
| procedure, public, pass(self) :: set_alias_conversion | Set alias conversion formula. |
| procedure, public, pass(self) :: stringify | Return a string representation of the unit. |
| procedure, public, pass(self) :: to | Convert magnitude with respect another unit. |
| procedure, public, pass(self) :: unset | unset the unit. |
| generic, public :: assignment(=) => assign_uom | Overloading |
| generic, public :: operator(+) => add | Overloading |
| generic, public :: operator(/) => div | Overloading |
| generic, public :: operator(*) => mul | Overloading |
| generic, public :: operator(-) => sub | Overloading |
| generic, public :: operator(**) => pow_R8P, pow_R4P, pow_I8P, pow_I4P, pow_I2P, pow_I1P | Overloading |
| generic, public :: operator(==) => is_equal | Overloading |
| procedure, private, pass(self) :: add_reference | Add a reference unit to unit. |
| procedure, private, pass(self) :: is_equal | Check if unit is equal with another one. |
| procedure, private, pass(self) :: parse | Parse unit definition from an input string. |
| procedure, private, pass(self) :: parse_alias | Parse unit alias from an input string. |
| procedure, private, pass(self) :: parse_name | Parse unit name from an input string. |
| procedure, private, pass(self) :: parse_references | Parse reference units from an input string. |
| procedure, private, pass(self) :: update_references_number | Update reference units number counter. |
| procedure, private, pass(lhs) :: assign_uom |
|
| procedure, private, pass(lhs) :: add |
|
| procedure, private, pass(lhs) :: div |
|
| procedure, private, pass(lhs) :: mul |
|
| procedure, private, pass(lhs) :: sub |
|
| procedure, private, pass(lhs) :: pow_R16P |
|
| procedure, private, pass(lhs) :: pow_R8P |
|
| procedure, private, pass(lhs) :: pow_R4P |
|
| procedure, private, pass(lhs) :: pow_I8P |
|
| procedure, private, pass(lhs) :: pow_I4P |
|
| procedure, private, pass(lhs) :: pow_I2P |
|
| procedure, private, pass(lhs) :: pow_I1P |
|
Create an instance of uom from an input source string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | source | Source input string definition of the unit. |
||
| type(uom_reference), | intent(in), | optional | :: | alias | Alias of the unit, e.g Pa (kg.m-1.s-2) for Pascal [pressure]. |
|
| character(len=*), | intent(in), | optional | :: | name | Unit name. |
The unit.
Return the main symbol, i.e. self%alias%aliases(1)%symbol_ if self%alias is defined or
self%references(1)%aliases(1)%symbol_ if self has only 1 uom_reference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The uom. |
Main alias symbol.
Return the main reference, i.e. self%alias if self%alias is defined or self%references(1) if self has only 1
uom_reference.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The uom. |
Main uom reference.
Check if the unit has a name.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The unit. |
Name presence status.
Check if the unit has a queried reference unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The unit. |
||
| type(uom_reference), | intent(in) | :: | reference | Reference unit to check the presence of. |
reference unit presence status.
Check if the unit has been defined, namely it has defined references.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The unit. |
Definition status.
Return prefixed unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The unit. |
||
| type(uom_reference), | intent(in) | :: | prefixes | Prefixes data. |
Prefixed unit.
Return a string representation of the unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The unit. |
||
| 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 | :: | with_name | Flag to activate name printing. |
|
| logical, | intent(in), | optional | :: | compact_reals | Flag to activate real numbers compacting. |
Raw characters data.
Convert magnitude with respect another unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The uom. |
||
| type(uom), | intent(in) | :: | other | Other unit used for conversion. |
||
| real(kind=RKP), | intent(in) | :: | magnitude | Magnitude to be converted. |
Converted magnitude.
Check if the unit has an alias.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The unit. |
Check result.
Remove a reference from the list of references.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(uom_reference), | intent(inout), | allocatable | :: | references(:) | References list. |
|
| integer(kind=I_P), | intent(in) | :: | id | Index of reference to remove. |
Return the alias.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The uom. |
||
| type(uom_reference), | intent(out) | :: | alias | Uom main alias. |
Return the references.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(in) | :: | self | The uom. |
||
| type(uom_reference), | intent(out), | allocatable | :: | references(:) | Uom references. |
Set the unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(inout) | :: | self | The unit. |
||
| type(uom_reference), | intent(in), | optional | :: | references(1:) | Unit references of the unit. |
|
| type(uom_reference), | intent(in), | optional | :: | alias | Alias of the unit, e.g Pa (kg.m-1.s-2) for Pascal [pressure]. |
|
| character(len=*), | intent(in), | optional | :: | name | Unit name. |
Set alias conversion formula.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(inout) | :: | self | The uom reference. |
||
| integer(kind=I_P), | intent(in) | :: | reference_index | Index of the reference to which set the conversion formula. |
||
| 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. |
Unset the unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(inout) | :: | self | The unit. |
Add reference unit to unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(inout) | :: | self | The unit. |
||
| type(uom_reference), | intent(in) | :: | reference | Unit reference to be added. |
Parse unit definition form an input string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(inout) | :: | self | The unit. |
||
| character(len=*), | intent(in) | :: | source | Input source string. |
Update references number counter.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(uom), | intent(inout) | :: | self | The unit. |