Given the max_vel_components array return the limiting max_vel
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension(3) | :: | components |
real pure function get_max_vel(components) result(max_vel)
real, dimension(3), intent(in) :: components
real :: max_vel_cfl, max_vel_error
if (use_2d_cfl) then
max_vel_cfl = components(1) + components(2)
else
max_vel_cfl = maxval(components(1:2))
end if
max_vel_error = components(3)
max_vel = max(max_vel_cfl, max_vel_error)
end function get_max_vel