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

In procedure nearby_extr, it is maybe faster to test selection /= i

than extr_map /= i.

Preparing to remove the coding of sufficient amplitude in extr_map: do
not use anywhere the sign of extr_map, use the component suff_amp of
the type eddy instead.

In program test_successive_overlap, I would rather not use default
values for namelist variables.

Add a larger test for successive_overlap, to have eddies wih
insufficient amplitude in the region.
parent 9c204185
No related branches found
No related tags found
No related merge requests found
Region 4.
\ No newline at end of file
&MAIN_NML
CORNER = 0.12500 , -59.875, ,
NLON = 120,
NLAT = 180
/
......@@ -18,10 +18,10 @@ program test_successive_overlap
TYPE(shpfileobject) hshp_outermost ! shapefile outermost_contour_1
TYPE(shpfileobject) hshp_max_speed ! shapefile max_speed_contour_1
real:: corner(2) = [0.125, - 59.875]
real:: corner(2) = [huge(0.), huge(0.)]
! longitude and latitude of the corner of the whole grid, in degrees
integer:: nlon = 120, nlat = 120
integer:: nlon = - 1, nlat = - 1
namelist /main_nml/ corner, nlon, nlat
!-------------------------------------------------------------------------
......
......@@ -289,5 +289,17 @@
],
["$input_dir/extr_map_negative_2_8.nc", "extr_map.nc"]
]
},
{
"args" : "$compil_prod_dir/test_successive_overlap",
"title" : "Successive_overlap_region_5",
"description": "Same as Successive_overlap, but with larger domain: region 5 instead of region 4.",
"required":
[
"$tests_old_dir/Get_snapshot_region_5/extremum_1.*",
"$tests_old_dir/Get_snapshot_region_5/max_speed_contour_1.*",
"$tests_old_dir/Get_snapshot_region_5/outermost_contour_1.*"
],
"stdin": "$input_dir/successive_overlap_region_5_nml.txt"
}
]
......@@ -33,9 +33,10 @@ contains
!--------------------------------------------------------------------------
selection = pack(extr_map, extr_map /= 0 .and. extr_map /= i)
selection = abs(pack(selection, (list_vis(abs(selection))%cyclone &
.neqv. list_vis(i)%cyclone) .or. selection > 0))
selection = pack(extr_map, extr_map /= 0)
selection = abs(pack(selection, selection /= i &
.and. ((list_vis(abs(selection))%cyclone .neqv. list_vis(i)%cyclone) &
.or. selection > 0)))
n_select = size(selection)
allocate(nearby_extr(2, n_select))
forall (l = 1:n_select) &
......
......@@ -7,7 +7,7 @@ contains
subroutine set_all_outerm(s, min_amp, max_radius, corner, step, ssh)
! Extraction of eddies: find extrema and set all outermost
! contours in snapshot. Not a function because snapshot is not
! contours in the snapshot "s". Not a function because "s" is not
! completely defined.
! Libraries:
......@@ -101,7 +101,7 @@ contains
end if
! Double sort of extrema on cyclonicity and SSH value:
selection = argwhere(cyclone)
n_cycl = size(selection)
selection = selection(indexx(s%list_vis(selection)%ssh_extr))
......@@ -113,7 +113,7 @@ contains
do l = 1, s%number_vis_eddies
i = sorted_extr(l)
if (flat_extr(i)) then
s%list_vis(i)%out_cont = get_1_outerm(s%list_vis(i)%cyclone, &
s%list_vis(i)%coord_extr, innermost_level(i), &
......@@ -141,18 +141,23 @@ contains
! (no forall because of gfortran internal compiler error)
! Define noise_around:
if (min_amp /= 0.) &
forall &
(i = 1:s%number_vis_eddies, &
flat_extr(i) .and. s%list_vis(i)%suff_amp) &
noise_around(i) &
= any(s%extr_map(llc(1, i):urc(1, i), llc(2, i):urc(2, i)) < 0)
if (min_amp /= 0.) then
do i = 1, s%number_vis_eddies
if (flat_extr(i) .and. s%list_vis(i)%suff_amp) then
associate (extr_map => s%extr_map(llc(1, i):urc(1, i), &
llc(2, i):urc(2, i)))
selection = abs(pack(extr_map, extr_map /= 0))
end associate
noise_around(i) = .not. all(s%list_vis(selection)%suff_amp)
end if
end do
end if
s%list_vis%twice = flat_extr .and. s%list_vis%suff_amp .and. noise_around
do l = 1, s%number_vis_eddies
i = sorted_extr(l)
if (s%list_vis(i)%suff_amp .and. noise_around(i) &
.or. .not. flat_extr(i)) then
s%list_vis(i)%out_cont = get_1_outerm(s%list_vis(i)%cyclone, &
......
......@@ -43,11 +43,12 @@ contains
DO m = max(i1_lat - dist_lim, 1), min(i1_lat + dist_lim, nlat)
DO l = max(i1_lon - dist_lim, 1), min(i1_lon + dist_lim, nlon)
if (flow(j)%extr_map(l, m) > 0) then
i2 = flow(j)%extr_map(l, m)
i2 = abs(flow(j)%extr_map(l, m))
if (flow(j)%list_vis(i2)%cyclone &
.eqv. flow(j - 1)%list_vis(i1)%cyclone) then
if (i2 /= 0) then
if (flow(j)%list_vis(i2)%suff_amp &
.and. (flow(j)%list_vis(i2)%cyclone &
.eqv. flow(j - 1)%list_vis(i1)%cyclone)) then
polyline_2 &
= merge(flow(j)%list_vis(i2)%speed_cont%polyline, &
flow(j)%list_vis(i2)%out_cont%polyline, &
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment