units Derived Type

type, public, extends(object) :: units

Morfeus universal base type for all units


Inherits

type~~units~~InheritsGraph type~units units type~object object type~units->type~object

Inherited by

type~~units~~InheritedByGraph type~units units type~grid grid type~grid->type~units units_ type~mesh mesh type~mesh->type~grid type~structured_grid structured_grid type~structured_grid->type~grid type~field field type~field->type~grid type~field->type~mesh msh type~cylindrical_grid cylindrical_grid type~cylindrical_grid->type~structured_grid type~cylindrical_grid->type~cylindrical_grid scale_factor type~pde pde type~pde->type~mesh msh type~problem_discretization problem_discretization type~problem_discretization->type~structured_grid block_map, vertices, scalar_fields, scalar_flux_divergence type~spherical_grid spherical_grid type~spherical_grid->type~structured_grid type~cartesian_grid cartesian_grid type~cartesian_grid->type~structured_grid type~vector_field vector_field type~vector_field->type~field type~scalar_field scalar_field type~scalar_field->type~field type~curvilinear_grid curvilinear_grid type~curvilinear_grid->type~structured_grid metric_tensor type~curvilinear_grid->type~structured_grid type~scalar_pde scalar_pde type~scalar_pde->type~pde type~vector_pde vector_pde type~vector_pde->type~pde

Contents


Components

TypeVisibility AttributesNameInitial
character(len=:), private, allocatable:: description
integer, private :: exponents_(num_fundamental) =dimensionless

Store the exponents for fundamental units

integer, private :: system =dimensionless

Default to SI units


Type-Bound Procedures

procedure, public :: add

  • interface

    private impure elemental module function add(lhs, rhs) result(total)

    result is the units of the sum of two dimensional quantities; includes operand consistency check

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: lhs
    class(units), intent(in) :: rhs

    Return Value type(units)

procedure, public :: assign_units

  • interface

    private pure module subroutine assign_units(lhs, rhs)

    copy units information

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(inout) :: lhs
    class(units), intent(in) :: rhs

procedure, public :: divide

  • interface

    private elemental module function divide(numerator, denominator) result(ratio)

    result is the units of the ratio of two dimensional quantities; includes units-sysetm consistency check

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: numerator
    class(units), intent(in) :: denominator

    Return Value type(units)

procedure, public :: get_system

  • interface

    private impure elemental module function get_system(this) result(system_of_units)

    result is enumerated value designating units system

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value integer

procedure, public :: get_units

  • interface

    private module function get_units(this) result(exponents)

    result holds the exponents of each unit in the argument (most useful when the actual argument is an expression)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value integer (num_fundamental)

procedure, public :: has_density_units

  • interface

    private elemental module function has_density_units(this) result(density_units)

    Return true if units match kilograms (kg/m^3)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_energy_units

  • interface

    private elemental module function has_energy_units(this) result(energy_units)

    Return true if units match joules (J)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_length_units

  • interface

    private elemental module function has_length_units(this) result(length_units)

    Return true if units match meters (m)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_mass_units

  • interface

    private elemental module function has_mass_units(this) result(mass_units)

    Return true if units match kilograms (kg)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_power_units

  • interface

    private elemental module function has_power_units(this) result(power_units)

    Return true if units match Watts (W)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_specific_energy_units

  • interface

    private elemental module function has_specific_energy_units(this) result(specific_energy_units)

    Return true if units match Joules per kilogram (J/kg)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_stress_units

  • interface

    private elemental module function has_stress_units(this) result(stress_units)

    Return true if units match Newtons per square meter (N/m^2)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_temperature_units

  • interface

    private elemental module function has_temperature_units(this) result(temperature_units)

    Return true if units match degrees Kelvin (K)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_time_units

  • interface

    private elemental module function has_time_units(this) result(time_units)

    Return true if units match seconds (s)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: has_velocity_units

  • interface

    private elemental module function has_velocity_units(this) result(velocity_units)

    Return true if units match meters/second^2 (m/s^2)

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: integer_power

  • interface

    private impure elemental module function integer_power(this, exponent_) result(this_raised)

    result has units of the opearand raised to the power "exponent_"

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this
    integer, intent(in) :: exponent_

    Return Value type(units)

procedure, public :: is_dimensionless

  • interface

    private elemental module function is_dimensionless(this) result(nondimensional)

    Return true if all units exponents are zero; false otherwise.

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value logical

procedure, public :: mark_as_defined

  • interface

    private pure module subroutine mark_as_defined(this)

    Mark the object as user-defined

    Arguments

    Type IntentOptional AttributesName
    class(object), intent(inout) :: this

procedure, public :: multiply

  • interface

    private elemental module function multiply(lhs, rhs) result(product_)

    result is the units of the product of two dimensional quantities; includes units-system consistency check

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: lhs
    class(units), intent(in) :: rhs

    Return Value type(units)

procedure, public :: negate

  • interface

    private elemental module function negate(this) result(negative_this)

    result is the units of the negative of a dimensional quantities

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this

    Return Value type(units)

procedure, public :: real_power

  • interface

    private impure elemental module function real_power(this, exponent_) result(this_raised)

    result is the units of the operand raised to the power "exponent_"; includes check that operand is dimensionless

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: this
    real, intent(in) :: exponent_

    Return Value type(units)

procedure, public :: set_units

  • interface

    private pure module subroutine set_units(this, exponents, system)

    define units

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(inout) :: this
    integer, intent(in) :: exponents(num_fundamental)
    integer, intent(in) :: system

procedure, public :: subtract

  • interface

    private impure elemental module function subtract(lhs, rhs) result(difference)

    result is the units of the difference of two dimensional quantities; includes operand consistency check

    Arguments

    Type IntentOptional AttributesName
    class(units), intent(in) :: lhs
    class(units), intent(in) :: rhs

    Return Value type(units)

procedure, public :: user_defined

  • interface

    private pure module function user_defined(this) result(is_defined)

    Return a boolean result indicating whether this object has been initialized since its declaration

    Arguments

    Type IntentOptional AttributesName
    class(object), intent(in) :: this

    Return Value logical