evaluate_m Module

This module has functions that evaluate textual expressions as Fortran data. This includes functions for converting mathematical expressions as arrays.



Interfaces

public interface evaluate

  • private subroutine evaluate_scalar_value(expression, value)

    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)
    

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: expression

    Mathematical expression

    real(kind=wp), intent(out) :: value

    Parsed result

  • private subroutine evaluate_scalar_field(expression, domain, value)

    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))
    

    Arguments

    Type IntentOptional 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

  • private subroutine evaluate_vector_value(expression, value)

    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))
    

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: expression

    Mathematical expression

    real(kind=wp), intent(out), dimension(3) :: value

    Parsed result

  • private subroutine evaluate_vector_field(expression, domain, value)

    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))
    

    Arguments

    Type IntentOptional 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

  • private subroutine evaluate_logical_value(expression, value)

    Takes a scalar logical expression as input and returns the value.

    Usage:

    call evaluate_logical_value('F', output)
    call evaluate_logical_value('T', output)
    

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: expression

    Character 'T' or 'F'

    logical, intent(out) :: value

    Parsed expression

  • private subroutine evaluate_integer_value(expression, value)

    Takes a scalar integer expression as input and returns the value.

    Usage:

    call evaluate_integer_value('10', output)
    

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: expression

    Numerical expression

    integer, intent(out) :: value

    Parsed result