copy_varOp Subroutine

public subroutine copy_varOp(left, right)

This function provides the assignment operator of tem_varSys_op_type

Arguments

Type IntentOptional Attributes Name
type(tem_varSys_op_type), intent(out) :: left

varSys op to copy to

type(tem_varSys_op_type), intent(in) :: right

varSys op to copy from


Called by

proc~~copy_varop~~CalledByGraph proc~copy_varop copy_varOp interface~assignment(=)~2 assignment(=) interface~assignment(=)~2->proc~copy_varop

Source Code

  subroutine copy_varOp(left, right)
    ! ---------------------------------------------------------------------------
    !> varSys op to copy to
    type(tem_varSys_op_type), intent(out) :: left
    !> varSys op to copy from
    type(tem_varSys_op_type), intent(in) :: right
    ! ---------------------------------------------------------------------------
    integer :: nVals
    ! ---------------------------------------------------------------------------
    left%myPos = right%myPos

    if (allocated(right%state_varPos)) then
      nVals = size(right%state_varPos)
      allocate(left%state_varPos(nVals))
      left%state_varPos = right%state_varPos
    end if
    if (allocated(right%auxField_varPos)) then
      nVals = size(right%auxField_varPos)
      allocate(left%auxField_varPos(nVals))
      left%auxField_varPos = right%auxField_varPos
    end if
    left%nComponents = right%nComponents
    left%nInputs = right%nInputs
    left%operType = right%operType

    if ( allocated(right%input_varPos) ) then
      allocate(left%input_varPos(size(right%input_varPos)))
      left%input_varPos = right%input_varPos
    end if

    if ( allocated(right%input_varIndex) ) then
      allocate(left%input_varIndex(size(right%input_varIndex)))
      left%input_varIndex = right%input_varIndex
    end if

    left%method_data = right%method_data
    left%get_element => right%get_element
    left%get_point => right%get_point
    left%set_params => right%set_params
    left%get_params => right%get_params
    left%setup_indices => right%setup_indices
    left%get_valOfIndex => right%get_valOfIndex

  end subroutine copy_varOp