Skip to content
Snippets Groups Projects
Commit 6dfdee49 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Optimize: check `min_inters` first

There is a check on `min_inters` inside `inters_lines` but adding
these two tests in overlap can spare calls to `copy_shift`. Note that
we do not need to add such tests in the three other cases of nullity
of speed contours because, in these three other cases, if at least one
of `min_inters_speed` or `min_inters_out` is <= 1 then `p_shifted` is
used.
parent fee9e5dc
No related branches found
No related tags found
No related merge requests found
......@@ -101,11 +101,15 @@ contains
assoc_eddies = inters_lines(e1%out_cont%polyline, p_shifted, &
min(min_inters_speed, min_inters_out))
else
p_shifted = copy_shift(e2%speed_cont%polyline, delta_long)
assoc_eddies = inters_lines(e1%speed_cont%polyline, &
p_shifted, min_inters_speed)
if (min_inters_speed <= 1.) then
p_shifted = copy_shift(e2%speed_cont%polyline, delta_long)
assoc_eddies = inters_lines(e1%speed_cont%polyline, &
p_shifted, min_inters_speed)
else
assoc_eddies = .false.
end if
if (.not. assoc_eddies) then
if (.not. assoc_eddies .and. min_inters_out <= 1.) then
p_shifted = copy_shift(e2%out_cont%polyline, delta_long)
assoc_eddies = inters_lines(e1%out_cont%polyline, &
p_shifted, min_inters_out)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment