Unit system processing module. More...
Data Types | |
| type | units |
| interface | clear |
| interface | deallocate |
| interface | operator(*) |
| interface | operator(/) |
| interface | operator(+) |
Functions/Subroutines | |
| logical function, public | add_okay (u1, u2) |
Unit system processing module.
This module provides procedures for unit system processing. It includes a derived type UNITS for representing physical units and operators for unit arithmetic (multiplication, division, addition).
| Operator/Procedure | Description |
|---|---|
| assignment(=) | Build UNITS from string or convert to string |
| operator(*) | Multiply two UNITS |
| operator(/) | Divide two UNITS |
| operator(+) | Add two UNITS (with compatibility check) |
| clear | Initialize UNITS variable |
| deallocate | Deallocate UNITS variable |
| add_okay | Check if two UNITS are compatible for addition |
| logical function, public dc_units::add_okay | ( | type(units), intent(in) | u1, |
| type(units), intent(in) | u2 ) |
Check if two UNITS are compatible for addition
Two units are compatible if they have the same dimensions (i.e., the same unit elements with the same powers).
| [in] | u1 | First UNITS variable |
| [in] | u2 | Second UNITS variable |
Definition at line 307 of file dc_units.f90.