fury_mixed_kinds.F90 Source File

FURY, definition of operators for mixed kinds math.

This File Depends On

sourcefile~~fury_mixed_kinds.f90~~EfferentGraph sourcefile~fury_mixed_kinds.f90 fury_mixed_kinds.F90 sourcefile~fury_uom32.f90 fury_uom32.F90 sourcefile~fury_uom32.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_qreal32.f90 fury_qreal32.F90 sourcefile~fury_uom32.f90->sourcefile~fury_qreal32.f90 sourcefile~fury_uom_symbol128.f90 fury_uom_symbol128.F90 sourcefile~fury_uom_symbol128.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom_reference128.f90 fury_uom_reference128.F90 sourcefile~fury_uom_symbol128.f90->sourcefile~fury_uom_reference128.f90 sourcefile~fury_uom128.f90 fury_uom128.F90 sourcefile~fury_uom_symbol128.f90->sourcefile~fury_uom128.f90 sourcefile~fury_uom_reference128.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom_reference128.f90->sourcefile~fury_uom128.f90 sourcefile~fury_uom_reference64.f90 fury_uom_reference64.F90 sourcefile~fury_uom_reference64.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom64.f90 fury_uom64.F90 sourcefile~fury_uom_reference64.f90->sourcefile~fury_uom64.f90 sourcefile~fury_uom_symbol32.f90 fury_uom_symbol32.F90 sourcefile~fury_uom_symbol32.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom_symbol32.f90->sourcefile~fury_uom32.f90 sourcefile~fury_uom_reference32.f90 fury_uom_reference32.F90 sourcefile~fury_uom_symbol32.f90->sourcefile~fury_uom_reference32.f90 sourcefile~fury_uom64.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_qreal64.f90 fury_qreal64.F90 sourcefile~fury_uom64.f90->sourcefile~fury_qreal64.f90 sourcefile~fury_qreal128.f90 fury_qreal128.F90 sourcefile~fury_qreal128.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~stringifor.f90 stringifor.F90 sourcefile~stringifor.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~stringifor.f90->sourcefile~fury_uom32.f90 sourcefile~stringifor.f90->sourcefile~fury_uom_symbol128.f90 sourcefile~stringifor.f90->sourcefile~fury_uom_reference128.f90 sourcefile~stringifor.f90->sourcefile~fury_uom_reference64.f90 sourcefile~stringifor.f90->sourcefile~fury_uom_symbol32.f90 sourcefile~stringifor.f90->sourcefile~fury_uom64.f90 sourcefile~stringifor.f90->sourcefile~fury_qreal128.f90 sourcefile~stringifor.f90->sourcefile~fury_qreal32.f90 sourcefile~fury_uom_symbol64.f90 fury_uom_symbol64.F90 sourcefile~stringifor.f90->sourcefile~fury_uom_symbol64.f90 sourcefile~stringifor.f90->sourcefile~fury_qreal64.f90 sourcefile~stringifor.f90->sourcefile~fury_uom128.f90 sourcefile~stringifor.f90->sourcefile~fury_uom_reference32.f90 sourcefile~fury_uom_converter.f90 fury_uom_converter.F90 sourcefile~fury_uom_converter.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom32.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom_symbol128.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom_reference128.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom_reference64.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom_symbol32.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom64.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom_symbol64.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom128.f90 sourcefile~fury_uom_converter.f90->sourcefile~fury_uom_reference32.f90 sourcefile~fury_qreal32.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~penf.f90 penf.F90 sourcefile~penf.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~penf.f90->sourcefile~fury_uom32.f90 sourcefile~penf.f90->sourcefile~fury_uom_symbol128.f90 sourcefile~penf.f90->sourcefile~fury_uom_reference128.f90 sourcefile~penf.f90->sourcefile~fury_uom_reference64.f90 sourcefile~penf.f90->sourcefile~fury_uom_symbol32.f90 sourcefile~penf.f90->sourcefile~fury_uom64.f90 sourcefile~penf.f90->sourcefile~fury_qreal128.f90 sourcefile~penf.f90->sourcefile~stringifor.f90 sourcefile~penf.f90->sourcefile~fury_uom_converter.f90 sourcefile~penf.f90->sourcefile~fury_qreal32.f90 sourcefile~penf.f90->sourcefile~fury_uom_symbol64.f90 sourcefile~penf.f90->sourcefile~fury_qreal64.f90 sourcefile~penf.f90->sourcefile~fury_uom128.f90 sourcefile~penf.f90->sourcefile~fury_uom_reference32.f90 sourcefile~stringifor_string_t.f90 stringifor_string_t.F90 sourcefile~penf.f90->sourcefile~stringifor_string_t.f90 sourcefile~befor64.f90 befor64.F90 sourcefile~penf.f90->sourcefile~befor64.f90 sourcefile~befor64_pack_data_m.f90 befor64_pack_data_m.F90 sourcefile~penf.f90->sourcefile~befor64_pack_data_m.f90 sourcefile~fury_uom_symbol64.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom_symbol64.f90->sourcefile~fury_uom_reference64.f90 sourcefile~fury_uom_symbol64.f90->sourcefile~fury_uom64.f90 sourcefile~fury_qreal64.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom128.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom128.f90->sourcefile~fury_qreal128.f90 sourcefile~fury_uom_reference32.f90->sourcefile~fury_mixed_kinds.f90 sourcefile~fury_uom_reference32.f90->sourcefile~fury_uom32.f90 sourcefile~stringifor_string_t.f90->sourcefile~stringifor.f90 sourcefile~befor64.f90->sourcefile~stringifor_string_t.f90 sourcefile~befor64_pack_data_m.f90->sourcefile~befor64.f90 sourcefile~penf_b_size.f90 penf_b_size.F90 sourcefile~penf_b_size.f90->sourcefile~penf.f90 sourcefile~penf_stringify.f90 penf_stringify.F90 sourcefile~penf_b_size.f90->sourcefile~penf_stringify.f90 sourcefile~penf_global_parameters_variables.f90 penf_global_parameters_variables.F90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf.f90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf_b_size.f90 sourcefile~penf_global_parameters_variables.f90->sourcefile~penf_stringify.f90 sourcefile~penf_stringify.f90->sourcefile~penf.f90
Help

Files Dependent On This One

sourcefile~~fury_mixed_kinds.f90~~AfferentGraph sourcefile~fury_mixed_kinds.f90 fury_mixed_kinds.F90 sourcefile~fury.f90 fury.f90 sourcefile~fury_mixed_kinds.f90->sourcefile~fury.f90 sourcefile~fury_test_qreal_eq.f90 fury_test_qreal_eq.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_eq.f90 sourcefile~fury_test_uom_assign.f90 fury_test_uom_assign.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_assign.f90 sourcefile~fury_test_qreal_eq_mixed.f90 fury_test_qreal_eq_mixed.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_eq_mixed.f90 sourcefile~fury_test_qreal_mul.f90 fury_test_qreal_mul.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_mul.f90 sourcefile~fury_test_qreal_mul_mixed.f90 fury_test_qreal_mul_mixed.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_mul_mixed.f90 sourcefile~fury_test_qreal_not_eq.f90 fury_test_qreal_not_eq.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_not_eq.f90 sourcefile~fury_test_uom_sub.f90 fury_test_uom_sub.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_sub.f90 sourcefile~fury_test_qreal_not_eq_mixed.f90 fury_test_qreal_not_eq_mixed.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_not_eq_mixed.f90 sourcefile~fury_test_qreal_pow.f90 fury_test_qreal_pow.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_pow.f90 sourcefile~fury_test_uom_assign_failure.f90 fury_test_uom_assign_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_assign_failure.f90 sourcefile~fury_test_qreal_sub.f90 fury_test_qreal_sub.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_sub.f90 sourcefile~fury_test_qreal_sub_failure.f90 fury_test_qreal_sub_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_sub_failure.f90 sourcefile~fury_test_qreal_sub_mixed.f90 fury_test_qreal_sub_mixed.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_sub_mixed.f90 sourcefile~fury_test_qreal_sub_mixed_failure.f90 fury_test_qreal_sub_mixed_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_sub_mixed_failure.f90 sourcefile~fury_test_uom_sub_failure.f90 fury_test_uom_sub_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_sub_failure.f90 sourcefile~fury_test_system_si.f90 fury_test_system_si.f90 sourcefile~fury.f90->sourcefile~fury_test_system_si.f90 sourcefile~fury_test_uom_add.f90 fury_test_uom_add.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_add.f90 sourcefile~fury_test_uom_div.f90 fury_test_uom_div.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_div.f90 sourcefile~fury_test_uom_add_failure.f90 fury_test_uom_add_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_add_failure.f90 sourcefile~fury_test_uom_aliases.f90 fury_test_uom_aliases.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_aliases.f90 sourcefile~fury_test_bolt32.f90 fury_test_bolt32.f90 sourcefile~fury.f90->sourcefile~fury_test_bolt32.f90 sourcefile~fury_test_bolt64.f90 fury_test_bolt64.f90 sourcefile~fury.f90->sourcefile~fury_test_bolt64.f90 sourcefile~fury_test_qreal_add.f90 fury_test_qreal_add.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_add.f90 sourcefile~fury_test_uom_mul.f90 fury_test_uom_mul.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_mul.f90 sourcefile~fury_test_qreal_add_aliases_failure.f90 fury_test_qreal_add_aliases_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_add_aliases_failure.f90 sourcefile~fury_test_uom_pow.f90 fury_test_uom_pow.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_pow.f90 sourcefile~fury_test_qreal_add_failure.f90 fury_test_qreal_add_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_add_failure.f90 sourcefile~fury_test_qreal_add_mixed.f90 fury_test_qreal_add_mixed.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_add_mixed.f90 sourcefile~fury_test_qreal_add_mixed_failure.f90 fury_test_qreal_add_mixed_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_add_mixed_failure.f90 sourcefile~fury_test_qreal_aliases.f90 fury_test_qreal_aliases.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_aliases.f90 sourcefile~fury_test_uom_parse_failure.f90 fury_test_uom_parse_failure.f90 sourcefile~fury.f90->sourcefile~fury_test_uom_parse_failure.f90 sourcefile~fury_test_qreal_assign.f90 fury_test_qreal_assign.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_assign.f90 sourcefile~fury_test_qreal_conversions_complex.f90 fury_test_qreal_conversions_complex.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_conversions_complex.f90 sourcefile~fury_test_qreal_conversions_si.f90 fury_test_qreal_conversions_si.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_conversions_si.f90 sourcefile~fury_test_qreal_conversions_simple.f90 fury_test_qreal_conversions_simple.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_conversions_simple.f90 sourcefile~fury_test_qreal_div.f90 fury_test_qreal_div.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_div.f90 sourcefile~fury_test_qreal_div_mixed.f90 fury_test_qreal_div_mixed.f90 sourcefile~fury.f90->sourcefile~fury_test_qreal_div_mixed.f90
Help

Source Code


Source Code

!< FURY, definition of operators for mixed kinds math.
module fury_mixed_kinds
!-----------------------------------------------------------------------------------------------------------------------------------
!< FURY, definition of operators for mixed kinds math.
!-----------------------------------------------------------------------------------------------------------------------------------
use, intrinsic :: iso_fortran_env, only : stderr => error_unit
use fury_qreal32, qreal32 => qreal
use fury_qreal64, qreal64 => qreal
use fury_qreal128, qreal128 => qreal
use fury_uom32, uom32 => uom
use fury_uom64, uom64 => uom
use fury_uom128, uom128 => uom
use fury_uom_converter
use fury_uom_reference32, uom_reference32 => uom_reference
use fury_uom_reference64, uom_reference64 => uom_reference
use fury_uom_reference128, uom_reference128 => uom_reference
use fury_uom_symbol32, uom_symbol32 => uom_symbol
use fury_uom_symbol64, uom_symbol64 => uom_symbol
use fury_uom_symbol128, uom_symbol128 => uom_symbol
use penf
use stringifor
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
implicit none
private
public :: assignment(=)
public :: operator(+)
public :: operator(/)
public :: operator(*)
public :: operator(-)
public :: operator(==)
public :: operator(/=)
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
interface assignment(=)
  ! qreal
  module procedure qreal32_assign_qreal64, qreal64_assign_qreal32
#ifdef r16p
  module procedure qreal32_assign_qreal128, qreal128_assign_qreal32
  module procedure qreal64_assign_qreal128, qreal128_assign_qreal64
#endif
  ! uom
  module procedure uom32_assign_uom64, uom64_assign_uom32
#ifdef r16p
  module procedure uom32_assign_uom128, uom128_assign_uom32
  module procedure uom64_assign_uom128, uom128_assign_uom64
#endif
  ! uom_reference
  module procedure uom_reference32_assign_uom_reference64, uom_reference64_assign_uom_reference32
#ifdef r16p
  module procedure uom_reference32_assign_uom_reference128, uom_reference128_assign_uom_reference32
  module procedure uom_reference64_assign_uom_reference128, uom_reference128_assign_uom_reference64
#endif
  ! uom_symbol
  module procedure uom_symbol32_assign_uom_symbol64, uom_symbol64_assign_uom_symbol32
#ifdef r16p
  module procedure uom_symbol32_assign_uom_symbol128, uom_symbol128_assign_uom_symbol32
  module procedure uom_symbol64_assign_uom_symbol128, uom_symbol128_assign_uom_symbol64
#endif
endinterface

interface operator(+)
  module procedure qreal32_add_qreal64, qreal64_add_qreal32
#ifdef r16p
  module procedure qreal32_add_qreal128, qreal128_add_qreal32
  module procedure qreal64_add_qreal128, qreal128_add_qreal64
#endif
endinterface

interface operator(/)
  module procedure qreal32_div_qreal64, qreal64_div_qreal32
#ifdef r16p
  module procedure qreal32_div_qreal128, qreal128_div_qreal32
  module procedure qreal64_div_qreal128, qreal128_div_qreal64
#endif
endinterface

interface operator(*)
  module procedure qreal32_mul_qreal64, qreal64_mul_qreal32
#ifdef r16p
  module procedure qreal32_mul_qreal128, qreal128_mul_qreal32
  module procedure qreal64_mul_qreal128, qreal128_mul_qreal64
#endif
endinterface

interface operator(-)
  module procedure qreal32_sub_qreal64, qreal64_sub_qreal32
#ifdef r16p
  module procedure qreal32_sub_qreal128, qreal128_sub_qreal32
  module procedure qreal64_sub_qreal128, qreal128_sub_qreal64
#endif
endinterface

interface operator(==)
  module procedure qreal32_eq_qreal64, qreal64_eq_qreal32
#ifdef r16p
  module procedure qreal32_eq_qreal128, qreal128_eq_qreal32
  module procedure qreal64_eq_qreal128, qreal128_eq_qreal64
#endif
endinterface

interface operator(/=)
  module procedure qreal32_not_eq_qreal64, qreal64_not_eq_qreal32
#ifdef r16p
  module procedure qreal32_not_eq_qreal128, qreal128_not_eq_qreal32
  module procedure qreal64_not_eq_qreal128, qreal128_not_eq_qreal64
#endif
endinterface
!-----------------------------------------------------------------------------------------------------------------------------------
contains
  ! assignment(=)
  subroutine qreal32_assign_qreal64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 = qreal64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32), intent(inout) :: lhs !< Left hand side.
  type(qreal64), intent(in)    :: rhs !< Right hand side.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_unit_defined()) then
    lhs%magnitude = rhs%magnitude
    if (allocated(rhs%name)) lhs%name = rhs%name
    if (.not.lhs%is_unit_defined()) then
      call lhs%allocate_unit
      lhs%unit = rhs%unit
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//&
                           '" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine qreal32_assign_qreal64

  subroutine qreal64_assign_qreal32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 = qreal32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64), intent(inout) :: lhs !< Left hand side.
  type(qreal32), intent(in)    :: rhs !< Right hand side.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_unit_defined()) then
    lhs%magnitude = rhs%magnitude
    if (allocated(rhs%name)) lhs%name = rhs%name
    if (.not.lhs%is_unit_defined()) then
      call lhs%allocate_unit
      lhs%unit = rhs%unit
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//&
                           '" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine qreal64_assign_qreal32

  subroutine qreal32_assign_qreal128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 = qreal128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32),  intent(inout) :: lhs !< Left hand side.
  type(qreal128), intent(in)    :: rhs !< Right hand side.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_unit_defined()) then
    lhs%magnitude = rhs%magnitude
    if (allocated(rhs%name)) lhs%name = rhs%name
    if (.not.lhs%is_unit_defined()) then
      call lhs%allocate_unit
      lhs%unit = rhs%unit
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//&
                           '" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine qreal32_assign_qreal128

  subroutine qreal128_assign_qreal32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 = qreal32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(inout) :: lhs !< Left hand side.
  type(qreal32),  intent(in)    :: rhs !< Right hand side.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_unit_defined()) then
    lhs%magnitude = rhs%magnitude
    if (allocated(rhs%name)) lhs%name = rhs%name
    if (.not.lhs%is_unit_defined()) then
      call lhs%allocate_unit
      lhs%unit = rhs%unit
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//&
                           '" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine qreal128_assign_qreal32

  subroutine qreal64_assign_qreal128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 = qreal128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64),  intent(inout) :: lhs !< Left hand side.
  type(qreal128), intent(in)    :: rhs !< Right hand side.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_unit_defined()) then
    lhs%magnitude = rhs%magnitude
    if (allocated(rhs%name)) lhs%name = rhs%name
    if (.not.lhs%is_unit_defined()) then
      call lhs%allocate_unit
      lhs%unit = rhs%unit
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//&
                           '" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine qreal64_assign_qreal128

  subroutine qreal128_assign_qreal64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 = qreal64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(inout) :: lhs !< Left hand side.
  type(qreal64),  intent(in)    :: rhs !< Right hand side.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_unit_defined()) then
    lhs%magnitude = rhs%magnitude
    if (allocated(rhs%name)) lhs%name = rhs%name
    if (.not.lhs%is_unit_defined()) then
      call lhs%allocate_unit
      lhs%unit = rhs%unit
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//&
                           '" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine qreal128_assign_qreal64

  subroutine uom32_assign_uom64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom32 = uom64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom32), intent(inout)         :: lhs               !< Left hand side.
  type(uom64), intent(in)            :: rhs               !< Right hand side.
  type(uom_reference64), allocatable :: rhs_references(:) !< RHS references.
  type(uom_reference64)              :: rhs_alias         !< RHS alias.
  type(uom_reference32), allocatable :: lhs_references(:) !< LHS references.
  type(uom_reference32)              :: lhs_alias         !< LHS alias.
  integer(I_P)                       :: r                 !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      if (allocated(rhs%name)) call lhs%set(name=rhs%name)
      call rhs%get_references(references=rhs_references)
      call rhs%get_alias(alias=rhs_alias)
      if (allocated(rhs_references)) then
        allocate(lhs_references(1:size(rhs_references, dim=1)))
        do r=1, size(rhs_references, dim=1)
          lhs_references(r) = rhs_references(r)
        enddo
        call lhs%set(references=lhs_references)
      endif
      if (rhs_alias%is_defined()) then
        lhs_alias = rhs_alias
        call lhs%set(alias=lhs_alias)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom32_assign_uom64

  subroutine uom64_assign_uom32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom64 = uom32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom64), intent(inout)         :: lhs               !< Left hand side.
  type(uom32), intent(in)            :: rhs               !< Right hand side.
  type(uom_reference32), allocatable :: rhs_references(:) !< RHS references.
  type(uom_reference32)              :: rhs_alias         !< RHS alias.
  type(uom_reference64), allocatable :: lhs_references(:) !< LHS references.
  type(uom_reference64)              :: lhs_alias         !< LHS alias.
  integer(I_P)                       :: r                 !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      if (allocated(rhs%name)) call lhs%set(name=rhs%name)
      call rhs%get_references(references=rhs_references)
      call rhs%get_alias(alias=rhs_alias)
      if (allocated(rhs_references)) then
        allocate(lhs_references(1:size(rhs_references, dim=1)))
        do r=1, size(rhs_references, dim=1)
          lhs_references(r) = rhs_references(r)
        enddo
        call lhs%set(references=lhs_references)
      endif
      if (rhs_alias%is_defined()) then
        lhs_alias = rhs_alias
        call lhs%set(alias=lhs_alias)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom64_assign_uom32

  subroutine uom32_assign_uom128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom32 = uom128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom32),  intent(inout)         :: lhs               !< Left hand side.
  type(uom128), intent(in)            :: rhs               !< Right hand side.
  type(uom_reference128), allocatable :: rhs_references(:) !< RHS references.
  type(uom_reference128)              :: rhs_alias         !< RHS alias.
  type(uom_reference32), allocatable  :: lhs_references(:) !< LHS references.
  type(uom_reference32)               :: lhs_alias         !< LHS alias.
  integer(I_P)                        :: r                 !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      if (allocated(rhs%name)) call lhs%set(name=rhs%name)
      call rhs%get_references(references=rhs_references)
      call rhs%get_alias(alias=rhs_alias)
      if (allocated(rhs_references)) then
        allocate(lhs_references(1:size(rhs_references, dim=1)))
        do r=1, size(rhs_references, dim=1)
          lhs_references(r) = rhs_references(r)
        enddo
        call lhs%set(references=lhs_references)
      endif
      if (rhs_alias%is_defined()) then
        lhs_alias = rhs_alias
        call lhs%set(alias=lhs_alias)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom32_assign_uom128

  subroutine uom128_assign_uom32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom128 = uom32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom128), intent(inout)         :: lhs               !< Left hand side.
  type(uom32),  intent(in)            :: rhs               !< Right hand side.
  type(uom_reference32), allocatable  :: rhs_references(:) !< RHS references.
  type(uom_reference32)               :: rhs_alias         !< RHS alias.
  type(uom_reference128), allocatable :: lhs_references(:) !< LHS references.
  type(uom_reference128)              :: lhs_alias         !< LHS alias.
  integer(I_P)                        :: r                 !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      if (allocated(rhs%name)) call lhs%set(name=rhs%name)
      call rhs%get_references(references=rhs_references)
      call rhs%get_alias(alias=rhs_alias)
      if (allocated(rhs_references)) then
        allocate(lhs_references(1:size(rhs_references, dim=1)))
        do r=1, size(rhs_references, dim=1)
          lhs_references(r) = rhs_references(r)
        enddo
        call lhs%set(references=lhs_references)
      endif
      if (rhs_alias%is_defined()) then
        lhs_alias = rhs_alias
        call lhs%set(alias=lhs_alias)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom128_assign_uom32

  subroutine uom64_assign_uom128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom64 = uom128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom64),  intent(inout)         :: lhs               !< Left hand side.
  type(uom128), intent(in)            :: rhs               !< Right hand side.
  type(uom_reference128), allocatable :: rhs_references(:) !< RHS references.
  type(uom_reference128)              :: rhs_alias         !< RHS alias.
  type(uom_reference64), allocatable  :: lhs_references(:) !< LHS references.
  type(uom_reference64)               :: lhs_alias         !< LHS alias.
  integer(I_P)                        :: r                 !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      if (allocated(rhs%name)) call lhs%set(name=rhs%name)
      call rhs%get_references(references=rhs_references)
      call rhs%get_alias(alias=rhs_alias)
      if (allocated(rhs_references)) then
        allocate(lhs_references(1:size(rhs_references, dim=1)))
        do r=1, size(rhs_references, dim=1)
          lhs_references(r) = rhs_references(r)
        enddo
        call lhs%set(references=lhs_references)
      endif
      if (rhs_alias%is_defined()) then
        lhs_alias = rhs_alias
        call lhs%set(alias=lhs_alias)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom64_assign_uom128

  subroutine uom128_assign_uom64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom128 = uom64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom128), intent(inout)         :: lhs               !< Left hand side.
  type(uom64),  intent(in)            :: rhs               !< Right hand side.
  type(uom_reference64), allocatable  :: rhs_references(:) !< RHS references.
  type(uom_reference64)               :: rhs_alias         !< RHS alias.
  type(uom_reference128), allocatable :: lhs_references(:) !< LHS references.
  type(uom_reference128)              :: lhs_alias         !< LHS alias.
  integer(I_P)                        :: r                 !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      if (allocated(rhs%name)) call lhs%set(name=rhs%name)
      call rhs%get_references(references=rhs_references)
      call rhs%get_alias(alias=rhs_alias)
      if (allocated(rhs_references)) then
        allocate(lhs_references(1:size(rhs_references, dim=1)))
        do r=1, size(rhs_references, dim=1)
          lhs_references(r) = rhs_references(r)
        enddo
        call lhs%set(references=lhs_references)
      endif
      if (rhs_alias%is_defined()) then
        lhs_alias = rhs_alias
        call lhs%set(alias=lhs_alias)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom128_assign_uom64

  subroutine uom_reference32_assign_uom_reference64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_reference32 = uom_reference64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_reference32), intent(inout) :: lhs            !< Left hand side.
  type(uom_reference64), intent(in)    :: rhs            !< Right hand side.
  type(uom_symbol64), allocatable      :: rhs_aliases(:) !< RHS uom symbol aliases.
  type(uom_symbol64)                   :: rhs_dimensions !< RHS dimensions.
  type(uom_symbol32), allocatable      :: lhs_aliases(:) !< LHS uom symbol aliases.
  type(uom_symbol32)                   :: lhs_dimensions !< LHS dimensions.
  integer(I_P)                         :: a              !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      call rhs%get_aliases(aliases=rhs_aliases)
      call rhs%get_dimensions(dimensions=rhs_dimensions)
      if (allocated(rhs_aliases)) then
        allocate(lhs_aliases(1:size(rhs_aliases, dim=1)))
        do a=1, size(rhs_aliases, dim=1)
          lhs_aliases(a) = rhs_aliases(a)
        enddo
        call lhs%set(aliases=lhs_aliases)
      endif
      if (rhs_dimensions%is_defined()) then
        lhs_dimensions = rhs_dimensions
        call lhs%set(dimensions=lhs_dimensions)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_reference32_assign_uom_reference64

  subroutine uom_reference64_assign_uom_reference32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_reference64 = uom_reference32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_reference64), intent(inout) :: lhs            !< Left hand side.
  type(uom_reference32), intent(in)    :: rhs            !< Right hand side.
  type(uom_symbol32), allocatable      :: rhs_aliases(:) !< RHS uom symbol aliases.
  type(uom_symbol32)                   :: rhs_dimensions !< RHS dimensions.
  type(uom_symbol64), allocatable      :: lhs_aliases(:) !< LHS uom symbol aliases.
  type(uom_symbol64)                   :: lhs_dimensions !< LHS dimensions.
  integer(I_P)                         :: a              !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      call rhs%get_aliases(aliases=rhs_aliases)
      call rhs%get_dimensions(dimensions=rhs_dimensions)
      if (allocated(rhs_aliases)) then
        allocate(lhs_aliases(1:size(rhs_aliases, dim=1)))
        do a=1, size(rhs_aliases, dim=1)
          lhs_aliases(a) = rhs_aliases(a)
        enddo
        call lhs%set(aliases=lhs_aliases)
      endif
      if (rhs_dimensions%is_defined()) then
        lhs_dimensions = rhs_dimensions
        call lhs%set(dimensions=lhs_dimensions)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_reference64_assign_uom_reference32

  subroutine uom_reference32_assign_uom_reference128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_reference32 = uom_reference128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_reference32),  intent(inout) :: lhs            !< Left hand side.
  type(uom_reference128), intent(in)    :: rhs            !< Right hand side.
  type(uom_symbol128), allocatable      :: rhs_aliases(:) !< RHS uom symbol aliases.
  type(uom_symbol128)                   :: rhs_dimensions !< RHS dimensions.
  type(uom_symbol32), allocatable       :: lhs_aliases(:) !< LHS uom symbol aliases.
  type(uom_symbol32)                    :: lhs_dimensions !< LHS dimensions.
  integer(I_P)                          :: a              !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      call rhs%get_aliases(aliases=rhs_aliases)
      call rhs%get_dimensions(dimensions=rhs_dimensions)
      if (allocated(rhs_aliases)) then
        allocate(lhs_aliases(1:size(rhs_aliases, dim=1)))
        do a=1, size(rhs_aliases, dim=1)
          lhs_aliases(a) = rhs_aliases(a)
        enddo
        call lhs%set(aliases=lhs_aliases)
      endif
      if (rhs_dimensions%is_defined()) then
        lhs_dimensions = rhs_dimensions
        call lhs%set(dimensions=lhs_dimensions)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_reference32_assign_uom_reference128

  subroutine uom_reference128_assign_uom_reference32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_reference128 = uom_reference32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_reference128), intent(inout) :: lhs            !< Left hand side.
  type(uom_reference32),  intent(in)    :: rhs            !< Right hand side.
  type(uom_symbol32), allocatable       :: rhs_aliases(:) !< RHS uom symbol aliases.
  type(uom_symbol32)                    :: rhs_dimensions !< RHS dimensions.
  type(uom_symbol128), allocatable      :: lhs_aliases(:) !< LHS uom symbol aliases.
  type(uom_symbol128)                   :: lhs_dimensions !< LHS dimensions.
  integer(I_P)                          :: a              !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      call rhs%get_aliases(aliases=rhs_aliases)
      call rhs%get_dimensions(dimensions=rhs_dimensions)
      if (allocated(rhs_aliases)) then
        allocate(lhs_aliases(1:size(rhs_aliases, dim=1)))
        do a=1, size(rhs_aliases, dim=1)
          lhs_aliases(a) = rhs_aliases(a)
        enddo
        call lhs%set(aliases=lhs_aliases)
      endif
      if (rhs_dimensions%is_defined()) then
        lhs_dimensions = rhs_dimensions
        call lhs%set(dimensions=lhs_dimensions)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_reference128_assign_uom_reference32

  subroutine uom_reference64_assign_uom_reference128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_reference64 = uom_reference128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_reference64),  intent(inout) :: lhs            !< Left hand side.
  type(uom_reference128), intent(in)    :: rhs            !< Right hand side.
  type(uom_symbol128), allocatable      :: rhs_aliases(:) !< RHS uom symbol aliases.
  type(uom_symbol128)                   :: rhs_dimensions !< RHS dimensions.
  type(uom_symbol64), allocatable       :: lhs_aliases(:) !< LHS uom symbol aliases.
  type(uom_symbol64)                    :: lhs_dimensions !< LHS dimensions.
  integer(I_P)                          :: a              !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      call rhs%get_aliases(aliases=rhs_aliases)
      call rhs%get_dimensions(dimensions=rhs_dimensions)
      if (allocated(rhs_aliases)) then
        allocate(lhs_aliases(1:size(rhs_aliases, dim=1)))
        do a=1, size(rhs_aliases, dim=1)
          lhs_aliases(a) = rhs_aliases(a)
        enddo
        call lhs%set(aliases=lhs_aliases)
      endif
      if (rhs_dimensions%is_defined()) then
        lhs_dimensions = rhs_dimensions
        call lhs%set(dimensions=lhs_dimensions)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_reference64_assign_uom_reference128

  subroutine uom_reference128_assign_uom_reference64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_reference128 = uom_reference64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_reference128), intent(inout) :: lhs            !< Left hand side.
  type(uom_reference64),  intent(in)    :: rhs            !< Right hand side.
  type(uom_symbol64), allocatable       :: rhs_aliases(:) !< RHS uom symbol aliases.
  type(uom_symbol64)                    :: rhs_dimensions !< RHS dimensions.
  type(uom_symbol128), allocatable      :: lhs_aliases(:) !< LHS uom symbol aliases.
  type(uom_symbol128)                   :: lhs_dimensions !< LHS dimensions.
  integer(I_P)                          :: a              !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      call rhs%get_aliases(aliases=rhs_aliases)
      call rhs%get_dimensions(dimensions=rhs_dimensions)
      if (allocated(rhs_aliases)) then
        allocate(lhs_aliases(1:size(rhs_aliases, dim=1)))
        do a=1, size(rhs_aliases, dim=1)
          lhs_aliases(a) = rhs_aliases(a)
        enddo
        call lhs%set(aliases=lhs_aliases)
      endif
      if (rhs_dimensions%is_defined()) then
        lhs_dimensions = rhs_dimensions
        call lhs%set(dimensions=lhs_dimensions)
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//&
                           lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
                           rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_reference128_assign_uom_reference64

  subroutine uom_symbol32_assign_uom_symbol64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_symbol32 = uom_symbol64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_symbol32), intent(inout) :: lhs       !< Left hand side.
  type(uom_symbol64), intent(in)    :: rhs       !< Right hand side.
  integer(I_P)                      :: exponent_ !< Exponent of the symbol, e.g. "-1" for Hertz, namely "s-1".
  real(R8P)                         :: factor_   !< Symbol multiplicative scale factor (used only for converters).
  real(R8P)                         :: offset_   !< Symbol additive offset (used only for converters).
  type(string)                      :: symbol_   !< literal symbol, e.g. "m" for metres.
  class(uom_converter), allocatable :: convert_  !< Generic conversion alias formula user-supplied.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      exponent_ = rhs%get_exponent()
      factor_ = rhs%get_factor()
      offset_ = rhs%get_offset()
      symbol_ = rhs%get_symbol()
      call rhs%get_convert(convert_=convert_)
      if (allocated(convert_)) then
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_,           &
                     factor_=real(factor_, R4P), offset_=real(offset_, R4P), &
                     convert_=convert_)
      else
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R4P), offset_=real(offset_, R4P))
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_symbol32_assign_uom_symbol64

  subroutine uom_symbol64_assign_uom_symbol32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_symbol64 = uom_symbol32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_symbol64), intent(inout) :: lhs       !< Left hand side.
  type(uom_symbol32), intent(in)    :: rhs       !< Right hand side.
  integer(I_P)                      :: exponent_ !< Exponent of the symbol, e.g. "-1" for Hertz, namely "s-1".
  real(R4P)                         :: factor_   !< Symbol multiplicative scale factor (used only for converters).
  real(R4P)                         :: offset_   !< Symbol additive offset (used only for converters).
  type(string)                      :: symbol_   !< literal symbol, e.g. "m" for metres.
  class(uom_converter), allocatable :: convert_  !< Generic conversion alias formula user-supplied.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      exponent_ = rhs%get_exponent()
      factor_ = rhs%get_factor()
      offset_ = rhs%get_offset()
      symbol_ = rhs%get_symbol()
      call rhs%get_convert(convert_=convert_)
      if (allocated(convert_)) then
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_,           &
                     factor_=real(factor_, R8P), offset_=real(offset_, R8P), &
                     convert_=convert_)
      else
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R8P), offset_=real(offset_, R8P))
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_symbol64_assign_uom_symbol32

  subroutine uom_symbol32_assign_uom_symbol128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_symbol32 = uom_symbol128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_symbol32),  intent(inout) :: lhs       !< Left hand side.
  type(uom_symbol128), intent(in)    :: rhs       !< Right hand side.
  integer(I_P)                       :: exponent_ !< Exponent of the symbol, e.g. "-1" for Hertz, namely "s-1".
  real(R16P)                         :: factor_   !< Symbol multiplicative scale factor (used only for converters).
  real(R16P)                         :: offset_   !< Symbol additive offset (used only for converters).
  type(string)                       :: symbol_   !< literal symbol, e.g. "m" for metres.
  class(uom_converter), allocatable  :: convert_  !< Generic conversion alias formula user-supplied.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      exponent_ = rhs%get_exponent()
      factor_ = rhs%get_factor()
      offset_ = rhs%get_offset()
      symbol_ = rhs%get_symbol()
      call rhs%get_convert(convert_=convert_)
      if (allocated(convert_)) then
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_,           &
                     factor_=real(factor_, R4P), offset_=real(offset_, R4P), &
                     convert_=convert_)
      else
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R4P), offset_=real(offset_, R4P))
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_symbol32_assign_uom_symbol128

  subroutine uom_symbol128_assign_uom_symbol32(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_symbol128 = uom_symbol32` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_symbol128), intent(inout) :: lhs       !< Left hand side.
  type(uom_symbol32),  intent(in)    :: rhs       !< Right hand side.
  integer(I_P)                       :: exponent_ !< Exponent of the symbol, e.g. "-1" for Hertz, namely "s-1".
  real(R4P)                          :: factor_   !< Symbol multiplicative scale factor (used only for converters).
  real(R4P)                          :: offset_   !< Symbol additive offset (used only for converters).
  type(string)                       :: symbol_   !< literal symbol, e.g. "m" for metres.
  class(uom_converter), allocatable  :: convert_  !< Generic conversion alias formula user-supplied.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      exponent_ = rhs%get_exponent()
      factor_ = rhs%get_factor()
      offset_ = rhs%get_offset()
      symbol_ = rhs%get_symbol()
      call rhs%get_convert(convert_=convert_)
      if (allocated(convert_)) then
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_,             &
                     factor_=real(factor_, R16P), offset_=real(offset_, R16P), &
                     convert_=convert_)
      else
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R16P), offset_=real(offset_, R16P))
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_symbol128_assign_uom_symbol32

  subroutine uom_symbol64_assign_uom_symbol128(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_symbol64 = uom_symbol128` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_symbol64),  intent(inout) :: lhs       !< Left hand side.
  type(uom_symbol128), intent(in)    :: rhs       !< Right hand side.
  integer(I_P)                       :: exponent_ !< Exponent of the symbol, e.g. "-1" for Hertz, namely "s-1".
  real(R16P)                         :: factor_   !< Symbol multiplicative scale factor (used only for converters).
  real(R16P)                         :: offset_   !< Symbol additive offset (used only for converters).
  type(string)                       :: symbol_   !< literal symbol, e.g. "m" for metres.
  class(uom_converter), allocatable  :: convert_  !< Generic conversion alias formula user-supplied.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      exponent_ = rhs%get_exponent()
      factor_ = rhs%get_factor()
      offset_ = rhs%get_offset()
      symbol_ = rhs%get_symbol()
      call rhs%get_convert(convert_=convert_)
      if (allocated(convert_)) then
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_,           &
                     factor_=real(factor_, R8P), offset_=real(offset_, R8P), &
                     convert_=convert_)
      else
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R8P), offset_=real(offset_, R8P))
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_symbol64_assign_uom_symbol128

  subroutine uom_symbol128_assign_uom_symbol64(lhs, rhs)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `uom_symbol128 = uom_symbol64` assignment.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(uom_symbol128), intent(inout) :: lhs       !< Left hand side.
  type(uom_symbol64),  intent(in)    :: rhs       !< Right hand side.
  integer(I_P)                       :: exponent_ !< Exponent of the symbol, e.g. "-1" for Hertz, namely "s-1".
  real(R8P)                          :: factor_   !< Symbol multiplicative scale factor (used only for converters).
  real(R8P)                          :: offset_   !< Symbol additive offset (used only for converters).
  type(string)                       :: symbol_   !< literal symbol, e.g. "m" for metres.
  class(uom_converter), allocatable  :: convert_  !< Generic conversion alias formula user-supplied.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (rhs%is_defined())  then
    if (.not.lhs%is_defined())  then
      exponent_ = rhs%get_exponent()
      factor_ = rhs%get_factor()
      offset_ = rhs%get_offset()
      symbol_ = rhs%get_symbol()
      call rhs%get_convert(convert_=convert_)
      if (allocated(convert_)) then
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_,             &
                     factor_=real(factor_, R16P), offset_=real(offset_, R16P), &
                     convert_=convert_)
      else
        call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R16P), offset_=real(offset_, R16P))
      endif
    else
      write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
      stop
    endif
  endif
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine uom_symbol128_assign_uom_symbol64

  ! operator(+)
  function qreal32_add_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 + qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32), intent(in) :: lhs !< Left hand side.
  type(qreal64), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = lhs
  opr = opr + rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_add_qreal64

  function qreal64_add_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 + qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64), intent(in) :: lhs !< Left hand side.
  type(qreal32), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = rhs
  opr = lhs + opr
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_add_qreal32

  function qreal32_add_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 + qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = lhs
  opr = opr + rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_add_qreal128

  function qreal128_add_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 + qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal32),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = rhs
  opr = lhs + opr
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_add_qreal32

  function qreal64_add_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 + qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = lhs
  opr = opr + rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_add_qreal128

  function qreal128_add_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 + qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal64),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = rhs
  opr = lhs + opr
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_add_qreal64

  ! operator(/)
  function qreal32_div_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 / qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32), intent(in) :: lhs !< Left hand side.
  type(qreal64), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp / rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_div_qreal64

  function qreal64_div_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 / qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64), intent(in) :: lhs !< Left hand side.
  type(qreal32), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs / tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_div_qreal32

  function qreal32_div_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 / qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp / rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_div_qreal128

  function qreal128_div_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 / qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal32),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs / tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_div_qreal32

  function qreal64_div_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 / qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp / rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_div_qreal128

  function qreal128_div_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 / qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal64),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs / tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_div_qreal64

  ! operator(*)
  function qreal32_mul_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 * qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32), intent(in) :: lhs !< Left hand side.
  type(qreal64), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp * rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_mul_qreal64

  function qreal64_mul_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 * qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64), intent(in) :: lhs !< Left hand side.
  type(qreal32), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs * tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_mul_qreal32

  function qreal32_mul_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 * qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp * rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_mul_qreal128

  function qreal128_mul_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 * qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal32),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs * tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_mul_qreal32

  function qreal64_mul_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 * qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp * rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_mul_qreal128

  function qreal128_mul_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 * qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal64),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs * tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_mul_qreal64

  ! operator(-)
  function qreal32_sub_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 - qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32), intent(in) :: lhs !< Left hand side.
  type(qreal64), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = lhs
  opr = opr - rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_sub_qreal64

  function qreal64_sub_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 - qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64), intent(in) :: lhs !< Left hand side.
  type(qreal32), intent(in) :: rhs !< Right hand side.
  type(qreal64)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = rhs
  opr = lhs - opr
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_sub_qreal32

  function qreal32_sub_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 - qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = lhs
  opr = opr - rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_sub_qreal128

  function qreal128_sub_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 - qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal32),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = rhs
  opr = lhs - opr
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_sub_qreal32

  function qreal64_sub_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 - qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = lhs
  opr = opr - rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_sub_qreal128

  function qreal128_sub_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 - qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal64),  intent(in) :: rhs !< Right hand side.
  type(qreal128)             :: opr !< Operator result.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  opr = rhs
  opr = lhs - opr
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_sub_qreal64

  ! operator(==)
  function qreal32_eq_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 == qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32), intent(in) :: lhs !< Left hand side.
  type(qreal64), intent(in) :: rhs !< Right hand side.
  logical                   :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp == rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_eq_qreal64

  function qreal64_eq_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 == qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64), intent(in) :: lhs !< Left hand side.
  type(qreal32), intent(in) :: rhs !< Right hand side.
  logical                   :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs == tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_eq_qreal32

  function qreal32_eq_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 == qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp == rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_eq_qreal128

  function qreal128_eq_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 == qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal32),  intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs == tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_eq_qreal32

  function qreal64_eq_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 == qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp == rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_eq_qreal128

  function qreal128_eq_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 == qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal64),  intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs == tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_eq_qreal64

  ! operator(/=)
  function qreal32_not_eq_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 /= qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32), intent(in) :: lhs !< Left hand side.
  type(qreal64), intent(in) :: rhs !< Right hand side.
  logical                   :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp /= rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_not_eq_qreal64

  function qreal64_not_eq_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 /= qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64), intent(in) :: lhs !< Left hand side.
  type(qreal32), intent(in) :: rhs !< Right hand side.
  logical                   :: opr !< Operator result.
  type(qreal64)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs /= tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_not_eq_qreal32

  function qreal32_not_eq_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal32 /= qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal32),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp /= rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal32_not_eq_qreal128

  function qreal128_not_eq_qreal32(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 /= qreal32` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal32),  intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs /= tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_not_eq_qreal32

  function qreal64_not_eq_qreal128(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal64 /= qreal128` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal64),  intent(in) :: lhs !< Left hand side.
  type(qreal128), intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = lhs
  opr = tmp /= rhs
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal64_not_eq_qreal128

  function qreal128_not_eq_qreal64(lhs, rhs) result(opr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< `qreal128 /= qreal64` operator.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(qreal128), intent(in) :: lhs !< Left hand side.
  type(qreal64),  intent(in) :: rhs !< Right hand side.
  logical                    :: opr !< Operator result.
  type(qreal128)             :: tmp !< Temporary buffer with high precision.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  tmp = rhs
  opr = lhs /= tmp
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction qreal128_not_eq_qreal64
endmodule fury_mixed_kinds

assignments.f90 basename_dir.f90 befor64.F90 befor64.F90 befor64_pack_data_m.F90 befor64_pack_data_m.F90 camelcase.f90 capitalize.f90 compact_real.f90 compact_real.f90 compact_real.f90 concatenation.f90 csv_naive_parser.f90 decode.f90 encode.f90 equal.f90 escape.f90 extension.f90 fill.f90 free.f90 fury.f90 fury_mixed_kinds.F90 fury_qreal128.F90 fury_qreal32.F90 fury_qreal64.F90 fury_system_abstract128.F90 fury_system_abstract32.F90 fury_system_abstract64.F90 fury_system_si128.F90 fury_system_si32.F90 fury_system_si64.F90 fury_test_bolt32.f90 fury_test_bolt64.f90 fury_test_qreal_add.f90 fury_test_qreal_add_aliases_failure.f90 fury_test_qreal_add_failure.f90 fury_test_qreal_add_mixed.f90 fury_test_qreal_add_mixed_failure.f90 fury_test_qreal_aliases.f90 fury_test_qreal_assign.f90 fury_test_qreal_conversions_complex.f90 fury_test_qreal_conversions_si.f90 fury_test_qreal_conversions_simple.f90 fury_test_qreal_div.f90 fury_test_qreal_div_mixed.f90 fury_test_qreal_eq.f90 fury_test_qreal_eq_mixed.f90 fury_test_qreal_mul.f90 fury_test_qreal_mul_mixed.f90 fury_test_qreal_not_eq.f90 fury_test_qreal_not_eq_mixed.f90 fury_test_qreal_pow.f90 fury_test_qreal_sub.f90 fury_test_qreal_sub_failure.f90 fury_test_qreal_sub_mixed.f90 fury_test_qreal_sub_mixed_failure.f90 fury_test_system_si.f90 fury_test_uom_add.f90 fury_test_uom_add_failure.f90 fury_test_uom_aliases.f90 fury_test_uom_assign.f90 fury_test_uom_assign_failure.f90 fury_test_uom_div.f90 fury_test_uom_mul.f90 fury_test_uom_parse_failure.f90 fury_test_uom_pow.f90 fury_test_uom_sub.f90 fury_test_uom_sub_failure.f90 fury_uom128.F90 fury_uom32.F90 fury_uom64.F90 fury_uom_converter.F90 fury_uom_reference128.F90 fury_uom_reference32.F90 fury_uom_reference64.F90 fury_uom_symbol128.F90 fury_uom_symbol32.F90 fury_uom_symbol64.F90 greater_equal_than.f90 greater_than.f90 insert.f90 io_basic.F90 io_listdirected.F90 is_digit.f90 is_integer.f90 is_number.f90 is_real.f90 join.f90 lower_equal_than.f90 lower_than.f90 not_equal.f90 partition.f90 penf.F90 penf.F90 penf.F90 penf.F90 penf.F90 penf_b_size.F90 penf_global_parameters_variables.F90 penf_stringify.F90 read_file.f90 read_line.f90 read_lines.f90 replace.f90 reverse.f90 sadjustlr.f90 scount.f90 search.f90 sindex.f90 slen.f90 slice.f90 snakecase.f90 split.f90 srepeat.f90 sscan.f90 start_end.f90 startcase.f90 strim.f90 stringifor.F90 stringifor_string_t.F90 strip.f90 sverify.f90 swapcase.f90 test_all.F90 test_all.f90 test_all.f90 Test_Driver.f90 to_number.f90 unescape.f90 unique.f90 upper_lower.f90 write_file.f90 write_lines.f90