From 6d2fa0c93b28d9ee609434cd3bd18dd3aa88716a Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Wed, 26 Apr 2023 15:06:17 +0200 Subject: [PATCH] Remove component radius4 and field radius4 Remove component radius4 of derived type eddy and field radius4 of `outermost_contour.dbf`. They are not used any longer. --- Common/derived_types.f90 | 7 +---- Common/read_field_indices.f90 | 4 --- Inst_eddies/Analysis/stat_SHPC.py | 39 ++----------------------- Inst_eddies/Tests/test_get_1_outerm.f90 | 1 - Inst_eddies/set_max_speed.f90 | 1 - Inst_eddies/shpc_create.f90 | 2 -- Inst_eddies/write_eddy.f90 | 2 -- Overlap/read_eddy.f90 | 8 ----- Overlap/recv_snapshot.f90 | 1 - Overlap/send_snapshot.f90 | 1 - test_write_null.f90 | 4 --- 11 files changed, 3 insertions(+), 67 deletions(-) diff --git a/Common/derived_types.f90 b/Common/derived_types.f90 index 33a22831..f8edfa46 100644 --- a/Common/derived_types.f90 +++ b/Common/derived_types.f90 @@ -44,11 +44,6 @@ module derived_types integer:: delta_out = huge(0) ! Minimum difference in time subscript where there is a direct ! successor. Huge means there is no direct succcessor. - - integer radius4 - ! extr%coord_proj + radius4 - 1 in all four directions is inside outermost - ! contour, extr%coord_proj + radius4 is outside. - ! radius4 /= 0 .eqv. out_cont%closed end type eddy type snapshot @@ -86,7 +81,7 @@ module derived_types ! Field identifiers in the DBF files: integer extr_ssh, extr_date, extr_eddy_index, extr_speed integer extr_proj_date, extr_proj_eddy_index - integer out_r_eq_area, out_ssh, out_date, out_eddy_index, out_radius4 + integer out_r_eq_area, out_ssh, out_date, out_eddy_index integer max_speed_r_eq_area, max_speed_ssh, max_speed_date, & max_speed_eddy_index diff --git a/Common/read_field_indices.f90 b/Common/read_field_indices.f90 index 5ed90cdd..bfdd8238 100644 --- a/Common/read_field_indices.f90 +++ b/Common/read_field_indices.f90 @@ -34,10 +34,6 @@ contains call dbf_get_field_index_03(hshp%outermost, "date", hshp%out_date) call dbf_get_field_index_03(hshp%outermost, "eddy_index", & hshp%out_eddy_index) - - ! We allow the field radius4 to be missing: - hshp%out_radius4 = dbfgetfieldindex(hshp%outermost, "radius4") - call dbf_get_field_index_03(hshp%max_speed, "r_eq_area", & hshp%max_speed_r_eq_area) call dbf_get_field_index_03(hshp%max_speed, "ssh", hshp%max_speed_ssh) diff --git a/Inst_eddies/Analysis/stat_SHPC.py b/Inst_eddies/Analysis/stat_SHPC.py index d42e010d..090d9461 100755 --- a/Inst_eddies/Analysis/stat_SHPC.py +++ b/Inst_eddies/Analysis/stat_SHPC.py @@ -20,12 +20,7 @@ with shapefile.Reader(path.join(args.SHPC, "Slice_0", args.orientation, "outermost_contour")) as outermost_contour: n_extr = len(extremum) field_names_outer = [f[0] for f in outermost_contour.fields[1:]] - with_radius_4 = 'radius4' in field_names_outer - if with_radius_4: - n_radius4 = np.zeros(3, dtype = int) - n_missing_speed = np.zeros(3, dtype = int) - for rec_extr, shape_rec_outer in zip(extremum.iterRecords(), outermost_contour): l = len(shape_rec_outer.shape.points) @@ -33,32 +28,11 @@ with shapefile.Reader(path.join(args.SHPC, "Slice_0", args.orientation, if shape_rec_outer.record.r_eq_area >= 0: n_outer += 1 - if with_radius_4: - if shape_rec_outer.record.radius4 == 0: - n_radius4[0] += 1 - elif shape_rec_outer.record.radius4 == 1: - n_radius4[1] += 1 - elif shape_rec_outer.record.radius4 >= 2: - n_radius4[2] += 1 - - if rec_extr.speed == 1e4 and with_radius_4: - if shape_rec_outer.record.radius4 == 0: - n_missing_speed[0] += 1 - elif shape_rec_outer.record.radius4 == 1: - n_missing_speed[1] += 1 - elif shape_rec_outer.record.radius4 >= 2: - n_missing_speed[2] += 1 - else: + if rec_extr.speed != 1e4: n_valid_speed += 1 print("number of extrema of SSH:", n_extr, "\n") -if with_radius_4: - print("number of extrema with radius4 == 0 (no outermost contour or " - "insufficient area):", n_radius4[0]) - print("number of extrema with radius4 == 1:", n_radius4[1]) - print("number of extrema with radius4 >= 2:", n_radius4[2], "\n") - print("number of outermost contours (outermost contour found, but may be with " "sufficient area or not):", n_outer) @@ -66,15 +40,6 @@ print("average number of points of outermost contour per extremum:", n_points / n_extr, "\n") print("number of valid speed values:", n_valid_speed) -if with_radius_4: - print("number of missing speed values with radius4 == 0:", - n_missing_speed[0]) - print("number of missing speed values with radius4 == 1:", - n_missing_speed[1]) - print("number of missing speed values with radius4 >= 2 (non null shape in " - "max_speed_contour and missing speed in extremum.dbf):", - n_missing_speed[2], "\n") - n_max_speed = 0 n_points_valid = 0 n_points = 0 @@ -90,7 +55,7 @@ with shapefile.Reader(path.join(args.SHPC, "Slice_0", args.orientation, n_points_valid += l print("number of non-null maximum-speed contours (distinct from the " - "outermost contour, implies radius4 >= 2):", + "outermost contour):", n_max_speed) if n_max_speed != 0: diff --git a/Inst_eddies/Tests/test_get_1_outerm.f90 b/Inst_eddies/Tests/test_get_1_outerm.f90 index 70c64be8..748d3282 100644 --- a/Inst_eddies/Tests/test_get_1_outerm.f90 +++ b/Inst_eddies/Tests/test_get_1_outerm.f90 @@ -90,7 +90,6 @@ program test_get_1_outerm e%cyclone = cyclone e%speed_cont = null_ssh_contour() e%max_speed = missing_speed - e%radius4 = - 1 call shpc_create(hshp, shpc_dir = "SHPC", cyclone = cyclone, slice = 0, & grid_lon_lat = grid_lon_lat) call write_eddy(e, hshp, date, i = 1) diff --git a/Inst_eddies/set_max_speed.f90 b/Inst_eddies/set_max_speed.f90 index 51eaec69..b10be2e4 100644 --- a/Inst_eddies/set_max_speed.f90 +++ b/Inst_eddies/set_max_speed.f90 @@ -64,7 +64,6 @@ contains !--------------------------------------------------------------- n_cont = size(cont_list) - e%radius4 = - 1 do i = 1, n_cont speed(i) = mean_speed(u, v, cont_list(i)%polyline, e%extr%coord, & diff --git a/Inst_eddies/shpc_create.f90 b/Inst_eddies/shpc_create.f90 index 1f17a973..49062cc0 100644 --- a/Inst_eddies/shpc_create.f90 +++ b/Inst_eddies/shpc_create.f90 @@ -56,8 +56,6 @@ contains ftinteger, nwidth = 5, ndecimals = 0) call dbf_add_field_03(hshp%out_eddy_index, hshp%outermost, 'eddy_index', & ftinteger, nwidth = 5, ndecimals = 0) - call dbf_add_field_03(hshp%out_radius4, hshp%outermost, 'radius4', & - ftinteger, nwidth = 2, ndecimals = 0) ! max_speed_contour shapefile: call shp_create_03(hshp%dir // "/max_speed_contour", shpt_polygon, & diff --git a/Inst_eddies/write_eddy.f90 b/Inst_eddies/write_eddy.f90 index 168660be..cd00840c 100644 --- a/Inst_eddies/write_eddy.f90 +++ b/Inst_eddies/write_eddy.f90 @@ -85,8 +85,6 @@ contains call dbf_write_attribute_03(hshpc%outermost, ishape, hshpc%out_date, date) call dbf_write_attribute_03(hshpc%outermost, ishape, hshpc%out_eddy_index, & i) - call dbf_write_attribute_03(hshpc%outermost, ishape, hshpc%out_radius4, & - e%radius4) ! max_speed_contour.dbf: if (e%speed_cont%area >= 0) then diff --git a/Overlap/read_eddy.f90 b/Overlap/read_eddy.f90 index d988bd2c..37e0741e 100644 --- a/Overlap/read_eddy.f90 +++ b/Overlap/read_eddy.f90 @@ -69,14 +69,6 @@ contains call dbf_read_attribute_03(e%out_cont%ssh, hshp%outermost, hshp%out_ssh, & ishape) - - if (hshp%out_radius4 /= - 1) then - call dbf_read_attribute_03(e%radius4, hshp%outermost, hshp%out_radius4, & - ishape) - else - e%radius4 = - 1 - end if - call shp_read_object_03(hshp%outermost, ishape, psobject) p = shpobj2pol(psobject) call shpdestroyobject(psobject) diff --git a/Overlap/recv_snapshot.f90 b/Overlap/recv_snapshot.f90 index 9490eb95..b50dd44f 100644 --- a/Overlap/recv_snapshot.f90 +++ b/Overlap/recv_snapshot.f90 @@ -37,7 +37,6 @@ contains call ezmpi_recv(s%list(i)%max_speed, source, tag) call ezmpi_recv(s%list(i)%delta_in, source, tag) call ezmpi_recv(s%list(i)%delta_out, source, tag) - call ezmpi_recv(s%list(i)%radius4, source, tag) end do allocate(s%extr_map(1 - copy:nlon + copy, nlat)) diff --git a/Overlap/send_snapshot.f90 b/Overlap/send_snapshot.f90 index a2e3c04d..708a6b45 100644 --- a/Overlap/send_snapshot.f90 +++ b/Overlap/send_snapshot.f90 @@ -34,7 +34,6 @@ contains call ezmpi_send(s%list(i)%max_speed, dest, tag) call ezmpi_send(s%list(i)%delta_in, dest, tag) call ezmpi_send(s%list(i)%delta_out, dest, tag) - call ezmpi_send(s%list(i)%radius4, dest, tag) end do call ezmpi_send(s%extr_map, dest, tag) diff --git a/test_write_null.f90 b/test_write_null.f90 index cc31e482..5d5ec424 100644 --- a/test_write_null.f90 +++ b/test_write_null.f90 @@ -47,8 +47,6 @@ program test_write_null call dbf_write_attribute_03(hshpc%outermost, ishape, hshpc%out_date, 0) call dbf_write_attribute_03(hshpc%outermost, ishape, & hshpc%out_eddy_index, i) - call dbf_write_attribute_03(hshpc%outermost, ishape, & - hshpc%out_radius4, 0) call dbf_write_attribute_03(hshpc%max_speed, ishape, & hshpc%max_speed_r_eq_area, - 100.) call dbf_write_attribute_03(hshpc%max_speed, ishape, & @@ -79,8 +77,6 @@ program test_write_null call dbf_write_attribute_03(hshpc%outermost, ishape, hshpc%out_date, 0) call dbf_write_attribute_03(hshpc%outermost, ishape, & hshpc%out_eddy_index, i) - call dbf_write_attribute_03(hshpc%outermost, ishape, & - hshpc%out_radius4, 0) end do do i = 1, n_eddies -- GitLab