MultiplicativeDerivation Derived Type

type, public, extends(Derivation) :: MultiplicativeDerivation

Composite derivation class containing two calculation rules applied additively. Both derivations must return same length array. Optionally applies one of several intrinsic functions to "inner" derivation result before multiplication.


Components

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

True only if user explicitly sets it to true

class(Derivation), private, allocatable :: outerDeriv

Outer multiplicative derivation - optional

class(Derivation), private, allocatable :: innerDeriv

Inner multiplicative derivation - this one has function applied to it

integer(kind=ik), private, allocatable, dimension(:) :: outerIndices

Subset of index vector passed to outer derivation

integer(kind=ik), private, allocatable, dimension(:) :: innerIndices

Subset of index vector passed to inner derivation

character(len=:), private, allocatable :: innerFuncName

Intrinsic function name optionally applied to result of inner derivation before raising to power and multiplying with outer result

real(kind=rk), private :: innerPower

Power to raise result of inner derivation (after applying optional function). Defaults to 1.

real(kind=rk), private :: outerPower

Power to raise result of outer derivation . Defaults to 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 => initMultDeriv

  • interface

    private module subroutine initMultDeriv(this, innerDeriv, innerIndices, outerDeriv, outerIndices, innerPower, outerPower, innerFuncName)

    Initialize multiplicative derivation object

    Arguments

    Type IntentOptional Attributes Name
    class(MultiplicativeDerivation), intent(inout) :: this
    class(Derivation), intent(in) :: innerDeriv
    integer(kind=ik), intent(in), dimension(:) :: innerIndices
    class(Derivation), intent(in), optional :: outerDeriv
    integer(kind=ik), intent(in), optional, dimension(:) :: outerIndices
    real(kind=rk), intent(in), optional :: innerPower
    real(kind=rk), intent(in), optional :: outerPower
    character(len=*), intent(in), optional :: innerFuncName

procedure, public :: calculate => calculateMultiplicative

  • interface

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

    Arguments

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

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