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

Move output of `cont_list` to `set_max_speed`

Move output of `cont_list` from `set_contours` to `set_max_speed`. The
advantage is that we will be able to add the speed to the shapefile.
parent f8ee659b
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ target_link_libraries(test_local_extrema PRIVATE NetCDF95::netcdf95
# test_set_max_speed
add_executable(test_set_max_speed test_set_max_speed.f90
${PROJECT_SOURCE_DIR}/Overlap/read_eddy.f90)
${PROJECT_SOURCE_DIR}/Overlap/read_eddy.f90 cont_list.f90)
target_link_libraries(test_set_max_speed PRIVATE Geometry::geometry
Numer_Rec_95::numer_rec_95 NetCDF95::netcdf95
Shapelib_03::shapelib_03 Contour_531::contour_531 Jumble::jumble
......
......@@ -11,12 +11,8 @@ contains
! Libraries:
use contour_531, only: convert_to_ind
use jumble, only: rad_to_deg
use shapelib, only: shpt_polygon
use shapelib_03, only: shp_append_object_03, dbf_write_attribute_03
use config_m, only: min_amp
use cont_list_m, only: write_cont_list, hshp_cont_list
use derived_types, only: extremum, ssh_contour
use get_1_outerm_m, only: get_1_outerm
use set_max_speed_m, only: set_max_speed
......@@ -80,8 +76,6 @@ contains
! number of good contours found and stored in cont_list, 0 <=
! n_cont <= n_max_cont
integer i, ishape
!--------------------------------------------------------------
! Only look for good contours with amplitudes >= min_amp:
......@@ -115,15 +109,6 @@ contains
v(llc(1):urc(1), llc(2):urc(2)), corner_window, step)
end if
if (write_cont_list) then
do i = 1, n_cont
call shp_append_object_03(ishape, hshp_cont_list, shpt_polygon, &
cont_list(i)%points * rad_to_deg)
call dbf_write_attribute_03(hshp_cont_list, ishape, ifield = 0, &
fieldvalue = cont_list(i)%ssh)
end do
end if
end subroutine set_contours
end module set_contours_m
......@@ -19,7 +19,9 @@ contains
IEEE_QUIET_NAN
! Libraries:
use jumble, only: new_unit
use jumble, only: new_unit, rad_to_deg
use shapelib, only: shpt_polygon
use shapelib_03, only: shp_append_object_03, dbf_write_attribute_03
use ccw_orient_m, only: ccw_orient
use complete_ssh_m, only: complete_ssh
......@@ -27,6 +29,7 @@ contains
use good_contour_m, only: good_contour
use mean_speed_m, only: mean_speed
use spher_polyline_area_m, only: spher_polyline_area
use cont_list_m, only: write_cont_list, hshp_cont_list
type(ssh_contour), intent(out):: speed_cont
......@@ -66,7 +69,7 @@ contains
! Local:
real, allocatable:: speed(:) ! (n_cont) speed on the contour
integer i, i_outer, unit
integer i, i_outer, unit, ishape
integer sort_ssh(size(cont_list)) ! (n_max_cont)
! Sorts cont_list%ssh in ascending order. Defined only for
......@@ -107,6 +110,15 @@ contains
end do
close(unit)
if (write_cont_list) then
do i = 1, n_cont
call shp_append_object_03(ishape, hshp_cont_list, shpt_polygon, &
cont_list(i)%points * rad_to_deg)
call dbf_write_attribute_03(hshp_cont_list, ishape, ifield = 0, &
fieldvalue = cont_list(i)%ssh)
end do
end if
#endif
i = maxloc(abs(speed), dim = 1, mask = .not. IEEE_IS_NAN(speed))
......
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