fparser_array Derived Type

type, public :: fparser_array

A wrapper to fparser to evaluate an array of functions.


Inherits

type~~fparser_array~~InheritsGraph type~fparser_array fparser_array type~fparser fparser type~fparser_array->type~fparser f type~stack_func_container stack_func_container type~fparser->type~stack_func_container bytecode_ops type~list_of_errors list_of_errors type~fparser->type~list_of_errors error_msg type~error error type~list_of_errors->type~error head

Contents

Source Code


Components

TypeVisibilityAttributesNameInitial
type(fparser), public, dimension(:), allocatable:: f

An array of parsers. Each one has the same variables.


Type-Bound Procedures

procedure, public :: parse => parse_function_array

  • private subroutine parse_function_array(me, funcstr, var, case_sensitive)

    Alternate version of parse_function for the fparser_array class.

    Arguments

    TypeIntentOptionalAttributesName
    class(fparser_array), intent(inout) :: me
    character(len=*), intent(in), dimension(:):: funcstr

    function string array

    character(len=*), intent(in), dimension(:):: var

    array with variable names

    logical, intent(in), optional :: case_sensitive

    are the variables case sensitive? [default is false]

procedure, public :: evaluate => evaluate_function_array

  • private subroutine evaluate_function_array(me, val, res)

    Alternate version of evaluate_function for the fparser_array class.

    Arguments

    TypeIntentOptionalAttributesName
    class(fparser_array), intent(inout) :: me
    real(kind=wp), intent(in), dimension(:):: val

    variable values

    real(kind=wp), intent(out), dimension(:):: res

    result. Should be size(me%f)

procedure, public :: destroy => destroy_parser_array

  • private pure elemental subroutine destroy_parser_array(me)

    fparser_array destructor.

    Arguments

    TypeIntentOptionalAttributesName
    class(fparser_array), intent(inout) :: me

procedure, public :: error => error_array

  • private pure elemental function error_array(me)

    Returns true if there are any errors in the class.

    Arguments

    TypeIntentOptionalAttributesName
    class(fparser_array), intent(in) :: me

    Return Value logical

    true if there are any errors in the class

procedure, public :: print_errors => print_errors_array

  • private subroutine print_errors_array(me, iunit)

    Prints the error messages (if any) in the class.

    Arguments

    TypeIntentOptionalAttributesName
    class(fparser_array), intent(inout) :: me
    integer, intent(in) :: iunit

    unit number for printing (assumed to be open)

procedure, public :: clear_errors => clear_errors_array

  • private pure elemental subroutine clear_errors_array(me)

    Clears any error messages in the class.

    Arguments

    TypeIntentOptionalAttributesName
    class(fparser_array), intent(inout) :: me

Source Code

      type,public :: fparser_array
          private
          type(fparser),dimension(:),allocatable :: f  !! An array of parsers.
                                                       !! Each one has the
                                                       !! same variables.
      contains
          private
          procedure,public :: parse        => parse_function_array
          procedure,public :: evaluate     => evaluate_function_array
          procedure,public :: destroy      => destroy_parser_array
          procedure,public :: error        => error_array
          procedure,public :: print_errors => print_errors_array
          procedure,public :: clear_errors => clear_errors_array
      end type fparser_array