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

Rename component suff_amp of type eddy to "valid". In preparation for

validity of an eddy depending not only on its amplitude but also its
surface. (Note that, in this version, the component valid is redundant: one
can simply test the component out_cont%n_points.)
parent acc96ac1
No related branches found
No related tags found
No related merge requests found
......@@ -84,9 +84,6 @@ depend ${makefile_dir}/depend.mk:
clean:
rm -f ${execut} ${objects} log
clobber: clean
rm -f *.mod ${makefile_dir}/depend.mk TAGS
ifneq ($(MAKECMDGOALS), clobber)
include ${makefile_dir}/depend.mk
endif
No preview for this file type
......@@ -12,7 +12,7 @@ contains
! Libraries:
use contour_531, only: null_polyline
use gpc_f, only: shpobj2pol, polygon
use nr_util, only: pi, deg_to_rad
use nr_util, only: deg_to_rad
use shapelib, only: shpfileobject, shpobject, dbfreadattribute, &
shpdestroyobject
use shapelib_03, only: shp_read_object_03, dbf_get_field_index_03
......@@ -20,7 +20,7 @@ contains
use derived_types, only: eddy
use read_field_indices_m, only: ifield_extr_ssh, ifield_extr_date, &
ifield_extr_eddy_index, ifield_extr_interp, ifield_extr_cycl, &
ifield_extr_suff_amp, ifield_extr_speed, ifield_out_area, &
ifield_extr_valid, ifield_extr_speed, ifield_out_area, &
ifield_out_ssh, ifield_out_radius4, ifield_max_speed_area, &
ifield_max_speed_ssh
......@@ -64,9 +64,9 @@ contains
attr = int_attr)
e%cyclone = int_attr == 1
call dbfreadattribute(hshp_extremum, ishape, ifield_extr_suff_amp, &
call dbfreadattribute(hshp_extremum, ishape, ifield_extr_valid, &
attr = int_attr)
e%suff_amp = int_attr == 1
e%valid = int_attr == 1
call dbfreadattribute(hshp_extremum, ishape, ifield_extr_speed, attr = attr)
e%max_speed = attr
......
......@@ -4,7 +4,7 @@ module read_field_indices_m
integer, protected:: ifield_extr_ssh, ifield_extr_date, &
ifield_extr_eddy_index, ifield_extr_interp, ifield_extr_cycl, &
ifield_extr_suff_amp, ifield_extr_speed
ifield_extr_valid, ifield_extr_speed
integer, protected:: ifield_out_area, ifield_out_ssh, ifield_out_radius4
integer, protected:: ifield_max_speed_area, ifield_max_speed_ssh
......@@ -32,7 +32,7 @@ contains
ifield_extr_eddy_index)
call dbf_get_field_index_03(hshp_extremum, "interpolat", ifield_extr_interp)
call dbf_get_field_index_03(hshp_extremum, "cyclone", ifield_extr_cycl)
call dbf_get_field_index_03(hshp_extremum, "suff_amp", ifield_extr_suff_amp)
call dbf_get_field_index_03(hshp_extremum, "valid", ifield_extr_valid)
call dbf_get_field_index_03(hshp_extremum, "speed", ifield_extr_speed)
call dbf_get_field_index_03(hshp_outermost, "area", ifield_out_area)
......
......@@ -44,7 +44,7 @@ program test_nearby_extr
list_vis(i)%cyclone = int_attr == 1
call dbfreadattribute(hshp, ishape, ifield = 5, attr = int_attr)
list_vis(i)%suff_amp = int_attr == 1
list_vis(i)%valid = int_attr == 1
call shp_read_object_03(hshp, ishape, psobject)
list_vis(i)%coord_extr = [psobject%padfx(1), psobject%padfy(1)] &
......
......@@ -95,7 +95,7 @@ program test_set_all_outerm
nwidth = 1, ndecimals = 0)
call dbf_add_field_03(ifield, hshp_extremum, 'cyclone', ftinteger, &
nwidth = 1, ndecimals = 0)
call dbf_add_field_03(ifield, hshp_extremum, 'suff_amp', ftinteger, &
call dbf_add_field_03(ifield, hshp_extremum, 'valid', ftinteger, &
nwidth = 1, ndecimals = 0)
call shp_create_03("outermost_contour_1", shpt_polygon, hshp_outermost)
......@@ -125,7 +125,7 @@ program test_set_all_outerm
call dbf_write_attribute_03(hshp_extremum, ishape, 4, &
merge(1, 0, s%list_vis(i)%cyclone))
call dbf_write_attribute_03(hshp_extremum, ishape, 5, &
merge(1, 0, s%list_vis(i)%suff_amp))
merge(1, 0, s%list_vis(i)%valid))
if (s%list_vis(i)%interpolated) then
call shp_append_null_03(ishape, hshp_outermost)
......
......@@ -19,9 +19,7 @@ module derived_types
type(ssh_contour) speed_cont ! contour with maximum average azimuthal speed
real max_speed ! average of azimuthal speed on speed_cont, in m s-1
logical suff_amp
! out_cont found and sufficient amplitude of ssh between extremum
! and out_cont
logical valid ! valid (passing all requirements) out_cont found
logical interpolated
......
......@@ -93,7 +93,7 @@ contains
! max-speed contours.
do i = 1, s%number_vis_eddies
if (s%list_vis(i)%suff_amp) then
if (s%list_vis(i)%valid) then
! Restrict the field to the outermost contour:
llc = floor(convert_to_ind(minval(s%list_vis(i)%out_cont%points, &
......
......@@ -4,7 +4,7 @@ module init_shapefiles_m
integer, protected:: ifield_extr_ssh, ifield_extr_date, &
ifield_extr_eddy_index, ifield_extr_interp, ifield_extr_cycl, &
ifield_extr_suff_amp, ifield_extr_speed
ifield_extr_valid, ifield_extr_speed
integer, protected:: ifield_out_area, ifield_out_ssh, ifield_out_date, &
ifield_out_eddy_index, ifield_out_radius4
integer, protected:: ifield_max_speed_area, ifield_max_speed_ssh, &
......@@ -39,7 +39,7 @@ contains
ftinteger, nwidth = 1, ndecimals = 0)
call dbf_add_field_03(ifield_extr_cycl, hshp_extremum, 'cyclone', &
ftinteger, nwidth = 1, ndecimals = 0)
call dbf_add_field_03(ifield_extr_suff_amp, hshp_extremum, 'suff_amp', &
call dbf_add_field_03(ifield_extr_valid, hshp_extremum, 'valid', &
ftinteger, nwidth = 1, ndecimals = 0)
call dbf_add_field_03(ifield_extr_speed, hshp_extremum, 'speed', ftdouble, &
nwidth = 13, ndecimals = 6)
......
......@@ -17,7 +17,7 @@ contains
type(eddy), intent(in):: list_vis(:)
! Visible eddies at a given date. We need components coord_extr,
! suff_amp and cyclone to be defined.
! valid and cyclone to be defined.
integer, intent(in):: i ! identifying number of the target extremum
......@@ -33,7 +33,7 @@ contains
selection = pack(extr_map, extr_map /= 0)
selection = pack(selection, selection /= i &
.and. ((list_vis(selection)%cyclone .neqv. list_vis(i)%cyclone) &
.or. list_vis(selection)%suff_amp))
.or. list_vis(selection)%valid))
n_select = size(selection)
allocate(nearby_extr(2, n_select))
forall (l = 1:n_select) &
......
......@@ -74,7 +74,7 @@ contains
s%list_vis(i)%ssh_extr = ssh(s%ind_extr(1, i), s%ind_extr(2, i))
s%list_vis(i)%cyclone = cyclone(i)
s%list_vis(i)%interpolated = .false.
s%list_vis(i)%suff_amp = .true.
s%list_vis(i)%valid = .true.
end forall
! Double sort of extrema on cyclonicity and SSH value:
......@@ -105,7 +105,7 @@ contains
nearby_extr(s%extr_map(llc(1):urc(1), llc(2):urc(2)), s%list_vis, &
i), ssh(llc(1):urc(1), llc(2):urc(2)), &
corner = corner + (llc - 1) * step, step = step)
s%list_vis(i)%suff_amp = s%list_vis(i)%out_cont%n_points /= 0
s%list_vis(i)%valid = s%list_vis(i)%out_cont%n_points /= 0
end do
end subroutine set_all_outerm
......
......@@ -34,7 +34,7 @@ contains
!-----------------------------------------------------------------------
do i1 = 1, flow(j - 1)%number_vis_eddies
if (flow(j - 1)%list_vis(i1)%suff_amp) then
if (flow(j - 1)%list_vis(i1)%valid) then
polyline_1 = merge(flow(j - 1)%list_vis(i1)%speed_cont%polyline, &
flow(j - 1)%list_vis(i1)%out_cont%polyline, &
flow(j - 1)%list_vis(i1)%speed_cont%n_points /= 0)
......@@ -46,7 +46,7 @@ contains
i2 = flow(j)%extr_map(l, m)
if (i2 /= 0) then
if (flow(j)%list_vis(i2)%suff_amp &
if (flow(j)%list_vis(i2)%valid &
.and. (flow(j)%list_vis(i2)%cyclone &
.eqv. flow(j - 1)%list_vis(i1)%cyclone)) then
polyline_2 &
......
......@@ -11,7 +11,7 @@ contains
use derived_types, only: eddy, missing_speed
use init_shapefiles_m, only: ifield_extr_ssh, ifield_extr_date, &
ifield_extr_eddy_index, ifield_extr_interp, ifield_extr_cycl, &
ifield_extr_suff_amp, ifield_extr_speed, ifield_out_area, &
ifield_extr_valid, ifield_extr_speed, ifield_out_area, &
ifield_out_ssh, ifield_out_date, ifield_out_eddy_index, &
ifield_out_radius4, ifield_max_speed_area, ifield_max_speed_ssh, &
ifield_max_speed_date, ifield_max_speed_eddy_index
......@@ -49,8 +49,8 @@ contains
merge(1, 0, e%interpolated))
call dbf_write_attribute_03(hshp_extremum, ishape, ifield_extr_cycl, &
merge(1, 0, e%cyclone))
call dbf_write_attribute_03(hshp_extremum, ishape, ifield_extr_suff_amp, &
merge(1, 0, e%suff_amp))
call dbf_write_attribute_03(hshp_extremum, ishape, ifield_extr_valid, &
merge(1, 0, e%valid))
if (ieee_is_nan(e%max_speed)) then
call dbf_write_attribute_03(hshp_extremum, ishape, ifield_extr_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