Fortran#

API#

module iapws__api

API. See [specs](../page/specs/api.html).

\(\)
pure subroutine psat(Ts, ps)

Compute the saturation pressure at temperature Ts. Validity range 273.13 K <= Ts <= 647.096 K.

Ts: real(kind=dp), contiguous, (:), intent(in)

Saturation temperature in K.

ps: real(kind=dp), contiguous, (:), intent(out)

Saturation pressure in MPa. Filled with nan if out of validity range.

\(\)
pure subroutine Tsat(ps, Ts)

Compute the saturation temperature at pressure ps. Validity range 611.213 Pa <= ps <= 22.064 MPa.

ps: real(kind=dp), contiguous, (:), intent(in)

Saturation pressure in MPa.

Ts: real(kind=dp), contiguous, (:), intent(out)

Saturation temperature in K. Filled with nan if out of validity range.

\(\)
pure subroutine Kw(T, rhow, k)

Compute the ionization constant of water Kw. Validity range 273.13 K <= T <= 1273.15 K and 0 <= p <= 1000 MPa.

T: real(kind=dp), (:), intent(in)

Temperature in K.

rhow: real(kind=dp), (:), intent(in)

Mass density in g.cm^{-3}.

k: real(kind=dp), (:), intent(out)

Ionization constant. Filled with NaN if out of validity range.

\(\)
function get_version() fptr

Returns the version

fptr: character(len=:), pointer

\(\)

C Bindings#

module iapws__capi

C API. See [specs](../pages/specs/capi.html). VERSION

R283

G704

R797

\(\)
type c_char_p
p: type(c_ptr)
\(\)
type cgas_type
gas: character(kind=c_char, len=1), allocatable, (:)
\(\)
subroutine capi_kh(T, gas, heavywater, k, size_gas, size_T)

C API for [[iapws__g704(module):kh(subroutine)]]

T: real(kind=c_double), (size_T), intent(in)

Temperature in °C.

gas: type(c_ptr), value, intent(in)

Gas.

heavywater: integer(kind=c_int), value, intent(in)

Flag if D2O (1) is used or H2O(0).

k: real(kind=c_double), (size_T), intent(inout)

Henry constant. Filled with NaNs if gas not found.

size_gas: integer(kind=c_int), value, intent(in)

Size of the gas string.

size_T: integer(kind=c_size_t), value, intent(in)

Size of T and k.

\(\)
subroutine capi_kd(T, gas, heavywater, k, size_gas, size_T)

C API for [[iapws__g704(module):kd(subroutine)]]

T: real(kind=c_double), (size_T), intent(in)

Temperature in °C.

gas: type(c_ptr), value, intent(in)

Gas.

heavywater: integer(kind=c_int), value, intent(in)

Flag if D2O (1) is used or H2O(0).

k: real(kind=c_double), (size_T), intent(inout)

Vapor-liquid constant. Filled with NaNs if gas not found.

size_gas: integer(kind=c_int), value, intent(in)

Size of the gas string.

size_T: integer(kind=c_size_t), value, intent(in)

Size of T and k.

\(\)
pure subroutine capi_psat(N, Ts, ps)

C API for [[iapws__api(module):psat(subroutine)]].

N: integer(kind=c_size_t), value, intent(in)

Size of Ts and ps.

Ts: real(kind=c_double), (N), intent(in)

Saturation temperature in K.

ps: real(kind=c_double), (N), intent(out)

Saturation pressure in MPa. Filled with nan if out of validity range.

\(\)
pure subroutine capi_Tsat(N, ps, Ts)

C API for [[iapws__api(module):Tsat(subroutine)]].

N: integer(kind=c_size_t), value, intent(in)

Size of ps and Ts.

ps: real(kind=c_double), (N), intent(in)

Saturation pressure in MPa.

Ts: real(kind=c_double), (N), intent(out)

Saturation temperature in K. Filled with nan if out of validity range.

\(\)
pure subroutine capi_Kw(N, T, rhow, k)

C API for [[iapws__api(module):Kw(subroutine)]].

N: integer(kind=c_size_t), value, intent(in)

Size of T, rhow and k.

T: real(kind=dp), (N), intent(in)

Temperature in K.

rhow: real(kind=dp), (N), intent(in)

Mass density in g.cm^{-3}.

k: real(kind=dp), (N), intent(out)

Ionization constant. Filled with NaN if out of validity range.

\(\)
function capi_get_version() cptr

C API for [[iapws__api(module):get_version(function)]]

cptr: type(c_ptr)

\(\)
pure function capi_ngases(heavywater) n

C API for [[iapws__g704(module):ngases(function)]]

heavywater: integer(kind=c_int), value, intent(in)

Flag if D2O (1) is used or H2O(0).

n: integer(kind=c_int)

\(\)
function capi_gases(heavywater) list_gases

C API for [[iapws__g704(module):gases(function)]]

heavywater: integer(kind=c_int), value, intent(in)

Flag if D2O (1) is used or H2O(0).

list_gases: type(c_ptr)

\(\)
function capi_gases2(heavywater) str_gases

C API for [[iapws__g704(module):gases2(function)]]

heavywater: integer(kind=c_int), value, intent(in)

Flag if D2O (1) is used or H2O(0).

str_gases: type(c_ptr)

\(\)