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

`delta_out` and `delta_in` should not increase

Bug fix in procedure overlap: `delta_out` and `delta_in` should not increase.
parent 8c9b7b72
No related branches found
No related tags found
No related merge requests found
......@@ -8,3 +8,4 @@ window.pdf
periodicity.pdf
copy.pdf
set_all_outerm.pdf
overlap.pdf
sources = window processes m3 call_graph input_output degeneracy periodicity copy set_all_outerm
sources = window processes m3 call_graph input_output degeneracy periodicity copy set_all_outerm overlap
objects := $(addsuffix .pdf, ${sources})
......
No preview for this file type
File added
This diff is collapsed.
......@@ -6,8 +6,9 @@ contains
function candidate_overlap(extr_map, list_vis, cyclone, delta_out, delta)
! Find the eddies in extr_map that are valid and have a given
! cyclonicity.
! Find the eddies in extr_map that are valid, have a given
! cyclonicity. Also, if delta_out < delta then the eddies should
! not have a predecessor at time distance < delta.
use derived_types, only: eddy
......@@ -18,11 +19,17 @@ contains
! extremum. 0 at other points.
type(eddy), intent(in):: list_vis(:)
! Visible eddies at a given date. We need components valid and
! cyclone to be defined.
! Visible eddies at a given date. We need components valid,
! cyclone and delta_in to be defined. Arriving in this subroutine,
! list_vis%delta_in could be <= delta or huge(0).
logical, intent(in):: cyclone ! cyclonicity of the target extremum
integer, intent(in):: delta_out, delta
integer, intent(in):: delta_out
! Arriving in this subroutine, delta_out could be <= delta or
! huge(0).
integer, intent(in):: delta
!---------------------------------------------------------------------
......
......@@ -27,12 +27,12 @@ module derived_types
logical interpolated
integer:: delta_in = huge(0)
! Maximum difference in time subscript where there is a direct
! predecessor. huge means there is no direct predecessor.
! Minimum difference in time subscript where there is a direct
! predecessor. Huge means there is no direct predecessor.
integer:: delta_out = huge(0)
! Maximum difference in time subscript where there is a direct
! successor. huge means there is no direct succcessor.
! Minimum difference in time subscript where there is a direct
! successor. Huge means there is no direct succcessor.
integer radius4
! ind_extr + radius4 - 1 in all four directions is inside outermost
......
......@@ -52,7 +52,9 @@ contains
! Local:
integer i1, i2, l, n_select, m
integer i1 ! eddy index of predecessor
integer i2 ! eddy index of successor
integer l, n_select, m
type(polyline) polyline_1, polyline_2
type(polygon) res_pol
......@@ -80,10 +82,12 @@ contains
urc(1) = min(urc(1), nlon)
end if
! Pre-select potential successors:
selection = candidate_overlap(flow(j)%extr_map(llc(1):urc(1), &
llc(2):urc(2)), flow(j)%list_vis, &
flow(j - delta)%list_vis(i1)%cyclone, &
flow(j - delta)%list_vis(i1)%delta_out, delta)
n_select = size(selection)
if (n_select /= 0) polyline_1 &
= merge(flow(j - delta)%list_vis(i1)%speed_cont%polyline, &
......@@ -92,6 +96,8 @@ contains
DO l = 1, n_select
i2 = selection(l)
! assertion {flow(j - delta)%list_vis(i1)%delta_out >=
! delta .or. flow(j)%list_vis(i2)%delta_in >= delta}
polyline_2 = merge(flow(j)%list_vis(i2)%speed_cont%polyline, &
flow(j)%list_vis(i2)%out_cont%polyline, &
flow(j)%list_vis(i2)%speed_cont%n_points /= 0)
......@@ -127,8 +133,10 @@ contains
flow(j)%list_vis(i2)%ssh_extr, &
weight(flow(j - delta)%list_vis(i1), &
flow(j)%list_vis(i2)))
flow(j - delta)%list_vis(i1)%delta_out = delta
flow(j)%list_vis(i2)%delta_in = delta
flow(j - delta)%list_vis(i1)%delta_out &
= min(flow(j - delta)%list_vis(i1)%delta_out, delta)
flow(j)%list_vis(i2)%delta_in &
= min(flow(j)%list_vis(i2)%delta_in, delta)
end if
end if
end DO
......
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