auxiliar.f90 Source File


This file depends on

sourcefile~~auxiliar.f90~~EfferentGraph sourcefile~auxiliar.f90 auxiliar.f90 sourcefile~constants.f90 constants.f90 sourcefile~auxiliar.f90->sourcefile~constants.f90

Files dependent on this one

sourcefile~~auxiliar.f90~~AfferentGraph sourcefile~auxiliar.f90 auxiliar.f90 sourcefile~continuation.f90 continuation.f90 sourcefile~continuation.f90->sourcefile~auxiliar.f90 sourcefile~linalg.f90 linalg.f90 sourcefile~continuation.f90->sourcefile~linalg.f90 sourcefile~flash.f90 flash.f90 sourcefile~flash.f90->sourcefile~auxiliar.f90 sourcefile~ar_models.f90 ar_models.f90 sourcefile~flash.f90->sourcefile~ar_models.f90 sourcefile~auxiliar.f90~2 auxiliar.f90 sourcefile~flash.f90->sourcefile~auxiliar.f90~2 sourcefile~pressure_equality.f90 pressure_equality.f90 sourcefile~flash.f90->sourcefile~pressure_equality.f90 sourcefile~linalg.f90->sourcefile~auxiliar.f90 sourcefile~math.f90 math.f90 sourcefile~math.f90->sourcefile~auxiliar.f90 sourcefile~math.f90->sourcefile~continuation.f90 sourcefile~math.f90->sourcefile~linalg.f90 sourcefile~phase_envelopes_pt.f90 phase_envelopes_pt.f90 sourcefile~phase_envelopes_pt.f90->sourcefile~auxiliar.f90 sourcefile~phase_envelopes_pt.f90->sourcefile~continuation.f90 sourcefile~phase_envelopes_pt.f90->sourcefile~ar_models.f90 sourcefile~critical.f90 critical.f90 sourcefile~phase_envelopes_pt.f90->sourcefile~critical.f90 sourcefile~phase_envelopes_pt.f90->sourcefile~auxiliar.f90~2 sourcefile~phase_envelopes_pt_mp.f90 phase_envelopes_pt_mp.f90 sourcefile~phase_envelopes_pt_mp.f90->sourcefile~auxiliar.f90 sourcefile~phase_envelopes_pt_mp.f90->sourcefile~math.f90 sourcefile~phase_envelopes_pt_mp.f90->sourcefile~ar_models.f90 sourcefile~auxiliar.f90~3 auxiliar.f90 sourcefile~phase_envelopes_pt_mp.f90->sourcefile~auxiliar.f90~3 sourcefile~phase_envelopes_px.f90 phase_envelopes_px.f90 sourcefile~phase_envelopes_px.f90->sourcefile~auxiliar.f90 sourcefile~phase_envelopes_px.f90->sourcefile~continuation.f90 sourcefile~phase_envelopes_px.f90->sourcefile~ar_models.f90 sourcefile~phase_envelopes_px.f90->sourcefile~auxiliar.f90~3 sourcefile~phase_envelopes_px_mp.f90 phase_envelopes_px_mp.f90 sourcefile~phase_envelopes_px_mp.f90->sourcefile~auxiliar.f90 sourcefile~phase_envelopes_px_mp.f90->sourcefile~math.f90 sourcefile~phase_envelopes_px_mp.f90->sourcefile~ar_models.f90 sourcefile~phase_envelopes_px_mp.f90->sourcefile~auxiliar.f90~3 sourcefile~phase_envelopes_tx.f90 phase_envelopes_tx.f90 sourcefile~phase_envelopes_tx.f90->sourcefile~auxiliar.f90 sourcefile~phase_envelopes_tx.f90->sourcefile~continuation.f90 sourcefile~phase_envelopes_tx.f90->sourcefile~ar_models.f90 sourcefile~phase_envelopes_tx.f90->sourcefile~auxiliar.f90~3 sourcefile~phase_envelopes_tx_mp.f90 phase_envelopes_tx_mp.f90 sourcefile~phase_envelopes_tx_mp.f90->sourcefile~auxiliar.f90 sourcefile~phase_envelopes_tx_mp.f90->sourcefile~math.f90 sourcefile~phase_envelopes_tx_mp.f90->sourcefile~ar_models.f90 sourcefile~phase_envelopes_tx_mp.f90->sourcefile~auxiliar.f90~3 sourcefile~pure_saturation.f90 pure_saturation.f90 sourcefile~pure_saturation.f90->sourcefile~auxiliar.f90 sourcefile~pure_saturation.f90->sourcefile~continuation.f90 sourcefile~pure_saturation.f90->sourcefile~linalg.f90 sourcefile~pure_saturation.f90->sourcefile~ar_models.f90 sourcefile~saturations_points.f90 saturations_points.f90 sourcefile~saturations_points.f90->sourcefile~auxiliar.f90 sourcefile~saturations_points.f90->sourcefile~ar_models.f90 sourcefile~saturation_point.f90 saturation_point.f90 sourcefile~saturations_points.f90->sourcefile~saturation_point.f90 sourcefile~saturations_points.f90->sourcefile~auxiliar.f90~2 sourcefile~volume.f90 volume.f90 sourcefile~volume.f90->sourcefile~auxiliar.f90 sourcefile~volume.f90->sourcefile~ar_models.f90 sourcefile~ar_models.f90->sourcefile~math.f90 sourcefile~auxiliar.f90~3->sourcefile~math.f90 sourcefile~binaries.f90 binaries.f90 sourcefile~binaries.f90->sourcefile~math.f90 sourcefile~binaries.f90->sourcefile~ar_models.f90 sourcefile~critical.f90->sourcefile~continuation.f90 sourcefile~critical.f90->sourcefile~linalg.f90 sourcefile~critical.f90->sourcefile~math.f90 sourcefile~critical.f90->sourcefile~ar_models.f90 sourcefile~stability.f90 stability.f90 sourcefile~critical.f90->sourcefile~stability.f90 sourcefile~equilibria.f90 equilibria.f90 sourcefile~equilibria.f90->sourcefile~flash.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_pt.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_pt_mp.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_px.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_px_mp.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_tx.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_tx_mp.f90 sourcefile~equilibria.f90->sourcefile~pure_saturation.f90 sourcefile~equilibria.f90->sourcefile~saturations_points.f90 sourcefile~equilibria.f90->sourcefile~binaries.f90 sourcefile~equilibria.f90->sourcefile~critical.f90 sourcefile~flash_mp.f90 flash_mp.f90 sourcefile~equilibria.f90->sourcefile~flash_mp.f90 sourcefile~generalized_isoline.f90 generalized_isoline.f90 sourcefile~equilibria.f90->sourcefile~generalized_isoline.f90 sourcefile~phase_envelopes_pt_3ph.f90 phase_envelopes_pt_3ph.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_pt_3ph.f90 sourcefile~phase_envelopes_px_3ph.f90 phase_envelopes_px_3ph.f90 sourcefile~equilibria.f90->sourcefile~phase_envelopes_px_3ph.f90 sourcefile~equilibria.f90->sourcefile~auxiliar.f90~2 sourcefile~equilibria.f90->sourcefile~stability.f90 sourcefile~flash_mp.f90->sourcefile~math.f90 sourcefile~flash_mp.f90->sourcefile~ar_models.f90 sourcefile~flash_mp.f90->sourcefile~stability.f90 sourcefile~generalized_isoline.f90->sourcefile~math.f90 sourcefile~generalized_isoline.f90->sourcefile~ar_models.f90 sourcefile~generalized_isoline.f90->sourcefile~stability.f90 sourcefile~generic_cubic.f90 generic_cubic.f90 sourcefile~generic_cubic.f90->sourcefile~linalg.f90 sourcefile~generic_cubic.f90->sourcefile~volume.f90 sourcefile~generic_cubic.f90->sourcefile~ar_models.f90 sourcefile~gerg2008.f90 gerg2008.f90 sourcefile~gerg2008.f90->sourcefile~math.f90 sourcefile~gerg2008.f90->sourcefile~generic_cubic.f90 sourcefile~implementations.f90~2 implementations.f90 sourcefile~gerg2008.f90->sourcefile~implementations.f90~2 sourcefile~armodel_adiff_api.f90 armodel_adiff_api.f90 sourcefile~gerg2008.f90->sourcefile~armodel_adiff_api.f90 sourcefile~implementations.f90~2->sourcefile~pure_saturation.f90 sourcefile~implementations.f90~2->sourcefile~generic_cubic.f90 sourcefile~alphas.f90 alphas.f90 sourcefile~implementations.f90~2->sourcefile~alphas.f90 sourcefile~huron_vidal.f90 huron_vidal.f90 sourcefile~implementations.f90~2->sourcefile~huron_vidal.f90 sourcefile~implementations.f90 implementations.f90 sourcefile~implementations.f90~2->sourcefile~implementations.f90 sourcefile~quadratic_mixing.f90 quadratic_mixing.f90 sourcefile~implementations.f90~2->sourcefile~quadratic_mixing.f90 sourcefile~nonlineal.f90 nonlineal.f90 sourcefile~nonlineal.f90->sourcefile~linalg.f90 sourcefile~nonlineal.f90->sourcefile~math.f90 sourcefile~phase_envelopes_pt_3ph.f90->sourcefile~math.f90 sourcefile~phase_envelopes_pt_3ph.f90->sourcefile~ar_models.f90 sourcefile~phase_envelopes_px_3ph.f90->sourcefile~math.f90 sourcefile~phase_envelopes_px_3ph.f90->sourcefile~ar_models.f90 sourcefile~phase_envelopes_px_3ph.f90->sourcefile~auxiliar.f90~3 sourcefile~saturation_point.f90->sourcefile~linalg.f90 sourcefile~saturation_point.f90->sourcefile~math.f90 sourcefile~saturation_point.f90->sourcefile~ar_models.f90 sourcefile~saturation_point.f90->sourcefile~nonlineal.f90 sourcefile~uniquac.f90 uniquac.f90 sourcefile~uniquac.f90->sourcefile~math.f90 sourcefile~alphas.f90->sourcefile~generic_cubic.f90 sourcefile~armodel_adiff_api.f90->sourcefile~ar_models.f90 sourcefile~auxiliar.f90~2->sourcefile~ar_models.f90 sourcefile~consistency_armodel.f90 consistency_armodel.f90 sourcefile~consistency_armodel.f90->sourcefile~ar_models.f90 sourcefile~huron_vidal.f90->sourcefile~generic_cubic.f90 sourcefile~huron_vidal.f90->sourcefile~quadratic_mixing.f90 sourcefile~nrtl_hv.f90 nrtl_hv.f90 sourcefile~huron_vidal.f90->sourcefile~nrtl_hv.f90 sourcefile~implementations.f90->sourcefile~uniquac.f90 sourcefile~implementations.f90->sourcefile~nrtl_hv.f90 sourcefile~models.f90 models.f90 sourcefile~models.f90->sourcefile~ar_models.f90 sourcefile~models.f90->sourcefile~generic_cubic.f90 sourcefile~models.f90->sourcefile~gerg2008.f90 sourcefile~models.f90->sourcefile~implementations.f90~2 sourcefile~models.f90->sourcefile~alphas.f90 sourcefile~models.f90->sourcefile~huron_vidal.f90 sourcefile~models.f90->sourcefile~implementations.f90 sourcefile~pc_saft.f90 pc_saft.f90 sourcefile~models.f90->sourcefile~pc_saft.f90 sourcefile~models.f90->sourcefile~quadratic_mixing.f90 sourcefile~pc_saft.f90->sourcefile~critical.f90 sourcefile~pc_saft.f90->sourcefile~armodel_adiff_api.f90 sourcefile~pressure_equality.f90->sourcefile~ar_models.f90 sourcefile~quadratic_mixing.f90->sourcefile~generic_cubic.f90 sourcefile~stability.f90->sourcefile~ar_models.f90 sourcefile~tapenade_ar_api.f90 tapenade_ar_api.f90 sourcefile~tapenade_ar_api.f90->sourcefile~ar_models.f90 sourcefile~yaeos.f90 yaeos.f90 sourcefile~yaeos.f90->sourcefile~equilibria.f90 sourcefile~yaeos.f90->sourcefile~models.f90 sourcefile~consistency.f90 consistency.f90 sourcefile~yaeos.f90->sourcefile~consistency.f90 sourcefile~autodiff.f90 autodiff.f90 sourcefile~autodiff.f90->sourcefile~armodel_adiff_api.f90 sourcefile~consistency.f90->sourcefile~consistency_armodel.f90 sourcefile~nrtl_hv.f90->sourcefile~autodiff.f90

Source Code

module yaeos__auxiliar
   use yaeos__constants, only: pr
   implicit none

   interface optval
      module procedure optval_integer, optval_real, optval_character
   end interface optval

contains

   integer function optval_integer(val, default)
      !! Set a value to a default if it is not defined
      integer, optional, intent(in) :: val
      integer, intent(in) :: default

      if (present(val)) then
         optval_integer = val
      else
         optval_integer = default
      end if
   end function optval_integer

   real(pr) function optval_real(val, default)
      !! Set a value to a default if it is not defined
      real(pr), optional, intent(in) :: val
      real(pr), intent(in) :: default

      if (present(val)) then
         optval_real = val
      else
         optval_real = default
      end if
   end function optval_real

   function optval_character(val, default)
      !! Set a value to a default if it is not defined
      character(len=*), optional, intent(in) :: val
      character(len=*), intent(in) :: default
      character(len=:), allocatable :: optval_character

      if (present(val)) then
         optval_character = val
      else
         optval_character = default
      end if
   end function optval_character

   subroutine sort(array, idx)
      use stdlib_sorting, only: std => sort
      !! Sort an array and return the indexes
      real(pr), intent(in out) :: array(:)
      integer, optional, intent(out) :: idx(:)

      call std(array)

   end subroutine sort
end module yaeos__auxiliar