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

Convert to longitude, latitude at the end

Because we may drop all the contours, if the area is not large enough,
or some of the contours, if `n_cont == n_max_cont-1`, convert to
longitude and latitude only when we are are sure it is useful.
parent 658a74e5
No related branches found
No related tags found
No related merge requests found
......@@ -115,8 +115,6 @@ contains
n_cont = 0
cont_list_proj(1) = good_contour(corner_proj, ssh, innermost_level_2, &
coord_extr_proj, outside_points_proj)
cont_list(1)%polyline = convert_to_reg_coord(cont_list_proj(1), &
corner_whole, step)
test_n_points: if (.not. cont_list_proj(1)%closed) then
! cont_list_proj(1)%n_points == 0
......@@ -131,8 +129,6 @@ contains
cyclone), "get_1_outerm level_try")
cont_list_proj(2) = good_contour(corner_proj, ssh, level_try, &
coord_extr_proj, outside_points_proj)
cont_list(2)%polyline = convert_to_reg_coord(cont_list_proj(2), &
corner_whole, step)
if (cont_list_proj(2)%closed) then
! cont_list_proj(2)%n_points /= 0
......@@ -149,9 +145,6 @@ contains
level_try = (level_good + level_bad) / 2.
cont_list_proj(n_cont + 1) = good_contour(corner_proj, ssh, &
level_try, coord_extr_proj, outside_points_proj)
cont_list(n_cont + 1)%polyline &
= convert_to_reg_coord(cont_list_proj(n_cont + 1), &
corner_whole, step)
if (cont_list_proj(n_cont + 1)%closed) then
! cont_list_proj(n_cont + 1)%n_points /= 0
......@@ -160,7 +153,7 @@ contains
if (n_cont == n_max_cont - 1) then
! Replace the previous good contour found
cont_list_proj(n_cont) = cont_list_proj(n_max_cont)
cont_list(n_cont) = cont_list(n_max_cont)
cont_list(n_cont)%ssh = cont_list(n_max_cont)%ssh
else
n_cont = n_cont + 1
end if
......@@ -178,13 +171,19 @@ contains
! Assertion: n_cont <= n_max_cont - 1
end if
out_cont = cont_list(n_cont)
out_cont%polyline = convert_to_reg_coord(cont_list_proj(n_cont), &
corner_whole, step)
out_cont%area = spher_polyline_area(out_cont%polyline)
if (abs(out_cont%area) < min_area) then
out_cont = null_ssh_contour()
n_cont = 0
else
! n_cont >= 1
forall (i = 1:n_cont - 1) cont_list(i)%polyline &
= convert_to_reg_coord(cont_list_proj(i), corner_whole, step)
cont_list(n_cont)%polyline = out_cont%polyline
out_cont%ssh = cont_list(n_cont)%ssh
call ccw_orient(out_cont)
end if
end if test_n_points
......
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