mod_units Module



Contents


Derived Types

type, public :: units_t

Components

TypeVisibilityAttributesNameInitial
logical, private :: units_set
logical, private :: cgs
logical, private :: based_on_density
logical, private :: based_on_temperature
logical, private :: based_on_numberdensity
real(kind=dp), private :: unit_length
real(kind=dp), private :: unit_time
real(kind=dp), private :: unit_density
real(kind=dp), private :: unit_velocity
real(kind=dp), private :: unit_temperature
real(kind=dp), private :: unit_pressure
real(kind=dp), private :: unit_magneticfield
real(kind=dp), private :: unit_numberdensity
real(kind=dp), private :: unit_mass
real(kind=dp), private :: mean_molecular_weight
real(kind=dp), private :: unit_resistivity
real(kind=dp), private :: unit_lambdaT
real(kind=dp), private :: unit_conduction

Type-Bound Procedures

procedure, public :: in_cgs
procedure, public :: are_set
procedure, public :: set_units_from_density
procedure, public :: set_units_from_temperature
procedure, public :: set_units_from_numberdensity
procedure, public :: set_mean_molecular_weight
procedure, public :: get_unit_length
procedure, public :: get_unit_time
procedure, public :: get_unit_density
procedure, public :: get_unit_velocity
procedure, public :: get_unit_temperature
procedure, public :: get_unit_pressure
procedure, public :: get_unit_magneticfield
procedure, public :: get_unit_numberdensity
procedure, public :: get_unit_mass
procedure, public :: get_mean_molecular_weight
procedure, public :: get_unit_resistivity
procedure, public :: get_unit_lambdaT
procedure, public :: get_unit_conduction
procedure, public :: get_unit_gravity
procedure, private :: update_dependent_units
procedure, private :: set_based_on_to_false

Functions

public pure function new_unit_system() result(units)

Arguments

None

Return Value type(units_t)

private pure function in_cgs(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value logical

private pure function are_set(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value logical

private pure function get_unit_length(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_time(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_density(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_velocity(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_temperature(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_pressure(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_magneticfield(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_numberdensity(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_mass(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_mean_molecular_weight(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_resistivity(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_lambdaT(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_conduction(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)

private pure function get_unit_gravity(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(in) :: this

Return Value real(kind=dp)


Subroutines

private pure subroutine set_based_on_to_false(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(inout) :: this

private pure subroutine set_units_from_density(this, unit_length, unit_magneticfield, unit_density, mean_molecular_weight)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(inout) :: this
real(kind=dp), intent(in) :: unit_length
real(kind=dp), intent(in) :: unit_magneticfield
real(kind=dp), intent(in) :: unit_density
real(kind=dp), intent(in), optional :: mean_molecular_weight

private pure subroutine set_units_from_temperature(this, unit_length, unit_magneticfield, unit_temperature, mean_molecular_weight)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(inout) :: this
real(kind=dp), intent(in) :: unit_length
real(kind=dp), intent(in) :: unit_magneticfield
real(kind=dp), intent(in) :: unit_temperature
real(kind=dp), intent(in), optional :: mean_molecular_weight

private pure subroutine set_units_from_numberdensity(this, unit_length, unit_temperature, unit_numberdensity, mean_molecular_weight)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(inout) :: this
real(kind=dp), intent(in) :: unit_length
real(kind=dp), intent(in) :: unit_temperature
real(kind=dp), intent(in) :: unit_numberdensity
real(kind=dp), intent(in), optional :: mean_molecular_weight

private pure subroutine update_dependent_units(this)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(inout) :: this

private pure subroutine set_mean_molecular_weight(this, mean_molecular_weight)

Arguments

TypeIntentOptionalAttributesName
class(units_t), intent(inout) :: this
real(kind=dp), intent(in) :: mean_molecular_weight