-
+
real(kind=c_double),
|
intent(in) |
@@ -397,7 +397,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/capi_ngases.html b/docs/proc/capi_ngases.html
index 068cd46..fc0ff15 100644
--- a/docs/proc/capi_ngases.html
+++ b/docs/proc/capi_ngases.html
@@ -329,7 +329,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/capi_psat.html b/docs/proc/capi_psat.html
index 9743a46..5e922dd 100644
--- a/docs/proc/capi_psat.html
+++ b/docs/proc/capi_psat.html
@@ -352,7 +352,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/capi_tsat.html b/docs/proc/capi_tsat.html
index 8ec4091..1b56768 100644
--- a/docs/proc/capi_tsat.html
+++ b/docs/proc/capi_tsat.html
@@ -352,7 +352,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/gases.html b/docs/proc/gases.html
index de3d94b..0db091e 100644
--- a/docs/proc/gases.html
+++ b/docs/proc/gases.html
@@ -344,7 +344,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/gases2.html b/docs/proc/gases2.html
index cbd6e7f..58cfa7b 100644
--- a/docs/proc/gases2.html
+++ b/docs/proc/gases2.html
@@ -329,7 +329,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/get_version.html b/docs/proc/get_version.html
index f047efe..6c7f60b 100644
--- a/docs/proc/get_version.html
+++ b/docs/proc/get_version.html
@@ -305,7 +305,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/iapws_r797_v.html b/docs/proc/iapws_r797_v.html
index 38b9ce2..6877261 100644
--- a/docs/proc/iapws_r797_v.html
+++ b/docs/proc/iapws_r797_v.html
@@ -168,7 +168,7 @@ Arguments
-
+
real(kind=dp),
|
intent(in) |
@@ -222,7 +222,7 @@ Return Value
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/kd.html b/docs/proc/kd.html
index 4de29e0..be7c620 100644
--- a/docs/proc/kd.html
+++ b/docs/proc/kd.html
@@ -367,7 +367,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/kh.html b/docs/proc/kh.html
index 8e8b868..db4ea77 100644
--- a/docs/proc/kh.html
+++ b/docs/proc/kh.html
@@ -367,7 +367,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/ngases.html b/docs/proc/ngases.html
index e26d2c0..c0fc91d 100644
--- a/docs/proc/ngases.html
+++ b/docs/proc/ngases.html
@@ -329,7 +329,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/psat.html b/docs/proc/psat.html
index 9fc0290..ce06b48 100644
--- a/docs/proc/psat.html
+++ b/docs/proc/psat.html
@@ -338,7 +338,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/proc/tsat.html b/docs/proc/tsat.html
index 29b4a2e..e0a1d6b 100644
--- a/docs/proc/tsat.html
+++ b/docs/proc/tsat.html
@@ -338,7 +338,7 @@ Graph Key
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/search.html b/docs/search.html
index f78e718..4abdeb2 100644
--- a/docs/search.html
+++ b/docs/search.html
@@ -99,7 +99,7 @@ Search Results
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/capi.f90.html b/docs/sourcefile/capi.f90.html
index af77939..9f8377f 100644
--- a/docs/sourcefile/capi.f90.html
+++ b/docs/sourcefile/capi.f90.html
@@ -438,7 +438,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/capi_g704.f90.html b/docs/sourcefile/capi_g704.f90.html
index 1ab3ada..fb21462 100644
--- a/docs/sourcefile/capi_g704.f90.html
+++ b/docs/sourcefile/capi_g704.f90.html
@@ -537,7 +537,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/capi_r283.f90.html b/docs/sourcefile/capi_r283.f90.html
index 748ce30..08d3a36 100644
--- a/docs/sourcefile/capi_r283.f90.html
+++ b/docs/sourcefile/capi_r283.f90.html
@@ -390,7 +390,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/capi_r797.f90.html b/docs/sourcefile/capi_r797.f90.html
index 4b4eb63..767f4d8 100644
--- a/docs/sourcefile/capi_r797.f90.html
+++ b/docs/sourcefile/capi_r797.f90.html
@@ -311,7 +311,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/capi_version.f90.html b/docs/sourcefile/capi_version.f90.html
index 2145665..1943018 100644
--- a/docs/sourcefile/capi_version.f90.html
+++ b/docs/sourcefile/capi_version.f90.html
@@ -399,7 +399,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/iapws.f90.html b/docs/sourcefile/iapws.f90.html
index 6534509..9572e4b 100644
--- a/docs/sourcefile/iapws.f90.html
+++ b/docs/sourcefile/iapws.f90.html
@@ -406,7 +406,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/iapws_g704.f90.html b/docs/sourcefile/iapws_g704.f90.html
index 3bc37d2..533edc4 100644
--- a/docs/sourcefile/iapws_g704.f90.html
+++ b/docs/sourcefile/iapws_g704.f90.html
@@ -496,381 +496,354 @@ Source Code
pure function findgas_abc(gas, abc)result(value)
!! Find the index of the gas in the ABC table.
implicit none
- character(len=*), intent(in) :: gas
- !! Gas.
- type(abc_t), dimension(:), intent(in) :: abc
- !! ABC table.
- integer(int32) :: value
- !! index of the gas.
-
- !! local variables
- integer(int32) :: i
-
- value = 0
-
- do i=1, size(abc)
- if(trim(gas) .eq. abc(i)%gas)then
- value = i
- exit
- endif
- end do
-end function
-
-pure function findgas_efgh(gas, efgh)result(value)
- !! Find the index of the gas in the ABC table.
- implicit none
- character(len=*), intent(in) :: gas
- !! Gas.
- type(efgh_t), dimension(:), intent(in) :: efgh
- !! EFGH table.
- integer(int32) :: value
- !! index of gas.
- integer(int32) :: i
-
- value = 0
-
- do i=1, size(efgh)
- if(trim(gas) .eq. efgh(i)%gas)then
- value = i
- exit
- endif
- end do
-end function
+
+ character(len=*), intent(in) :: gas !! Gas.
+ type(abc_t), dimension(:), intent(in) :: abc !! ABC table.
+ integer(int32) :: value !! index of the gas.
+
+ integer(int32) :: i
+
+ value = 0
+
+ do i=1, size(abc)
+ if(trim(gas) .eq. abc(i)%gas)then
+ value = i
+ exit
+ endif
+ end do
+end function
+
+pure function findgas_efgh(gas, efgh)result(value)
+ !! Find the index of the gas in the ABC table.
+ implicit none
+
+ character(len=*), intent(in) :: gas !! Gas.
+ type(efgh_t), dimension(:), intent(in) :: efgh !! EFGH table.
+ integer(int32) :: value !! index of gas.
+
+ integer(int32) :: i
+
+ value = 0
+
+ do i=1, size(efgh)
+ if(trim(gas) .eq. efgh(i)%gas)then
+ value = i
+ exit
+ endif
+ end do
+end function
+
+pure elemental function f_p1star_H2O(T)result(value)
+ !! Compute p1* in H2O.
+ implicit none
-pure elemental function f_p1star_H2O(T)result(value)
- !! Compute p1* in H2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- real(dp) :: value
- !! p1* in MPa.
-
- real(dp) :: Tr
- real(dp) :: tau
+ real(dp), intent(in) :: T !! Temperature in K.
+ real(dp) :: value !! p1* in MPa.
+
+ real(dp) :: Tr
+ real(dp) :: tau
+
+ Tr = T/Tc1_H2O
+ tau = 1 - Tr
+ value = exp(1/(Tr) * sum(aibi_H2O(:,1)*tau**(aibi_H2O(:,2)))) * pc1_H2O
+end function
- Tr = T/Tc1_H2O
- tau = 1 - Tr
- value = exp(1/(Tr) * sum(aibi_H2O(:,1)*tau**(aibi_H2O(:,2)))) * pc1_H2O
-end function
-
-pure elemental function f_p1star_D2O(T)result(value)
- !! Compute p1* in D2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- real(dp) :: value
- !! p1* in MPa.
-
- real(dp) :: Tr
- real(dp) :: tau
-
- Tr = T/Tc1_D2O
- tau = 1 - Tr
- value = exp(1/(Tr) * sum(aibi_D2O(:,1)*tau**(aibi_D2O(:,2)))) * pc1_D2O
-end function
-
-pure elemental function f_kh_p1star_H2O(T, abc)result(value)
- !! Compute kh/p1* in H2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kH/p1* adimensional.
-
- real(dp) :: Tr
- real(dp) :: tau
-
- Tr = T/Tc1_H2O
- tau = 1 - Tr
- value = exp(abc%A/Tr + abc%B*(tau**0.355_dp)/Tr + abc%C*exp(tau)*Tr**(-0.41_dp))
-end function
-
-pure elemental function f_kh_p1star_D2O(T, abc)result(value)
- !! Compute kh/p1* in D2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kh/p1* adimensional.
-
- real(dp) :: Tr
- real(dp) :: tau
-
- Tr = T/Tc1_D2O
- tau = 1 - Tr
- value = exp(abc%A/Tr + abc%B*(tau**0.355_dp)/Tr + abc%C*exp(tau)*Tr**(-0.41_dp))
-end function
-
-pure elemental function ft_H2O(tau)result(value)
- !! Compute f(t) for H2O.
- implicit none
- real(dp), intent(in) :: tau
- !! tau = 1-T/Tr.
- real(dp) :: value
- !! f(t) is adimensional.
- value = sum(cidi_H2O(:,1) * tau**(cidi_H2O(:,2)))
-end function
-
-pure elemental function ft_D2O(tau)result(value)
- !! Compute f(t) for D2O.
- implicit none
- real(dp), intent(in) :: tau
- !! tau = 1-T/Tr.
- real(dp) :: value
- !! f(t) is adimensional.
- value = sum(cidi_D2O(:,1) * tau**(cidi_D2O(:,2)))
-end function
-
-pure elemental function f_kh_H2O(T, abc)result(value)
- !! Compute kH in H2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kH in MPa.
- value = f_kh_p1star_H2O(T, abc) * f_p1star_H2O(T)
-end function
+pure elemental function f_p1star_D2O(T)result(value)
+ !! Compute p1* in D2O.
+ implicit none
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ real(dp) :: value !! p1* in MPa.
+
+ real(dp) :: Tr
+ real(dp) :: tau
+
+ Tr = T/Tc1_D2O
+ tau = 1 - Tr
+ value = exp(1/(Tr) * sum(aibi_D2O(:,1)*tau**(aibi_D2O(:,2)))) * pc1_D2O
+end function
+
+pure elemental function f_kh_p1star_H2O(T, abc)result(value)
+ !! Compute kh/p1* in H2O.
+ implicit none
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kH/p1* adimensional.
+
+ real(dp) :: Tr
+ real(dp) :: tau
+
+ Tr = T/Tc1_H2O
+ tau = 1 - Tr
+ value = exp(abc%A/Tr + abc%B*(tau**0.355_dp)/Tr + abc%C*exp(tau)*Tr**(-0.41_dp))
+end function
+
+pure elemental function f_kh_p1star_D2O(T, abc)result(value)
+ !! Compute kh/p1* in D2O.
+ implicit none
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kh/p1* adimensional.
+
+ real(dp) :: Tr
+ real(dp) :: tau
+
+ Tr = T/Tc1_D2O
+ tau = 1 - Tr
+ value = exp(abc%A/Tr + abc%B*(tau**0.355_dp)/Tr + abc%C*exp(tau)*Tr**(-0.41_dp))
+end function
+
+pure elemental function ft_H2O(tau)result(value)
+ !! Compute f(t) for H2O.
+ implicit none
+
+ real(dp), intent(in) :: tau !! tau = 1-T/Tr.
+ real(dp) :: value !! f(t) is adimensional.
+ value = sum(cidi_H2O(:,1) * tau**(cidi_H2O(:,2)))
+end function
+
+pure elemental function ft_D2O(tau)result(value)
+ !! Compute f(t) for D2O.
+ implicit none
+
+ real(dp), intent(in) :: tau !! tau = 1-T/Tr.
+ real(dp) :: value !! f(t) is adimensional.
+ value = sum(cidi_D2O(:,1) * tau**(cidi_D2O(:,2)))
+end function
+
+pure elemental function f_kh_H2O(T, abc)result(value)
+ !! Compute kH in H2O.
+ implicit none
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kH in MPa.
+ value = f_kh_p1star_H2O(T, abc) * f_p1star_H2O(T)
+end function
+
+pure elemental function f_kh_D2O(T, abc)result(value)
+ !! Compute kH in D2O.
+ implicit none
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kH in MPa.
+ value = f_kh_p1star_D2O(T, abc) * f_p1star_D2O(T)
+end function
+
+pure elemental function f_kd_H2O(T, efgh) result(value)
+ !! Compute kd in H2O.
+ implicit none
-pure elemental function f_kh_D2O(T, abc)result(value)
- !! Compute kH in D2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kH in MPa.
- value = f_kh_p1star_D2O(T, abc) * f_p1star_D2O(T)
-end function
-
-pure elemental function f_kd_H2O(T, efgh) result(value)
- !! Compute kd in H2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(efgh_t), intent(in) :: efgh
- !! EFGH coefficients.
- real(dp) :: value
- !! kD adimensional.
-
- real(dp) :: Tr
- real(dp) :: tau
- real(dp) :: p1
- real(dp) :: p2
- real(dp) :: p3
- real(dp) :: p4
-
- Tr = (T+T_KELVIN)/Tc1_H2O
- tau = 1-Tr
-
- p1 = q_H2O*efgh%F
- p2 = efgh%E/T*ft_H2O(tau)
- p3 = (efgh%F + efgh%G*tau**(2.0_dp/3.0_dp) + efgh%H*tau)
- p4 = exp(-T/100.0_dp)
-
- value = exp(p1 + p2 + p3 * p4)
-
-end function
-
-pure elemental function f_kd_D2O(T, efgh) result(value)
- !! Compute kd in D2O.
- implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(efgh_t), intent(in) :: efgh
- !! EFGH coefficients.
- real(dp) :: value
- !! kD adimensional.
-
- real(dp) :: Tr
- real(dp) :: tau
- real(dp) :: p1
- real(dp) :: p2
- real(dp) :: p3
- real(dp) :: p4
-
- Tr = T/Tc1_D2O
- tau = 1-Tr
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(efgh_t), intent(in) :: efgh !! EFGH coefficients.
+ real(dp) :: value !! kD adimensional.
+
+ real(dp) :: Tr
+ real(dp) :: tau
+ real(dp) :: p1
+ real(dp) :: p2
+ real(dp) :: p3
+ real(dp) :: p4
+
+ Tr = (T+T_KELVIN)/Tc1_H2O
+ tau = 1-Tr
+
+ p1 = q_H2O*efgh%F
+ p2 = efgh%E/T*ft_H2O(tau)
+ p3 = (efgh%F + efgh%G*tau**(2.0_dp/3.0_dp) + efgh%H*tau)
+ p4 = exp(-T/100.0_dp)
+
+ value = exp(p1 + p2 + p3 * p4)
+
+end function
+
+pure elemental function f_kd_D2O(T, efgh) result(value)
+ !! Compute kd in D2O.
+ implicit none
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(efgh_t), intent(in) :: efgh !! EFGH coefficients.
+ real(dp) :: value !! kD adimensional.
+
+ real(dp) :: Tr
+ real(dp) :: tau
+ real(dp) :: p1
+ real(dp) :: p2
+ real(dp) :: p3
+ real(dp) :: p4
+
+ Tr = T/Tc1_D2O
+ tau = 1-Tr
+
+ p1 = q_D2O*efgh%F
+ p2 = efgh%E/T*ft_D2O(tau)
+ p3 = (efgh%F + efgh%G*tau**(2.0_dp/3.0_dp) + efgh%H*tau)
+ p4 = exp(-T/100.0_dp)
+
+ value = exp(p1 + p2 + p3 * p4)
+
+end function
+
+pure subroutine kh(T, gas, heavywater, k)
+ !! Compute the henry constant kH for a given temperature.
+ implicit none
+
+ real(dp), intent(in) :: T(:) !! Temperature in K.
+ character(len=*), intent(in) :: gas !! Gas.
+ integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
+ real(dp), intent(out) :: k(:) !! Henry constant. Filled with NaNs if gas not found.
+
+ integer(int32) :: i
- p1 = q_D2O*efgh%F
- p2 = efgh%E/T*ft_D2O(tau)
- p3 = (efgh%F + efgh%G*tau**(2.0_dp/3.0_dp) + efgh%H*tau)
- p4 = exp(-T/100.0_dp)
-
- value = exp(p1 + p2 + p3 * p4)
-
-end function
-
-pure subroutine kh(T, gas, heavywater, k)
- !! Compute the henry constant kH for a given temperature.
- implicit none
-
- ! arguments
- real(dp), intent(in) :: T(:) !! Temperature in K.
- character(len=*), intent(in) :: gas !! Gas.
- integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
- real(dp), intent(out) :: k(:) !! Henry constant. Filled with NaNs if gas not found.
-
- ! variables
- integer(int32) :: i
-
- if(heavywater > 0)then
- i = findgas_abc(gas, abc_D2O)
- if(i==0)then
- k = ieee_value(1.0_dp, ieee_quiet_nan)
- else
- k = f_kh_D2O(T, abc_D2O(i))
- endif
- else
- i = findgas_abc(gas, abc_H2O)
+ if(heavywater > 0)then
+ i = findgas_abc(gas, abc_D2O)
+ if(i==0)then
+ k = ieee_value(1.0_dp, ieee_quiet_nan)
+ else
+ k = f_kh_D2O(T, abc_D2O(i))
+ endif
+ else
+ i = findgas_abc(gas, abc_H2O)
+ if(i==0)then
+ k = ieee_value(1.0_dp, ieee_quiet_nan)
+ else
+ k = f_kh_H2O(T, abc_H2O(i))
+ endif
+ endif
+
+end subroutine
+
+pure subroutine kd(T, gas, heavywater, k)
+ !! Compute the vapor-liquid constant kd for a given temperature.
+ implicit none
+
+ real(dp), intent(in) :: T(:) !! Temperature in K.
+ character(len=*), intent(in) :: gas !! Gas.
+ integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
+ real(dp), intent(out) :: k(:) !! Vapor-liquid constant. Filled with NaNs if gas not found.
+
+ integer(int32) :: i
+
+ if(heavywater > 0)then
+ i = findgas_efgh(gas, efgh_D2O)
if(i==0)then
k = ieee_value(1.0_dp, ieee_quiet_nan)
else
- k = f_kh_H2O(T, abc_H2O(i))
+ k = f_kd_D2O(T, efgh_D2O(i))
endif
- endif
-
-end subroutine
-
-pure subroutine kd(T, gas, heavywater, k)
- !! Compute the vapor-liquid constant kd for a given temperature.
- implicit none
-
- ! arguments
- real(dp), intent(in) :: T(:) !! Temperature in K.
- character(len=*), intent(in) :: gas !! Gas.
- integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
- real(dp), intent(out) :: k(:) !! Vapor-liquid constant. Filled with NaNs if gas not found.
-
- ! variables
- integer(int32) :: i
-
- if(heavywater > 0)then
- i = findgas_efgh(gas, efgh_D2O)
- if(i==0)then
- k = ieee_value(1.0_dp, ieee_quiet_nan)
- else
- k = f_kd_D2O(T, efgh_D2O(i))
- endif
- else
- i = findgas_efgh(gas, efgh_H2O)
- if(i==0)then
- k = ieee_value(1.0_dp, ieee_quiet_nan)
- else
- k = f_kd_H2O(T, efgh_H2O(i))
- endif
- endif
-
-end subroutine
-
-pure function ngases(heavywater)result(n)
- !! Returns the number of gases.
- implicit none
-
- ! arguments
- integer(int32), intent(in) :: heavywater
- !! Flag if D2O (1) is used or H2O(0).
- integer(int32) :: n
- !! Number of gases.
-
- if(heavywater > 0)then
- n = ngas_D2O
- else
- n = ngas_H2O
- endif
-end function
-
-function gases(heavywater)result(list_gases)
- !! Returns the list of available gases.
- implicit none
-
- ! arguments
- integer(int32), intent(in) :: heavywater
- !! Flag if D2O (1) is used or H2O(0).
- type(gas_type), pointer :: list_gases(:)
- !! Available gases.
-
- ! variables
- integer(int32) :: i, n
-
- if(allocated(f_gases))then
- deallocate(f_gases)
- endif
-
- if(heavywater > 0)then
- allocate(f_gases(ngas_D2O))
- do i=1, ngas_D2O
- if(allocated(f_gases(i)%gas))then
- deallocate(f_gases(i)%gas)
- endif
- n = len(trim(abc_D2O(i)%gas))
- allocate(character(len=n) :: f_gases(i)%gas)
- f_gases(i)%gas = trim(abc_D2O(i)%gas)
- enddo
- else
- allocate(f_gases(ngas_H2O))
- do i=1, ngas_H2O
- if(allocated(f_gases(i)%gas))then
- deallocate(f_gases(i)%gas)
- endif
- n = len(trim(abc_H2O(i)%gas))
- allocate(character(len=n) :: f_gases(i)%gas)
- f_gases(i)%gas = trim(abc_H2O(i)%gas)
- enddo
- endif
- list_gases => f_gases
-end function
+ else
+ i = findgas_efgh(gas, efgh_H2O)
+ if(i==0)then
+ k = ieee_value(1.0_dp, ieee_quiet_nan)
+ else
+ k = f_kd_H2O(T, efgh_H2O(i))
+ endif
+ endif
+
+end subroutine
+
+pure function ngases(heavywater)result(n)
+ !! Returns the number of gases.
+ implicit none
+
+ integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
+ integer(int32) :: n !! Number of gases.
+
+ if(heavywater > 0)then
+ n = ngas_D2O
+ else
+ n = ngas_H2O
+ endif
+end function
+
+function gases(heavywater)result(list_gases)
+ !! Returns the list of available gases.
+ implicit none
+
+ ! arguments
+ integer(int32), intent(in) :: heavywater
+ !! Flag if D2O (1) is used or H2O(0).
+ type(gas_type), pointer :: list_gases(:)
+ !! Available gases.
+
+ ! variables
+ integer(int32) :: i, n
+
+ if(allocated(f_gases))then
+ deallocate(f_gases)
+ endif
+
+ if(heavywater > 0)then
+ allocate(f_gases(ngas_D2O))
+ do i=1, ngas_D2O
+ if(allocated(f_gases(i)%gas))then
+ deallocate(f_gases(i)%gas)
+ endif
+ n = len(trim(abc_D2O(i)%gas))
+ allocate(character(len=n) :: f_gases(i)%gas)
+ f_gases(i)%gas = trim(abc_D2O(i)%gas)
+ enddo
+ else
+ allocate(f_gases(ngas_H2O))
+ do i=1, ngas_H2O
+ if(allocated(f_gases(i)%gas))then
+ deallocate(f_gases(i)%gas)
+ endif
+ n = len(trim(abc_H2O(i)%gas))
+ allocate(character(len=n) :: f_gases(i)%gas)
+ f_gases(i)%gas = trim(abc_H2O(i)%gas)
+ enddo
+ endif
+ list_gases => f_gases
+end function
+
+function gases2(heavywater)result(str_gases)
+ !! Returns the available gases as a string.
+ implicit none
+
+ ! arguments
+ integer(int32), intent(in) :: heavywater
+ !! Flag if D2O (1) is used or H2O(0).
+ character(len=:), pointer :: str_gases
+ !! Available gases
+
+ ! variables
+ integer(int32) :: i, j, k, ngas
+ type(gas_type), pointer :: f_gases_list(:)
+
+ f_gases_list => gases(heavywater)
+ ngas = size(f_gases_list)
+
+ k = 0
+ do i=1, ngas
+ k = k + len(f_gases_list(i)%gas)
+ enddo
+
+ if(allocated(f_gases_str))then
+ deallocate(f_gases_str)
+ endif
+ allocate(character(len=k+ngas) :: f_gases_str)
-function gases2(heavywater)result(str_gases)
- !! Returns the available gases as a string.
- implicit none
-
- ! arguments
- integer(int32), intent(in) :: heavywater
- !! Flag if D2O (1) is used or H2O(0).
- character(len=:), pointer :: str_gases
- !! Available gases
-
- ! variables
- integer(int32) :: i, j, k, ngas
- type(gas_type), pointer :: f_gases_list(:)
-
- f_gases_list => gases(heavywater)
- ngas = size(f_gases_list)
-
- k = 0
- do i=1, ngas
- k = k + len(f_gases_list(i)%gas)
- enddo
-
- if(allocated(f_gases_str))then
- deallocate(f_gases_str)
- endif
- allocate(character(len=k+ngas) :: f_gases_str)
-
- i = 1
- j = 1
- k = 1
- do i=1, ngas
- do j=1, len(f_gases_list(i)%gas)
- f_gases_str(k:k) = f_gases_list(i)%gas(j:j)
- k = k + 1
- enddo
- f_gases_str(k:k) = ","
- k = k + 1
- enddo
- f_gases_str(len(f_gases_str):len(f_gases_str)) = ""
- str_gases => f_gases_str
-
-end function
-
-end module
+ i = 1
+ j = 1
+ k = 1
+ do i=1, ngas
+ do j=1, len(f_gases_list(i)%gas)
+ f_gases_str(k:k) = f_gases_list(i)%gas(j:j)
+ k = k + 1
+ enddo
+ f_gases_str(k:k) = ","
+ k = k + 1
+ enddo
+ f_gases_str(len(f_gases_str):len(f_gases_str)) = ""
+ str_gases => f_gases_str
+
+end function
+
+end module
@@ -892,7 +865,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/iapws_r283.f90.html b/docs/sourcefile/iapws_r283.f90.html
index 423e958..736b4bf 100644
--- a/docs/sourcefile/iapws_r283.f90.html
+++ b/docs/sourcefile/iapws_r283.f90.html
@@ -396,7 +396,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/iapws_r797.f90.html b/docs/sourcefile/iapws_r797.f90.html
index ac5fc60..122eb11 100644
--- a/docs/sourcefile/iapws_r797.f90.html
+++ b/docs/sourcefile/iapws_r797.f90.html
@@ -357,11 +357,11 @@ Source Code
real(dp), parameter :: T_KELVIN = 273.15_dp !! Parameters from IAPWS R7-97
-real(dp), parameter :: Tc = Tc_H2O !! critical temperature of water in K
-real(dp), parameter :: pc = pc_H2O !! critical pressure of the water in MPa
-real(dp), parameter :: rhoc = rhoc_H2O !! critical density of the water in kg.m-3.
+real(dp), parameter :: Tc = Tc_H2O !! critical temperature of water in K
+real(dp), parameter :: pc = pc_H2O !! critical pressure of the water in MPa
+real(dp), parameter :: rhoc = rhoc_H2O !! critical density of the water in kg.m-3.
-real(dp), parameter :: R = 0.461526_dp !! Specific gas constant 0.461 526 kJ.kg-1.K-1
+real(dp), parameter :: R = 0.461526_dp !! Specific gas constant 0.461 526 kJ.kg-1.K-1
@@ -400,13 +400,13 @@ Source Code
+0.65017534844798e3_dp &
] !! ni coefficients for region 4 (saturation line)
-real(dp), parameter :: r4_Tmin = 273.15_dp !! Lower bound for validity for ps(T) in K.
-real(dp), parameter :: r4_Tmax = 647.096_dp !! Upper bound for validity ps(T) in K.
+real(dp), parameter :: r4_Tmin = 273.15_dp !! Lower bound for validity for ps(T) in K.
+real(dp), parameter :: r4_Tmax = 647.096_dp !! Upper bound for validity ps(T) in K.
real(dp), parameter :: r4_pmin = 611.213e-6_dp !! Lower bound for validity for Ts(p) in MPa
-real(dp), parameter :: r4_pmax = 22.064_dp !! Upper bound for validity Ts(p) in MPa
+real(dp), parameter :: r4_pmax = 22.064_dp !! Upper bound for validity Ts(p) in MPa
-real(dp), parameter :: r4_Tstar = 1_dp !! K
-real(dp), parameter :: r4_Pstar = 1_dp !! MPa
+real(dp), parameter :: r4_Tstar = 1_dp !! K
+real(dp), parameter :: r4_Pstar = 1_dp !! MPa
!--------------------------------------------------------------------------------------------------------------------------------
@@ -563,7 +563,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/sourcefile/iapws_version.f90.html b/docs/sourcefile/iapws_version.f90.html
index a216475..69014a8 100644
--- a/docs/sourcefile/iapws_version.f90.html
+++ b/docs/sourcefile/iapws_version.f90.html
@@ -282,7 +282,7 @@ Source Code
implicit none
private
- character(len=*), parameter :: version = "0.3.0"
+ character(len=*), parameter :: version = "0.4.0"
character(len=:), allocatable, target :: version_f
public :: get_version
@@ -327,7 +327,7 @@ Source Code
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084
diff --git a/docs/src/iapws_g704.f90 b/docs/src/iapws_g704.f90
index 5d6fa21..633e7cc 100644
--- a/docs/src/iapws_g704.f90
+++ b/docs/src/iapws_g704.f90
@@ -128,14 +128,11 @@ module iapws__g704
pure function findgas_abc(gas, abc)result(value)
!! Find the index of the gas in the ABC table.
implicit none
- character(len=*), intent(in) :: gas
- !! Gas.
- type(abc_t), dimension(:), intent(in) :: abc
- !! ABC table.
- integer(int32) :: value
- !! index of the gas.
+
+ character(len=*), intent(in) :: gas !! Gas.
+ type(abc_t), dimension(:), intent(in) :: abc !! ABC table.
+ integer(int32) :: value !! index of the gas.
- !! local variables
integer(int32) :: i
value = 0
@@ -151,12 +148,11 @@ pure function findgas_abc(gas, abc)result(value)
pure function findgas_efgh(gas, efgh)result(value)
!! Find the index of the gas in the ABC table.
implicit none
- character(len=*), intent(in) :: gas
- !! Gas.
- type(efgh_t), dimension(:), intent(in) :: efgh
- !! EFGH table.
- integer(int32) :: value
- !! index of gas.
+
+ character(len=*), intent(in) :: gas !! Gas.
+ type(efgh_t), dimension(:), intent(in) :: efgh !! EFGH table.
+ integer(int32) :: value !! index of gas.
+
integer(int32) :: i
value = 0
@@ -172,10 +168,9 @@ pure function findgas_efgh(gas, efgh)result(value)
pure elemental function f_p1star_H2O(T)result(value)
!! Compute p1* in H2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- real(dp) :: value
- !! p1* in MPa.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ real(dp) :: value !! p1* in MPa.
real(dp) :: Tr
real(dp) :: tau
@@ -188,10 +183,9 @@ pure elemental function f_p1star_H2O(T)result(value)
pure elemental function f_p1star_D2O(T)result(value)
!! Compute p1* in D2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- real(dp) :: value
- !! p1* in MPa.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ real(dp) :: value !! p1* in MPa.
real(dp) :: Tr
real(dp) :: tau
@@ -204,12 +198,10 @@ pure elemental function f_p1star_D2O(T)result(value)
pure elemental function f_kh_p1star_H2O(T, abc)result(value)
!! Compute kh/p1* in H2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kH/p1* adimensional.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kH/p1* adimensional.
real(dp) :: Tr
real(dp) :: tau
@@ -222,12 +214,10 @@ pure elemental function f_kh_p1star_H2O(T, abc)result(value)
pure elemental function f_kh_p1star_D2O(T, abc)result(value)
!! Compute kh/p1* in D2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kh/p1* adimensional.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kh/p1* adimensional.
real(dp) :: Tr
real(dp) :: tau
@@ -240,56 +230,48 @@ pure elemental function f_kh_p1star_D2O(T, abc)result(value)
pure elemental function ft_H2O(tau)result(value)
!! Compute f(t) for H2O.
implicit none
- real(dp), intent(in) :: tau
- !! tau = 1-T/Tr.
- real(dp) :: value
- !! f(t) is adimensional.
+
+ real(dp), intent(in) :: tau !! tau = 1-T/Tr.
+ real(dp) :: value !! f(t) is adimensional.
value = sum(cidi_H2O(:,1) * tau**(cidi_H2O(:,2)))
end function
pure elemental function ft_D2O(tau)result(value)
!! Compute f(t) for D2O.
implicit none
- real(dp), intent(in) :: tau
- !! tau = 1-T/Tr.
- real(dp) :: value
- !! f(t) is adimensional.
+
+ real(dp), intent(in) :: tau !! tau = 1-T/Tr.
+ real(dp) :: value !! f(t) is adimensional.
value = sum(cidi_D2O(:,1) * tau**(cidi_D2O(:,2)))
end function
pure elemental function f_kh_H2O(T, abc)result(value)
!! Compute kH in H2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kH in MPa.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kH in MPa.
value = f_kh_p1star_H2O(T, abc) * f_p1star_H2O(T)
end function
pure elemental function f_kh_D2O(T, abc)result(value)
!! Compute kH in D2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(abc_t), intent(in) :: abc
- !! ABC coefficients.
- real(dp) :: value
- !! kH in MPa.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(abc_t), intent(in) :: abc !! ABC coefficients.
+ real(dp) :: value !! kH in MPa.
value = f_kh_p1star_D2O(T, abc) * f_p1star_D2O(T)
end function
pure elemental function f_kd_H2O(T, efgh) result(value)
!! Compute kd in H2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(efgh_t), intent(in) :: efgh
- !! EFGH coefficients.
- real(dp) :: value
- !! kD adimensional.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(efgh_t), intent(in) :: efgh !! EFGH coefficients.
+ real(dp) :: value !! kD adimensional.
real(dp) :: Tr
real(dp) :: tau
@@ -313,12 +295,10 @@ pure elemental function f_kd_H2O(T, efgh) result(value)
pure elemental function f_kd_D2O(T, efgh) result(value)
!! Compute kd in D2O.
implicit none
- real(dp), intent(in) :: T
- !! Temperature in K.
- type(efgh_t), intent(in) :: efgh
- !! EFGH coefficients.
- real(dp) :: value
- !! kD adimensional.
+
+ real(dp), intent(in) :: T !! Temperature in K.
+ type(efgh_t), intent(in) :: efgh !! EFGH coefficients.
+ real(dp) :: value !! kD adimensional.
real(dp) :: Tr
real(dp) :: tau
@@ -343,13 +323,11 @@ pure subroutine kh(T, gas, heavywater, k)
!! Compute the henry constant kH for a given temperature.
implicit none
- ! arguments
real(dp), intent(in) :: T(:) !! Temperature in K.
character(len=*), intent(in) :: gas !! Gas.
integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
real(dp), intent(out) :: k(:) !! Henry constant. Filled with NaNs if gas not found.
- ! variables
integer(int32) :: i
if(heavywater > 0)then
@@ -374,13 +352,11 @@ pure subroutine kd(T, gas, heavywater, k)
!! Compute the vapor-liquid constant kd for a given temperature.
implicit none
- ! arguments
real(dp), intent(in) :: T(:) !! Temperature in K.
character(len=*), intent(in) :: gas !! Gas.
integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
real(dp), intent(out) :: k(:) !! Vapor-liquid constant. Filled with NaNs if gas not found.
- ! variables
integer(int32) :: i
if(heavywater > 0)then
@@ -405,11 +381,8 @@ pure function ngases(heavywater)result(n)
!! Returns the number of gases.
implicit none
- ! arguments
- integer(int32), intent(in) :: heavywater
- !! Flag if D2O (1) is used or H2O(0).
- integer(int32) :: n
- !! Number of gases.
+ integer(int32), intent(in) :: heavywater !! Flag if D2O (1) is used or H2O(0).
+ integer(int32) :: n !! Number of gases.
if(heavywater > 0)then
n = ngas_D2O
diff --git a/docs/src/iapws_r797.f90 b/docs/src/iapws_r797.f90
index 613848e..dc3ea6b 100644
--- a/docs/src/iapws_r797.f90
+++ b/docs/src/iapws_r797.f90
@@ -10,11 +10,11 @@ module iapws__r797
real(dp), parameter :: T_KELVIN = 273.15_dp !! Parameters from IAPWS R7-97
-real(dp), parameter :: Tc = Tc_H2O !! critical temperature of water in K
-real(dp), parameter :: pc = pc_H2O !! critical pressure of the water in MPa
-real(dp), parameter :: rhoc = rhoc_H2O !! critical density of the water in kg.m-3.
+real(dp), parameter :: Tc = Tc_H2O !! critical temperature of water in K
+real(dp), parameter :: pc = pc_H2O !! critical pressure of the water in MPa
+real(dp), parameter :: rhoc = rhoc_H2O !! critical density of the water in kg.m-3.
-real(dp), parameter :: R = 0.461526_dp !! Specific gas constant 0.461 526 kJ.kg-1.K-1
+real(dp), parameter :: R = 0.461526_dp !! Specific gas constant 0.461 526 kJ.kg-1.K-1
@@ -53,13 +53,13 @@ module iapws__r797
+0.65017534844798e3_dp &
] !! ni coefficients for region 4 (saturation line)
-real(dp), parameter :: r4_Tmin = 273.15_dp !! Lower bound for validity for ps(T) in K.
-real(dp), parameter :: r4_Tmax = 647.096_dp !! Upper bound for validity ps(T) in K.
+real(dp), parameter :: r4_Tmin = 273.15_dp !! Lower bound for validity for ps(T) in K.
+real(dp), parameter :: r4_Tmax = 647.096_dp !! Upper bound for validity ps(T) in K.
real(dp), parameter :: r4_pmin = 611.213e-6_dp !! Lower bound for validity for Ts(p) in MPa
-real(dp), parameter :: r4_pmax = 22.064_dp !! Upper bound for validity Ts(p) in MPa
+real(dp), parameter :: r4_pmax = 22.064_dp !! Upper bound for validity Ts(p) in MPa
-real(dp), parameter :: r4_Tstar = 1_dp !! K
-real(dp), parameter :: r4_Pstar = 1_dp !! MPa
+real(dp), parameter :: r4_Tstar = 1_dp !! K
+real(dp), parameter :: r4_Pstar = 1_dp !! MPa
!--------------------------------------------------------------------------------------------------------------------------------
diff --git a/docs/src/iapws_version.f90 b/docs/src/iapws_version.f90
index 071fbb3..01d7a46 100644
--- a/docs/src/iapws_version.f90
+++ b/docs/src/iapws_version.f90
@@ -3,7 +3,7 @@ module iapws__version
implicit none
private
- character(len=*), parameter :: version = "0.3.0"
+ character(len=*), parameter :: version = "0.4.0"
character(len=:), allocatable, target :: version_f
public :: get_version
diff --git a/docs/tipuesearch/tipuesearch_content.js b/docs/tipuesearch/tipuesearch_content.js
index 305faff..7c357d8 100644
--- a/docs/tipuesearch/tipuesearch_content.js
+++ b/docs/tipuesearch/tipuesearch_content.js
@@ -1 +1 @@
-var tipuesearch = {"pages":[{"title":" iapws ","text":"iapws Introduction Dependencies Installation License Introduction ipaws is a Fortran library providing the formulas for computing light and heavy water properties.\nThe formulas are taken from http://iapws.org. \nC API allows usage from C, or can be used as a basis for other wrappers.\nPython wrapper allows easy usage from Python. For now, I have implemented R2-83 [x] Tc in H2O and D2O [x] pc in H2O and D2O [x] rhoc in H2O and D2O G7-04 [x] kH [x] kD R7-97 [ ] Region 1 [ ] Region 2 [ ] Region 3 [x] Region 4 [ ] Region 5 To use iapws within your fpm project,\nadd the following to your fpm.toml file: [ dependencies ] iapws = { git = \"https://github.com/MilanSkocic/iapws.git\" } Dependencies gcc>=10.0\ngfortran>=10.0\nfpm>=0.7\nstdlib>=0.5 Installation A Makefile is provided, which uses fpm , for building the library. On windows, msys2 needs to be installed. \n Add the msys2 binary (usually C:\\msys64\\usr\\bin) to the path in order to be able to use make. On Darwin, the gcc toolchain needs to be installed. Build: the configuration file will set all the environment variables necessary for the compilation chmod +x configure.sh\n . ./configure.sh\n make Run tests make test Install make install Uninstall make uninstall License MIT Developer Info Milan Skocic","tags":"home","loc":"index.html"},{"title":"gas_type – iapws ","text":"type, public :: gas_type Derived type containing a allocatable string for representing a gas. Components Type Visibility Attributes Name Initial character(len=:), public, allocatable :: gas Gas","tags":"","loc":"type/gas_type.html"},{"title":"gases – iapws","text":"public function gases(heavywater) result(list_gases) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type( gas_type ), pointer, (:) Available gases. Called by proc~~gases~~CalledByGraph proc~gases gases proc~capi_gases capi_gases proc~capi_gases->proc~gases proc~gases2 gases2 proc~gases2->proc~gases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/gases.html"},{"title":"gases2 – iapws","text":"public function gases2(heavywater) result(str_gases) Returns the available gases as a string. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value character(len=:), pointer Available gases Calls proc~~gases2~~CallsGraph proc~gases2 gases2 proc~gases gases proc~gases2->proc~gases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/gases2.html"},{"title":"ngases – iapws","text":"public pure function ngases(heavywater) result(n) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=int32) Number of gases. Called by proc~~ngases~~CalledByGraph proc~ngases ngases proc~capi_ngases capi_ngases proc~capi_ngases->proc~ngases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/ngases.html"},{"title":"kd – iapws","text":"public pure subroutine kd(T, gas, heavywater, k) Compute the vapor-liquid constant kd for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Vapor-liquid constant. Filled with NaNs if gas not found. Called by proc~~kd~~CalledByGraph proc~kd kd proc~capi_kd capi_kd proc~capi_kd->proc~kd Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/kd.html"},{"title":"kh – iapws","text":"public pure subroutine kh(T, gas, heavywater, k) Compute the henry constant kH for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Henry constant. Filled with NaNs if gas not found. Called by proc~~kh~~CalledByGraph proc~kh kh proc~capi_kh capi_kh proc~capi_kh->proc~kh Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/kh.html"},{"title":"iapws_r797_v – iapws","text":"public pure elemental function iapws_r797_v(P, T) result(res) Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: P real(kind=dp), intent(in) :: T Return Value real(kind=dp)","tags":"","loc":"proc/iapws_r797_v.html"},{"title":"Tsat – iapws","text":"public pure subroutine Tsat(ps, Ts) Compute the saturation temperature at pressure ps.\nValidity range 611.213 Pa <= ps <= 22.064 MPa. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: ps (:) Saturation pressure in MPa. real(kind=dp), intent(out) :: Ts (:) Saturation temperature in K. Filled with nan if out of validity range. Called by proc~~tsat~~CalledByGraph proc~tsat Tsat proc~capi_tsat capi_Tsat proc~capi_tsat->proc~tsat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/tsat.html"},{"title":"psat – iapws","text":"public pure subroutine psat(Ts, ps) Compute the saturation pressure at temperature Ts. \nValidity range 273.13 K <= Ts <= 647.096 K. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: Ts (:) Saturation temperature in K. real(kind=dp), intent(out) :: ps (:) Saturation pressure in MPa. Filled with nan if out of validity range. Called by proc~~psat~~CalledByGraph proc~psat psat proc~capi_psat capi_psat proc~capi_psat->proc~psat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/psat.html"},{"title":"capi_gases – iapws","text":"public function capi_gases(heavywater) result(list_gases) bind(C, name=\"iapws_g704_gases\")) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type(c_ptr) Available gases. Calls proc~~capi_gases~~CallsGraph proc~capi_gases capi_gases proc~gases gases proc~capi_gases->proc~gases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_gases.html"},{"title":"capi_ngases – iapws","text":"public pure function capi_ngases(heavywater) result(n) bind(C, name=\"iapws_g704_ngases\")) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=c_int) Number of gases. Calls proc~~capi_ngases~~CallsGraph proc~capi_ngases capi_ngases proc~ngases ngases proc~capi_ngases->proc~ngases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_ngases.html"},{"title":"capi_kd – iapws","text":"public subroutine capi_kd(T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kd\") Compute the vapor-liquid constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Vapor-liquid constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k. Calls proc~~capi_kd~~CallsGraph proc~capi_kd capi_kd proc~kd kd proc~capi_kd->proc~kd Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_kd.html"},{"title":"capi_kh – iapws","text":"public subroutine capi_kh(T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kh\") Compute the henry constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Henry constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k. Calls proc~~capi_kh~~CallsGraph proc~capi_kh capi_kh proc~kh kh proc~capi_kh->proc~kh Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_kh.html"},{"title":"capi_get_version – iapws","text":"public function capi_get_version() result(cptr) bind(c,name=\"iapws_get_version\")) Get the version. Arguments None Return Value type(c_ptr) Pointer to version string. Calls proc~~capi_get_version~~CallsGraph proc~capi_get_version capi_get_version proc~get_version get_version proc~capi_get_version->proc~get_version Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_get_version.html"},{"title":"capi_Tsat – iapws","text":"public pure subroutine capi_Tsat(N, ps, Ts) bind(C, name=\"iapws_r797_Tsat\") Compute the saturation temperature at pressure ps. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: ps (N) real(kind=c_double), intent(out) :: Ts (N) Calls proc~~capi_tsat~~CallsGraph proc~capi_tsat capi_Tsat proc~tsat Tsat proc~capi_tsat->proc~tsat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_tsat.html"},{"title":"capi_psat – iapws","text":"public pure subroutine capi_psat(N, Ts, ps) bind(C, name=\"iapws_r797_psat\") Compute the saturation pressure at temperature Ts. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: Ts (N) real(kind=c_double), intent(out) :: ps (N) Calls proc~~capi_psat~~CallsGraph proc~capi_psat capi_psat proc~psat psat proc~capi_psat->proc~psat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_psat.html"},{"title":"get_version – iapws","text":"public function get_version() result(fptr) Get the version. \nReturns Arguments None Return Value character(len=:), pointer Pointer to the version string. Called by proc~~get_version~~CalledByGraph proc~get_version get_version proc~capi_get_version capi_get_version proc~capi_get_version->proc~get_version Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/get_version.html"},{"title":"iapws – iapws","text":"Main module for the IAPWS library. Uses iapws__r283 iapws__version iapws__capi iapws__r797 iapws__g704 module~~iapws~~UsesGraph module~iapws iapws module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__g704 iapws__g704 module~iapws->module~iapws__g704 module~iapws__r283 iapws__r283 module~iapws->module~iapws__r283 module~iapws__r797 iapws__r797 module~iapws->module~iapws__r797 module~iapws__version iapws__version module~iapws->module~iapws__version module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi->module~iapws__capi_g704 module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi->module~iapws__capi_r783 module~iapws__capi_version iapws__capi_version module~iapws__capi->module~iapws__capi_version module~iapws__g704->module~iapws__r283 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds module~iapws__r797->module~iapws__r283 module~iapws__r797->ieee_arithmetic module~iapws__r797->stdlib_kinds module~iapws__capi_g704->module~iapws__g704 iso_c_binding iso_c_binding module~iapws__capi_g704->iso_c_binding iso_fortran_env iso_fortran_env module~iapws__capi_g704->iso_fortran_env module~iapws__capi_r783->module~iapws__r283 module~iapws__capi_r783->iso_c_binding module~iapws__capi_version->module~iapws__version module~iapws__capi_version->iso_c_binding Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"module/iapws.html"},{"title":"iapws__capi_r783 – iapws","text":"Module for IAPWS R2-83: C API. Uses iapws__r283 iso_c_binding module~~iapws__capi_r783~~UsesGraph module~iapws__capi_r783 iapws__capi_r783 iso_c_binding iso_c_binding module~iapws__capi_r783->iso_c_binding module~iapws__r283 iapws__r283 module~iapws__capi_r783->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi_r783~~UsedByGraph module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi iapws__capi module~iapws__capi->module~iapws__capi_r783 module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Variables Type Visibility Attributes Name Initial real(kind=c_double), public, bind(C, name=\"0\") :: capi_Tc_D2O = Tc_D2O Critical temperature for D2O in K real(kind=c_double), public, bind(C, name=\"0\") :: capi_Tc_H2O = Tc_H2O Critical temperature for H2O in K real(kind=c_double), public, bind(C, name=\"0\") :: capi_pc_D2O = pc_D2O Critical pressure for D2O in MPa real(kind=c_double), public, bind(C, name=\"0\") :: capi_pc_H2O = pc_H2O Critical pressure for H2O in MPa real(kind=c_double), public, bind(C, name=\"0\") :: capi_rhoc_D2O = rhoc_D2O Critical density for D2O in kg.m-3 real(kind=c_double), public, bind(C, name=\"0\") :: capi_rhoc_H2O = rhoc_H2O Critical density for H2O in kg.m-3","tags":"","loc":"module/iapws__capi_r783.html"},{"title":"iapws__g704 – iapws","text":"Module for IAPWS G7-04.\nEFGH coefficients for gases in heavywater.\nai and bi coefficients for water Uses iapws__r283 stdlib_kinds ieee_arithmetic module~~iapws__g704~~UsesGraph module~iapws__g704 iapws__g704 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__g704->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__g704~~UsedByGraph module~iapws__g704 iapws__g704 module~iapws iapws module~iapws->module~iapws__g704 module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi_g704->module~iapws__g704 module~iapws__capi->module~iapws__capi_g704 Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Derived Types type, public :: gas_type Derived type containing a allocatable string for representing a gas. Components Type Visibility Attributes Name Initial character(len=:), public, allocatable :: gas Gas Functions public function gases (heavywater) result(list_gases) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type( gas_type ), pointer, (:) Available gases. public function gases2 (heavywater) result(str_gases) Returns the available gases as a string. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value character(len=:), pointer Available gases public pure function ngases (heavywater) result(n) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=int32) Number of gases. Subroutines public pure subroutine kd (T, gas, heavywater, k) Compute the vapor-liquid constant kd for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Vapor-liquid constant. Filled with NaNs if gas not found. public pure subroutine kh (T, gas, heavywater, k) Compute the henry constant kH for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Henry constant. Filled with NaNs if gas not found.","tags":"","loc":"module/iapws__g704.html"},{"title":"iapws__r797 – iapws","text":"Module for IAPWS R7-97: Not fully implemented - under development. Uses iapws__r283 stdlib_kinds ieee_arithmetic module~~iapws__r797~~UsesGraph module~iapws__r797 iapws__r797 ieee_arithmetic ieee_arithmetic module~iapws__r797->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__r797->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__r797->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__r797~~UsedByGraph module~iapws__r797 iapws__r797 module~iapws iapws module~iapws->module~iapws__r797 module~iapws__capi_r797 iapws__capi_r797 module~iapws__capi_r797->module~iapws__r797 Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public pure elemental function iapws_r797_v (P, T) result(res) Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: P real(kind=dp), intent(in) :: T Return Value real(kind=dp) Subroutines public pure subroutine Tsat (ps, Ts) Compute the saturation temperature at pressure ps.\nValidity range 611.213 Pa <= ps <= 22.064 MPa. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: ps (:) Saturation pressure in MPa. real(kind=dp), intent(out) :: Ts (:) Saturation temperature in K. Filled with nan if out of validity range. public pure subroutine psat (Ts, ps) Compute the saturation pressure at temperature Ts. \nValidity range 273.13 K <= Ts <= 647.096 K. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: Ts (:) Saturation temperature in K. real(kind=dp), intent(out) :: ps (:) Saturation pressure in MPa. Filled with nan if out of validity range.","tags":"","loc":"module/iapws__r797.html"},{"title":"iapws__capi_g704 – iapws","text":"Module for IAPWS G704 : C API. Uses iso_fortran_env iapws__g704 iso_c_binding module~~iapws__capi_g704~~UsesGraph module~iapws__capi_g704 iapws__capi_g704 iso_c_binding iso_c_binding module~iapws__capi_g704->iso_c_binding iso_fortran_env iso_fortran_env module~iapws__capi_g704->iso_fortran_env module~iapws__g704 iapws__g704 module~iapws__capi_g704->module~iapws__g704 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__g704->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi_g704~~UsedByGraph module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi iapws__capi module~iapws__capi->module~iapws__capi_g704 module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public function capi_gases (heavywater) result(list_gases) bind(C, name=\"iapws_g704_gases\")) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type(c_ptr) Available gases. public pure function capi_ngases (heavywater) result(n) bind(C, name=\"iapws_g704_ngases\")) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=c_int) Number of gases. Subroutines public subroutine capi_kd (T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kd\") Compute the vapor-liquid constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Vapor-liquid constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k. public subroutine capi_kh (T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kh\") Compute the henry constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Henry constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k.","tags":"","loc":"module/iapws__capi_g704.html"},{"title":"iapws__capi – iapws","text":"Main module for the IAPWS library: C API. Uses iapws__capi_r783 iapws__capi_g704 iapws__capi_version module~~iapws__capi~~UsesGraph module~iapws__capi iapws__capi module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi->module~iapws__capi_g704 module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi->module~iapws__capi_r783 module~iapws__capi_version iapws__capi_version module~iapws__capi->module~iapws__capi_version iso_c_binding iso_c_binding module~iapws__capi_g704->iso_c_binding iso_fortran_env iso_fortran_env module~iapws__capi_g704->iso_fortran_env module~iapws__g704 iapws__g704 module~iapws__capi_g704->module~iapws__g704 module~iapws__capi_r783->iso_c_binding module~iapws__r283 iapws__r283 module~iapws__capi_r783->module~iapws__r283 module~iapws__capi_version->iso_c_binding module~iapws__version iapws__version module~iapws__capi_version->module~iapws__version module~iapws__g704->module~iapws__r283 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi~~UsedByGraph module~iapws__capi iapws__capi module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"module/iapws__capi.html"},{"title":"iapws__capi_version – iapws","text":"Uses iapws__version iso_c_binding module~~iapws__capi_version~~UsesGraph module~iapws__capi_version iapws__capi_version iso_c_binding iso_c_binding module~iapws__capi_version->iso_c_binding module~iapws__version iapws__version module~iapws__capi_version->module~iapws__version Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi_version~~UsedByGraph module~iapws__capi_version iapws__capi_version module~iapws__capi iapws__capi module~iapws__capi->module~iapws__capi_version module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public function capi_get_version () result(cptr) bind(c,name=\"iapws_get_version\")) Get the version. Arguments None Return Value type(c_ptr) Pointer to version string.","tags":"","loc":"module/iapws__capi_version.html"},{"title":"iapws__r283 – iapws","text":"Module for IAPWS R2-83. Uses stdlib_kinds module~~iapws__r283~~UsesGraph module~iapws__r283 iapws__r283 stdlib_kinds stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__r283~~UsedByGraph module~iapws__r283 iapws__r283 module~iapws iapws module~iapws->module~iapws__r283 module~iapws__g704 iapws__g704 module~iapws->module~iapws__g704 module~iapws__r797 iapws__r797 module~iapws->module~iapws__r797 module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi_r783->module~iapws__r283 module~iapws__g704->module~iapws__r283 module~iapws__r797->module~iapws__r283 module~iapws__capi->module~iapws__capi_r783 module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi->module~iapws__capi_g704 module~iapws__capi_g704->module~iapws__g704 module~iapws__capi_r797 iapws__capi_r797 module~iapws__capi_r797->module~iapws__r797 Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Variables Type Visibility Attributes Name Initial real(kind=dp), public, parameter :: Tc_D2O = 643.847_dp Critical temperature for D2O in K real(kind=dp), public, parameter :: Tc_H2O = 647.096_dp Critical temperature for H2O in K real(kind=dp), public, parameter :: pc_D2O = 21.671_dp Critical pressure for H2O in MPa real(kind=dp), public, parameter :: pc_H2O = 22.064_dp Critical pressure for H2O in MPa real(kind=dp), public, parameter :: rhoc_D2O = 356.0_dp Critical density for H2O in kg.m-3 real(kind=dp), public, parameter :: rhoc_H2O = 322.0_dp Critical density for H2O in kg.m-3","tags":"","loc":"module/iapws__r283.html"},{"title":"iapws__capi_r797 – iapws","text":"Uses stdlib_kinds iapws__r797 iso_c_binding module~~iapws__capi_r797~~UsesGraph module~iapws__capi_r797 iapws__capi_r797 iso_c_binding iso_c_binding module~iapws__capi_r797->iso_c_binding module~iapws__r797 iapws__r797 module~iapws__capi_r797->module~iapws__r797 stdlib_kinds stdlib_kinds module~iapws__capi_r797->stdlib_kinds module~iapws__r797->stdlib_kinds ieee_arithmetic ieee_arithmetic module~iapws__r797->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__r797->module~iapws__r283 module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Subroutines public pure subroutine capi_Tsat (N, ps, Ts) bind(C, name=\"iapws_r797_Tsat\") Compute the saturation temperature at pressure ps. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: ps (N) real(kind=c_double), intent(out) :: Ts (N) public pure subroutine capi_psat (N, Ts, ps) bind(C, name=\"iapws_r797_psat\") Compute the saturation pressure at temperature Ts. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: Ts (N) real(kind=c_double), intent(out) :: ps (N)","tags":"","loc":"module/iapws__capi_r797.html"},{"title":"iapws__version – iapws","text":"Version Used by module~~iapws__version~~UsedByGraph module~iapws__version iapws__version module~iapws iapws module~iapws->module~iapws__version module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__capi_version iapws__capi_version module~iapws__capi_version->module~iapws__version module~iapws__capi->module~iapws__capi_version Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public function get_version () result(fptr) Get the version. \nReturns Arguments None Return Value character(len=:), pointer Pointer to the version string.","tags":"","loc":"module/iapws__version.html"},{"title":"iapws.f90 – iapws","text":"This file depends on sourcefile~~iapws.f90~~EfferentGraph sourcefile~iapws.f90 iapws.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~iapws.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~iapws.f90->sourcefile~iapws_r797.f90 sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~iapws.f90->sourcefile~iapws_version.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws !! Main module for the IAPWS library. use iapws__version use iapws__g704 use iapws__r283 use iapws__r797 use iapws__capi end module","tags":"","loc":"sourcefile/iapws.f90.html"},{"title":"capi_r283.f90 – iapws","text":"This file depends on sourcefile~~capi_r283.f90~~EfferentGraph sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi_r283.f90~~AfferentGraph sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi.f90 capi.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_r783 !! Module for IAPWS R2-83: C API. use iso_c_binding , only : c_double use iapws__r283 implicit none private real ( c_double ), protected , bind ( C , name = \"iapws_r283_Tc_H2O\" ) :: capi_Tc_H2O = Tc_H2O !! Critical temperature for H2O in K real ( c_double ), protected , bind ( C , name = \"iapws_r283_Tc_D2O\" ) :: capi_Tc_D2O = Tc_D2O !! Critical temperature for D2O in K real ( c_double ), protected , bind ( C , name = \"iapws_r283_pc_H2O\" ) :: capi_pc_H2O = pc_H2O !! Critical pressure for H2O in MPa real ( c_double ), protected , bind ( C , name = \"iapws_r283_pc_D2O\" ) :: capi_pc_D2O = pc_D2O !! Critical pressure for D2O in MPa real ( c_double ), protected , bind ( C , name = \"iapws_r283_rhoc_H2O\" ) :: capi_rhoc_H2O = rhoc_H2O !! Critical density for H2O in kg.m-3 real ( c_double ), protected , bind ( C , name = \"iapws_r283_rhoc_D2O\" ) :: capi_rhoc_D2O = rhoc_D2O !! Critical density for D2O in kg.m-3 public :: capi_Tc_H2O , & capi_Tc_D2O , & capi_pc_H2O , & capi_pc_D2O , & capi_rhoc_H2O , & capi_rhoc_D2O end module iapws__capi_r783","tags":"","loc":"sourcefile/capi_r283.f90.html"},{"title":"iapws_g704.f90 – iapws","text":"This file depends on sourcefile~~iapws_g704.f90~~EfferentGraph sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~iapws_g704.f90~~AfferentGraph sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_g704.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__g704 !! Module for IAPWS G7-04. use stdlib_kinds , only : dp , int32 use ieee_arithmetic , only : ieee_value , ieee_quiet_nan use iapws__r283 implicit none private integer ( int32 ), parameter :: lengas = 5 integer ( int32 ), parameter :: ngas_H2O = 14 integer ( int32 ), parameter :: ngas_D2O = 7 type :: gas_type !! Derived type containing a allocatable string for representing a gas. character ( len = :), allocatable :: gas !! Gas end type type ( gas_type ), allocatable , target :: f_gases (:) character ( len = :), allocatable , target :: f_gases_str real ( dp ), parameter :: T_KELVIN = 27 3.15_dp !! Absolute temperature in KELVIN real ( dp ), parameter :: Tc1_H2O = Tc_H2O real ( dp ), parameter :: pc1_H2O = pc_H2O real ( dp ), parameter :: Tc1_D2O = Tc_D2O real ( dp ), parameter :: pc1_D2O = pc_D2O real ( dp ), parameter :: q_H2O = - 0.023767_dp !! solvent coefficient for kd in water real ( dp ), parameter :: q_D2O = - 0.024552_dp !! solvent coefficient for kd in heavywater !! ABC coefficients for gases in water. type :: abc_t character ( len = lengas ) :: gas !! Gas real ( dp ) :: A !! A Column real ( dp ) :: B !! B Column real ( dp ) :: C !! C Column end type !! EFGH coefficients for gases in heavywater. type :: efgh_t character ( len = lengas ) :: gas !! Gas real ( dp ) :: E !! E Column real ( dp ) :: F !! F Column real ( dp ) :: G !! G Column real ( dp ) :: H !! H Column end type !! ai and bi coefficients for water real ( dp ), dimension ( 6 , 2 ), parameter :: aibi_H2O = reshape ([& - 7.85951783_dp , 1.84408259_dp , - 1 1.78664970_dp , 2 2.68074110_dp , - 1 5.96187190_dp , 1.80122502_dp ,& 1.000_dp , 1.500_dp , 3.000_dp , 3.500_dp , 4.000_dp , 7.500_dp ], [ 6 , 2 ]) !! ai and bi coefficients for heavywater real ( dp ), dimension ( 5 , 2 ), parameter :: aibi_D2O = reshape ([& - 7.8966570_dp , 2 4.7330800_dp , - 2 7.8112800_dp , 9.3559130_dp , - 9.2200830_dp , & 1.00_dp , 1.89_dp , 2.00_dp , 3.00_dp , 3.60_dp ], [ 5 , 2 ]) !! ABC constants water. type ( abc_t ), dimension ( ngas_H2O ), parameter :: abc_H2O = & [ abc_t ( \"He\" , - 3.52839_dp , 7.12983_dp , 4.47770_dp ),& abc_t ( \"Ne\" , - 3.18301_dp , 5.31448_dp , 5.43774_dp ),& abc_t ( \"Ar\" , - 8.40954_dp , 4.29587_dp , 1 0.52779_dp ),& abc_t ( \"Kr\" , - 8.97358_dp , 3.61508_dp , 1 1.29963_dp ),& abc_t ( \"Xe\" , - 1 4.21635_dp , 4.00041_dp , 1 5.60999_dp ),& abc_t ( \"H2\" , - 4.73284_dp , 6.08954_dp , 6.06066_dp ),& abc_t ( \"N2\" , - 9.67578_dp , 4.72162_dp , 1 1.70585_dp ),& abc_t ( \"O2\" , - 9.44833_dp , 4.43822_dp , 1 1.42005_dp ),& abc_t ( \"CO\" , - 1 0.52862_dp , 5.13259_dp , 1 2.01421_dp ),& abc_t ( \"CO2\" , - 8.55445_dp , 4.01195_dp , 9.52345_dp ),& abc_t ( \"H2S\" , - 4.51499_dp , 5.23538_dp , 4.42126_dp ),& abc_t ( \"CH4\" , - 1 0.44708_dp , 4.66491_dp , 1 2.12986_dp ),& abc_t ( \"C2H6\" , - 1 9.67563_dp , 4.51222_dp , 2 0.62567_dp ),& abc_t ( \"SF6\" , - 1 6.56118_dp , 2.15289_dp , 2 0.35440_dp )] !! ABC constants for heavywater type ( abc_t ), dimension ( ngas_D2O ), parameter :: abc_D2O = & [ abc_t ( \"He\" , - 0.72643_dp , 7.02134_dp , 2.04433_dp ),& abc_t ( \"Ne\" , - 0.91999_dp , 5.65327_dp , 3.17247_dp ),& abc_t ( \"Ar\" , - 7.17725_dp , 4.48177_dp , 9.31509_dp ),& abc_t ( \"Kr\" , - 8.47059_dp , 3.91580_dp , 1 0.69433_dp ),& abc_t ( \"Xe\" , - 1 4.46485_dp , 4.42330_dp , 1 5.60919_dp ),& abc_t ( \"D2\" , - 5.33843_dp , 6.15723_dp , 6.53046_dp ),& abc_t ( \"CH4\" , - 1 0.01915_dp , 4.73368_dp , 1 1.75711_dp )] !! ci and di coefficients for water real ( dp ), dimension ( 6 , 2 ), parameter :: cidi_H2O = reshape ([& 1.99274064_dp , 1.09965342_dp , - 0.510839303_dp , - 1.75493479_dp , - 4 5.5170352_dp , - 6.7469445d5 ,& 1.0_dp / 3.0_dp , 2.0_dp / 3.0_dp , 5.0_dp / 3.0_dp , 1 6.0_dp / 3.0_dp , 4 3.0_dp / 3.0_dp , 11 0.0_dp / 3.0_dp ], [ 6 , 2 ]) !! ci and di coefficients for heavywater real ( dp ), dimension ( 4 , 2 ), parameter :: cidi_D2O = reshape ([& 2.7072_dp , 0.58662_dp , - 1.3069_dp , - 4 5.663_dp , & 0.374_dp , 1.45_dp , 2.6_dp , 1 2.3_dp ], [ 4 , 2 ]) !! EFGH constants for water type ( efgh_t ), dimension ( ngas_H2O ), parameter :: efgh_H2O = & [ efgh_t ( \"He\" , 226 7.4082_dp , - 2.9616_dp , - 3.2604_dp , 7.8819_dp ),& efgh_t ( \"Ne\" , 250 7.3022_dp , - 3 8.6955_dp , 11 0.3992_dp , - 7 1.9096_dp ),& efgh_t ( \"Ar\" , 231 0.5463_dp , - 4 6.7034_dp , 16 0.4066_dp , - 11 8.3043_dp ),& efgh_t ( \"Kr\" , 227 6.9722_dp , - 6 1.1494_dp , 21 4.0117_dp , - 15 9.0407_dp ),& efgh_t ( \"Xe\" , 202 2.8375_dp , 1 6.7913_dp , - 6 1.2401_dp , 4 1.9236_dp ),& efgh_t ( \"H2\" , 228 6.4159_dp , 1 1.3397_dp , - 7 0.7279_dp , 6 3.0631_dp ),& efgh_t ( \"N2\" , 238 8.8777_dp , - 1 4.9593_dp , 4 2.0179_dp , - 2 9.4396_dp ),& efgh_t ( \"O2\" , 230 5.0674_dp , - 1 1.3240_dp , 2 5.3224_dp , - 1 5.6449_dp ),& efgh_t ( \"CO\" , 234 6.2291_dp , - 5 7.6317_dp , 20 4.5324_dp , - 15 2.6377_dp ),& efgh_t ( \"CO2\" , 167 2.9376_dp , 2 8.1751_dp , - 11 2.4619_dp , 8 5.3807_dp ),& efgh_t ( \"H2S\" , 131 9.1205_dp , 1 4.1571_dp , - 4 6.8361_dp , 3 3.2266_dp ),& efgh_t ( \"CH4\" , 221 5.6977_dp , - 0.1089_dp , - 6.6240_dp , 4.6789_dp ),& efgh_t ( \"C2H6\" , 214 3.8121_dp , 6.8859_dp , - 1 2.6084_dp , 0.0_dp ),& efgh_t ( \"SF6\" , 287 1.7265_dp , - 6 6.7556_dp , 22 9.7191_dp , - 17 2.7400_dp )] !! EFGH constants for heavywater type ( efgh_t ), dimension ( ngas_D2O ), parameter :: efgh_D2O = & [ efgh_t ( \"He\" , 229 3.2474_dp , - 5 4.7707_dp , 19 4.2924_dp , - 14 2.1257 ), & efgh_t ( \"Ne\" , 243 9.6677_dp , - 9 3.4934_dp , 33 0.7783_dp , - 24 3.0100_dp ),& efgh_t ( \"Ar\" , 226 9.2352_dp , - 5 3.6321_dp , 19 1.8421_dp , - 14 3.7659_dp ),& efgh_t ( \"Kr\" , 225 0.3857_dp , - 4 2.0835_dp , 14 0.7656_dp , - 10 2.7592_dp ),& efgh_t ( \"Xe\" , 203 8.3656_dp , 6 8.1228_dp , - 27 1.3390_dp , 20 7.7984_dp ),& efgh_t ( \"D2\" , 214 1.3214_dp , - 1.9696_dp , 1.6136_dp , 0.0_dp ),& efgh_t ( \"CH4\" , 221 6.0181_dp , - 4 0.7666_dp , 15 2.5778_dp , - 11 7.7430_dp )] public :: gas_type public :: kh , kd public :: ngases public :: gases , gases2 contains pure function findgas_abc ( gas , abc ) result ( value ) !! Find the index of the gas in the ABC table. implicit none character ( len =* ), intent ( in ) :: gas !! Gas. type ( abc_t ), dimension (:), intent ( in ) :: abc !! ABC table. integer ( int32 ) :: value !! index of the gas. !! local variables integer ( int32 ) :: i value = 0 do i = 1 , size ( abc ) if ( trim ( gas ) . eq . abc ( i )% gas ) then value = i exit endif end do end function pure function findgas_efgh ( gas , efgh ) result ( value ) !! Find the index of the gas in the ABC table. implicit none character ( len =* ), intent ( in ) :: gas !! Gas. type ( efgh_t ), dimension (:), intent ( in ) :: efgh !! EFGH table. integer ( int32 ) :: value !! index of gas. integer ( int32 ) :: i value = 0 do i = 1 , size ( efgh ) if ( trim ( gas ) . eq . efgh ( i )% gas ) then value = i exit endif end do end function pure elemental function f_p1star_H2O ( T ) result ( value ) !! Compute p1* in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. real ( dp ) :: value !! p1* in MPa. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_H2O tau = 1 - Tr value = exp ( 1 / ( Tr ) * sum ( aibi_H2O (:, 1 ) * tau ** ( aibi_H2O (:, 2 )))) * pc1_H2O end function pure elemental function f_p1star_D2O ( T ) result ( value ) !! Compute p1* in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. real ( dp ) :: value !! p1* in MPa. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_D2O tau = 1 - Tr value = exp ( 1 / ( Tr ) * sum ( aibi_D2O (:, 1 ) * tau ** ( aibi_D2O (:, 2 )))) * pc1_D2O end function pure elemental function f_kh_p1star_H2O ( T , abc ) result ( value ) !! Compute kh/p1* in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kH/p1* adimensional. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_H2O tau = 1 - Tr value = exp ( abc % A / Tr + abc % B * ( tau ** 0.355_dp ) / Tr + abc % C * exp ( tau ) * Tr ** ( - 0.41_dp )) end function pure elemental function f_kh_p1star_D2O ( T , abc ) result ( value ) !! Compute kh/p1* in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kh/p1* adimensional. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_D2O tau = 1 - Tr value = exp ( abc % A / Tr + abc % B * ( tau ** 0.355_dp ) / Tr + abc % C * exp ( tau ) * Tr ** ( - 0.41_dp )) end function pure elemental function ft_H2O ( tau ) result ( value ) !! Compute f(t) for H2O. implicit none real ( dp ), intent ( in ) :: tau !! tau = 1-T/Tr. real ( dp ) :: value !! f(t) is adimensional. value = sum ( cidi_H2O (:, 1 ) * tau ** ( cidi_H2O (:, 2 ))) end function pure elemental function ft_D2O ( tau ) result ( value ) !! Compute f(t) for D2O. implicit none real ( dp ), intent ( in ) :: tau !! tau = 1-T/Tr. real ( dp ) :: value !! f(t) is adimensional. value = sum ( cidi_D2O (:, 1 ) * tau ** ( cidi_D2O (:, 2 ))) end function pure elemental function f_kh_H2O ( T , abc ) result ( value ) !! Compute kH in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kH in MPa. value = f_kh_p1star_H2O ( T , abc ) * f_p1star_H2O ( T ) end function pure elemental function f_kh_D2O ( T , abc ) result ( value ) !! Compute kH in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kH in MPa. value = f_kh_p1star_D2O ( T , abc ) * f_p1star_D2O ( T ) end function pure elemental function f_kd_H2O ( T , efgh ) result ( value ) !! Compute kd in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( efgh_t ), intent ( in ) :: efgh !! EFGH coefficients. real ( dp ) :: value !! kD adimensional. real ( dp ) :: Tr real ( dp ) :: tau real ( dp ) :: p1 real ( dp ) :: p2 real ( dp ) :: p3 real ( dp ) :: p4 Tr = ( T + T_KELVIN ) / Tc1_H2O tau = 1 - Tr p1 = q_H2O * efgh % F p2 = efgh % E / T * ft_H2O ( tau ) p3 = ( efgh % F + efgh % G * tau ** ( 2.0_dp / 3.0_dp ) + efgh % H * tau ) p4 = exp ( - T / 10 0.0_dp ) value = exp ( p1 + p2 + p3 * p4 ) end function pure elemental function f_kd_D2O ( T , efgh ) result ( value ) !! Compute kd in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( efgh_t ), intent ( in ) :: efgh !! EFGH coefficients. real ( dp ) :: value !! kD adimensional. real ( dp ) :: Tr real ( dp ) :: tau real ( dp ) :: p1 real ( dp ) :: p2 real ( dp ) :: p3 real ( dp ) :: p4 Tr = T / Tc1_D2O tau = 1 - Tr p1 = q_D2O * efgh % F p2 = efgh % E / T * ft_D2O ( tau ) p3 = ( efgh % F + efgh % G * tau ** ( 2.0_dp / 3.0_dp ) + efgh % H * tau ) p4 = exp ( - T / 10 0.0_dp ) value = exp ( p1 + p2 + p3 * p4 ) end function pure subroutine kh ( T , gas , heavywater , k ) !! Compute the henry constant kH for a given temperature. implicit none ! arguments real ( dp ), intent ( in ) :: T (:) !! Temperature in K. character ( len =* ), intent ( in ) :: gas !! Gas. integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( dp ), intent ( out ) :: k (:) !! Henry constant. Filled with NaNs if gas not found. ! variables integer ( int32 ) :: i if ( heavywater > 0 ) then i = findgas_abc ( gas , abc_D2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kh_D2O ( T , abc_D2O ( i )) endif else i = findgas_abc ( gas , abc_H2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kh_H2O ( T , abc_H2O ( i )) endif endif end subroutine pure subroutine kd ( T , gas , heavywater , k ) !! Compute the vapor-liquid constant kd for a given temperature. implicit none ! arguments real ( dp ), intent ( in ) :: T (:) !! Temperature in K. character ( len =* ), intent ( in ) :: gas !! Gas. integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( dp ), intent ( out ) :: k (:) !! Vapor-liquid constant. Filled with NaNs if gas not found. ! variables integer ( int32 ) :: i if ( heavywater > 0 ) then i = findgas_efgh ( gas , efgh_D2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kd_D2O ( T , efgh_D2O ( i )) endif else i = findgas_efgh ( gas , efgh_H2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kd_H2O ( T , efgh_H2O ( i )) endif endif end subroutine pure function ngases ( heavywater ) result ( n ) !! Returns the number of gases. implicit none ! arguments integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). integer ( int32 ) :: n !! Number of gases. if ( heavywater > 0 ) then n = ngas_D2O else n = ngas_H2O endif end function function gases ( heavywater ) result ( list_gases ) !! Returns the list of available gases. implicit none ! arguments integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). type ( gas_type ), pointer :: list_gases (:) !! Available gases. ! variables integer ( int32 ) :: i , n if ( allocated ( f_gases )) then deallocate ( f_gases ) endif if ( heavywater > 0 ) then allocate ( f_gases ( ngas_D2O )) do i = 1 , ngas_D2O if ( allocated ( f_gases ( i )% gas )) then deallocate ( f_gases ( i )% gas ) endif n = len ( trim ( abc_D2O ( i )% gas )) allocate ( character ( len = n ) :: f_gases ( i )% gas ) f_gases ( i )% gas = trim ( abc_D2O ( i )% gas ) enddo else allocate ( f_gases ( ngas_H2O )) do i = 1 , ngas_H2O if ( allocated ( f_gases ( i )% gas )) then deallocate ( f_gases ( i )% gas ) endif n = len ( trim ( abc_H2O ( i )% gas )) allocate ( character ( len = n ) :: f_gases ( i )% gas ) f_gases ( i )% gas = trim ( abc_H2O ( i )% gas ) enddo endif list_gases => f_gases end function function gases2 ( heavywater ) result ( str_gases ) !! Returns the available gases as a string. implicit none ! arguments integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). character ( len = :), pointer :: str_gases !! Available gases ! variables integer ( int32 ) :: i , j , k , ngas type ( gas_type ), pointer :: f_gases_list (:) f_gases_list => gases ( heavywater ) ngas = size ( f_gases_list ) k = 0 do i = 1 , ngas k = k + len ( f_gases_list ( i )% gas ) enddo if ( allocated ( f_gases_str )) then deallocate ( f_gases_str ) endif allocate ( character ( len = k + ngas ) :: f_gases_str ) i = 1 j = 1 k = 1 do i = 1 , ngas do j = 1 , len ( f_gases_list ( i )% gas ) f_gases_str ( k : k ) = f_gases_list ( i )% gas ( j : j ) k = k + 1 enddo f_gases_str ( k : k ) = \",\" k = k + 1 enddo f_gases_str ( len ( f_gases_str ): len ( f_gases_str )) = \"\" str_gases => f_gases_str end function end module","tags":"","loc":"sourcefile/iapws_g704.f90.html"},{"title":"iapws_r797.f90 – iapws","text":"This file depends on sourcefile~~iapws_r797.f90~~EfferentGraph sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~iapws_r797.f90~~AfferentGraph sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~capi_r797.f90 capi_r797.f90 sourcefile~capi_r797.f90->sourcefile~iapws_r797.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_r797.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__r797 !! Module for IAPWS R7-97: Not fully implemented - under development. use stdlib_kinds , only : dp use ieee_arithmetic use iapws__r283 , only : Tc_H2O , pc_H2O , rhoc_H2O implicit none private public :: iapws_r797_v , psat , Tsat real ( dp ), parameter :: T_KELVIN = 27 3.15_dp !! Parameters from IAPWS R7-97 real ( dp ), parameter :: Tc = Tc_H2O !! critical temperature of water in K real ( dp ), parameter :: pc = pc_H2O !! critical pressure of the water in MPa real ( dp ), parameter :: rhoc = rhoc_H2O !! critical density of the water in kg.m-3. real ( dp ), parameter :: R = 0.461526_dp !! Specific gas constant 0.461 526 kJ.kg-1.K-1 ! Region 1 !-------------------------------------------------------------------------------------------------------------------------------- real ( dp ), parameter :: r1_ps = 1 6.53_dp ! p* real ( dp ), parameter :: r1_ts = 138 6.0_dp ! T* real ( dp ) :: IJn_r1f ( 9 , 3 ) = transpose ( reshape ([& 0.0_dp , - 2.0_dp , 0.146_dp , & 0.0_dp , - 1.0_dp , - 0.84548187169114_dp , & 0.0_dp , 0.0_dp , - 0.37563672040d1 , & 0.0_dp , 1.0_dp , 0.33855169168385d1 , & 0.0_dp , 2.0_dp , - 0.95791963387872_dp ,& 0.0_dp , 3.0_dp , 0.15772038513228_dp , & 0.0_dp , 4.0_dp , - 0.16616417199501d-1 , & 0.0_dp , 5.0_dp , - 0.81214629983568d-3 , & 1.0_dp , - 9.0_dp , - 0.28319080123804d-3 ], & [ 3 , 9 ])) !! Coefficients I, J and n for forward equation in region 1. !-------------------------------------------------------------------------------------------------------------------------------- ! Region 4: Saturation line !-------------------------------------------------------------------------------------------------------------------------------- real ( dp ) :: r4_n ( 10 ) = [ & + 0.11670521452767e4_dp , & - 0.72421316703206e6_dp , & - 0.1707384694009292e2_dp , & + 0.12020824702470e5_dp , & - 0.32325550322333e7_dp , & + 0.14915108613530e2_dp , & - 0.48232657361591e4_dp , & + 0.40511340542057e6_dp , & - 0.23855557567849_dp , & + 0.65017534844798e3_dp & ] !! ni coefficients for region 4 (saturation line) real ( dp ), parameter :: r4_Tmin = 27 3.15_dp !! Lower bound for validity for ps(T) in K. real ( dp ), parameter :: r4_Tmax = 64 7.096_dp !! Upper bound for validity ps(T) in K. real ( dp ), parameter :: r4_pmin = 61 1.213e-6_dp !! Lower bound for validity for Ts(p) in MPa real ( dp ), parameter :: r4_pmax = 2 2.064_dp !! Upper bound for validity Ts(p) in MPa real ( dp ), parameter :: r4_Tstar = 1_dp !! K real ( dp ), parameter :: r4_Pstar = 1_dp !! MPa !-------------------------------------------------------------------------------------------------------------------------------- contains ! Region 1 !-------------------------------------------------------------------------------------------------------------------------------- pure elemental function gamma_ ( P , T ) result ( res ) implicit none real ( dp ), intent ( in ) :: P !! Pressure real ( dp ), intent ( in ) :: T !! Temperature real ( dp ) :: pi real ( dp ) :: tau real ( dp ) :: res pi = ( T + T_KELVIN ) / r1_ts tau = P / r1_ps res = sum ( IJn_r1f (:, 3 ) * ( 7.1_dp - pi ) ** IJn_r1f (:, 1 ) * ( tau - 1.222_dp ) ** IJn_r1f (:, 2 )) end function pure elemental function gamma_pi ( P , T ) result ( res ) implicit none real ( dp ), intent ( in ) :: P real ( dp ), intent ( in ) :: T real ( dp ) :: pi real ( dp ) :: tau real ( dp ) :: res pi = ( T + T_KELVIN ) / r1_ts tau = P / r1_ps res = sum ( IJn_r1f (:, 3 ) * IJn_r1f (:, 1 ) * ( 7.1_dp - pi ) ** ( IJn_r1f (:, 1 ) - 1.0_dp ) * ( tau - 1.222_dp ) ** IJn_r1f (:, 2 )) end function pure elemental function iapws_r797_v ( P , T ) result ( res ) implicit none real ( dp ), intent ( in ) :: P real ( dp ), intent ( in ) :: T real ( dp ) :: res res = R * ( T + T_KELVIN ) / P * gamma_pi ( P , T ) end function !-------------------------------------------------------------------------------------------------------------------------------- ! Region 4: Saturation line !-------------------------------------------------------------------------------------------------------------------------------- pure elemental function r4_ps ( Ts ) result ( value ) !! Compute the saturation-pressure line. !! Validity range 273.13 K <= Ts <= 647.096 K. real ( dp ), intent ( in ) :: Ts !! Saturation temperature in K. real ( dp ) :: value !! Saturation pressure in MPa at temperature Ts. Is nan if Ts is out of range. real ( dp ) :: theta , Ts_K , A , B , C if ( Ts < r4_Tmin ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else if ( Ts > r4_Tmax ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else Ts_K = Ts / r4_Tstar theta = Ts_K + r4_n ( 9 ) / ( Ts_K - r4_n ( 10 )) A = theta ** 2 + r4_n ( 1 ) * theta + r4_n ( 2 ) B = r4_n ( 3 ) * theta ** 2 + r4_n ( 4 ) * theta + r4_n ( 5 ) C = r4_n ( 6 ) * theta ** 2 + r4_n ( 7 ) * theta + r4_n ( 8 ) value = r4_Pstar * ( 2 * C / ( - B + ( B ** 2 - 4 * A * C ) ** ( 0.5_dp ))) ** ( 4.0_dp ) endif end function pure elemental function r4_Ts ( ps ) result ( value ) !! Compute the saturation-pressure line. !! Validity range 611.213 Pa <= ps <= 22.064 MPa. real ( dp ), intent ( in ) :: ps !! Saturation pressure in MPa. real ( dp ) :: value !! Saturation temperature in K at pressure ps. Is nan if ps is out of range. real ( dp ) :: beta , D , E , F , G if ( ps < r4_pmin ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else if ( ps > r4_pmax ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else beta = ( ps / r4_Pstar ) ** ( 0.25_dp ) E = beta ** 2 + r4_n ( 3 ) * beta + r4_n ( 6 ) F = r4_n ( 1 ) * beta ** 2 + r4_n ( 4 ) * beta + r4_n ( 7 ) G = r4_n ( 2 ) * beta ** 2 + r4_n ( 5 ) * beta + r4_n ( 8 ) D = 2 * G / ( - F - ( F ** 2 - 4 * E * G ) ** ( 0.5_dp )) value = r4_Tstar * ( r4_n ( 10 ) + D - (( r4_n ( 10 ) + D ) ** 2.0_dp - 4.0_dp * ( r4_n ( 9 ) + r4_n ( 10 ) * D )) ** 0.5_dp ) / 2.0_dp endif end function pure subroutine psat ( Ts , ps ) !! Compute the saturation pressure at temperature Ts. !! Validity range 273.13 K <= Ts <= 647.096 K. real ( dp ), intent ( in ) :: Ts (:) !! Saturation temperature in K. real ( dp ), intent ( out ) :: ps (:) !! Saturation pressure in MPa. Filled with nan if out of validity range. ps = r4_ps ( Ts ) end subroutine pure subroutine Tsat ( ps , Ts ) !! Compute the saturation temperature at pressure ps. !! Validity range 611.213 Pa <= ps <= 22.064 MPa. real ( dp ), intent ( in ) :: ps (:) !! Saturation pressure in MPa. real ( dp ), intent ( out ) :: Ts (:) !! Saturation temperature in K. Filled with nan if out of validity range. Ts = r4_Ts ( ps ) end subroutine !-------------------------------------------------------------------------------------------------------------------------------- end module","tags":"","loc":"sourcefile/iapws_r797.f90.html"},{"title":"capi_g704.f90 – iapws","text":"This file depends on sourcefile~~capi_g704.f90~~EfferentGraph sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi_g704.f90~~AfferentGraph sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90 capi.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_g704 !! Module for IAPWS G704 : C API. use iso_fortran_env use iso_c_binding , only : c_double , c_int , c_ptr , c_f_pointer , c_char , c_size_t , c_null_char , c_loc use iapws__g704 implicit none private type , bind ( C ) :: c_char_p type ( c_ptr ) :: p end type type :: cgas_type character ( kind = c_char , len = 1 ), allocatable :: gas (:) end type type ( cgas_type ), allocatable , target :: c_gases (:) type ( c_char_p ), allocatable , target :: char_pp (:) character ( len = :), allocatable , target :: c_gases_str public :: capi_kh , capi_kd public :: capi_ngases public :: capi_gases contains subroutine capi_kh ( T , gas , heavywater , k , size_gas , size_T ) bind ( C , name = \"iapws_g704_kh\" ) !! Compute the henry constant for a given temperature. implicit none ! arguments integer ( c_int ), intent ( in ), value :: size_gas !! Size of the gas string. integer ( c_size_t ), intent ( in ), value :: size_T !! Size of T and k. real ( c_double ), intent ( in ) :: T ( size_T ) !! Temperature in °C. type ( c_ptr ), intent ( in ), value :: gas !! Gas. integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( c_double ), intent ( inout ) :: k ( size_T ) !! Henry constant. Filled with NaNs if gas not found. ! variables character , pointer , dimension (:) :: c2f_gas character ( len = size_gas ) :: f_gas integer ( int32 ) :: i call c_f_pointer ( gas , c2f_gas , shape = [ size_gas ]) do i = 1 , size_gas f_gas ( i : i ) = c2f_gas ( i ) enddo call kh ( T , f_gas , heavywater , k ) end subroutine subroutine capi_kd ( T , gas , heavywater , k , size_gas , size_T ) bind ( C , name = \"iapws_g704_kd\" ) !! Compute the vapor-liquid constant for a given temperature. implicit none ! arguments integer ( c_size_t ), intent ( in ), value :: size_T !! Size of T and k. integer ( c_int ), intent ( in ), value :: size_gas !! Size of the gas string. real ( c_double ), intent ( in ) :: T ( size_T ) !! Temperature in °C. type ( c_ptr ), intent ( in ), value :: gas !! Gas. integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( c_double ), intent ( inout ) :: k ( size_T ) !! Vapor-liquid constant. Filled with NaNs if gas not found. ! variables character , pointer , dimension (:) :: c2f_gas character ( len = size_gas ) :: f_gas integer ( int32 ) :: i call c_f_pointer ( gas , c2f_gas , shape = [ size_gas ]) do i = 1 , size_gas f_gas ( i : i ) = c2f_gas ( i ) enddo call kd ( T , f_gas , heavywater , k ) end subroutine pure function capi_ngases ( heavywater ) bind ( C , name = \"iapws_g704_ngases\" ) result ( n ) !! Returns the number of gases. implicit none ! arguments integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). integer ( c_int ) :: n !! Number of gases. n = ngases ( heavywater ) end function function capi_gases ( heavywater ) bind ( C , name = \"iapws_g704_gases\" ) result ( list_gases ) !! Returns the list of available gases. implicit none ! arguments integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). type ( c_ptr ) :: list_gases !! Available gases. ! variables integer ( int32 ) :: i , j , ngas , n type ( gas_type ), pointer :: f_gases (:) => null () f_gases => gases ( heavywater ) ngas = size ( f_gases ) if ( allocated ( c_gases )) then deallocate ( c_gases ) endif allocate ( c_gases ( ngas )) if ( allocated ( char_pp )) then deallocate ( char_pp ) endif allocate ( char_pp ( ngas )) do i = 1 , ngas if ( allocated ( c_gases ( i )% gas )) then deallocate ( c_gases ( i )% gas ) endif n = len ( f_gases ( i )% gas ) allocate ( c_gases ( i )% gas ( n + 1 )) do j = 1 , n c_gases ( i )% gas ( j ) = f_gases ( i )% gas ( j : j ) enddo c_gases ( i )% gas ( n + 1 ) = c_null_char char_pp ( i )% p = c_loc ( c_gases ( i )% gas ) enddo list_gases = c_loc ( char_pp ) end function function capi_gases2 ( heavywater ) bind ( C , name = \"iapws_g704_gases2\" ) result ( str_gases ) !! Returns the available gases as a string. implicit none ! arguments integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). type ( c_ptr ) :: str_gases !! Available gases. ! variables character ( len = :), pointer :: f_gases_str => null () f_gases_str => gases2 ( heavywater ) if ( allocated ( c_gases_str )) then deallocate ( c_gases_str ) endif allocate ( character ( len = len ( f_gases_str )) :: c_gases_str ) c_gases_str = f_gases_str c_gases_str ( len ( f_gases_str ): len ( f_gases_str )) = c_null_char str_gases = c_loc ( c_gases_str ) end function end module iapws__capi_g704","tags":"","loc":"sourcefile/capi_g704.f90.html"},{"title":"capi.f90 – iapws","text":"This file depends on sourcefile~~capi.f90~~EfferentGraph sourcefile~capi.f90 capi.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi.f90~~AfferentGraph sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi !! Main module for the IAPWS library: C API. use iapws__capi_version use iapws__capi_r783 use iapws__capi_g704 end module iapws__capi","tags":"","loc":"sourcefile/capi.f90.html"},{"title":"capi_version.f90 – iapws","text":"This file depends on sourcefile~~capi_version.f90~~EfferentGraph sourcefile~capi_version.f90 capi_version.f90 sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi_version.f90~~AfferentGraph sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi.f90 capi.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_version !! Version: C API. use iso_c_binding , only : c_null_char , c_ptr , c_loc use iapws__version implicit none private character ( len = :), allocatable , target :: version_c public :: capi_get_version contains function capi_get_version () bind ( c , name = \"iapws_get_version\" ) result ( cptr ) !! Get the version. implicit none ! Returns type ( c_ptr ) :: cptr !! Pointer to version string. character ( len = :), pointer :: fptr fptr => get_version () if ( allocated ( version_c )) then deallocate ( version_c ) endif allocate ( character ( len = len ( fptr ) + 1 ) :: version_c ) version_c = fptr // c_null_char cptr = c_loc ( version_c ) end function end module iapws__capi_version","tags":"","loc":"sourcefile/capi_version.f90.html"},{"title":"iapws_r283.f90 – iapws","text":"Files dependent on this one sourcefile~~iapws_r283.f90~~AfferentGraph sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~iapws.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~iapws.f90->sourcefile~iapws_r797.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~capi_r797.f90 capi_r797.f90 sourcefile~capi_r797.f90->sourcefile~iapws_r797.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__r283 !! Module for IAPWS R2-83. use stdlib_kinds , only : dp implicit none private real ( dp ), parameter :: Tc_H2O = 64 7.096_dp !! Critical temperature for H2O in K real ( dp ), parameter :: Tc_D2O = 64 3.847_dp !! Critical temperature for D2O in K real ( dp ), parameter :: pc_H2O = 2 2.064_dp !! Critical pressure for H2O in MPa real ( dp ), parameter :: pc_D2O = 2 1.671_dp !! Critical pressure for H2O in MPa real ( dp ), parameter :: rhoc_H2O = 32 2.0_dp !! Critical density for H2O in kg.m-3 real ( dp ), parameter :: rhoc_D2O = 35 6.0_dp !! Critical density for H2O in kg.m-3 public :: Tc_H2O , Tc_D2O , pc_H2O , pc_D2O , rhoc_H2O , rhoc_D2O end module","tags":"","loc":"sourcefile/iapws_r283.f90.html"},{"title":"capi_r797.f90 – iapws","text":"This file depends on sourcefile~~capi_r797.f90~~EfferentGraph sourcefile~capi_r797.f90 capi_r797.f90 sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~capi_r797.f90->sourcefile~iapws_r797.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_r797 use stdlib_kinds , only : dp , int32 use iso_c_binding , only : c_double , c_int , c_size_t use iapws__r797 implicit none private public :: capi_psat , capi_Tsat contains pure subroutine capi_psat ( N , Ts , ps ) bind ( C , name = \"iapws_r797_psat\" ) !! Compute the saturation pressure at temperature Ts. integer ( c_size_t ), intent ( in ), value :: N real ( c_double ), intent ( in ) :: Ts ( N ) real ( c_double ), intent ( out ) :: ps ( N ) call psat ( Ts , ps ) end subroutine pure subroutine capi_Tsat ( N , ps , Ts ) bind ( C , name = \"iapws_r797_Tsat\" ) !! Compute the saturation temperature at pressure ps. integer ( c_size_t ), intent ( in ), value :: N real ( c_double ), intent ( in ) :: ps ( N ) real ( c_double ), intent ( out ) :: Ts ( N ) call Tsat ( ps , Ts ) end subroutine end module iapws__capi_r797","tags":"","loc":"sourcefile/capi_r797.f90.html"},{"title":"iapws_version.f90 – iapws","text":"Files dependent on this one sourcefile~~iapws_version.f90~~AfferentGraph sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_version.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__version !! Version implicit none private character ( len =* ), parameter :: version = \"0.3.0\" character ( len = :), allocatable , target :: version_f public :: get_version contains function get_version () result ( fptr ) !! Get the version. implicit none !! Returns character ( len = :), pointer :: fptr !! Pointer to the version string. if ( allocated ( version_f )) then deallocate ( version_f ) endif allocate ( character ( len = len ( version )) :: version_f ) version_f = version fptr => version_f end function end module iapws__version","tags":"","loc":"sourcefile/iapws_version.f90.html"},{"title":"Contributing and specs – iapws","text":"Water properties for Modern Fortran.","tags":"","loc":"page/index.html"},{"title":"Changelog – iapws","text":"Version 0.4.0 Version 0.3.0 Version 0.2.2 Version 0.2.1 Version 0.2.0 Version 0.1.1 Version 0.1.0 Version 0.4.0 Implementation of the region 4 in R7-97. API break for kh and kd in g704. The temperature must be provided in Kelvin instead of degrees Celsius. Add dependency to numpy for python wrapper. Add pure python modules for encapsulating C extensions. Refractoring and code cleaning. Documentation update. Not released yet Version 0.3.0 API break: functions for the Fortran code were renamed: They do not contain the package+module in the name for the sake of simplicity The package is only added in the functions for the C API in order to have a namespace-like behavior. If needed for solving conflicts with other packages, the functions can be aliased. Separate sources files for the C API code for each module. Implement tests with the test-drive framework. Add version extension in the pywrapper. Implement version module with its getter. Documentation update. Version 0.2.2 Implementation of report R283 for critical constants of water. Switch to pyproject.toml for python wrapper. Code refractoring and clean up. Documentation update. Full changelog available at github Version 0.2.1 Comlete missing documentation of private functions. Minor fixes in C API code as well in python wrapper. Remove unecessary dependency in Makefile. Full changelog available at github Version 0.2.0 New structure with modules corresponding to the IAPWS papers. Compatible with fpm. fpm module naming convention. API break for iapws_g704_kh and iapws_g704_kd functions: only 1d-arrays as inputs in Fortran and C API. only objects with buffer protocol as inputs in python wrapper. python wrappers return memoryviews. New functions: providing the number of gases in H2O and D2O. providing the available of gases in H2O and D2O as list of strings. providing the available of gases in H2O and D2O as a unique string. Cleanup old app code not needed anymore. Fix memory allocation in pywrapper. Completed tests. Documentation improvements: Add conversion equations from molar fractions to solubilities. Add plots for visualizing kh and kd. Full changelog available at github Version 0.1.1 Logo creation Error handling in python wrapper for arrays with rank greater than 1 Tests in python wrapper for expected failures with rank-n arrays Full changelog available at github Version 0.1.0 Implementation of kH and kD from IAPWS G7-04 in fortran + C API Python wrapper for kH and kD. Documentation with sphinx. Full changelog available at github","tags":"","loc":"page/changelog.html"},{"title":"Examples – iapws","text":"Fortran C Python Fortran program example_in_f use stdlib_kinds , only : dp , int32 use iapws implicit none integer ( int32 ) :: i , ngas real ( dp ) :: T ( 1 ), kh_res ( 1 ), kd_res ( 1 ) real ( dp ) :: Ts ( 7 ), ps ( 7 ) character ( len = 2 ) :: gas = \"O2\" integer ( int32 ) :: heavywater = 0 type ( gas_type ), pointer :: gases_list (:) character ( len = :), pointer :: gases_str print * , '########################## IAPWS VERSION ##########################' print * , \"version \" , get_version () print * , '########################## IAPWS R2-83 ##########################' print \"(a, f10.3, a)\" , \"Tc in h2o=\" , Tc_H2O , \" k\" print \"(a, f10.3, a)\" , \"pc in h2o=\" , pc_H2O , \" mpa\" print \"(a, f10.3, a)\" , \"rhoc in h2o=\" , rhoc_H2O , \" kg/m3\" print \"(a, f10.3, a)\" , \"Tc in D2O=\" , Tc_D2O , \" k\" print \"(a, f10.3, a)\" , \"pc in D2O=\" , pc_D2O , \" mpa\" print \"(a, f10.3, a)\" , \"rhoc in D2O=\" , rhoc_D2O , \" kg/m3\" print * , '' print * , '########################## IAPWS G7-04 ##########################' ! Compute kh and kd in H2O T ( 1 ) = 2 5.0_dp + 27 3.15_dp call kh ( T , gas , heavywater , kh_res ) print \"(A10, 1X, A10, 1X, A2, F10.1, A, 4X, A3, SP, F10.4)\" , \"Gas=\" , gas , \"T=\" , T , \"K\" , \"kh=\" , kh_res call kd ( T , gas , heavywater , kd_res ) print \"(A10, 1X, A10, 1X, A2, F10.1, A, 4X, A3, SP, F15.4)\" , \"Gas=\" , gas , \"T=\" , T , \"K\" , \"kh=\" , kd_res ! Get and print available gases heavywater = 0 ngas = ngases ( heavywater ) gases_list => null () gases_list => gases ( heavywater ) gases_str => gases2 ( heavywater ) print * , \"Gases in H2O: \" , ngas print * , gases_str do i = 1 , ngas print * , gases_list ( i )% gas enddo heavywater = 1 ngas = ngases ( heavywater ) gases_list => null () gases_list => gases ( heavywater ) gases_str => gases2 ( heavywater ) print * , \"Gases in D2O: \" , ngas print * , gases_str do i = 1 , ngas print * , gases_list ( i )% gas enddo print * , '########################## IAPWS R7-97 ##########################' ! Compute ps from Ts. Ts (:) = [ - 1.0_dp , 2 5.0_dp , 10 0.0_dp , 20 0.0_dp , 30 0.0_dp , 36 0.0_dp , 37 4.0_dp ] Ts (:) = Ts (:) + 27 3.15_dp call psat ( Ts , ps ) do i = 1 , size ( Ts ) print \"(SP, F23.3, A3, 4X, F23.3, A3)\" , Ts ( i ), \"K\" , ps ( i ), \"MPa\" end do ! Compute Ts from ps call Tsat ( ps , Ts ) do i = 1 , size ( Ts ) print \"(SP, F23.3, A3, 4X, F23.3, A3)\" , Ts ( i ), \"K\" , ps ( i ), \"MPa\" end do end program C #include #include #include \"iapws.h\" int main ( void ){ double T = 25.0 + 273.15 ; /* in C*/ char * gas = \"O2\" ; double kh , kd ; char ** gases_list ; char * gases_str ; int ngas ; int i ; int heavywater = 0 ; printf ( \"%s \\n \" , \"########################## IAPWS VERSION ##########################\" ); printf ( \"version %s \\n \" , iapws_get_version ()); printf ( \"%s \\n \" , \"########################## IAPWS R2-83 ##########################\" ); printf ( \"%s %10.3f %s \\n \" , \"Tc in H2O\" , iapws_r283_Tc_H2O , \"K\" ); printf ( \"%s %10.3f %s \\n \" , \"pc in H2O\" , iapws_r283_pc_H2O , \"MPa\" ); printf ( \"%s %10.3f %s \\n \" , \"rhoc in H2O\" , iapws_r283_rhoc_H2O , \"kg/m3\" ); printf ( \"%s %10.3f %s \\n \" , \"Tc in D2O\" , iapws_r283_Tc_D2O , \"K\" ); printf ( \"%s %10.3f %s \\n \" , \"pc in D2O\" , iapws_r283_pc_D2O , \"MPa\" ); printf ( \"%s %10.3f %s \\n \" , \"rhoc in D2O\" , iapws_r283_rhoc_D2O , \"kg/m3\" ); printf ( \" \\n \" ); printf ( \"%s \\n \" , \"########################## IAPWS G7-04 ##########################\" ); /* Compute kh and kd in H2O*/ iapws_g704_kh ( & T , gas , heavywater , & kh , strlen ( gas ), 1 ); printf ( \"Gas=%s \\t T=%fK \\t kh=%+10.4f \\n \" , gas , T , kh ); iapws_g704_kd ( & T , gas , heavywater , & kd , strlen ( gas ), 1 ); printf ( \"Gas=%s \\t T=%fK \\t kd=%+15.4f \\n \" , gas , T , kd ); /* Get and print the available gases */ ngas = iapws_g704_ngases ( heavywater ); gases_list = iapws_g704_gases ( heavywater ); gases_str = iapws_g704_gases2 ( heavywater ); printf ( \"Gases in H2O: %d \\n \" , ngas ); printf ( \"%s \\n \" , gases_str ); for ( i = 0 ; i < ngas ; i ++ ){ printf ( \"%s \\n \" , gases_list [ i ]); } heavywater = 1 ; ngas = iapws_g704_ngases ( heavywater ); gases_list = iapws_g704_gases ( heavywater ); gases_str = iapws_g704_gases2 ( heavywater ); printf ( \"Gases in D2O: %d \\n \" , ngas ); printf ( \"%s \\n \" , gases_str ); for ( i = 0 ; i < ngas ; i ++ ){ printf ( \"%s \\n \" , gases_list [ i ]); } printf ( \"%s \\n \" , \"########################## IAPWS R7-97 ##########################\" ); double Ts [ 7 ] = { -1.0 , 25.0 , 100.0 , 200.0 , 300.0 , 360.0 , 374.0 }; double ps [ 7 ] = { 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 }; for ( i = 0 ; i < 7 ; i ++ ){ Ts [ i ] = Ts [ i ] + 273.15 ; } iapws_r797_psat ( 7 , Ts , ps ); for ( i = 0 ; i < 7 ; i ++ ){ printf ( \"%+23.3f %s %+23.3f %s \\n \" , Ts [ i ], \"K\" , ps [ i ], \"MPa\" ); } iapws_r797_Tsat ( 7 , ps , Ts ); for ( i = 0 ; i < 7 ; i ++ ){ printf ( \"%+23.3f %s %+23.3f %s \\n \" , Ts [ i ], \"K\" , ps [ i ], \"MPa\" ); } return 0 ; } Python r \"\"\"Example in python\"\"\" import sys sys . path . insert ( 0 , \"../py/src/\" ) import array import numpy as np import matplotlib.pyplot as plt import pyiapws print ( \"########################## IAPWS VERSION ##########################\" ) print ( pyiapws . __version__ ) print ( \"########################## IAPWS R2-83 ##########################\" ) print ( \"Tc in H2O\" , pyiapws . r283 . Tc_H2O , \"K\" ) print ( \"pc in H2O\" , pyiapws . r283 . pc_H2O , \"MPa\" ) print ( \"rhoc in H2O\" , pyiapws . r283 . rhoc_H2O , \"kg/m3\" ) print ( \"Tc in D2O\" , pyiapws . r283 . Tc_D2O , \"K\" ) print ( \"pc in D2O\" , pyiapws . r283 . pc_D2O , \"MPa\" ) print ( \"rhoc in D2O\" , pyiapws . r283 . rhoc_D2O , \"kg/m3\" ) print ( \"\" ) print ( \"########################## IAPWS G7-04 ##########################\" ) gas = \"O2\" T = array . array ( \"d\" , ( 25.0 + 273.15 ,)) # Compute kh and kd in H2O heavywater = False k = pyiapws . g704 . kh ( T , \"O2\" , heavywater ) print ( f \"Gas= { gas } \\t T= { T [ 0 ] } K \\t kh= { k [ 0 ] : +10.4f } \\n \" ) k = pyiapws . g704 . kd ( T , \"O2\" , heavywater ) print ( f \"Gas= { gas } \\t T= { T [ 0 ] } K \\t kd= { k [ 0 ] : +10.4f } \\n \" ) # Get and print the available gases heavywater = False gases_list = pyiapws . g704 . gases ( heavywater ) gases_str = pyiapws . g704 . gases2 ( heavywater ) ngas = pyiapws . g704 . ngases ( heavywater ) print ( f \"Gases in H2O: { ngas :} \" ) print ( gases_str ) for gas in gases_list : print ( gas ) heavywater = True gases_list = pyiapws . g704 . gases ( heavywater ) gases_str = pyiapws . g704 . gases2 ( heavywater ) ngas = pyiapws . g704 . ngases ( heavywater ) print ( f \"Gases in D2O: { ngas :} \" ) print ( gases_str ) for gas in gases_list : print ( gas ) style = { \"marker\" : \".\" , \"ls\" : \"\" , \"ms\" : 2 } T_KELVIN = 273.15 T = np . linspace ( 0.0 , 360.0 , 1000 ) + 273.15 solvent = { True : \"D2O\" , False : \"H2O\" } print ( \"Generating plot for kh\" ) kname = \"kh\" for HEAVYWATER in ( False , True ): print ( solvent [ HEAVYWATER ]) fig = plt . figure () ax = fig . add_subplot () ax . grid ( visible = True , ls = ':' ) ax . set_xlabel ( \"T /°C\" ) ax . set_ylabel ( \"ln (kh/1GPa)\" ) gases = pyiapws . g704 . gases ( HEAVYWATER ) for gas in gases : k = pyiapws . g704 . kh ( T , gas , HEAVYWATER ) / 1000.0 ln_k = np . log ( k ) ax . plot ( T , ln_k , label = gas , ** style ) ax . legend ( ncol = 3 ) fig . savefig ( f \"../media/g704- { kname : s } _ { solvent [ HEAVYWATER ] } .png\" , dpi = 100 , format = \"png\" ) print ( \"Generating plot for kd\" ) kname = \"kd\" for HEAVYWATER in ( False , True ): print ( solvent [ HEAVYWATER ]) fig = plt . figure () ax = fig . add_subplot () ax . grid ( visible = True , ls = ':' ) ax . set_xlabel ( \"T /°C\" ) ax . set_ylabel ( \"ln kd\" ) gases = pyiapws . g704 . gases ( HEAVYWATER ) for gas in gases : k = pyiapws . g704 . kd ( T , gas , HEAVYWATER ) ln_k = np . log ( k ) ax . plot ( T , ln_k , label = gas , ** style ) ax . legend ( ncol = 3 ) fig . savefig ( f \"../media/g704- { kname : s } _ { solvent [ HEAVYWATER ] } .png\" , dpi = 100 , format = \"png\" ) print ( \"########################## IAPWS R7-97 ##########################\" ) Ts = np . asarray ([ - 1.0 , 25.0 , 100.0 , 200.0 , 300.0 , 360.0 , 374.0 ]) Ts = Ts + 273.15 ps = pyiapws . r797 . psat ( Ts ) for i in range ( Ts . size ): print ( f \" { Ts [ i ] : 23.3f } K { ps [ i ] : 23.3f } MPa.\" ) Ts = pyiapws . r797 . Tsat ( ps ) for i in range ( Ts . size ): print ( f \" { Ts [ i ] : 23.3f } K { ps [ i ] : 23.3f } MPa.\" ) fig = plt . figure () ax = fig . add_subplot () ax . grid ( visible = True , ls = ':' ) ax . set_xlabel ( \"Ts /K\" ) ax . set_ylabel ( \"ps /MPa\" ) Ts = np . linspace ( 0.0 , 370.0 , 500 ) Ts = Ts + 273.15 ps = pyiapws . r797 . psat ( Ts ) ax . plot ( Ts , ps , \"r-\" , label = \"ps(Ts)\" ) Ts = pyiapws . r797 . Tsat ( ps ) ax . plot ( Ts , ps , \"b--\" , label = \"Ts(ps)\" ) ax . legend () fig . savefig ( f \"../media/r797-r4.png\" , dpi = 100 , format = \"png\" ) plt . show ()","tags":"","loc":"page/examples.html"},{"title":"License – iapws","text":"MIT License Copyright (c) Milan Skocic Permission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n“Software”), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions: The above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","tags":"","loc":"page/license.html"},{"title":"References – iapws","text":"IAPWS, “Release on the Values of Temperature, Pressure and Density of Ordinary and Heavy Water Substances at Their Respective Critical Points,” IAPWS, St. Petersburg, Russia, R2-83, 1992. IAPWS, “Guideline on the Henry’s Constant and Vapor-Liquid Distribution Constant for Gases in H2O and D2O at High Temperatures,” IAPWS, Kyoto, Japan, G7-04, 2004. IAPWS, “Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam,” Lucerne, Switzerland, R7-97, 2007. IAPWS, “Revised Release on the IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use,” Praque, Czech Republic, R6-95, 2018. Wolfgang Wagner and A. Pruss. “International Equations for the Saturation Properties of Ordinary Water Substance”. Revised According to the International Temperature Scale of 1990. Addendum to J. Phys. Chem. Ref. Data 16, 893 (1987). Journal of Physical and Chemical Reference Data, 22(3):783–787, May 1993. doi:10.1063/1.555926. Allan H. Harvey and Eric W. Lemmon. “Correlation for the Vapor Pressure of Heavy Water From the Triple Point to the Critical Point”. Journal of Physical and Chemical Reference Data, 31(1):173–181, March 2002. doi:10.1063/1.1430231. R. Fernandez-Prini, J.L. Alvarez, and A.H. Harvey. “Henry’s Constants and Vapor–Liquid Distribution Constants for Gaseous Solutes in H2O and D2O at High Temperatures”. Journal of Physical Chemistry Reference Data, 32(2):903–916, 2003.","tags":"","loc":"page/references.html"},{"title":"Specifications (specs) – iapws","text":"This is an index/directory of the specifications (specs) for each module. R2-83 - Values of Temperature, Pressure and Density of Ordinary and Heavy Water Substances at Their Respective Critical Points G7-04 - Guideline on the Henry’s Constant and Vapor-Liquid Distribution Constant for Gases in H2O and D2O at High Temperatures R7-97 - Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam C API - Prototypes for C language.","tags":"","loc":"page/specs/index.html"},{"title":"C API – iapws","text":"The prototypes of the C API are defined as shown below. #ifndef IAPWS_H #define IAPWS_H #if _MSC_VER #define ADD_IMPORT __declspec(dllimport) #else #define ADD_IMPORT #endif extern char * iapws_get_version ( void ); ADD_IMPORT extern const double iapws_r283_Tc_H2O ; ADD_IMPORT extern const double iapws_r283_Tc_D2O ; ADD_IMPORT extern const double iapws_r283_pc_H2O ; ADD_IMPORT extern const double iapws_r283_pc_D2O ; ADD_IMPORT extern const double iapws_r283_rhoc_H2O ; ADD_IMPORT extern const double iapws_r283_rhoc_D2O ; extern void iapws_g704_kh ( double * T , char * gas , int heavywater , double * k , int size_gas , size_t size_T ); extern void iapws_g704_kd ( double * T , char * gas , int heavywater , double * k , int size_gas , size_t size_T ); extern int iapws_g704_ngases ( int heavywater ); extern char ** iapws_g704_gases ( int heavywater ); extern char * iapws_g704_gases2 ( int heavywater ); extern void iapws_r797_psat ( size_t N , double * Ts , double * ps ); extern void iapws_r797_Tsat ( size_t N , double * ps , double * Ts ); #endif","tags":"","loc":"page/specs/capi.html"},{"title":"IPAWS G7-04 – iapws","text":"Description Henry Contant: kh Vapor-Liquid Distribution Constant: kd Molar fractions Available gases Plots Description The computation is based on the parameters provided by the technical report G7-04 Henry Contant: kh The Henry constant is defined as shown in equation below. kh is expressed in MPa. : liquid-phase fugacity : mole fraction of the solute The Henry’s constant kh is given as a function of temperature by: : critical temperature of the solvent as recommended by IAPWS . is the vapor pressure of the solvent at the temperature of interest and \n is calculated from the correlation of Wagner and Pruss for and from the correlation of Harvey and Lemmon for . Both equations have the form: is 6 for and 5 for is the critical pressure of the solvent recommended by the report R2-83 Vapor-Liquid Distribution Constant: kd The liquid-vapor distribution constant kd is defined as shown in equation below. kd is adimensional. : mole fraction of the solute is the vapor-phase solute mole fraction in equilibrium with the liquid The vapor-liquid distribution constant kd is given as a function of temperature by: : -0.023767 for and -0.024552 for . Wagner et al. for and fernandez-prini et al. for In both cases, has the following form: is 6 for and 4 for Molar fractions The molar fractions and as following: By fixing at 1.0 it comes that the molar fractions and are then expressed per \nunit of pressure as shown in the following equation . The molar fractions can be converted to solubilties in ppm or cm3/kg by considering dilute solutions. is the considered gas and the solvent is either or . Available gases kh and kd can be computed for the following gases: in water: He, Ne, Ar, Kr, Xe, H2, N2, O2, CO, CO2, H2S, CH4, C2H6, SF6 in heavywater: He, Ne, Ar, Kr, Xe, D2, CH4 The available gases can be retrieved with gases which returns the available gases as a list. gases2 which return the available gases as a string. ngases which returns the number of available gases. Plots","tags":"","loc":"page/specs/iapws_g704.html"},{"title":"IAPWS R2-83 – iapws","text":"Description In water In heavywater Description The technical report R2-83 defines constants used for computing the water properties. In water In heavywater","tags":"","loc":"page/specs/iapws_r283.html"},{"title":"IAPWS R7-97 – iapws","text":"Description Structure of the formulation Reference constants Auxiliary Equation for the Boundary between Regions 2 and 3 Region 4: Saturation line The saturation-pressure equation (Basic Equation): psat The saturation-temperature equation (Backward Equation): Tsat Plot Description The computation is based on the parameters provided by the technical report R7-97 . Structure of the formulation The R7-97 report consists of a set of equations for different \nregions which cover the following range of validity: and and Reference constants The specific gas constant of ordinary water used for this formulation is This value results from the recommended values of the molar gas constant, \nand the molar mass of ordinary water ( Wagner et al., Harvey et al. ).\nThe values of the critical parameters are from the corresponding IAPWS release. Auxiliary Equation for the Boundary between Regions 2 and 3 Region 4: Saturation line The equation for describing the saturation line is an implicit quadratic\nequation which can be directly solved with regard to both saturation pressure and saturation temperature . The details are largely described in the literature IAPWS R797, IAPWS R695 . where and with and and are coefficients. The saturation-pressure equation (Basic Equation): psat The solution of the quadratic equation with regard to saturation pressure is as follows: with and Range of validity: . The saturation-temperature equation (Backward Equation): Tsat The saturation-temperature solution of the quadratic equation reads where and Range of validity: Plot","tags":"","loc":"page/specs/iapws_r797.html"}]}
\ No newline at end of file
+var tipuesearch = {"pages":[{"title":" iapws ","text":"iapws Introduction Dependencies Installation License Introduction ipaws is a Fortran library providing the formulas for computing light and heavy water properties.\nThe formulas are taken from http://iapws.org. \nC API allows usage from C, or can be used as a basis for other wrappers.\nPython wrapper allows easy usage from Python. For now, I have implemented R2-83 [x] Tc in H2O and D2O [x] pc in H2O and D2O [x] rhoc in H2O and D2O G7-04 [x] kH [x] kD R7-97 [ ] Region 1 [ ] Region 2 [ ] Region 3 [x] Region 4 [ ] Region 5 To use iapws within your fpm project,\nadd the following to your fpm.toml file: [ dependencies ] iapws = { git = \"https://github.com/MilanSkocic/iapws.git\" } Dependencies gcc>=10.0\ngfortran>=10.0\nfpm>=0.7\nstdlib>=0.5 Installation A Makefile is provided, which uses fpm , for building the library. On windows, msys2 needs to be installed. \n Add the msys2 binary (usually C:\\msys64\\usr\\bin) to the path in order to be able to use make. On Darwin, the gcc toolchain needs to be installed. Build: the configuration file will set all the environment variables necessary for the compilation chmod +x configure.sh\n . ./configure.sh\n make Run tests make test Install make install Uninstall make uninstall License MIT Developer Info Milan Skocic","tags":"home","loc":"index.html"},{"title":"gas_type – iapws ","text":"type, public :: gas_type Derived type containing a allocatable string for representing a gas. Components Type Visibility Attributes Name Initial character(len=:), public, allocatable :: gas Gas","tags":"","loc":"type/gas_type.html"},{"title":"capi_get_version – iapws","text":"public function capi_get_version() result(cptr) bind(c,name=\"iapws_get_version\")) Get the version. Arguments None Return Value type(c_ptr) Pointer to version string. Calls proc~~capi_get_version~~CallsGraph proc~capi_get_version capi_get_version proc~get_version get_version proc~capi_get_version->proc~get_version Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_get_version.html"},{"title":"gases – iapws","text":"public function gases(heavywater) result(list_gases) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type( gas_type ), pointer, (:) Available gases. Called by proc~~gases~~CalledByGraph proc~gases gases proc~capi_gases capi_gases proc~capi_gases->proc~gases proc~gases2 gases2 proc~gases2->proc~gases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/gases.html"},{"title":"gases2 – iapws","text":"public function gases2(heavywater) result(str_gases) Returns the available gases as a string. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value character(len=:), pointer Available gases Calls proc~~gases2~~CallsGraph proc~gases2 gases2 proc~gases gases proc~gases2->proc~gases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/gases2.html"},{"title":"ngases – iapws","text":"public pure function ngases(heavywater) result(n) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=int32) Number of gases. Called by proc~~ngases~~CalledByGraph proc~ngases ngases proc~capi_ngases capi_ngases proc~capi_ngases->proc~ngases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/ngases.html"},{"title":"kd – iapws","text":"public pure subroutine kd(T, gas, heavywater, k) Compute the vapor-liquid constant kd for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Vapor-liquid constant. Filled with NaNs if gas not found. Called by proc~~kd~~CalledByGraph proc~kd kd proc~capi_kd capi_kd proc~capi_kd->proc~kd Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/kd.html"},{"title":"kh – iapws","text":"public pure subroutine kh(T, gas, heavywater, k) Compute the henry constant kH for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Henry constant. Filled with NaNs if gas not found. Called by proc~~kh~~CalledByGraph proc~kh kh proc~capi_kh capi_kh proc~capi_kh->proc~kh Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/kh.html"},{"title":"capi_gases – iapws","text":"public function capi_gases(heavywater) result(list_gases) bind(C, name=\"iapws_g704_gases\")) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type(c_ptr) Available gases. Calls proc~~capi_gases~~CallsGraph proc~capi_gases capi_gases proc~gases gases proc~capi_gases->proc~gases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_gases.html"},{"title":"capi_ngases – iapws","text":"public pure function capi_ngases(heavywater) result(n) bind(C, name=\"iapws_g704_ngases\")) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=c_int) Number of gases. Calls proc~~capi_ngases~~CallsGraph proc~capi_ngases capi_ngases proc~ngases ngases proc~capi_ngases->proc~ngases Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_ngases.html"},{"title":"capi_kd – iapws","text":"public subroutine capi_kd(T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kd\") Compute the vapor-liquid constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Vapor-liquid constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k. Calls proc~~capi_kd~~CallsGraph proc~capi_kd capi_kd proc~kd kd proc~capi_kd->proc~kd Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_kd.html"},{"title":"capi_kh – iapws","text":"public subroutine capi_kh(T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kh\") Compute the henry constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Henry constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k. Calls proc~~capi_kh~~CallsGraph proc~capi_kh capi_kh proc~kh kh proc~capi_kh->proc~kh Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_kh.html"},{"title":"iapws_r797_v – iapws","text":"public pure elemental function iapws_r797_v(P, T) result(res) Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: P real(kind=dp), intent(in) :: T Return Value real(kind=dp)","tags":"","loc":"proc/iapws_r797_v.html"},{"title":"Tsat – iapws","text":"public pure subroutine Tsat(ps, Ts) Compute the saturation temperature at pressure ps.\nValidity range 611.213 Pa <= ps <= 22.064 MPa. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: ps (:) Saturation pressure in MPa. real(kind=dp), intent(out) :: Ts (:) Saturation temperature in K. Filled with nan if out of validity range. Called by proc~~tsat~~CalledByGraph proc~tsat Tsat proc~capi_tsat capi_Tsat proc~capi_tsat->proc~tsat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/tsat.html"},{"title":"psat – iapws","text":"public pure subroutine psat(Ts, ps) Compute the saturation pressure at temperature Ts. \nValidity range 273.13 K <= Ts <= 647.096 K. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: Ts (:) Saturation temperature in K. real(kind=dp), intent(out) :: ps (:) Saturation pressure in MPa. Filled with nan if out of validity range. Called by proc~~psat~~CalledByGraph proc~psat psat proc~capi_psat capi_psat proc~capi_psat->proc~psat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/psat.html"},{"title":"capi_Tsat – iapws","text":"public pure subroutine capi_Tsat(N, ps, Ts) bind(C, name=\"iapws_r797_Tsat\") Compute the saturation temperature at pressure ps. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: ps (N) real(kind=c_double), intent(out) :: Ts (N) Calls proc~~capi_tsat~~CallsGraph proc~capi_tsat capi_Tsat proc~tsat Tsat proc~capi_tsat->proc~tsat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_tsat.html"},{"title":"capi_psat – iapws","text":"public pure subroutine capi_psat(N, Ts, ps) bind(C, name=\"iapws_r797_psat\") Compute the saturation pressure at temperature Ts. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: Ts (N) real(kind=c_double), intent(out) :: ps (N) Calls proc~~capi_psat~~CallsGraph proc~capi_psat capi_psat proc~psat psat proc~capi_psat->proc~psat Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/capi_psat.html"},{"title":"get_version – iapws","text":"public function get_version() result(fptr) Get the version. \nReturns Arguments None Return Value character(len=:), pointer Pointer to the version string. Called by proc~~get_version~~CalledByGraph proc~get_version get_version proc~capi_get_version capi_get_version proc~capi_get_version->proc~get_version Help Graph Key Nodes of different colours represent the following: Graph Key Subroutine Subroutine Function Function Interface Interface Type Bound Procedure Type Bound Procedure Unknown Procedure Type Unknown Procedure Type Program Program This Page's Entity This Page's Entity Solid arrows point from a procedure to one which it calls. Dashed \narrows point from an interface to procedures which implement that interface.\nThis could include the module procedures in a generic interface or the\nimplementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"proc/get_version.html"},{"title":"iapws__capi_version – iapws","text":"Uses iso_c_binding iapws__version module~~iapws__capi_version~~UsesGraph module~iapws__capi_version iapws__capi_version iso_c_binding iso_c_binding module~iapws__capi_version->iso_c_binding module~iapws__version iapws__version module~iapws__capi_version->module~iapws__version Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi_version~~UsedByGraph module~iapws__capi_version iapws__capi_version module~iapws__capi iapws__capi module~iapws__capi->module~iapws__capi_version module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public function capi_get_version () result(cptr) bind(c,name=\"iapws_get_version\")) Get the version. Arguments None Return Value type(c_ptr) Pointer to version string.","tags":"","loc":"module/iapws__capi_version.html"},{"title":"iapws__capi_r783 – iapws","text":"Module for IAPWS R2-83: C API. Uses iso_c_binding iapws__r283 module~~iapws__capi_r783~~UsesGraph module~iapws__capi_r783 iapws__capi_r783 iso_c_binding iso_c_binding module~iapws__capi_r783->iso_c_binding module~iapws__r283 iapws__r283 module~iapws__capi_r783->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi_r783~~UsedByGraph module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi iapws__capi module~iapws__capi->module~iapws__capi_r783 module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Variables Type Visibility Attributes Name Initial real(kind=c_double), public, bind(C, name=\"0\") :: capi_Tc_D2O = Tc_D2O Critical temperature for D2O in K real(kind=c_double), public, bind(C, name=\"0\") :: capi_Tc_H2O = Tc_H2O Critical temperature for H2O in K real(kind=c_double), public, bind(C, name=\"0\") :: capi_pc_D2O = pc_D2O Critical pressure for D2O in MPa real(kind=c_double), public, bind(C, name=\"0\") :: capi_pc_H2O = pc_H2O Critical pressure for H2O in MPa real(kind=c_double), public, bind(C, name=\"0\") :: capi_rhoc_D2O = rhoc_D2O Critical density for D2O in kg.m-3 real(kind=c_double), public, bind(C, name=\"0\") :: capi_rhoc_H2O = rhoc_H2O Critical density for H2O in kg.m-3","tags":"","loc":"module/iapws__capi_r783.html"},{"title":"iapws__g704 – iapws","text":"Module for IAPWS G7-04.\nEFGH coefficients for gases in heavywater.\nai and bi coefficients for water Uses iapws__r283 stdlib_kinds ieee_arithmetic module~~iapws__g704~~UsesGraph module~iapws__g704 iapws__g704 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__g704->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__g704~~UsedByGraph module~iapws__g704 iapws__g704 module~iapws iapws module~iapws->module~iapws__g704 module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi_g704->module~iapws__g704 module~iapws__capi->module~iapws__capi_g704 Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Derived Types type, public :: gas_type Derived type containing a allocatable string for representing a gas. Components Type Visibility Attributes Name Initial character(len=:), public, allocatable :: gas Gas Functions public function gases (heavywater) result(list_gases) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type( gas_type ), pointer, (:) Available gases. public function gases2 (heavywater) result(str_gases) Returns the available gases as a string. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value character(len=:), pointer Available gases public pure function ngases (heavywater) result(n) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=int32) Number of gases. Subroutines public pure subroutine kd (T, gas, heavywater, k) Compute the vapor-liquid constant kd for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Vapor-liquid constant. Filled with NaNs if gas not found. public pure subroutine kh (T, gas, heavywater, k) Compute the henry constant kH for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: T (:) Temperature in K. character(len=*), intent(in) :: gas Gas. integer(kind=int32), intent(in) :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=dp), intent(out) :: k (:) Henry constant. Filled with NaNs if gas not found.","tags":"","loc":"module/iapws__g704.html"},{"title":"iapws – iapws","text":"Main module for the IAPWS library. Uses iapws__version iapws__capi iapws__r797 iapws__g704 iapws__r283 module~~iapws~~UsesGraph module~iapws iapws module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__g704 iapws__g704 module~iapws->module~iapws__g704 module~iapws__r283 iapws__r283 module~iapws->module~iapws__r283 module~iapws__r797 iapws__r797 module~iapws->module~iapws__r797 module~iapws__version iapws__version module~iapws->module~iapws__version module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi->module~iapws__capi_g704 module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi->module~iapws__capi_r783 module~iapws__capi_version iapws__capi_version module~iapws__capi->module~iapws__capi_version module~iapws__g704->module~iapws__r283 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds module~iapws__r797->module~iapws__r283 module~iapws__r797->ieee_arithmetic module~iapws__r797->stdlib_kinds module~iapws__capi_g704->module~iapws__g704 iso_c_binding iso_c_binding module~iapws__capi_g704->iso_c_binding iso_fortran_env iso_fortran_env module~iapws__capi_g704->iso_fortran_env module~iapws__capi_r783->module~iapws__r283 module~iapws__capi_r783->iso_c_binding module~iapws__capi_version->module~iapws__version module~iapws__capi_version->iso_c_binding Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"module/iapws.html"},{"title":"iapws__capi – iapws","text":"Main module for the IAPWS library: C API. Uses iapws__capi_r783 iapws__capi_version iapws__capi_g704 module~~iapws__capi~~UsesGraph module~iapws__capi iapws__capi module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi->module~iapws__capi_g704 module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi->module~iapws__capi_r783 module~iapws__capi_version iapws__capi_version module~iapws__capi->module~iapws__capi_version iso_c_binding iso_c_binding module~iapws__capi_g704->iso_c_binding iso_fortran_env iso_fortran_env module~iapws__capi_g704->iso_fortran_env module~iapws__g704 iapws__g704 module~iapws__capi_g704->module~iapws__g704 module~iapws__capi_r783->iso_c_binding module~iapws__r283 iapws__r283 module~iapws__capi_r783->module~iapws__r283 module~iapws__capi_version->iso_c_binding module~iapws__version iapws__version module~iapws__capi_version->module~iapws__version module~iapws__g704->module~iapws__r283 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi~~UsedByGraph module~iapws__capi iapws__capi module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs.","tags":"","loc":"module/iapws__capi.html"},{"title":"iapws__capi_g704 – iapws","text":"Module for IAPWS G704 : C API. Uses iso_c_binding iapws__g704 iso_fortran_env module~~iapws__capi_g704~~UsesGraph module~iapws__capi_g704 iapws__capi_g704 iso_c_binding iso_c_binding module~iapws__capi_g704->iso_c_binding iso_fortran_env iso_fortran_env module~iapws__capi_g704->iso_fortran_env module~iapws__g704 iapws__g704 module~iapws__capi_g704->module~iapws__g704 ieee_arithmetic ieee_arithmetic module~iapws__g704->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__g704->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__g704->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__capi_g704~~UsedByGraph module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi iapws__capi module~iapws__capi->module~iapws__capi_g704 module~iapws iapws module~iapws->module~iapws__capi Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public function capi_gases (heavywater) result(list_gases) bind(C, name=\"iapws_g704_gases\")) Returns the list of available gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value type(c_ptr) Available gases. public pure function capi_ngases (heavywater) result(n) bind(C, name=\"iapws_g704_ngases\")) Returns the number of gases. Arguments Type Intent Optional Attributes Name integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). Return Value integer(kind=c_int) Number of gases. Subroutines public subroutine capi_kd (T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kd\") Compute the vapor-liquid constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Vapor-liquid constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k. public subroutine capi_kh (T, gas, heavywater, k, size_gas, size_T) bind(C,name=\"iapws_g704_kh\") Compute the henry constant for a given temperature. Arguments Type Intent Optional Attributes Name real(kind=c_double), intent(in) :: T (size_T) Temperature in °C. type(c_ptr), intent(in), value :: gas Gas. integer(kind=c_int), intent(in), value :: heavywater Flag if D2O (1) is used or H2O(0). real(kind=c_double), intent(inout) :: k (size_T) Henry constant. Filled with NaNs if gas not found. integer(kind=c_int), intent(in), value :: size_gas Size of the gas string. integer(kind=c_size_t), intent(in), value :: size_T Size of T and k.","tags":"","loc":"module/iapws__capi_g704.html"},{"title":"iapws__r283 – iapws","text":"Module for IAPWS R2-83. Uses stdlib_kinds module~~iapws__r283~~UsesGraph module~iapws__r283 iapws__r283 stdlib_kinds stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__r283~~UsedByGraph module~iapws__r283 iapws__r283 module~iapws iapws module~iapws->module~iapws__r283 module~iapws__g704 iapws__g704 module~iapws->module~iapws__g704 module~iapws__r797 iapws__r797 module~iapws->module~iapws__r797 module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__capi_r783 iapws__capi_r783 module~iapws__capi_r783->module~iapws__r283 module~iapws__g704->module~iapws__r283 module~iapws__r797->module~iapws__r283 module~iapws__capi->module~iapws__capi_r783 module~iapws__capi_g704 iapws__capi_g704 module~iapws__capi->module~iapws__capi_g704 module~iapws__capi_g704->module~iapws__g704 module~iapws__capi_r797 iapws__capi_r797 module~iapws__capi_r797->module~iapws__r797 Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Variables Type Visibility Attributes Name Initial real(kind=dp), public, parameter :: Tc_D2O = 643.847_dp Critical temperature for D2O in K real(kind=dp), public, parameter :: Tc_H2O = 647.096_dp Critical temperature for H2O in K real(kind=dp), public, parameter :: pc_D2O = 21.671_dp Critical pressure for H2O in MPa real(kind=dp), public, parameter :: pc_H2O = 22.064_dp Critical pressure for H2O in MPa real(kind=dp), public, parameter :: rhoc_D2O = 356.0_dp Critical density for H2O in kg.m-3 real(kind=dp), public, parameter :: rhoc_H2O = 322.0_dp Critical density for H2O in kg.m-3","tags":"","loc":"module/iapws__r283.html"},{"title":"iapws__r797 – iapws","text":"Module for IAPWS R7-97: Not fully implemented - under development. Uses iapws__r283 stdlib_kinds ieee_arithmetic module~~iapws__r797~~UsesGraph module~iapws__r797 iapws__r797 ieee_arithmetic ieee_arithmetic module~iapws__r797->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__r797->module~iapws__r283 stdlib_kinds stdlib_kinds module~iapws__r797->stdlib_kinds module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Used by module~~iapws__r797~~UsedByGraph module~iapws__r797 iapws__r797 module~iapws iapws module~iapws->module~iapws__r797 module~iapws__capi_r797 iapws__capi_r797 module~iapws__capi_r797->module~iapws__r797 Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public pure elemental function iapws_r797_v (P, T) result(res) Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: P real(kind=dp), intent(in) :: T Return Value real(kind=dp) Subroutines public pure subroutine Tsat (ps, Ts) Compute the saturation temperature at pressure ps.\nValidity range 611.213 Pa <= ps <= 22.064 MPa. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: ps (:) Saturation pressure in MPa. real(kind=dp), intent(out) :: Ts (:) Saturation temperature in K. Filled with nan if out of validity range. public pure subroutine psat (Ts, ps) Compute the saturation pressure at temperature Ts. \nValidity range 273.13 K <= Ts <= 647.096 K. Arguments Type Intent Optional Attributes Name real(kind=dp), intent(in) :: Ts (:) Saturation temperature in K. real(kind=dp), intent(out) :: ps (:) Saturation pressure in MPa. Filled with nan if out of validity range.","tags":"","loc":"module/iapws__r797.html"},{"title":"iapws__capi_r797 – iapws","text":"Uses iso_c_binding stdlib_kinds iapws__r797 module~~iapws__capi_r797~~UsesGraph module~iapws__capi_r797 iapws__capi_r797 iso_c_binding iso_c_binding module~iapws__capi_r797->iso_c_binding module~iapws__r797 iapws__r797 module~iapws__capi_r797->module~iapws__r797 stdlib_kinds stdlib_kinds module~iapws__capi_r797->stdlib_kinds module~iapws__r797->stdlib_kinds ieee_arithmetic ieee_arithmetic module~iapws__r797->ieee_arithmetic module~iapws__r283 iapws__r283 module~iapws__r797->module~iapws__r283 module~iapws__r283->stdlib_kinds Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Subroutines public pure subroutine capi_Tsat (N, ps, Ts) bind(C, name=\"iapws_r797_Tsat\") Compute the saturation temperature at pressure ps. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: ps (N) real(kind=c_double), intent(out) :: Ts (N) public pure subroutine capi_psat (N, Ts, ps) bind(C, name=\"iapws_r797_psat\") Compute the saturation pressure at temperature Ts. Arguments Type Intent Optional Attributes Name integer(kind=c_size_t), intent(in), value :: N real(kind=c_double), intent(in) :: Ts (N) real(kind=c_double), intent(out) :: ps (N)","tags":"","loc":"module/iapws__capi_r797.html"},{"title":"iapws__version – iapws","text":"Version Used by module~~iapws__version~~UsedByGraph module~iapws__version iapws__version module~iapws iapws module~iapws->module~iapws__version module~iapws__capi iapws__capi module~iapws->module~iapws__capi module~iapws__capi_version iapws__capi_version module~iapws__capi_version->module~iapws__version module~iapws__capi->module~iapws__capi_version Help Graph Key Nodes of different colours represent the following: Graph Key Module Module Submodule Submodule Subroutine Subroutine Function Function Program Program This Page's Entity This Page's Entity Solid arrows point from a submodule to the (sub)module which it is\ndescended from. Dashed arrows point from a module or program unit to \nmodules which it uses. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Functions public function get_version () result(fptr) Get the version. \nReturns Arguments None Return Value character(len=:), pointer Pointer to the version string.","tags":"","loc":"module/iapws__version.html"},{"title":"capi_version.f90 – iapws","text":"This file depends on sourcefile~~capi_version.f90~~EfferentGraph sourcefile~capi_version.f90 capi_version.f90 sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi_version.f90~~AfferentGraph sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi.f90 capi.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_version !! Version: C API. use iso_c_binding , only : c_null_char , c_ptr , c_loc use iapws__version implicit none private character ( len = :), allocatable , target :: version_c public :: capi_get_version contains function capi_get_version () bind ( c , name = \"iapws_get_version\" ) result ( cptr ) !! Get the version. implicit none ! Returns type ( c_ptr ) :: cptr !! Pointer to version string. character ( len = :), pointer :: fptr fptr => get_version () if ( allocated ( version_c )) then deallocate ( version_c ) endif allocate ( character ( len = len ( fptr ) + 1 ) :: version_c ) version_c = fptr // c_null_char cptr = c_loc ( version_c ) end function end module iapws__capi_version","tags":"","loc":"sourcefile/capi_version.f90.html"},{"title":"capi_r283.f90 – iapws","text":"This file depends on sourcefile~~capi_r283.f90~~EfferentGraph sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi_r283.f90~~AfferentGraph sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi.f90 capi.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_r783 !! Module for IAPWS R2-83: C API. use iso_c_binding , only : c_double use iapws__r283 implicit none private real ( c_double ), protected , bind ( C , name = \"iapws_r283_Tc_H2O\" ) :: capi_Tc_H2O = Tc_H2O !! Critical temperature for H2O in K real ( c_double ), protected , bind ( C , name = \"iapws_r283_Tc_D2O\" ) :: capi_Tc_D2O = Tc_D2O !! Critical temperature for D2O in K real ( c_double ), protected , bind ( C , name = \"iapws_r283_pc_H2O\" ) :: capi_pc_H2O = pc_H2O !! Critical pressure for H2O in MPa real ( c_double ), protected , bind ( C , name = \"iapws_r283_pc_D2O\" ) :: capi_pc_D2O = pc_D2O !! Critical pressure for D2O in MPa real ( c_double ), protected , bind ( C , name = \"iapws_r283_rhoc_H2O\" ) :: capi_rhoc_H2O = rhoc_H2O !! Critical density for H2O in kg.m-3 real ( c_double ), protected , bind ( C , name = \"iapws_r283_rhoc_D2O\" ) :: capi_rhoc_D2O = rhoc_D2O !! Critical density for D2O in kg.m-3 public :: capi_Tc_H2O , & capi_Tc_D2O , & capi_pc_H2O , & capi_pc_D2O , & capi_rhoc_H2O , & capi_rhoc_D2O end module iapws__capi_r783","tags":"","loc":"sourcefile/capi_r283.f90.html"},{"title":"iapws_g704.f90 – iapws","text":"This file depends on sourcefile~~iapws_g704.f90~~EfferentGraph sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~iapws_g704.f90~~AfferentGraph sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_g704.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__g704 !! Module for IAPWS G7-04. use stdlib_kinds , only : dp , int32 use ieee_arithmetic , only : ieee_value , ieee_quiet_nan use iapws__r283 implicit none private integer ( int32 ), parameter :: lengas = 5 integer ( int32 ), parameter :: ngas_H2O = 14 integer ( int32 ), parameter :: ngas_D2O = 7 type :: gas_type !! Derived type containing a allocatable string for representing a gas. character ( len = :), allocatable :: gas !! Gas end type type ( gas_type ), allocatable , target :: f_gases (:) character ( len = :), allocatable , target :: f_gases_str real ( dp ), parameter :: T_KELVIN = 27 3.15_dp !! Absolute temperature in KELVIN real ( dp ), parameter :: Tc1_H2O = Tc_H2O real ( dp ), parameter :: pc1_H2O = pc_H2O real ( dp ), parameter :: Tc1_D2O = Tc_D2O real ( dp ), parameter :: pc1_D2O = pc_D2O real ( dp ), parameter :: q_H2O = - 0.023767_dp !! solvent coefficient for kd in water real ( dp ), parameter :: q_D2O = - 0.024552_dp !! solvent coefficient for kd in heavywater !! ABC coefficients for gases in water. type :: abc_t character ( len = lengas ) :: gas !! Gas real ( dp ) :: A !! A Column real ( dp ) :: B !! B Column real ( dp ) :: C !! C Column end type !! EFGH coefficients for gases in heavywater. type :: efgh_t character ( len = lengas ) :: gas !! Gas real ( dp ) :: E !! E Column real ( dp ) :: F !! F Column real ( dp ) :: G !! G Column real ( dp ) :: H !! H Column end type !! ai and bi coefficients for water real ( dp ), dimension ( 6 , 2 ), parameter :: aibi_H2O = reshape ([& - 7.85951783_dp , 1.84408259_dp , - 1 1.78664970_dp , 2 2.68074110_dp , - 1 5.96187190_dp , 1.80122502_dp ,& 1.000_dp , 1.500_dp , 3.000_dp , 3.500_dp , 4.000_dp , 7.500_dp ], [ 6 , 2 ]) !! ai and bi coefficients for heavywater real ( dp ), dimension ( 5 , 2 ), parameter :: aibi_D2O = reshape ([& - 7.8966570_dp , 2 4.7330800_dp , - 2 7.8112800_dp , 9.3559130_dp , - 9.2200830_dp , & 1.00_dp , 1.89_dp , 2.00_dp , 3.00_dp , 3.60_dp ], [ 5 , 2 ]) !! ABC constants water. type ( abc_t ), dimension ( ngas_H2O ), parameter :: abc_H2O = & [ abc_t ( \"He\" , - 3.52839_dp , 7.12983_dp , 4.47770_dp ),& abc_t ( \"Ne\" , - 3.18301_dp , 5.31448_dp , 5.43774_dp ),& abc_t ( \"Ar\" , - 8.40954_dp , 4.29587_dp , 1 0.52779_dp ),& abc_t ( \"Kr\" , - 8.97358_dp , 3.61508_dp , 1 1.29963_dp ),& abc_t ( \"Xe\" , - 1 4.21635_dp , 4.00041_dp , 1 5.60999_dp ),& abc_t ( \"H2\" , - 4.73284_dp , 6.08954_dp , 6.06066_dp ),& abc_t ( \"N2\" , - 9.67578_dp , 4.72162_dp , 1 1.70585_dp ),& abc_t ( \"O2\" , - 9.44833_dp , 4.43822_dp , 1 1.42005_dp ),& abc_t ( \"CO\" , - 1 0.52862_dp , 5.13259_dp , 1 2.01421_dp ),& abc_t ( \"CO2\" , - 8.55445_dp , 4.01195_dp , 9.52345_dp ),& abc_t ( \"H2S\" , - 4.51499_dp , 5.23538_dp , 4.42126_dp ),& abc_t ( \"CH4\" , - 1 0.44708_dp , 4.66491_dp , 1 2.12986_dp ),& abc_t ( \"C2H6\" , - 1 9.67563_dp , 4.51222_dp , 2 0.62567_dp ),& abc_t ( \"SF6\" , - 1 6.56118_dp , 2.15289_dp , 2 0.35440_dp )] !! ABC constants for heavywater type ( abc_t ), dimension ( ngas_D2O ), parameter :: abc_D2O = & [ abc_t ( \"He\" , - 0.72643_dp , 7.02134_dp , 2.04433_dp ),& abc_t ( \"Ne\" , - 0.91999_dp , 5.65327_dp , 3.17247_dp ),& abc_t ( \"Ar\" , - 7.17725_dp , 4.48177_dp , 9.31509_dp ),& abc_t ( \"Kr\" , - 8.47059_dp , 3.91580_dp , 1 0.69433_dp ),& abc_t ( \"Xe\" , - 1 4.46485_dp , 4.42330_dp , 1 5.60919_dp ),& abc_t ( \"D2\" , - 5.33843_dp , 6.15723_dp , 6.53046_dp ),& abc_t ( \"CH4\" , - 1 0.01915_dp , 4.73368_dp , 1 1.75711_dp )] !! ci and di coefficients for water real ( dp ), dimension ( 6 , 2 ), parameter :: cidi_H2O = reshape ([& 1.99274064_dp , 1.09965342_dp , - 0.510839303_dp , - 1.75493479_dp , - 4 5.5170352_dp , - 6.7469445d5 ,& 1.0_dp / 3.0_dp , 2.0_dp / 3.0_dp , 5.0_dp / 3.0_dp , 1 6.0_dp / 3.0_dp , 4 3.0_dp / 3.0_dp , 11 0.0_dp / 3.0_dp ], [ 6 , 2 ]) !! ci and di coefficients for heavywater real ( dp ), dimension ( 4 , 2 ), parameter :: cidi_D2O = reshape ([& 2.7072_dp , 0.58662_dp , - 1.3069_dp , - 4 5.663_dp , & 0.374_dp , 1.45_dp , 2.6_dp , 1 2.3_dp ], [ 4 , 2 ]) !! EFGH constants for water type ( efgh_t ), dimension ( ngas_H2O ), parameter :: efgh_H2O = & [ efgh_t ( \"He\" , 226 7.4082_dp , - 2.9616_dp , - 3.2604_dp , 7.8819_dp ),& efgh_t ( \"Ne\" , 250 7.3022_dp , - 3 8.6955_dp , 11 0.3992_dp , - 7 1.9096_dp ),& efgh_t ( \"Ar\" , 231 0.5463_dp , - 4 6.7034_dp , 16 0.4066_dp , - 11 8.3043_dp ),& efgh_t ( \"Kr\" , 227 6.9722_dp , - 6 1.1494_dp , 21 4.0117_dp , - 15 9.0407_dp ),& efgh_t ( \"Xe\" , 202 2.8375_dp , 1 6.7913_dp , - 6 1.2401_dp , 4 1.9236_dp ),& efgh_t ( \"H2\" , 228 6.4159_dp , 1 1.3397_dp , - 7 0.7279_dp , 6 3.0631_dp ),& efgh_t ( \"N2\" , 238 8.8777_dp , - 1 4.9593_dp , 4 2.0179_dp , - 2 9.4396_dp ),& efgh_t ( \"O2\" , 230 5.0674_dp , - 1 1.3240_dp , 2 5.3224_dp , - 1 5.6449_dp ),& efgh_t ( \"CO\" , 234 6.2291_dp , - 5 7.6317_dp , 20 4.5324_dp , - 15 2.6377_dp ),& efgh_t ( \"CO2\" , 167 2.9376_dp , 2 8.1751_dp , - 11 2.4619_dp , 8 5.3807_dp ),& efgh_t ( \"H2S\" , 131 9.1205_dp , 1 4.1571_dp , - 4 6.8361_dp , 3 3.2266_dp ),& efgh_t ( \"CH4\" , 221 5.6977_dp , - 0.1089_dp , - 6.6240_dp , 4.6789_dp ),& efgh_t ( \"C2H6\" , 214 3.8121_dp , 6.8859_dp , - 1 2.6084_dp , 0.0_dp ),& efgh_t ( \"SF6\" , 287 1.7265_dp , - 6 6.7556_dp , 22 9.7191_dp , - 17 2.7400_dp )] !! EFGH constants for heavywater type ( efgh_t ), dimension ( ngas_D2O ), parameter :: efgh_D2O = & [ efgh_t ( \"He\" , 229 3.2474_dp , - 5 4.7707_dp , 19 4.2924_dp , - 14 2.1257 ), & efgh_t ( \"Ne\" , 243 9.6677_dp , - 9 3.4934_dp , 33 0.7783_dp , - 24 3.0100_dp ),& efgh_t ( \"Ar\" , 226 9.2352_dp , - 5 3.6321_dp , 19 1.8421_dp , - 14 3.7659_dp ),& efgh_t ( \"Kr\" , 225 0.3857_dp , - 4 2.0835_dp , 14 0.7656_dp , - 10 2.7592_dp ),& efgh_t ( \"Xe\" , 203 8.3656_dp , 6 8.1228_dp , - 27 1.3390_dp , 20 7.7984_dp ),& efgh_t ( \"D2\" , 214 1.3214_dp , - 1.9696_dp , 1.6136_dp , 0.0_dp ),& efgh_t ( \"CH4\" , 221 6.0181_dp , - 4 0.7666_dp , 15 2.5778_dp , - 11 7.7430_dp )] public :: gas_type public :: kh , kd public :: ngases public :: gases , gases2 contains pure function findgas_abc ( gas , abc ) result ( value ) !! Find the index of the gas in the ABC table. implicit none character ( len =* ), intent ( in ) :: gas !! Gas. type ( abc_t ), dimension (:), intent ( in ) :: abc !! ABC table. integer ( int32 ) :: value !! index of the gas. integer ( int32 ) :: i value = 0 do i = 1 , size ( abc ) if ( trim ( gas ) . eq . abc ( i )% gas ) then value = i exit endif end do end function pure function findgas_efgh ( gas , efgh ) result ( value ) !! Find the index of the gas in the ABC table. implicit none character ( len =* ), intent ( in ) :: gas !! Gas. type ( efgh_t ), dimension (:), intent ( in ) :: efgh !! EFGH table. integer ( int32 ) :: value !! index of gas. integer ( int32 ) :: i value = 0 do i = 1 , size ( efgh ) if ( trim ( gas ) . eq . efgh ( i )% gas ) then value = i exit endif end do end function pure elemental function f_p1star_H2O ( T ) result ( value ) !! Compute p1* in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. real ( dp ) :: value !! p1* in MPa. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_H2O tau = 1 - Tr value = exp ( 1 / ( Tr ) * sum ( aibi_H2O (:, 1 ) * tau ** ( aibi_H2O (:, 2 )))) * pc1_H2O end function pure elemental function f_p1star_D2O ( T ) result ( value ) !! Compute p1* in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. real ( dp ) :: value !! p1* in MPa. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_D2O tau = 1 - Tr value = exp ( 1 / ( Tr ) * sum ( aibi_D2O (:, 1 ) * tau ** ( aibi_D2O (:, 2 )))) * pc1_D2O end function pure elemental function f_kh_p1star_H2O ( T , abc ) result ( value ) !! Compute kh/p1* in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kH/p1* adimensional. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_H2O tau = 1 - Tr value = exp ( abc % A / Tr + abc % B * ( tau ** 0.355_dp ) / Tr + abc % C * exp ( tau ) * Tr ** ( - 0.41_dp )) end function pure elemental function f_kh_p1star_D2O ( T , abc ) result ( value ) !! Compute kh/p1* in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kh/p1* adimensional. real ( dp ) :: Tr real ( dp ) :: tau Tr = T / Tc1_D2O tau = 1 - Tr value = exp ( abc % A / Tr + abc % B * ( tau ** 0.355_dp ) / Tr + abc % C * exp ( tau ) * Tr ** ( - 0.41_dp )) end function pure elemental function ft_H2O ( tau ) result ( value ) !! Compute f(t) for H2O. implicit none real ( dp ), intent ( in ) :: tau !! tau = 1-T/Tr. real ( dp ) :: value !! f(t) is adimensional. value = sum ( cidi_H2O (:, 1 ) * tau ** ( cidi_H2O (:, 2 ))) end function pure elemental function ft_D2O ( tau ) result ( value ) !! Compute f(t) for D2O. implicit none real ( dp ), intent ( in ) :: tau !! tau = 1-T/Tr. real ( dp ) :: value !! f(t) is adimensional. value = sum ( cidi_D2O (:, 1 ) * tau ** ( cidi_D2O (:, 2 ))) end function pure elemental function f_kh_H2O ( T , abc ) result ( value ) !! Compute kH in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kH in MPa. value = f_kh_p1star_H2O ( T , abc ) * f_p1star_H2O ( T ) end function pure elemental function f_kh_D2O ( T , abc ) result ( value ) !! Compute kH in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( abc_t ), intent ( in ) :: abc !! ABC coefficients. real ( dp ) :: value !! kH in MPa. value = f_kh_p1star_D2O ( T , abc ) * f_p1star_D2O ( T ) end function pure elemental function f_kd_H2O ( T , efgh ) result ( value ) !! Compute kd in H2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( efgh_t ), intent ( in ) :: efgh !! EFGH coefficients. real ( dp ) :: value !! kD adimensional. real ( dp ) :: Tr real ( dp ) :: tau real ( dp ) :: p1 real ( dp ) :: p2 real ( dp ) :: p3 real ( dp ) :: p4 Tr = ( T + T_KELVIN ) / Tc1_H2O tau = 1 - Tr p1 = q_H2O * efgh % F p2 = efgh % E / T * ft_H2O ( tau ) p3 = ( efgh % F + efgh % G * tau ** ( 2.0_dp / 3.0_dp ) + efgh % H * tau ) p4 = exp ( - T / 10 0.0_dp ) value = exp ( p1 + p2 + p3 * p4 ) end function pure elemental function f_kd_D2O ( T , efgh ) result ( value ) !! Compute kd in D2O. implicit none real ( dp ), intent ( in ) :: T !! Temperature in K. type ( efgh_t ), intent ( in ) :: efgh !! EFGH coefficients. real ( dp ) :: value !! kD adimensional. real ( dp ) :: Tr real ( dp ) :: tau real ( dp ) :: p1 real ( dp ) :: p2 real ( dp ) :: p3 real ( dp ) :: p4 Tr = T / Tc1_D2O tau = 1 - Tr p1 = q_D2O * efgh % F p2 = efgh % E / T * ft_D2O ( tau ) p3 = ( efgh % F + efgh % G * tau ** ( 2.0_dp / 3.0_dp ) + efgh % H * tau ) p4 = exp ( - T / 10 0.0_dp ) value = exp ( p1 + p2 + p3 * p4 ) end function pure subroutine kh ( T , gas , heavywater , k ) !! Compute the henry constant kH for a given temperature. implicit none real ( dp ), intent ( in ) :: T (:) !! Temperature in K. character ( len =* ), intent ( in ) :: gas !! Gas. integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( dp ), intent ( out ) :: k (:) !! Henry constant. Filled with NaNs if gas not found. integer ( int32 ) :: i if ( heavywater > 0 ) then i = findgas_abc ( gas , abc_D2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kh_D2O ( T , abc_D2O ( i )) endif else i = findgas_abc ( gas , abc_H2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kh_H2O ( T , abc_H2O ( i )) endif endif end subroutine pure subroutine kd ( T , gas , heavywater , k ) !! Compute the vapor-liquid constant kd for a given temperature. implicit none real ( dp ), intent ( in ) :: T (:) !! Temperature in K. character ( len =* ), intent ( in ) :: gas !! Gas. integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( dp ), intent ( out ) :: k (:) !! Vapor-liquid constant. Filled with NaNs if gas not found. integer ( int32 ) :: i if ( heavywater > 0 ) then i = findgas_efgh ( gas , efgh_D2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kd_D2O ( T , efgh_D2O ( i )) endif else i = findgas_efgh ( gas , efgh_H2O ) if ( i == 0 ) then k = ieee_value ( 1.0_dp , ieee_quiet_nan ) else k = f_kd_H2O ( T , efgh_H2O ( i )) endif endif end subroutine pure function ngases ( heavywater ) result ( n ) !! Returns the number of gases. implicit none integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). integer ( int32 ) :: n !! Number of gases. if ( heavywater > 0 ) then n = ngas_D2O else n = ngas_H2O endif end function function gases ( heavywater ) result ( list_gases ) !! Returns the list of available gases. implicit none ! arguments integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). type ( gas_type ), pointer :: list_gases (:) !! Available gases. ! variables integer ( int32 ) :: i , n if ( allocated ( f_gases )) then deallocate ( f_gases ) endif if ( heavywater > 0 ) then allocate ( f_gases ( ngas_D2O )) do i = 1 , ngas_D2O if ( allocated ( f_gases ( i )% gas )) then deallocate ( f_gases ( i )% gas ) endif n = len ( trim ( abc_D2O ( i )% gas )) allocate ( character ( len = n ) :: f_gases ( i )% gas ) f_gases ( i )% gas = trim ( abc_D2O ( i )% gas ) enddo else allocate ( f_gases ( ngas_H2O )) do i = 1 , ngas_H2O if ( allocated ( f_gases ( i )% gas )) then deallocate ( f_gases ( i )% gas ) endif n = len ( trim ( abc_H2O ( i )% gas )) allocate ( character ( len = n ) :: f_gases ( i )% gas ) f_gases ( i )% gas = trim ( abc_H2O ( i )% gas ) enddo endif list_gases => f_gases end function function gases2 ( heavywater ) result ( str_gases ) !! Returns the available gases as a string. implicit none ! arguments integer ( int32 ), intent ( in ) :: heavywater !! Flag if D2O (1) is used or H2O(0). character ( len = :), pointer :: str_gases !! Available gases ! variables integer ( int32 ) :: i , j , k , ngas type ( gas_type ), pointer :: f_gases_list (:) f_gases_list => gases ( heavywater ) ngas = size ( f_gases_list ) k = 0 do i = 1 , ngas k = k + len ( f_gases_list ( i )% gas ) enddo if ( allocated ( f_gases_str )) then deallocate ( f_gases_str ) endif allocate ( character ( len = k + ngas ) :: f_gases_str ) i = 1 j = 1 k = 1 do i = 1 , ngas do j = 1 , len ( f_gases_list ( i )% gas ) f_gases_str ( k : k ) = f_gases_list ( i )% gas ( j : j ) k = k + 1 enddo f_gases_str ( k : k ) = \",\" k = k + 1 enddo f_gases_str ( len ( f_gases_str ): len ( f_gases_str )) = \"\" str_gases => f_gases_str end function end module","tags":"","loc":"sourcefile/iapws_g704.f90.html"},{"title":"iapws.f90 – iapws","text":"This file depends on sourcefile~~iapws.f90~~EfferentGraph sourcefile~iapws.f90 iapws.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~iapws.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~iapws.f90->sourcefile~iapws_r797.f90 sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~iapws.f90->sourcefile~iapws_version.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws !! Main module for the IAPWS library. use iapws__version use iapws__g704 use iapws__r283 use iapws__r797 use iapws__capi end module","tags":"","loc":"sourcefile/iapws.f90.html"},{"title":"capi.f90 – iapws","text":"This file depends on sourcefile~~capi.f90~~EfferentGraph sourcefile~capi.f90 capi.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi.f90~~AfferentGraph sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi !! Main module for the IAPWS library: C API. use iapws__capi_version use iapws__capi_r783 use iapws__capi_g704 end module iapws__capi","tags":"","loc":"sourcefile/capi.f90.html"},{"title":"capi_g704.f90 – iapws","text":"This file depends on sourcefile~~capi_g704.f90~~EfferentGraph sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~capi_g704.f90~~AfferentGraph sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90 capi.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~capi.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_g704 !! Module for IAPWS G704 : C API. use iso_fortran_env use iso_c_binding , only : c_double , c_int , c_ptr , c_f_pointer , c_char , c_size_t , c_null_char , c_loc use iapws__g704 implicit none private type , bind ( C ) :: c_char_p type ( c_ptr ) :: p end type type :: cgas_type character ( kind = c_char , len = 1 ), allocatable :: gas (:) end type type ( cgas_type ), allocatable , target :: c_gases (:) type ( c_char_p ), allocatable , target :: char_pp (:) character ( len = :), allocatable , target :: c_gases_str public :: capi_kh , capi_kd public :: capi_ngases public :: capi_gases contains subroutine capi_kh ( T , gas , heavywater , k , size_gas , size_T ) bind ( C , name = \"iapws_g704_kh\" ) !! Compute the henry constant for a given temperature. implicit none ! arguments integer ( c_int ), intent ( in ), value :: size_gas !! Size of the gas string. integer ( c_size_t ), intent ( in ), value :: size_T !! Size of T and k. real ( c_double ), intent ( in ) :: T ( size_T ) !! Temperature in °C. type ( c_ptr ), intent ( in ), value :: gas !! Gas. integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( c_double ), intent ( inout ) :: k ( size_T ) !! Henry constant. Filled with NaNs if gas not found. ! variables character , pointer , dimension (:) :: c2f_gas character ( len = size_gas ) :: f_gas integer ( int32 ) :: i call c_f_pointer ( gas , c2f_gas , shape = [ size_gas ]) do i = 1 , size_gas f_gas ( i : i ) = c2f_gas ( i ) enddo call kh ( T , f_gas , heavywater , k ) end subroutine subroutine capi_kd ( T , gas , heavywater , k , size_gas , size_T ) bind ( C , name = \"iapws_g704_kd\" ) !! Compute the vapor-liquid constant for a given temperature. implicit none ! arguments integer ( c_size_t ), intent ( in ), value :: size_T !! Size of T and k. integer ( c_int ), intent ( in ), value :: size_gas !! Size of the gas string. real ( c_double ), intent ( in ) :: T ( size_T ) !! Temperature in °C. type ( c_ptr ), intent ( in ), value :: gas !! Gas. integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). real ( c_double ), intent ( inout ) :: k ( size_T ) !! Vapor-liquid constant. Filled with NaNs if gas not found. ! variables character , pointer , dimension (:) :: c2f_gas character ( len = size_gas ) :: f_gas integer ( int32 ) :: i call c_f_pointer ( gas , c2f_gas , shape = [ size_gas ]) do i = 1 , size_gas f_gas ( i : i ) = c2f_gas ( i ) enddo call kd ( T , f_gas , heavywater , k ) end subroutine pure function capi_ngases ( heavywater ) bind ( C , name = \"iapws_g704_ngases\" ) result ( n ) !! Returns the number of gases. implicit none ! arguments integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). integer ( c_int ) :: n !! Number of gases. n = ngases ( heavywater ) end function function capi_gases ( heavywater ) bind ( C , name = \"iapws_g704_gases\" ) result ( list_gases ) !! Returns the list of available gases. implicit none ! arguments integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). type ( c_ptr ) :: list_gases !! Available gases. ! variables integer ( int32 ) :: i , j , ngas , n type ( gas_type ), pointer :: f_gases (:) => null () f_gases => gases ( heavywater ) ngas = size ( f_gases ) if ( allocated ( c_gases )) then deallocate ( c_gases ) endif allocate ( c_gases ( ngas )) if ( allocated ( char_pp )) then deallocate ( char_pp ) endif allocate ( char_pp ( ngas )) do i = 1 , ngas if ( allocated ( c_gases ( i )% gas )) then deallocate ( c_gases ( i )% gas ) endif n = len ( f_gases ( i )% gas ) allocate ( c_gases ( i )% gas ( n + 1 )) do j = 1 , n c_gases ( i )% gas ( j ) = f_gases ( i )% gas ( j : j ) enddo c_gases ( i )% gas ( n + 1 ) = c_null_char char_pp ( i )% p = c_loc ( c_gases ( i )% gas ) enddo list_gases = c_loc ( char_pp ) end function function capi_gases2 ( heavywater ) bind ( C , name = \"iapws_g704_gases2\" ) result ( str_gases ) !! Returns the available gases as a string. implicit none ! arguments integer ( c_int ), intent ( in ), value :: heavywater !! Flag if D2O (1) is used or H2O(0). type ( c_ptr ) :: str_gases !! Available gases. ! variables character ( len = :), pointer :: f_gases_str => null () f_gases_str => gases2 ( heavywater ) if ( allocated ( c_gases_str )) then deallocate ( c_gases_str ) endif allocate ( character ( len = len ( f_gases_str )) :: c_gases_str ) c_gases_str = f_gases_str c_gases_str ( len ( f_gases_str ): len ( f_gases_str )) = c_null_char str_gases = c_loc ( c_gases_str ) end function end module iapws__capi_g704","tags":"","loc":"sourcefile/capi_g704.f90.html"},{"title":"iapws_r283.f90 – iapws","text":"Files dependent on this one sourcefile~~iapws_r283.f90~~AfferentGraph sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~capi_r283.f90 capi_r283.f90 sourcefile~capi_r283.f90->sourcefile~iapws_r283.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_g704.f90 iapws_g704.f90 sourcefile~iapws.f90->sourcefile~iapws_g704.f90 sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~iapws.f90->sourcefile~iapws_r797.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~iapws_g704.f90->sourcefile~iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 sourcefile~capi.f90->sourcefile~capi_r283.f90 sourcefile~capi_g704.f90 capi_g704.f90 sourcefile~capi.f90->sourcefile~capi_g704.f90 sourcefile~capi_g704.f90->sourcefile~iapws_g704.f90 sourcefile~capi_r797.f90 capi_r797.f90 sourcefile~capi_r797.f90->sourcefile~iapws_r797.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__r283 !! Module for IAPWS R2-83. use stdlib_kinds , only : dp implicit none private real ( dp ), parameter :: Tc_H2O = 64 7.096_dp !! Critical temperature for H2O in K real ( dp ), parameter :: Tc_D2O = 64 3.847_dp !! Critical temperature for D2O in K real ( dp ), parameter :: pc_H2O = 2 2.064_dp !! Critical pressure for H2O in MPa real ( dp ), parameter :: pc_D2O = 2 1.671_dp !! Critical pressure for H2O in MPa real ( dp ), parameter :: rhoc_H2O = 32 2.0_dp !! Critical density for H2O in kg.m-3 real ( dp ), parameter :: rhoc_D2O = 35 6.0_dp !! Critical density for H2O in kg.m-3 public :: Tc_H2O , Tc_D2O , pc_H2O , pc_D2O , rhoc_H2O , rhoc_D2O end module","tags":"","loc":"sourcefile/iapws_r283.f90.html"},{"title":"iapws_r797.f90 – iapws","text":"This file depends on sourcefile~~iapws_r797.f90~~EfferentGraph sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Files dependent on this one sourcefile~~iapws_r797.f90~~AfferentGraph sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~capi_r797.f90 capi_r797.f90 sourcefile~capi_r797.f90->sourcefile~iapws_r797.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_r797.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__r797 !! Module for IAPWS R7-97: Not fully implemented - under development. use stdlib_kinds , only : dp use ieee_arithmetic use iapws__r283 , only : Tc_H2O , pc_H2O , rhoc_H2O implicit none private public :: iapws_r797_v , psat , Tsat real ( dp ), parameter :: T_KELVIN = 27 3.15_dp !! Parameters from IAPWS R7-97 real ( dp ), parameter :: Tc = Tc_H2O !! critical temperature of water in K real ( dp ), parameter :: pc = pc_H2O !! critical pressure of the water in MPa real ( dp ), parameter :: rhoc = rhoc_H2O !! critical density of the water in kg.m-3. real ( dp ), parameter :: R = 0.461526_dp !! Specific gas constant 0.461 526 kJ.kg-1.K-1 ! Region 1 !-------------------------------------------------------------------------------------------------------------------------------- real ( dp ), parameter :: r1_ps = 1 6.53_dp ! p* real ( dp ), parameter :: r1_ts = 138 6.0_dp ! T* real ( dp ) :: IJn_r1f ( 9 , 3 ) = transpose ( reshape ([& 0.0_dp , - 2.0_dp , 0.146_dp , & 0.0_dp , - 1.0_dp , - 0.84548187169114_dp , & 0.0_dp , 0.0_dp , - 0.37563672040d1 , & 0.0_dp , 1.0_dp , 0.33855169168385d1 , & 0.0_dp , 2.0_dp , - 0.95791963387872_dp ,& 0.0_dp , 3.0_dp , 0.15772038513228_dp , & 0.0_dp , 4.0_dp , - 0.16616417199501d-1 , & 0.0_dp , 5.0_dp , - 0.81214629983568d-3 , & 1.0_dp , - 9.0_dp , - 0.28319080123804d-3 ], & [ 3 , 9 ])) !! Coefficients I, J and n for forward equation in region 1. !-------------------------------------------------------------------------------------------------------------------------------- ! Region 4: Saturation line !-------------------------------------------------------------------------------------------------------------------------------- real ( dp ) :: r4_n ( 10 ) = [ & + 0.11670521452767e4_dp , & - 0.72421316703206e6_dp , & - 0.1707384694009292e2_dp , & + 0.12020824702470e5_dp , & - 0.32325550322333e7_dp , & + 0.14915108613530e2_dp , & - 0.48232657361591e4_dp , & + 0.40511340542057e6_dp , & - 0.23855557567849_dp , & + 0.65017534844798e3_dp & ] !! ni coefficients for region 4 (saturation line) real ( dp ), parameter :: r4_Tmin = 27 3.15_dp !! Lower bound for validity for ps(T) in K. real ( dp ), parameter :: r4_Tmax = 64 7.096_dp !! Upper bound for validity ps(T) in K. real ( dp ), parameter :: r4_pmin = 61 1.213e-6_dp !! Lower bound for validity for Ts(p) in MPa real ( dp ), parameter :: r4_pmax = 2 2.064_dp !! Upper bound for validity Ts(p) in MPa real ( dp ), parameter :: r4_Tstar = 1_dp !! K real ( dp ), parameter :: r4_Pstar = 1_dp !! MPa !-------------------------------------------------------------------------------------------------------------------------------- contains ! Region 1 !-------------------------------------------------------------------------------------------------------------------------------- pure elemental function gamma_ ( P , T ) result ( res ) implicit none real ( dp ), intent ( in ) :: P !! Pressure real ( dp ), intent ( in ) :: T !! Temperature real ( dp ) :: pi real ( dp ) :: tau real ( dp ) :: res pi = ( T + T_KELVIN ) / r1_ts tau = P / r1_ps res = sum ( IJn_r1f (:, 3 ) * ( 7.1_dp - pi ) ** IJn_r1f (:, 1 ) * ( tau - 1.222_dp ) ** IJn_r1f (:, 2 )) end function pure elemental function gamma_pi ( P , T ) result ( res ) implicit none real ( dp ), intent ( in ) :: P real ( dp ), intent ( in ) :: T real ( dp ) :: pi real ( dp ) :: tau real ( dp ) :: res pi = ( T + T_KELVIN ) / r1_ts tau = P / r1_ps res = sum ( IJn_r1f (:, 3 ) * IJn_r1f (:, 1 ) * ( 7.1_dp - pi ) ** ( IJn_r1f (:, 1 ) - 1.0_dp ) * ( tau - 1.222_dp ) ** IJn_r1f (:, 2 )) end function pure elemental function iapws_r797_v ( P , T ) result ( res ) implicit none real ( dp ), intent ( in ) :: P real ( dp ), intent ( in ) :: T real ( dp ) :: res res = R * ( T + T_KELVIN ) / P * gamma_pi ( P , T ) end function !-------------------------------------------------------------------------------------------------------------------------------- ! Region 4: Saturation line !-------------------------------------------------------------------------------------------------------------------------------- pure elemental function r4_ps ( Ts ) result ( value ) !! Compute the saturation-pressure line. !! Validity range 273.13 K <= Ts <= 647.096 K. real ( dp ), intent ( in ) :: Ts !! Saturation temperature in K. real ( dp ) :: value !! Saturation pressure in MPa at temperature Ts. Is nan if Ts is out of range. real ( dp ) :: theta , Ts_K , A , B , C if ( Ts < r4_Tmin ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else if ( Ts > r4_Tmax ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else Ts_K = Ts / r4_Tstar theta = Ts_K + r4_n ( 9 ) / ( Ts_K - r4_n ( 10 )) A = theta ** 2 + r4_n ( 1 ) * theta + r4_n ( 2 ) B = r4_n ( 3 ) * theta ** 2 + r4_n ( 4 ) * theta + r4_n ( 5 ) C = r4_n ( 6 ) * theta ** 2 + r4_n ( 7 ) * theta + r4_n ( 8 ) value = r4_Pstar * ( 2 * C / ( - B + ( B ** 2 - 4 * A * C ) ** ( 0.5_dp ))) ** ( 4.0_dp ) endif end function pure elemental function r4_Ts ( ps ) result ( value ) !! Compute the saturation-pressure line. !! Validity range 611.213 Pa <= ps <= 22.064 MPa. real ( dp ), intent ( in ) :: ps !! Saturation pressure in MPa. real ( dp ) :: value !! Saturation temperature in K at pressure ps. Is nan if ps is out of range. real ( dp ) :: beta , D , E , F , G if ( ps < r4_pmin ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else if ( ps > r4_pmax ) then value = ieee_value ( 1.0_dp , ieee_quiet_nan ) else beta = ( ps / r4_Pstar ) ** ( 0.25_dp ) E = beta ** 2 + r4_n ( 3 ) * beta + r4_n ( 6 ) F = r4_n ( 1 ) * beta ** 2 + r4_n ( 4 ) * beta + r4_n ( 7 ) G = r4_n ( 2 ) * beta ** 2 + r4_n ( 5 ) * beta + r4_n ( 8 ) D = 2 * G / ( - F - ( F ** 2 - 4 * E * G ) ** ( 0.5_dp )) value = r4_Tstar * ( r4_n ( 10 ) + D - (( r4_n ( 10 ) + D ) ** 2.0_dp - 4.0_dp * ( r4_n ( 9 ) + r4_n ( 10 ) * D )) ** 0.5_dp ) / 2.0_dp endif end function pure subroutine psat ( Ts , ps ) !! Compute the saturation pressure at temperature Ts. !! Validity range 273.13 K <= Ts <= 647.096 K. real ( dp ), intent ( in ) :: Ts (:) !! Saturation temperature in K. real ( dp ), intent ( out ) :: ps (:) !! Saturation pressure in MPa. Filled with nan if out of validity range. ps = r4_ps ( Ts ) end subroutine pure subroutine Tsat ( ps , Ts ) !! Compute the saturation temperature at pressure ps. !! Validity range 611.213 Pa <= ps <= 22.064 MPa. real ( dp ), intent ( in ) :: ps (:) !! Saturation pressure in MPa. real ( dp ), intent ( out ) :: Ts (:) !! Saturation temperature in K. Filled with nan if out of validity range. Ts = r4_Ts ( ps ) end subroutine !-------------------------------------------------------------------------------------------------------------------------------- end module","tags":"","loc":"sourcefile/iapws_r797.f90.html"},{"title":"capi_r797.f90 – iapws","text":"This file depends on sourcefile~~capi_r797.f90~~EfferentGraph sourcefile~capi_r797.f90 capi_r797.f90 sourcefile~iapws_r797.f90 iapws_r797.f90 sourcefile~capi_r797.f90->sourcefile~iapws_r797.f90 sourcefile~iapws_r283.f90 iapws_r283.f90 sourcefile~iapws_r797.f90->sourcefile~iapws_r283.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__capi_r797 use stdlib_kinds , only : dp , int32 use iso_c_binding , only : c_double , c_int , c_size_t use iapws__r797 implicit none private public :: capi_psat , capi_Tsat contains pure subroutine capi_psat ( N , Ts , ps ) bind ( C , name = \"iapws_r797_psat\" ) !! Compute the saturation pressure at temperature Ts. integer ( c_size_t ), intent ( in ), value :: N real ( c_double ), intent ( in ) :: Ts ( N ) real ( c_double ), intent ( out ) :: ps ( N ) call psat ( Ts , ps ) end subroutine pure subroutine capi_Tsat ( N , ps , Ts ) bind ( C , name = \"iapws_r797_Tsat\" ) !! Compute the saturation temperature at pressure ps. integer ( c_size_t ), intent ( in ), value :: N real ( c_double ), intent ( in ) :: ps ( N ) real ( c_double ), intent ( out ) :: Ts ( N ) call Tsat ( ps , Ts ) end subroutine end module iapws__capi_r797","tags":"","loc":"sourcefile/capi_r797.f90.html"},{"title":"iapws_version.f90 – iapws","text":"Files dependent on this one sourcefile~~iapws_version.f90~~AfferentGraph sourcefile~iapws_version.f90 iapws_version.f90 sourcefile~capi_version.f90 capi_version.f90 sourcefile~capi_version.f90->sourcefile~iapws_version.f90 sourcefile~iapws.f90 iapws.f90 sourcefile~iapws.f90->sourcefile~iapws_version.f90 sourcefile~capi.f90 capi.f90 sourcefile~iapws.f90->sourcefile~capi.f90 sourcefile~capi.f90->sourcefile~capi_version.f90 Help Graph Key Nodes of different colours represent the following: Graph Key Source File Source File This Page's Entity This Page's Entity Solid arrows point from a file to a file which it depends on. A file\nis dependent upon another if the latter must be compiled before the former\ncan be. Where possible, edges connecting nodes are\ngiven different colours to make them easier to distinguish in\nlarge graphs. Source Code module iapws__version !! Version implicit none private character ( len =* ), parameter :: version = \"0.4.0\" character ( len = :), allocatable , target :: version_f public :: get_version contains function get_version () result ( fptr ) !! Get the version. implicit none !! Returns character ( len = :), pointer :: fptr !! Pointer to the version string. if ( allocated ( version_f )) then deallocate ( version_f ) endif allocate ( character ( len = len ( version )) :: version_f ) version_f = version fptr => version_f end function end module iapws__version","tags":"","loc":"sourcefile/iapws_version.f90.html"},{"title":"Contributing and specs – iapws","text":"Water properties for Modern Fortran.","tags":"","loc":"page/index.html"},{"title":"Changelog – iapws","text":"Version 0.4.0 Version 0.3.0 Version 0.2.2 Version 0.2.1 Version 0.2.0 Version 0.1.1 Version 0.1.0 Version 0.4.0 Implementation of the region 4 in R7-97. API break for kh and kd in g704. The temperature must be provided in Kelvin instead of degrees Celsius. Add dependency to numpy for python wrapper. Add pure python modules for encapsulating C extensions. Refractoring and code cleaning. Documentation update. Version 0.3.0 API break: functions for the Fortran code were renamed: They do not contain the package+module in the name for the sake of simplicity The package is only added in the functions for the C API in order to have a namespace-like behavior. If needed for solving conflicts with other packages, the functions can be aliased. Separate sources files for the C API code for each module. Implement tests with the test-drive framework. Add version extension in the pywrapper. Implement version module with its getter. Documentation update. Version 0.2.2 Implementation of report R283 for critical constants of water. Switch to pyproject.toml for python wrapper. Code refractoring and clean up. Documentation update. Full changelog available at github Version 0.2.1 Comlete missing documentation of private functions. Minor fixes in C API code as well in python wrapper. Remove unecessary dependency in Makefile. Full changelog available at github Version 0.2.0 New structure with modules corresponding to the IAPWS papers. Compatible with fpm. fpm module naming convention. API break for iapws_g704_kh and iapws_g704_kd functions: only 1d-arrays as inputs in Fortran and C API. only objects with buffer protocol as inputs in python wrapper. python wrappers return memoryviews. New functions: providing the number of gases in H2O and D2O. providing the available of gases in H2O and D2O as list of strings. providing the available of gases in H2O and D2O as a unique string. Cleanup old app code not needed anymore. Fix memory allocation in pywrapper. Completed tests. Documentation improvements: Add conversion equations from molar fractions to solubilities. Add plots for visualizing kh and kd. Full changelog available at github Version 0.1.1 Logo creation Error handling in python wrapper for arrays with rank greater than 1 Tests in python wrapper for expected failures with rank-n arrays Full changelog available at github Version 0.1.0 Implementation of kH and kD from IAPWS G7-04 in fortran + C API Python wrapper for kH and kD. Documentation with sphinx. Full changelog available at github","tags":"","loc":"page/changelog.html"},{"title":"Examples – iapws","text":"Fortran C Python Fortran program example_in_f use stdlib_kinds , only : dp , int32 use iapws implicit none integer ( int32 ) :: i , ngas real ( dp ) :: T ( 1 ), kh_res ( 1 ), kd_res ( 1 ) real ( dp ) :: Ts ( 7 ), ps ( 7 ) character ( len = 2 ) :: gas = \"O2\" integer ( int32 ) :: heavywater = 0 type ( gas_type ), pointer :: gases_list (:) character ( len = :), pointer :: gases_str print * , '########################## IAPWS VERSION ##########################' print * , \"version \" , get_version () print * , '########################## IAPWS R2-83 ##########################' print \"(a, f10.3, a)\" , \"Tc in h2o=\" , Tc_H2O , \" k\" print \"(a, f10.3, a)\" , \"pc in h2o=\" , pc_H2O , \" mpa\" print \"(a, f10.3, a)\" , \"rhoc in h2o=\" , rhoc_H2O , \" kg/m3\" print \"(a, f10.3, a)\" , \"Tc in D2O=\" , Tc_D2O , \" k\" print \"(a, f10.3, a)\" , \"pc in D2O=\" , pc_D2O , \" mpa\" print \"(a, f10.3, a)\" , \"rhoc in D2O=\" , rhoc_D2O , \" kg/m3\" print * , '' print * , '########################## IAPWS G7-04 ##########################' ! Compute kh and kd in H2O T ( 1 ) = 2 5.0_dp + 27 3.15_dp call kh ( T , gas , heavywater , kh_res ) print \"(A10, 1X, A10, 1X, A2, F10.1, A, 4X, A3, SP, F10.4)\" , \"Gas=\" , gas , \"T=\" , T , \"K\" , \"kh=\" , kh_res call kd ( T , gas , heavywater , kd_res ) print \"(A10, 1X, A10, 1X, A2, F10.1, A, 4X, A3, SP, F15.4)\" , \"Gas=\" , gas , \"T=\" , T , \"K\" , \"kh=\" , kd_res ! Get and print available gases heavywater = 0 ngas = ngases ( heavywater ) gases_list => null () gases_list => gases ( heavywater ) gases_str => gases2 ( heavywater ) print * , \"Gases in H2O: \" , ngas print * , gases_str do i = 1 , ngas print * , gases_list ( i )% gas enddo heavywater = 1 ngas = ngases ( heavywater ) gases_list => null () gases_list => gases ( heavywater ) gases_str => gases2 ( heavywater ) print * , \"Gases in D2O: \" , ngas print * , gases_str do i = 1 , ngas print * , gases_list ( i )% gas enddo print * , '########################## IAPWS R7-97 ##########################' ! Compute ps from Ts. Ts (:) = [ - 1.0_dp , 2 5.0_dp , 10 0.0_dp , 20 0.0_dp , 30 0.0_dp , 36 0.0_dp , 37 4.0_dp ] Ts (:) = Ts (:) + 27 3.15_dp call psat ( Ts , ps ) do i = 1 , size ( Ts ) print \"(SP, F23.3, A3, 4X, F23.3, A3)\" , Ts ( i ), \"K\" , ps ( i ), \"MPa\" end do ! Compute Ts from ps call Tsat ( ps , Ts ) do i = 1 , size ( Ts ) print \"(SP, F23.3, A3, 4X, F23.3, A3)\" , Ts ( i ), \"K\" , ps ( i ), \"MPa\" end do end program C #include #include #include \"iapws.h\" int main ( void ){ double T = 25.0 + 273.15 ; /* in C*/ char * gas = \"O2\" ; double kh , kd ; char ** gases_list ; char * gases_str ; int ngas ; int i ; int heavywater = 0 ; printf ( \"%s \\n \" , \"########################## IAPWS VERSION ##########################\" ); printf ( \"version %s \\n \" , iapws_get_version ()); printf ( \"%s \\n \" , \"########################## IAPWS R2-83 ##########################\" ); printf ( \"%s %10.3f %s \\n \" , \"Tc in H2O\" , iapws_r283_Tc_H2O , \"K\" ); printf ( \"%s %10.3f %s \\n \" , \"pc in H2O\" , iapws_r283_pc_H2O , \"MPa\" ); printf ( \"%s %10.3f %s \\n \" , \"rhoc in H2O\" , iapws_r283_rhoc_H2O , \"kg/m3\" ); printf ( \"%s %10.3f %s \\n \" , \"Tc in D2O\" , iapws_r283_Tc_D2O , \"K\" ); printf ( \"%s %10.3f %s \\n \" , \"pc in D2O\" , iapws_r283_pc_D2O , \"MPa\" ); printf ( \"%s %10.3f %s \\n \" , \"rhoc in D2O\" , iapws_r283_rhoc_D2O , \"kg/m3\" ); printf ( \" \\n \" ); printf ( \"%s \\n \" , \"########################## IAPWS G7-04 ##########################\" ); /* Compute kh and kd in H2O*/ iapws_g704_kh ( & T , gas , heavywater , & kh , strlen ( gas ), 1 ); printf ( \"Gas=%s \\t T=%fK \\t kh=%+10.4f \\n \" , gas , T , kh ); iapws_g704_kd ( & T , gas , heavywater , & kd , strlen ( gas ), 1 ); printf ( \"Gas=%s \\t T=%fK \\t kd=%+15.4f \\n \" , gas , T , kd ); /* Get and print the available gases */ ngas = iapws_g704_ngases ( heavywater ); gases_list = iapws_g704_gases ( heavywater ); gases_str = iapws_g704_gases2 ( heavywater ); printf ( \"Gases in H2O: %d \\n \" , ngas ); printf ( \"%s \\n \" , gases_str ); for ( i = 0 ; i < ngas ; i ++ ){ printf ( \"%s \\n \" , gases_list [ i ]); } heavywater = 1 ; ngas = iapws_g704_ngases ( heavywater ); gases_list = iapws_g704_gases ( heavywater ); gases_str = iapws_g704_gases2 ( heavywater ); printf ( \"Gases in D2O: %d \\n \" , ngas ); printf ( \"%s \\n \" , gases_str ); for ( i = 0 ; i < ngas ; i ++ ){ printf ( \"%s \\n \" , gases_list [ i ]); } printf ( \"%s \\n \" , \"########################## IAPWS R7-97 ##########################\" ); double Ts [ 7 ] = { -1.0 , 25.0 , 100.0 , 200.0 , 300.0 , 360.0 , 374.0 }; double ps [ 7 ] = { 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 }; for ( i = 0 ; i < 7 ; i ++ ){ Ts [ i ] = Ts [ i ] + 273.15 ; } iapws_r797_psat ( 7 , Ts , ps ); for ( i = 0 ; i < 7 ; i ++ ){ printf ( \"%+23.3f %s %+23.3f %s \\n \" , Ts [ i ], \"K\" , ps [ i ], \"MPa\" ); } iapws_r797_Tsat ( 7 , ps , Ts ); for ( i = 0 ; i < 7 ; i ++ ){ printf ( \"%+23.3f %s %+23.3f %s \\n \" , Ts [ i ], \"K\" , ps [ i ], \"MPa\" ); } return 0 ; } Python r \"\"\"Example in python\"\"\" import sys sys . path . insert ( 0 , \"../py/src/\" ) import array import numpy as np import matplotlib.pyplot as plt import pyiapws print ( \"########################## IAPWS VERSION ##########################\" ) print ( pyiapws . __version__ ) print ( \"########################## IAPWS R2-83 ##########################\" ) print ( \"Tc in H2O\" , pyiapws . r283 . Tc_H2O , \"K\" ) print ( \"pc in H2O\" , pyiapws . r283 . pc_H2O , \"MPa\" ) print ( \"rhoc in H2O\" , pyiapws . r283 . rhoc_H2O , \"kg/m3\" ) print ( \"Tc in D2O\" , pyiapws . r283 . Tc_D2O , \"K\" ) print ( \"pc in D2O\" , pyiapws . r283 . pc_D2O , \"MPa\" ) print ( \"rhoc in D2O\" , pyiapws . r283 . rhoc_D2O , \"kg/m3\" ) print ( \"\" ) print ( \"########################## IAPWS G7-04 ##########################\" ) gas = \"O2\" T = array . array ( \"d\" , ( 25.0 + 273.15 ,)) # Compute kh and kd in H2O heavywater = False k = pyiapws . g704 . kh ( T , \"O2\" , heavywater ) print ( f \"Gas= { gas } \\t T= { T [ 0 ] } K \\t kh= { k [ 0 ] : +10.4f } \\n \" ) k = pyiapws . g704 . kd ( T , \"O2\" , heavywater ) print ( f \"Gas= { gas } \\t T= { T [ 0 ] } K \\t kd= { k [ 0 ] : +10.4f } \\n \" ) # Get and print the available gases heavywater = False gases_list = pyiapws . g704 . gases ( heavywater ) gases_str = pyiapws . g704 . gases2 ( heavywater ) ngas = pyiapws . g704 . ngases ( heavywater ) print ( f \"Gases in H2O: { ngas :} \" ) print ( gases_str ) for gas in gases_list : print ( gas ) heavywater = True gases_list = pyiapws . g704 . gases ( heavywater ) gases_str = pyiapws . g704 . gases2 ( heavywater ) ngas = pyiapws . g704 . ngases ( heavywater ) print ( f \"Gases in D2O: { ngas :} \" ) print ( gases_str ) for gas in gases_list : print ( gas ) style = { \"marker\" : \".\" , \"ls\" : \"\" , \"ms\" : 2 } T_KELVIN = 273.15 T = np . linspace ( 0.0 , 360.0 , 1000 ) + 273.15 solvent = { True : \"D2O\" , False : \"H2O\" } print ( \"Generating plot for kh\" ) kname = \"kh\" for HEAVYWATER in ( False , True ): print ( solvent [ HEAVYWATER ]) fig = plt . figure () ax = fig . add_subplot () ax . grid ( visible = True , ls = ':' ) ax . set_xlabel ( \"T /°C\" ) ax . set_ylabel ( \"ln (kh/1GPa)\" ) gases = pyiapws . g704 . gases ( HEAVYWATER ) for gas in gases : k = pyiapws . g704 . kh ( T , gas , HEAVYWATER ) / 1000.0 ln_k = np . log ( k ) ax . plot ( T , ln_k , label = gas , ** style ) ax . legend ( ncol = 3 ) fig . savefig ( f \"../media/g704- { kname : s } _ { solvent [ HEAVYWATER ] } .png\" , dpi = 100 , format = \"png\" ) print ( \"Generating plot for kd\" ) kname = \"kd\" for HEAVYWATER in ( False , True ): print ( solvent [ HEAVYWATER ]) fig = plt . figure () ax = fig . add_subplot () ax . grid ( visible = True , ls = ':' ) ax . set_xlabel ( \"T /°C\" ) ax . set_ylabel ( \"ln kd\" ) gases = pyiapws . g704 . gases ( HEAVYWATER ) for gas in gases : k = pyiapws . g704 . kd ( T , gas , HEAVYWATER ) ln_k = np . log ( k ) ax . plot ( T , ln_k , label = gas , ** style ) ax . legend ( ncol = 3 ) fig . savefig ( f \"../media/g704- { kname : s } _ { solvent [ HEAVYWATER ] } .png\" , dpi = 100 , format = \"png\" ) print ( \"########################## IAPWS R7-97 ##########################\" ) Ts = np . asarray ([ - 1.0 , 25.0 , 100.0 , 200.0 , 300.0 , 360.0 , 374.0 ]) Ts = Ts + 273.15 ps = pyiapws . r797 . psat ( Ts ) for i in range ( Ts . size ): print ( f \" { Ts [ i ] : 23.3f } K { ps [ i ] : 23.3f } MPa.\" ) Ts = pyiapws . r797 . Tsat ( ps ) for i in range ( Ts . size ): print ( f \" { Ts [ i ] : 23.3f } K { ps [ i ] : 23.3f } MPa.\" ) fig = plt . figure () ax = fig . add_subplot () ax . grid ( visible = True , ls = ':' ) ax . set_xlabel ( \"Ts /K\" ) ax . set_ylabel ( \"ps /MPa\" ) Ts = np . linspace ( 0.0 , 370.0 , 500 ) Ts = Ts + 273.15 ps = pyiapws . r797 . psat ( Ts ) ax . plot ( Ts , ps , \"r-\" , label = \"ps(Ts)\" ) Ts = pyiapws . r797 . Tsat ( ps ) ax . plot ( Ts , ps , \"b--\" , label = \"Ts(ps)\" ) ax . legend () fig . savefig ( f \"../media/r797-r4.png\" , dpi = 100 , format = \"png\" ) plt . show ()","tags":"","loc":"page/examples.html"},{"title":"License – iapws","text":"MIT License Copyright (c) Milan Skocic Permission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n“Software”), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions: The above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","tags":"","loc":"page/license.html"},{"title":"References – iapws","text":"IAPWS, “Release on the Values of Temperature, Pressure and Density of Ordinary and Heavy Water Substances at Their Respective Critical Points,” IAPWS, St. Petersburg, Russia, R2-83, 1992. IAPWS, “Guideline on the Henry’s Constant and Vapor-Liquid Distribution Constant for Gases in H2O and D2O at High Temperatures,” IAPWS, Kyoto, Japan, G7-04, 2004. IAPWS, “Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam,” Lucerne, Switzerland, R7-97, 2007. IAPWS, “Revised Release on the IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use,” Praque, Czech Republic, R6-95, 2018. Wolfgang Wagner and A. Pruss. “International Equations for the Saturation Properties of Ordinary Water Substance”. Revised According to the International Temperature Scale of 1990. Addendum to J. Phys. Chem. Ref. Data 16, 893 (1987). Journal of Physical and Chemical Reference Data, 22(3):783–787, May 1993. doi:10.1063/1.555926. Allan H. Harvey and Eric W. Lemmon. “Correlation for the Vapor Pressure of Heavy Water From the Triple Point to the Critical Point”. Journal of Physical and Chemical Reference Data, 31(1):173–181, March 2002. doi:10.1063/1.1430231. R. Fernandez-Prini, J.L. Alvarez, and A.H. Harvey. “Henry’s Constants and Vapor–Liquid Distribution Constants for Gaseous Solutes in H2O and D2O at High Temperatures”. Journal of Physical Chemistry Reference Data, 32(2):903–916, 2003.","tags":"","loc":"page/references.html"},{"title":"Specifications (specs) – iapws","text":"This is an index/directory of the specifications (specs) for each module. R2-83 - Values of Temperature, Pressure and Density of Ordinary and Heavy Water Substances at Their Respective Critical Points G7-04 - Guideline on the Henry’s Constant and Vapor-Liquid Distribution Constant for Gases in H2O and D2O at High Temperatures R7-97 - Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam C API - Prototypes for C language.","tags":"","loc":"page/specs/index.html"},{"title":"C API – iapws","text":"The prototypes of the C API are defined as shown below. #ifndef IAPWS_H #define IAPWS_H #if _MSC_VER #define ADD_IMPORT __declspec(dllimport) #else #define ADD_IMPORT #endif extern char * iapws_get_version ( void ); ADD_IMPORT extern const double iapws_r283_Tc_H2O ; ADD_IMPORT extern const double iapws_r283_Tc_D2O ; ADD_IMPORT extern const double iapws_r283_pc_H2O ; ADD_IMPORT extern const double iapws_r283_pc_D2O ; ADD_IMPORT extern const double iapws_r283_rhoc_H2O ; ADD_IMPORT extern const double iapws_r283_rhoc_D2O ; extern void iapws_g704_kh ( double * T , char * gas , int heavywater , double * k , int size_gas , size_t size_T ); extern void iapws_g704_kd ( double * T , char * gas , int heavywater , double * k , int size_gas , size_t size_T ); extern int iapws_g704_ngases ( int heavywater ); extern char ** iapws_g704_gases ( int heavywater ); extern char * iapws_g704_gases2 ( int heavywater ); extern void iapws_r797_psat ( size_t N , double * Ts , double * ps ); extern void iapws_r797_Tsat ( size_t N , double * ps , double * Ts ); #endif","tags":"","loc":"page/specs/capi.html"},{"title":"IPAWS G7-04 – iapws","text":"Description Henry Contant: kh Vapor-Liquid Distribution Constant: kd Molar fractions Available gases Plots Description The computation is based on the parameters provided by the technical report G7-04 Henry Contant: kh The Henry constant is defined as shown in equation below. kh is expressed in MPa. : liquid-phase fugacity : mole fraction of the solute The Henry’s constant kh is given as a function of temperature by: : critical temperature of the solvent as recommended by IAPWS . is the vapor pressure of the solvent at the temperature of interest and \n is calculated from the correlation of Wagner and Pruss for and from the correlation of Harvey and Lemmon for . Both equations have the form: is 6 for and 5 for is the critical pressure of the solvent recommended by the report R2-83 Vapor-Liquid Distribution Constant: kd The liquid-vapor distribution constant kd is defined as shown in equation below. kd is adimensional. : mole fraction of the solute is the vapor-phase solute mole fraction in equilibrium with the liquid The vapor-liquid distribution constant kd is given as a function of temperature by: : -0.023767 for and -0.024552 for . Wagner et al. for and fernandez-prini et al. for In both cases, has the following form: is 6 for and 4 for Molar fractions The molar fractions and as following: By fixing at 1.0 it comes that the molar fractions and are then expressed per \nunit of pressure as shown in the following equation . The molar fractions can be converted to solubilties in ppm or cm3/kg by considering dilute solutions. is the considered gas and the solvent is either or . Available gases kh and kd can be computed for the following gases: in water: He, Ne, Ar, Kr, Xe, H2, N2, O2, CO, CO2, H2S, CH4, C2H6, SF6 in heavywater: He, Ne, Ar, Kr, Xe, D2, CH4 The available gases can be retrieved with gases which returns the available gases as a list. gases2 which return the available gases as a string. ngases which returns the number of available gases. Plots","tags":"","loc":"page/specs/iapws_g704.html"},{"title":"IAPWS R2-83 – iapws","text":"Description In water In heavywater Description The technical report R2-83 defines constants used for computing the water properties. In water In heavywater","tags":"","loc":"page/specs/iapws_r283.html"},{"title":"IAPWS R7-97 – iapws","text":"Description Structure of the formulation Reference constants Auxiliary Equation for the Boundary between Regions 2 and 3 Region 4: Saturation line The saturation-pressure equation (Basic Equation): psat The saturation-temperature equation (Backward Equation): Tsat Plot Description The computation is based on the parameters provided by the technical report R7-97 . Structure of the formulation The R7-97 report consists of a set of equations for different \nregions which cover the following range of validity: and and Reference constants The specific gas constant of ordinary water used for this formulation is This value results from the recommended values of the molar gas constant, \nand the molar mass of ordinary water ( Wagner et al., Harvey et al. ).\nThe values of the critical parameters are from the corresponding IAPWS release. Auxiliary Equation for the Boundary between Regions 2 and 3 Region 4: Saturation line The equation for describing the saturation line is an implicit quadratic\nequation which can be directly solved with regard to both saturation pressure and saturation temperature . The details are largely described in the literature IAPWS R797, IAPWS R695 . where and with and and are coefficients. The saturation-pressure equation (Basic Equation): psat The solution of the quadratic equation with regard to saturation pressure is as follows: with and Range of validity: . The saturation-temperature equation (Backward Equation): Tsat The saturation-temperature solution of the quadratic equation reads where and Range of validity: Plot","tags":"","loc":"page/specs/iapws_r797.html"}]}
\ No newline at end of file
diff --git a/docs/type/gas_type.html b/docs/type/gas_type.html
index 5b6dec3..65ca450 100644
--- a/docs/type/gas_type.html
+++ b/docs/type/gas_type.html
@@ -207,7 +207,7 @@ Components
Documentation generated by
FORD
- on 2024-07-05T14:03:08.376264
+ on 2024-07-21T00:24:29.256084