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

Only one pass through the extrema to define outermost contours. All

the logic with flat_extr and noise_around is no longer needed.
parent cdc6c87a
No related branches found
No related tags found
No related merge requests found
......@@ -116,15 +116,15 @@ vides, c'est-à-dire égales à null\_ssh\_contour(). On peut distinguer
les cas du tableau (\ref{tab:null_ssh_contour}).
\begin{table}[htbp]
\centering
\begin{tabular}{llllll|l}
out\_cont & suff\_amp & extr\_map & radius4 & max\_speed
\begin{tabular}{lllll|l}
out\_cont & suff\_amp & radius4 & max\_speed
& fraction & note \\
\hline
null & F & < 0 & 0 & \np{e4} & 5 \% & 1 \\
$\ne$ null & F & < 0 & 0 & \np{e4} & 6 \% \\
$\ne$ null & T & > 0 & 1 & NaN & 3 \% & 2 \\
$\ne$ null & T & > 0 & 1 & $\ne \np{e4}$, $\ne$ NaN & 47 \% \\
$\ne$ null & T & > 0 & $\ge 2$ & $\ne \np{e4}$, $\ne$ NaN & 21 \%
null & F & 0 & \np{e4} & 5 \% & 1 \\
$\ne$ null & F & 0 & \np{e4} & 6 \% \\
$\ne$ null & T & 1 & NaN & 3 \% & 2 \\
$\ne$ null & T & 1 & $\ne \np{e4}$, $\ne$ NaN & 47 \% \\
$\ne$ null & T & $\ge 2$ & $\ne \np{e4}$, $\ne$ NaN & 21 \%
& 3
\end{tabular}
\caption{Cas où les composantes out\_cont ou speed\_cont d'un tourbillon sont
......@@ -511,11 +511,8 @@ vitesse maximale), 720 latitudes par 1440 longitudes.
\item[eddy] La comparaison entre out\_cont\%ssh et ssh\_extr donne la
distinction anticyclone -- cyclone mais il est quand même plus
confortable d'avoir cette information directement dans les
sorties. Pour cela, j'ajoute un champ cyclone. De même, le fait que
l'amplitude de ssh soit ou non en dessous du seuil est codé dans
extr\_map mais il me semble plus confortable de l'avoir en plus ici,
dans le champ suff\_amp. Mémoire utilisée par un scalaire de ce type
:
sorties. Pour cela, j'ajoute un champ cyclone. Mémoire utilisée par
un scalaire de ce type :
\begin{equation*}
\mathrm{taille}(\mathtt{eddy})
= 11\ \mathrm{mots} + \mathrm{taille}(\mathtt{out\_cont})
......
......@@ -47,8 +47,6 @@ contains
logical, allocatable:: cyclone(:) ! (s%number_vis_eddies)
integer i, l
integer n_cycl ! number of cyclones
logical, allocatable:: flat_extr(:) ! (s%number_vis_eddies) flat extremum
logical, allocatable:: noise_around(:) ! (s%number_vis_eddies)
integer, allocatable:: sorted_extr(:) ! (s%number_vis_eddies)
! identifying number of extrema, first minima sorted in order of
......@@ -76,8 +74,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), flat_extr(s%number_vis_eddies), &
noise_around(s%number_vis_eddies), llc(2, s%number_vis_eddies), &
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))
......@@ -94,12 +91,6 @@ contains
corner_window(:, i) = corner + (llc(:, i) - 1) * step
end forall
if (min_amp == 0.) then
flat_extr = .false.
else
flat_extr = abs(innermost_level - s%list_vis%ssh_extr) < min_amp
end if
! Double sort of extrema on cyclonicity and SSH value:
selection = argwhere(cyclone)
......@@ -113,54 +104,21 @@ 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), &
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)
if (s%list_vis(i)%out_cont%n_points == 0) then
s%list_vis(i)%suff_amp = .false.
else
s%list_vis(i)%suff_amp = abs(s%list_vis(i)%out_cont%ssh &
- s%list_vis(i)%ssh_extr) >= min_amp
end if
end if
end do
! Define noise_around:
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 = 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)) &
s%list_vis(i)%out_cont = get_1_outerm(s%list_vis(i)%cyclone, &
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)
if (s%list_vis(i)%out_cont%n_points == 0) then
s%list_vis(i)%suff_amp = .false.
else
s%list_vis(i)%suff_amp = abs(s%list_vis(i)%out_cont%ssh &
- s%list_vis(i)%ssh_extr) >= min_amp
end if
end do
! We must modify s%list_vis(i)%suff_amp in this loop, separate from
! the previous loop, so we do not influence the batch of
! get_1_outerm.
forall (i = 1:s%number_vis_eddies, .not. flat_extr(i)) &
s%list_vis(i)%suff_amp = s%list_vis(i)%out_cont%n_points /= 0
s%list_vis%twice = .false.
end subroutine set_all_outerm
......
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