Argument validation shared by the portable and backend Estimate implementations.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RefinementIndicator3D_t), | intent(in) | :: | this | |||
| class(Scalar3D), | intent(in) | :: | solution | |||
| integer, | intent(in) | :: | ivar | |||
| real(kind=prec), | intent(in), | optional | :: | gate(:) |
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