max_vec Function

private pure elemental function max_vec(this, val)

Get the max value elementwise between a vec3 and a scalar

Arguments

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

Input vector

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

Input max value

Return Value type(vector)


Source Code

        type(vector) pure elemental function max_vec(this, val)
            !! Get the max value elementwise between a vec3 and a scalar
            !> Input vector
            type(vector),  intent(IN) :: this
            !> Input max value
            real(kind=wp), intent(IN) :: val

            max_vec = vector(max(this%x, val), max(this%y, val), max(this%z, val))

        end function max_vec