fury_system_abstract64
FURY definition of abstract units system with float64 kind. FURY implementation of abstract units system with generic kind.
Source: src/lib/fury_system_abstract64.F90
Dependencies
Contents
- system_abstract
- free
- add_constant_qreal
- add_prefix_string
- add_prefix_uom_reference
- add_unit_string
- add_unit_uom
- const
- list_constants
- list_prefixes
- list_units
- unit
- has_constant
- has_prefix
- has_unit
- qunit_qreal
- is_queried
- has_synonym
Derived Types
system_abstract
Abstract units system class.
Inheritance
Attributes: abstract
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
acronym | character(len=:) | allocatable | Units system acronym, e.g. "SI" for the International System. |
constants | type(qreal) | allocatable | Defined constants. |
constants_number | integer(kind=I_P) | Number of constants. | |
units | type(uom) | allocatable | Defined units. |
units_number | integer(kind=I_P) | Number of units. | |
prefixes | type(uom_reference) | allocatable | Prefixes. |
prefixes_number | integer(kind=I_P) | Number of prefixes. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
initialize | pass(self) | Initialize the units system. |
add_constant | Add a new constant. Generic: add_constant_qreal | |
add_prefix | Add a new prefix. Generic: add_prefix_string, add_prefix_uom_reference | |
add_unit | Add a new unit. Generic: add_unit_string, add_unit_uom | |
const | pass(self) | Return an instance of the queried constant (if defined). |
free | pass(self) | Free the units system. |
list_constants | pass(self) | Return the list of defined constants. |
list_prefixes | pass(self) | Return the list of defined prefixes. |
list_units | pass(self) | Return the list of defined units. |
unit | pass(self) | Return an instance of the queried unit (if defined). |
qunit | Return an instance of quantity with the queried unit. Generic: qunit_qreal | |
add_constant_qreal | pass(self) | Add a new constant from qreal input. |
add_prefix_string | pass(self) | Add a new prefix from string input. |
add_prefix_uom_reference | pass(self) | Add a new prefix from uom_reference input. |
add_unit_string | pass(self) | Add a new unit from string input. |
add_unit_uom | pass(self) | Add a new unit from uom input. |
has_constant | pass(self) | Check if a constant is present into the system. |
has_prefix | pass(self) | Check if a prefix is present into the system. |
has_unit | pass(self) | Check if a unit is present into the system. |
qunit_qreal | pass(self) | Return an instance of quantity with the queried unit. |
Subroutines
free
Free the units system.
Attributes: elemental
subroutine free(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | inout | The system. |
add_constant_qreal
Add a new constant from qreal input.
subroutine add_constant_qreal(self, source)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | inout | The system. | |
source | type(qreal) | in | Constant source. |
Call graph
add_prefix_string
Add a new prefix from string input.
subroutine add_prefix_string(self, source)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | inout | The system. | |
source | character(len=*) | in | Prefix source. |
Call graph
add_prefix_uom_reference
Add a new prefix from uom_reference input.
subroutine add_prefix_uom_reference(self, source)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | inout | The system. | |
source | type(uom_reference) | in | Prefix source. |
Call graph
add_unit_string
Add a new unit from string input.
subroutine add_unit_string(self, source)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | inout | The system. | |
source | character(len=*) | in | Unit source. |
Call graph
add_unit_uom
Add a new unit from uom input.
subroutine add_unit_uom(self, source)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | inout | The system. | |
source | type(uom) | in | Unit source. |
Call graph
Functions
const
Return an instance of the queried constant (if defined).
Returns: type(qreal)
function const(self, c) result(const_)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
c | character(len=*) | in | Constant name. |
Call graph
list_constants
Return the list defined constants.
Returns: character(len=:)
function list_constants(self, with_dimensions, with_aliases, with_name, compact_reals, prefix_string) result(raw)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
with_dimensions | logical | in | optional | Flag to activate dimensions printing. |
with_aliases | logical | in | optional | Flag to activate aliases printing. |
with_name | logical | in | optional | Flag to activate name printing. |
compact_reals | logical | in | optional | Flag to activate real numbers compacting. |
prefix_string | character(len=*) | in | optional | Prefix string. |
Call graph
list_prefixes
Return the list defined prefixes.
Returns: character(len=:)
function list_prefixes(self, with_aliases, compact_reals, prefix_string) result(raw)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
with_aliases | logical | in | optional | Flag to activate alias printing. |
compact_reals | logical | in | optional | Flag to activate real numbers compacting. |
prefix_string | character(len=*) | in | optional | Prefix string. |
Call graph
list_units
Return the list defined units.
Returns: character(len=:)
function list_units(self, with_dimensions, with_aliases, protect_aliases, with_name, compact_reals, prefix_string) result(raw)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
with_dimensions | logical | in | optional | Flag to activate dimensions printing. |
with_aliases | logical | in | optional | Flag to activate aliases printing. |
protect_aliases | logical | in | optional | Flag to activate aliases printing in protected mode. |
with_name | logical | in | optional | Flag to activate name printing. |
compact_reals | logical | in | optional | Flag to activate real numbers compacting. |
prefix_string | character(len=*) | in | optional | Prefix string. |
Call graph
unit
Return an instance of the queried unit (if defined).
The query matches the unit name or a synonym of its main symbol, that is an alias with the same exponent, without multiplicative factor, additive offset or user-supplied converter (e.g. "meter" of "m = metre = meter"). The units obtained prefixing the system units by the system prefixes are queried too (e.g. "km", "kilometre"). The unit returned is undefined if the query matches no unit.
Returns: type(uom)
function unit(self, u) result(unit_)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
u | character(len=*) | in | Unit name or symbol. |
Call graph
has_constant
Return an instance of the queried unit (if defined).
Returns: logical
function has_constant(self, const) result(is_found)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
const | type(qreal) | in | Constant queried. |
Call graph
has_prefix
Check if a prefix is present into the system.
Returns: logical
function has_prefix(self, prefix) result(is_found)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
prefix | type(uom_reference) | in | prefix queried. |
Call graph
has_unit
Check if a unit is present into the system.
Returns: logical
function has_unit(self, unit) result(is_found)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
unit | type(uom) | in | Unit queried. |
Call graph
qunit_qreal
Return an instance of quantity (qreal) with the queried unit (if defined).
This is useful to build quantity by algebric expressions, e.g. q1 = 2.0 * system%qunit('metre').
Returns: type(qreal)
function qunit_qreal(self, u) result(qunit_)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(system_abstract) | in | The system. | |
u | character(len=*) | in | Unit name or main symbol alias. |
Call graph
is_queried
Check if a unit is the queried one: by its name or by a synonym of its main symbol.
The synonyms are searched into the main alias of the unit (e.g. "N" of "kg.m.s-2 (N[force])") and into its reference when it is the only one (e.g. "min" of "minute = 60 * s = min (minute[time])"): a unit made of more references (e.g. "m [length].s-1 [time-1]") is matched by its alias or name only.
Returns: logical
function is_queried(unit, query)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
unit | type(uom) | in | The unit. | |
query | character(len=*) | in | Unit name or symbol. |
Call graph
has_synonym
Check if a reference has a synonym of its main symbol equal to the query.
A synonym is an alias with the same exponent of the main symbol, without multiplicative factor, additive offset or user-supplied converter: "meter" is a synonym of "m = metre = meter", "s" is not a synonym of "Hz = s-1".
Returns: logical
function has_synonym(reference, query)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
reference | type(uom_reference) | in | The reference. | |
query | character(len=*) | in | Symbol queried. |
Call graph