Gradient_Scalar2D_t Subroutine

public subroutine Gradient_Scalar2D_t(this, df)

Arguments

TypeIntentOptionalAttributesName
class(Scalar2D_t), intent(in) :: this
real(kind=prec), intent(inout) :: df(1:this%N+1,1:this%N+1,1:this%nelem,1:this%nvar,1:2)

Contents

Source Code


Source Code

  subroutine Gradient_Scalar2D_t(this,df)
    implicit none
    class(Scalar2D_t),intent(in) :: this
    real(prec),intent(inout) :: df(1:this%N+1,1:this%N+1,1:this%nelem,1:this%nvar,1:2)
    ! Local
    integer    :: i,j,ii,iel,ivar
    real(prec) :: df1,df2

    do concurrent(i=1:this%N+1,j=1:this%N+1,iel=1:this%nElem,ivar=1:this%nVar)
      df1 = 0.0_prec
      df2 = 0.0_prec
      do ii = 1,this%N+1
        df1 = df1+this%interp%dMatrix(ii,i)*this%interior(ii,j,iel,ivar)
        df2 = df2+this%interp%dMatrix(ii,j)*this%interior(i,ii,iel,ivar)
      enddo
      df(i,j,iel,ivar,1) = df1
      df(i,j,iel,ivar,2) = df2
    enddo

  endsubroutine Gradient_Scalar2D_t