copy_Var Subroutine

public subroutine copy_Var(left, right)

This routine provide funtionality to copy variable type

Arguments

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

variable to copy to

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

variable to copy from


Called by

proc~~copy_var~~CalledByGraph proc~copy_var copy_Var interface~assignment(=)~6 assignment(=) interface~assignment(=)~6->proc~copy_var

Contents

Source Code


Source Code

  subroutine copy_Var(left, right)
    ! ---------------------------------------------------------------------------
    !> variable to copy to
    type(tem_variable_type), intent(out) :: left
    !> variable to copy from
    type(tem_variable_type), intent(in) :: right
    ! ---------------------------------------------------------------------------
    left%label = right%label
    left%nComponents = right%nComponents
    left%varType = right%varType
    left%operType = right%operType
    if (allocated(right%input_varName)) then
      allocate(left%input_varName(size(right%input_varName)))
      left%input_varName = right%input_varName
    end if
    if (allocated(right%input_varIndex)) then
      allocate(left%input_varIndex(size(right%input_varIndex)))
      left%input_varIndex = right%input_varIndex
    end if
    if (allocated(right%st_fun)) then
      allocate(left%st_fun(size(right%st_fun)))
      left%st_fun = right%st_fun
    end if
  end subroutine copy_Var