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

Read `cont_list_proj` instead of computing it

In program `test_set_max_speed`, read `cont_list_proj` instead of
computing it. Computing it is not possible with a non
longitude-latitude grid.
parent 7c9a1e1b
No related branches found
No related tags found
No related merge requests found
...@@ -194,7 +194,8 @@ ...@@ -194,7 +194,8 @@
"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc",
"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc",
"$tests_old_dir/Get_1_outerm/SHPC", "$tests_old_dir/Get_1_outerm/SHPC",
"$tests_old_dir/Get_1_outerm/cont_list.shp" "$tests_old_dir/Get_1_outerm/cont_list.shp",
"$tests_old_dir/Get_1_outerm/cont_list_proj.shp"
] ]
], ],
"input": "t\n", "input": "t\n",
...@@ -209,7 +210,8 @@ ...@@ -209,7 +210,8 @@
"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc",
"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc", "$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc",
"$tests_old_dir/Get_1_outerm_noise_2_8/SHPC", "$tests_old_dir/Get_1_outerm_noise_2_8/SHPC",
"$tests_old_dir/Get_1_outerm_noise_2_8/cont_list.shp" "$tests_old_dir/Get_1_outerm_noise_2_8/cont_list.shp",
"$tests_old_dir/Get_1_outerm_noise_2_8/cont_list_proj.shp"
] ]
], ],
"input": "t\n", "input": "t\n",
...@@ -245,7 +247,8 @@ ...@@ -245,7 +247,8 @@
"$src_dir/Inst_eddies/Tests/Input/degenerated_SSH.nc", "$src_dir/Inst_eddies/Tests/Input/degenerated_SSH.nc",
"$src_dir/Inst_eddies/Tests/Input/degenerated_SSH.nc", "$src_dir/Inst_eddies/Tests/Input/degenerated_SSH.nc",
"$tests_old_dir/SHPC_degenerate/SHPC", "$tests_old_dir/SHPC_degenerate/SHPC",
"$tests_old_dir/SHPC_degenerate/cont_list.shp" "$tests_old_dir/SHPC_degenerate/cont_list.shp",
"$tests_old_dir/SHPC_degenerate/cont_list_proj.shp"
] ]
], ],
"input": "f\n", "input": "f\n",
......
...@@ -22,7 +22,7 @@ program test_set_max_speed ...@@ -22,7 +22,7 @@ program test_set_max_speed
logical cyclone logical cyclone
logical periodic ! grid is periodic in longitude logical periodic ! grid is periodic in longitude
integer nlon, nlat, d, eddy_index, n_cont, i, j, ishape integer nlon, nlat, d, eddy_index, n_cont, i, ishape
real, allocatable:: ssh(:, :) ! (nlon, nlat) sea-surface height, in m real, allocatable:: ssh(:, :) ! (nlon, nlat) sea-surface height, in m
real, allocatable:: u(:, :), v(:, :) ! (nlon, nlat) wind, in m s-1 real, allocatable:: u(:, :), v(:, :) ! (nlon, nlat) wind, in m s-1
type(eddy) e type(eddy) e
...@@ -109,14 +109,25 @@ program test_set_max_speed ...@@ -109,14 +109,25 @@ program test_set_max_speed
cont_list(i)%points = cont_list(i)%points * deg_to_rad cont_list(i)%points = cont_list(i)%points * deg_to_rad
end if end if
end do
call shpclose(hshp)
call get_command_arg_dyn(5, path, &
"Required 5th argument: cont-list-proj-shapefile")
call shp_open_03(hshp, path, "rb")
do i = 1, n_cont
ishape = i - 1
call shp_read_pol(p, hshp, ishape)
if (p%nparts == 0) then
cont_list_proj(i)%polyline = null_polyline()
else
cont_list_proj(i)%polyline = p%part(1)
end if
call dbf_read_attribute_03(cont_list_proj(i)%ssh, hshp, ifield = 0, & call dbf_read_attribute_03(cont_list_proj(i)%ssh, hshp, ifield = 0, &
ishape = ishape) ishape = ishape)
cont_list_proj(i)%n_points = cont_list(i)%n_points
cont_list_proj(i)%closed = cont_list(i)%closed
allocate(cont_list_proj(i)%points(2, cont_list_proj(i)%n_points))
forall (j = 1:cont_list_proj(i)%n_points) &
cont_list_proj(i)%points(:, j) = (cont_list(i)%points(:, j) &
- corner) / step + 1.
end do end do
call shpclose(hshp) call shpclose(hshp)
......
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