SimpleDerivation Derived Type

type, public, extends(Derivation) :: SimpleDerivation

Simple derivation object assuming all variables are confroming. Just multiplies the input array entries and raises them to set powers. Optionally multiplies the result with a constant.


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

real(kind=rk), private, allocatable, dimension(:) :: varPowers

Powers corresponding to each variable - indices in calculate must conform to this

real(kind=rk), private :: multConst

Multiplicative constant - default 1


Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: init => initSimpleDeriv

  • interface

    private module subroutine initSimpleDeriv(this, varPowers, multConst)

    Initialize simple derivation object

    Arguments

    Type IntentOptional Attributes Name
    class(SimpleDerivation), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:) :: varPowers
    real(kind=rk), intent(in), optional :: multConst

procedure, public :: calculate => calculateSimple

  • interface

    private module function calculateSimple(this, inputArray, indices) result(output)

    Arguments

    Type IntentOptional Attributes Name
    class(SimpleDerivation), intent(inout) :: this
    type(RealArray), intent(in), dimension(:) :: inputArray
    integer(kind=ik), intent(in), dimension(:) :: indices

    Return Value real(kind=rk), allocatable, dimension(:)