This module has functions that evaluate textual expressions as Fortran data. This includes functions for converting mathematical expressions as arrays.
Takes a scalar mathematical expression as input and returns the value.
Usage:
call evaluate_scalar_value('0', output)
call evaluate_scalar_value('sin(0.3*pi)*exp(-pi)', output)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | expression |
Mathematical expression |
||
real(kind=wp), | intent(out) | :: | value |
Parsed result |
Evaluates a scalar-valued function of 'z' at the provided values for 'z'.
Usage:
call evaluate_scalar_value('0', input(1:n), output(1:n))
call evaluate_scalar_value('sin(pi*z)*exp(-pi*z)', input(1:n), output(1:n))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | expression |
Function of 'z' |
||
real(kind=wp), | intent(in), | dimension(:) | :: | domain |
Values of 'z' |
|
real(kind=wp), | dimension(:), allocatable | :: | value |
Parsed result |
Takes a vector mathematical expression as input and returns the value.
Usage:
call evaluate_scalar_value('[0,0,0]', output(1:3))
call evaluate_scalar_value('[sin(0.3*pi),0,cos(0,3*pi)]', output(1:3))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | expression |
Mathematical expression |
||
real(kind=wp), | intent(out), | dimension(3) | :: | value |
Parsed result |
Evaluates a vector-valued function of 'z' at the provided values for 'z'.
Usage:
call evaluate_scalar_value('[0,0,0]', input(1:n), output(1:3,1:n))
call evaluate_scalar_value('[sin(pi*z/2),0,cos(pi*z/2)]', input(1:n), output(1:3,1:n))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | expression |
Function of 'z' |
||
real(kind=wp), | intent(in), | dimension(:) | :: | domain |
Values of 'z' |
|
real(kind=wp), | dimension(:, :), allocatable | :: | value |
Parsed result |
Takes a scalar logical expression as input and returns the value.
Usage:
call evaluate_logical_value('F', output)
call evaluate_logical_value('T', output)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | expression |
Character 'T' or 'F' |
||
logical, | intent(out) | :: | value |
Parsed expression |
Takes a scalar integer expression as input and returns the value.
Usage:
call evaluate_integer_value('10', output)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | expression |
Numerical expression |
||
integer, | intent(out) | :: | value |
Parsed result |