This routine provide funtionality to copy variable type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(out) | :: | left |
variable to copy to |
||
type(tem_variable_type), | intent(in) | :: | right |
variable to copy from |
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