SetUnitSystem Subroutine

public subroutine SetUnitSystem(UnitSystem)

Set the system of units to use (SI or IP). Notes: this function HAS TO BE CALLED before the library can be used

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: UnitSystem

Called by

proc~~setunitsystem~~CalledByGraph proc~setunitsystem SetUnitSystem proc~initpsychrometrics InitPsychrometrics proc~initpsychrometrics->proc~setunitsystem proc~calcminimaldxcooling CalcMinimalDXCooling proc~calcminimaldxcooling->proc~initpsychrometrics proc~calcminimaldxheating CalcMinimalDXHeating proc~calcminimaldxheating->proc~initpsychrometrics proc~simminimaldxheating SimMinimalDXHeating proc~simminimaldxheating->proc~calcminimaldxheating proc~simminimaldxcooling SimMinimalDXCooling proc~simminimaldxcooling->proc~calcminimaldxcooling

Contents

Source Code


Source Code

  subroutine SetUnitSystem(UnitSystem)
  !+ Set the system of units to use (SI or IP).
  !+ Notes: this function *HAS TO BE CALLED* before the library can be used

    integer, intent(in)    :: UnitSystem
    !+ Units: string indicating the system of units chosen (SI or IP)

    if (.not. (UnitSystem == SI .or. UnitSystem == IP)) then
      error stop "The system of units has to be either SI or IP."
    end if

    PSYCHROLIB_UNITS = UnitSystem

    ! Define tolerance on temperature calculations
    ! The tolerance is the same in IP and SI
    if (UnitSystem == IP) then
      PSYCHROLIB_TOLERANCE = 0.001 * 9.0 / 5.0
    else
      PSYCHROLIB_TOLERANCE = 0.001
    end if
  end subroutine SetUnitSystem