diff --git a/set_all_outerm.f b/set_all_outerm.f index 4e5378236848df2f6f903787985eb7e261518cc4..8b6337620fd204342678cd3e4921a09615b16c1b 100644 --- a/set_all_outerm.f +++ b/set_all_outerm.f @@ -57,15 +57,8 @@ contains ! identifying numbers of a selection of extrema ! Window around each extremum: - - integer, allocatable:: llc(:, :) ! (2, s%number_vis_eddies) - ! indices in global grid of lower left corner - - integer, allocatable:: urc(:, :) ! (2, s%number_vis_eddies) - ! indices in global grid of upper right corner - - real, allocatable:: corner_window(:, :) ! (2, s%number_vis_eddies) - ! longitude and latitude, in rad + integer llc(2) ! indices in global grid of lower left corner + integer urc(2) ! indices in global grid of upper right corner !-------------------------------------------------------------- @@ -74,9 +67,7 @@ contains allocate(s%extr_map(nlon, nlat)) call local_extrema(ssh, s%extr_map, s%ind_extr, innermost_level, cyclone) s%number_vis_eddies = size(s%ind_extr, 2) - allocate(s%list_vis(s%number_vis_eddies), llc(2, s%number_vis_eddies), & - urc(2, s%number_vis_eddies), corner_window(2, s%number_vis_eddies), & - sorted_extr(s%number_vis_eddies)) + allocate(s%list_vis(s%number_vis_eddies), sorted_extr(s%number_vis_eddies)) forall (i = 1:s%number_vis_eddies) s%list_vis(i)%coord_extr = corner + (s%ind_extr(:, i) - 1) * step @@ -84,11 +75,6 @@ contains s%list_vis(i)%cyclone = cyclone(i) s%list_vis(i)%interpolated = .false. s%list_vis(i)%suff_amp = .true. - - ! Define the geographical window around each eddy extremum: - llc(:, i) = max(s%ind_extr(:, i) - max_radius, 1) - urc(:, i) = min(s%ind_extr(:, i) + max_radius, [nlon, nlat]) - corner_window(:, i) = corner + (llc(:, i) - 1) * step end forall ! Double sort of extrema on cyclonicity and SSH value: @@ -104,12 +90,16 @@ contains do l = 1, s%number_vis_eddies i = sorted_extr(l) + + ! Define the geographical window around each eddy extremum: + llc = max(s%ind_extr(:, i) - max_radius, 1) + urc = min(s%ind_extr(:, i) + max_radius, [nlon, nlat]) + s%list_vis(i)%out_cont = get_1_outerm(s%list_vis(i)%cyclone, & s%list_vis(i)%coord_extr, innermost_level(i), & - nearby_extr(s%extr_map(llc(1, i):urc(1, i), & - llc(2, i):urc(2, i)), s%list_vis, i), & - ssh(llc(1, i):urc(1, i), llc(2, i):urc(2, i)), & - corner_window(:, i), step) + nearby_extr(s%extr_map(llc(1):urc(1), llc(2):urc(2)), s%list_vis, & + i), ssh(llc(1):urc(1), llc(2):urc(2)), & + corner = corner + (llc - 1) * step, step = step) if (s%list_vis(i)%out_cont%n_points == 0) then s%list_vis(i)%suff_amp = .false. else