jacobian_block_add_real Function

private function jacobian_block_add_real(this, rhs) result(sum)

Produces a Jacobian block which has been offset by some constant increment.

Arguments

Type IntentOptional AttributesName
class(jacobian_block), intent(in) :: this
real(kind=r8), intent(in) :: rhs

A scalar which should be added to this block

Return Value type(jacobian_block)


Contents


Source Code

  function jacobian_block_add_real(this, rhs) result(sum)
    !* Author: Chris MacMackin 
    !  Date: December 2016
    !
    ! Produces a Jacobian block which has been offset by some constant
    ! increment.
    !
    ! @Warning This operation will overwrite any previous sums which
    ! have been performed to produce `this`.
    !
    class(jacobian_block), intent(in) :: this
    real(r8), intent(in)              :: rhs
      !! A scalar which should be added to this block
    type(jacobian_block)              :: sum
    sum = this
    sum%real_increment = rhs
    sum%has_increment = sum%has_increment + 1
#ifdef DEBUG
    call logger%debug('jacobian_block%add','Added real to a Jacobian block.')
#endif
  end function jacobian_block_add_real