yaeos__auxiliar Module

General auxiliary utilities

Small convenience procedures shared by model, solver, and phase-equilibrium code.

Description

The generic optval returns either a present optional scalar or a supplied default. sort sorts a real array in place using stdlib_sorting.

Examples

niter = optval(max_iters, 100)
call sort(values)

Uses

  • module~~yaeos__auxiliar~~UsesGraph module~yaeos__auxiliar yaeos__auxiliar module~yaeos__constants yaeos__constants module~yaeos__auxiliar->module~yaeos__constants iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env

Used by

  • module~~yaeos__auxiliar~~UsedByGraph module~yaeos__auxiliar yaeos__auxiliar proc~cubic_roots cubic_roots proc~cubic_roots->module~yaeos__auxiliar proc~cubic_roots_rosendo cubic_roots_rosendo proc~cubic_roots_rosendo->module~yaeos__auxiliar proc~flash flash proc~flash->module~yaeos__auxiliar proc~flash_no_beta_limits flash_no_beta_limits proc~flash_no_beta_limits->module~yaeos__auxiliar proc~full_newton full_newton proc~full_newton->module~yaeos__auxiliar proc~levenberg_marquardt levenberg_marquardt proc~levenberg_marquardt->module~yaeos__auxiliar proc~powel_hybrid powel_hybrid proc~powel_hybrid->module~yaeos__auxiliar proc~pt_envelope pt_envelope proc~pt_envelope->module~yaeos__auxiliar proc~pt_envelope_2ph pt_envelope_2ph proc~pt_envelope_2ph->module~yaeos__auxiliar proc~pure_saturation_line pure_saturation_line proc~pure_saturation_line->module~yaeos__auxiliar proc~px_envelope px_envelope proc~px_envelope->module~yaeos__auxiliar proc~px_envelope_2ph px_envelope_2ph proc~px_envelope_2ph->module~yaeos__auxiliar proc~saturation_pressure saturation_pressure proc~saturation_pressure->module~yaeos__auxiliar proc~saturation_temperature saturation_temperature proc~saturation_temperature->module~yaeos__auxiliar proc~tx_envelope tx_envelope proc~tx_envelope->module~yaeos__auxiliar proc~tx_envelope_2ph tx_envelope_2ph proc~tx_envelope_2ph->module~yaeos__auxiliar proc~volume_michelsen volume_michelsen proc~volume_michelsen->module~yaeos__auxiliar

Interfaces

public interface optval

  • public function optval_integer(val, default)

    optval_integer

    Return the optional integer value or its fallback.

    Description

    Selects val when present and otherwise returns default.

    Examples

    iterations = optval(max_iters, 100)
    

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in), optional :: val

    Optional integer value.

    integer, intent(in) :: default

    Value returned when val is absent.

    Return Value integer

  • public function optval_real(val, default)

    optval_real

    Return the optional real value or its fallback.

    Description

    Selects val when present and otherwise returns default.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=pr), intent(in), optional :: val

    Optional real value.

    real(kind=pr), intent(in) :: default

    Value returned when val is absent.

    Return Value real(kind=pr)

  • public function optval_character(val, default)

    optval_character

    Return the optional character value or its fallback.

    Description

    Selects val when present and otherwise returns default; the result is allocated to the selected string length.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in), optional :: val

    Optional character value.

    character(len=*), intent(in) :: default

    Value returned when val is absent.

    Return Value character(len=:), allocatable

  • public function optval_logical(val, default)

    optval_logical

    Return the optional logical value or its fallback.

    Description

    Selects val when present and otherwise returns default.

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in), optional :: val

    Optional logical value.

    logical, intent(in) :: default

    Value returned when val is absent.

    Return Value logical


Functions

public function optval_character(val, default)

Return the optional character value or its fallback.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: val

Optional character value.

character(len=*), intent(in) :: default

Value returned when val is absent.

Return Value character(len=:), allocatable

public function optval_integer(val, default)

Return the optional integer value or its fallback.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: val

Optional integer value.

integer, intent(in) :: default

Value returned when val is absent.

Return Value integer

public function optval_logical(val, default)

Return the optional logical value or its fallback.

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: val

Optional logical value.

logical, intent(in) :: default

Value returned when val is absent.

Return Value logical

public function optval_real(val, default)

Return the optional real value or its fallback.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in), optional :: val

Optional real value.

real(kind=pr), intent(in) :: default

Value returned when val is absent.

Return Value real(kind=pr)


Subroutines

public subroutine sort(array, idx)

Sort a real array in ascending order in place.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(inout) :: array(:)

Values to sort; overwritten in ascending order.

integer, intent(out), optional :: idx(:)

Reserved optional index output; currently unchanged.