CheckEstimateArguments Subroutine

public subroutine CheckEstimateArguments(this, solution, ivar, gate)

Argument validation shared by the portable and backend Estimate implementations.

Arguments

TypeIntentOptionalAttributesName
class(RefinementIndicator3D_t), intent(in) :: this
class(Scalar3D), intent(in) :: solution
integer, intent(in) :: ivar
real(kind=prec), intent(in), optional :: gate(:)

Called by

proc~~checkestimatearguments~~CalledByGraph proc~checkestimatearguments CheckEstimateArguments proc~estimate_refinementindicator3d_t Estimate_RefinementIndicator3D_t proc~estimate_refinementindicator3d_t->proc~checkestimatearguments proc~estimate_refinementindicator3d Estimate_RefinementIndicator3D proc~estimate_refinementindicator3d->proc~checkestimatearguments

Contents


Source Code

  subroutine CheckEstimateArguments(this,solution,ivar,gate)
    !! Argument validation shared by the portable and backend Estimate implementations.
    implicit none
    class(RefinementIndicator3D_t),intent(in) :: this
    class(Scalar3D),intent(in) :: solution
    integer,intent(in) :: ivar
    real(prec),intent(in),optional :: gate(:)

    if(solution%N /= this%N) then
      print*,__FILE__,':',__LINE__, &
        ' : Error : solution degree does not match indicator degree.'
      stop 1
    endif
    if(solution%nElem /= this%nElem) then
      print*,__FILE__,':',__LINE__, &
        ' : Error : solution element count does not match indicator element count.'
      stop 1
    endif
    if(ivar < 0 .or. ivar > solution%nVar) then
      print*,__FILE__,':',__LINE__, &
        ' : Error : driving-variable index out of range.'
      stop 1
    endif
    if(present(gate)) then
      if(size(gate) < this%nElem) then
        print*,__FILE__,':',__LINE__, &
          ' : Error : caller-supplied gate array is smaller than the element count.'
        stop 1
      endif
    endif

  endsubroutine CheckEstimateArguments