ecx__capi Module


Uses

  • module~~ecx__capi~~UsesGraph module~ecx__capi ecx__capi module~ecx__api ecx__api module~ecx__capi->module~ecx__api module~ecx__common ecx__common module~ecx__capi->module~ecx__common module~ecx__core ecx__core module~ecx__capi->module~ecx__core module~ecx__api->module~ecx__common module~ecx__api->module~ecx__core module~ecx__eis ecx__eis module~ecx__api->module~ecx__eis module~ecx__version ecx__version module~ecx__api->module~ecx__version ieee_arithmetic ieee_arithmetic module~ecx__common->ieee_arithmetic iso_c_binding iso_c_binding module~ecx__common->iso_c_binding stdlib_codata stdlib_codata module~ecx__common->stdlib_codata stdlib_constants stdlib_constants module~ecx__common->stdlib_constants stdlib_kinds stdlib_kinds module~ecx__common->stdlib_kinds stdlib_math stdlib_math module~ecx__common->stdlib_math stdlib_optval stdlib_optval module~ecx__common->stdlib_optval module~ecx__core->module~ecx__common module~ecx__eis->module~ecx__common module~ecx__eis->module~ecx__core

Used by

  • module~~ecx__capi~~UsedByGraph module~ecx__capi ecx__capi module~ecx ecx module~ecx->module~ecx__capi program~ecxcli ecxcli program~ecxcli->module~ecx

Variables

Type Visibility Attributes Name Initial
character(len=:), public, allocatable, target :: errmsg_c
character(len=:), public, allocatable, target :: version_c

Functions

public function capi_get_version() result(cptr) bind(c, name="ecx_get_version"))

C API - Get the version.

Arguments

None

Return Value type(c_ptr)

Pointer to version string.

public pure function capi_nernst(E0, z, aox, vox, nox, ared, vred, nred, T) result(E) bind(C, name="ecx_kinetics_nernst")

Compute the Nernst electrochemical potential in V.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in), value :: E0

Standard electrochemical potential in V.

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

Number of exchanged electrons.

real(kind=c_double), intent(in) :: aox(nox)

Activities of the oxidants.

real(kind=c_double), intent(in) :: vox(nox)

Coefficients for the oxidants.

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

Number of oxidants.

real(kind=c_double), intent(in) :: ared(nred)

Activities of the reductants

real(kind=c_double), intent(in) :: vred(nred)

Coefficients for the reductants.

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

Number of reductants.

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

Temperature in °C.

Return Value real(kind=c_double)


Subroutines

public pure subroutine capi_bv(U, OCV, j0, jdla, jdlc, aa, ac, za, zc, A, T, I, n) bind(c, name="ecx_kinetics_bv")

Compute Butler Volmer equation without mass transport.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: U(n)

Potential in volts.

real(kind=c_double), intent(in), value :: OCV

Open circuit potential in volts.

real(kind=c_double), intent(in), value :: j0

Exchange current density in A.cm-2

real(kind=c_double), intent(in), value :: jdla

Anodic diffusion limiting current density in A.cm-2.

real(kind=c_double), intent(in), value :: jdlc

Cathodic diffusion limiting current density in A.cm-2.

real(kind=c_double), intent(in), value :: aa

Anodic transfert coefficient.

real(kind=c_double), intent(in), value :: ac

Cathodic transfert coefficient.

real(kind=c_double), intent(in), value :: za

Number of exchanged electrons in anodic branch.

real(kind=c_double), intent(in), value :: zc

Number of exchanged electrons in cathodic branch.

real(kind=c_double), intent(in), value :: A

Area in cm2.

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

Temperature in °C.

real(kind=c_double), intent(out) :: I(n)

Current in A.

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

Size of U and I.

public pure subroutine capi_kTe(T, kTe_, n) bind(C, name="ecx_core_kTe")

Compute the thermal voltage.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: T(n)

Temperature in °C.

real(kind=c_double), intent(out) :: kTe_(n)

Thermal voltage in V.

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

Size of T and kTe.

public pure subroutine capi_nm2eV(lambda, E, n) bind(C, name="ecx_core_nm2eV")

C API - Convert wavelength to energy

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: lambda(n)

Wavelength in nm.

real(kind=c_double), intent(out) :: E(n)

Energy in eV.

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

Size of lambda and E.

public pure subroutine capi_sbv(U, OCV, j0, aa, ac, za, zc, A, T, I, n) bind(c, name="ecx_kinetics_sbv")

Compute Butler Volmer equation without mass transport.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: U(n)

Potential in volts.

real(kind=c_double), intent(in), value :: OCV

Open circuit potential in volts.

real(kind=c_double), intent(in), value :: j0

Exchange current density in A.cm-2.

real(kind=c_double), intent(in), value :: aa

Anodic transfert coefficient.

real(kind=c_double), intent(in), value :: ac

Cathodic transfert coefficient.

real(kind=c_double), intent(in), value :: za

Number of exchanged electrons in anodic branch.

real(kind=c_double), intent(in), value :: zc

Number of exchanged electrons in cathodic branch.

real(kind=c_double), intent(in), value :: A

Area in cm2.

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

Temperature in °C.

real(kind=c_double), intent(out) :: I(n)

Current in A.

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

Size of U and I.

public subroutine capi_z(p, w, zout, e, k, n, errstat, errmsg) bind(C, name="ecx_eis_z")

Compute the complex impedance for the given element.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: p(k)

Parameters.

real(kind=c_double), intent(in) :: w(n)

Angular frequencies in rad.s-1

complex(kind=c_double_complex), intent(out) :: zout(n)

Complex impedance in Ohms.

character(kind=c_char, len=1), intent(in), value :: e

Electrochemical element: R, C, L, Q, O, T, G

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

Size of p

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

Size of w

integer(kind=c_int), intent(out) :: errstat

Error status

type(c_ptr), intent(out) :: errmsg

errmsg Error message