init_vec4_vector_real Function

private function init_vec4_vector_real(vec, val) result(out)

Initalise vec4 from a vec3 and Scalar e.g vec4 = [vec3%x, vec3%y, vec3%z, scalar]

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: vec

Input vec3

real(kind=wp), intent(in) :: val

Input Scalar

Return Value type(vec4)


Source Code

        type(vec4) function init_vec4_vector_real(vec, val) result(out)
            !! Initalise vec4 from a vec3 and Scalar
            !! e.g vec4 = [vec3%x, vec3%y, vec3%z, scalar]
            use vector_class
            !> Input vec3
            type(vector),  intent(in) :: vec
            !> Input Scalar
            real(kind=wp), intent(in) :: val

            out%x = vec%x
            out%y = vec%y
            out%z = vec%z
            out%p = val

        end function init_vec4_vector_real