From bce9ff0a654536deeee0422e776d9dfeeb5ec1ac Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Wed, 20 Dec 2017 17:34:59 +0100
Subject: [PATCH] Rename set_outermost_contour to get_1_outerm.

---
 GNUmakefile                                   | 10 +++----
 ...set_outermost_contour.f => get_1_outerm.f} | 10 +++----
 Sources/set_all_outerm.f                      | 12 +++++----
 ...utermost_contour.f => test_get_1_outerm.f} | 12 ++++-----
 Tests/test_set_max_speed.f                    |  4 +--
 Tests/tests.json                              | 26 +++++++++----------
 depend.mk                                     |  6 ++---
 file_list                                     |  4 +--
 8 files changed, 43 insertions(+), 41 deletions(-)
 rename Sources/{set_outermost_contour.f => get_1_outerm.f} (93%)
 rename Tests/{test_set_outermost_contour.f => test_get_1_outerm.f} (89%)

diff --git a/GNUmakefile b/GNUmakefile
index 7187b068..c7b8e2ce 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -7,11 +7,11 @@ VPATH = ${makefile_dir}/Sources ${makefile_dir}/Tests
 
 src_test_local_extrema = test_local_extrema.f local_extrema.f
 
-src_test_set_outermost_contour = good_contour.f test_set_outermost_contour.f derived_types.f set_outermost_contour.f outermost_possible_level.f spherical_polygon_area.f
+src_test_get_1_outerm = good_contour.f test_get_1_outerm.f derived_types.f get_1_outerm.f outermost_possible_level.f spherical_polygon_area.f
 
 src_test_set_max_speed = test_set_max_speed.f derived_types.f set_max_speed.f good_contour.f max_speed_contour_ssh.f mean_speed.f spherical_polygon_area.f inside_4.f
 
-src_test_get_snapshot = test_get_snapshot.f get_snapshot.f dispatch_snapshot.f write_eddy.f send_snapshot.f receive_snapshot.f local_extrema.f set_max_speed.f outermost_possible_level.f set_outermost_contour.f max_speed_contour_ssh.f good_contour.f spherical_polygon_area.f mean_speed.f inside_4.f set_all_outerm.f
+src_test_get_snapshot = test_get_snapshot.f get_snapshot.f dispatch_snapshot.f write_eddy.f send_snapshot.f receive_snapshot.f local_extrema.f set_max_speed.f outermost_possible_level.f get_1_outerm.f max_speed_contour_ssh.f good_contour.f spherical_polygon_area.f mean_speed.f inside_4.f set_all_outerm.f
 
 sources := $(shell cat ${makefile_dir}/file_list)
 
@@ -20,12 +20,12 @@ lib_list = contour_531 numer_rec_95 shapelib_03 netcdf95 geometry jumble netcdff
 # 2. Objects and executable files
 
 obj_test_local_extrema := $(src_test_local_extrema:.f=.o)
-obj_test_set_outermost_contour := $(src_test_set_outermost_contour:.f=.o)
+obj_test_get_1_outerm := $(src_test_get_1_outerm:.f=.o)
 obj_test_set_max_speed := $(src_test_set_max_speed:.f=.o)
 obj_test_get_snapshot := $(src_test_get_snapshot:.f=.o)
 objects := $(sources:.f=.o)
 
-execut = test_good_contour test_inside_4 test_set_outermost_contour test_local_extrema test_max_speed_contour_ssh test_mean_speed test_set_max_speed test_get_snapshot
+execut = test_good_contour test_inside_4 test_get_1_outerm test_local_extrema test_max_speed_contour_ssh test_mean_speed test_set_max_speed test_get_snapshot
 
 # 3. Compiler-dependent part
 
@@ -39,7 +39,7 @@ LINK.o = $(FC) $(LDFLAGS) $(TARGET_ARCH)
 .DELETE_ON_ERROR:
 .PHONY: all clean clobber depend
 all: ${execut} log
-test_set_outermost_contour: ${obj_test_set_outermost_contour}
+test_get_1_outerm: ${obj_test_get_1_outerm}
 test_set_max_speed: ${obj_test_set_max_speed}
 test_max_speed_contour_ssh: max_speed_contour_ssh.o
 test_good_contour: good_contour.o
diff --git a/Sources/set_outermost_contour.f b/Sources/get_1_outerm.f
similarity index 93%
rename from Sources/set_outermost_contour.f
rename to Sources/get_1_outerm.f
index d70ead89..a4e163d4 100644
--- a/Sources/set_outermost_contour.f
+++ b/Sources/get_1_outerm.f
@@ -1,10 +1,10 @@
-module set_outermost_contour_m
+module get_1_outerm_m
 
   implicit none
 
 contains
 
-  subroutine set_outermost_contour(e, ind_targ_extr, innermost_level, &
+  subroutine get_1_outerm(e, ind_targ_extr, innermost_level, &
        extr_map, ssh, corner, step)
 
     ! Defines e%outermost_contour. Method: dichotomy on level of ssh.
@@ -64,7 +64,7 @@ contains
        level_try = merge(maxval(ssh), minval(ssh), e%cyclone)
        call assert((level_try - e%ssh_extremum) &
             / (level_good - e%ssh_extremum) > 1., &
-            "set_outermost_contour level_try")
+            "get_1_outerm level_try")
        tentative_contour = good_contour(corner, step, ssh, level_try, &
             e%coord_extr, nearby_extr)
 
@@ -97,6 +97,6 @@ contains
             = spherical_polygon_area(e%outermost_contour%polyline)
     end if
 
-  end subroutine set_outermost_contour
+  end subroutine get_1_outerm
 
-end module set_outermost_contour_m
+end module get_1_outerm_m
diff --git a/Sources/set_all_outerm.f b/Sources/set_all_outerm.f
index 61d5c37c..e9836604 100644
--- a/Sources/set_all_outerm.f
+++ b/Sources/set_all_outerm.f
@@ -7,8 +7,10 @@ contains
   subroutine set_all_outerm(s, min_amp, max_radius, corner, step, &
        innermost_level, ssh)
 
+    ! Set all outermost contours.
+
     use derived_types, only: snapshot
-    use set_outermost_contour_m, only: set_outermost_contour
+    use get_1_outerm_m, only: get_1_outerm
 
     type(snapshot), intent(inout):: s
     
@@ -75,7 +77,7 @@ contains
 
     do i = 1, s%number_vis_eddies
        if (flat_extr(i)) then
-          call set_outermost_contour(s%list_vis(i), ind_targ_extr(:, i), &
+          call get_1_outerm(s%list_vis(i), ind_targ_extr(:, i), &
                innermost_level(i), &
                s%extr_map(llc(1, i):urc(1, i), llc(2, i):urc(2, i)), &
                ssh(llc(1, i):urc(1, i), llc(2, i):urc(2, i)), &
@@ -92,7 +94,7 @@ contains
 
     ! We must modify s%extr_map in this loop, separate from the
     ! previous loop, so we do not influence the batch of
-    ! set_outermost_contour.
+    ! get_1_outerm.
     do i = 1, s%number_vis_eddies
        if (flat_extr(i) .and. .not. s%list_vis(i)%suff_amp) &
             s%extr_map(s%ind_extr(1, i), s%ind_extr(2, i)) &
@@ -113,7 +115,7 @@ contains
     do i = 1, s%number_vis_eddies
        if (s%list_vis(i)%suff_amp .and. noise_around(i) &
             .or. .not. flat_extr(i)) then
-          call set_outermost_contour(s%list_vis(i), ind_targ_extr(:, i), &
+          call get_1_outerm(s%list_vis(i), ind_targ_extr(:, i), &
                innermost_level(i), &
                s%extr_map(llc(1, i):urc(1, i), llc(2, i):urc(2, i)), &
                ssh(llc(1, i):urc(1, i), llc(2, i):urc(2, i)), &
@@ -125,7 +127,7 @@ contains
 
     ! We must modify s%extr_map in this loop, separate from the
     ! previous loop, so we do not influence the batch of
-    ! set_outermost_contour.
+    ! get_1_outerm.
     do i = 1, s%number_vis_eddies
        if (.not. flat_extr(i) .and. .not. s%list_vis(i)%suff_amp) &
             s%extr_map(s%ind_extr(1, i), s%ind_extr(2, i)) &
diff --git a/Tests/test_set_outermost_contour.f b/Tests/test_get_1_outerm.f
similarity index 89%
rename from Tests/test_set_outermost_contour.f
rename to Tests/test_get_1_outerm.f
index 9995a584..08ba1113 100644
--- a/Tests/test_set_outermost_contour.f
+++ b/Tests/test_get_1_outerm.f
@@ -1,4 +1,4 @@
-program test_set_outermost_contour
+program test_get_1_outerm
 
   use, intrinsic:: ISO_FORTRAN_ENV
 
@@ -7,7 +7,7 @@ program test_set_outermost_contour
   use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf95_get_var, &
        nf95_gw_var
   use nr_util, only: pi
-  use set_outermost_contour_m, only: set_outermost_contour
+  use get_1_outerm_m, only: get_1_outerm
   use shapelib, only: shpt_polygon, shpfileobject, ftdouble, shpclose
   use shapelib_03, only: shp_create_03, dbf_add_field_03, &
        shp_append_simple_object_03, dbf_write_attribute_03
@@ -73,14 +73,14 @@ program test_set_outermost_contour
   e%coord_extr = [longitude(1), latitude(1)] + (ind_targ_extr - 1) * step
   e%cyclone = cyclone
   e%ssh_extremum = ssh_extremum
-  call set_outermost_contour(e, ind_targ_extr, innermost_level, extr_map, &
+  call get_1_outerm(e, ind_targ_extr, innermost_level, extr_map, &
        ssh, corner = [longitude(1), latitude(1)], step = step)
 
   if (e%outermost_contour%closed) then
      print *, "Radius of disk of equal area: ", &
           sqrt(e%outermost_contour%area / pi) / 1e3, "km"
 
-     call shp_create_03("test_set_outermost_contour", shpt_polygon, shphandle)
+     call shp_create_03("test_get_1_outerm", shpt_polygon, shphandle)
      call dbf_add_field_03(field_number, shphandle, 'level', ftdouble, &
           nwidth = 13, ndecimals = 6)
      call shp_append_simple_object_03(shape_number, shphandle, shpt_polygon, &
@@ -88,9 +88,9 @@ program test_set_outermost_contour
      call dbf_write_attribute_03(shphandle, shape_number, ifield = 0, &
           fieldvalue = e%outermost_contour%ssh)
      CALL shpclose(shphandle)
-     print *, 'Created shapefile "test_set_outermost_contour".'
+     print *, 'Created shapefile "test_get_1_outerm".'
   else
      print *, "Could not find an outermost contour."
   end if
 
-end program test_set_outermost_contour
+end program test_get_1_outerm
diff --git a/Tests/test_set_max_speed.f b/Tests/test_set_max_speed.f
index d2e21781..0d58ea24 100644
--- a/Tests/test_set_max_speed.f
+++ b/Tests/test_set_max_speed.f
@@ -78,8 +78,8 @@ program test_set_max_speed
 
   call nf95_close(ncid)
 
-  print *, "Reading from shapefile test_set_outermost_contour..."
-  call shp_open_03("test_set_outermost_contour", "rb", hshp)
+  print *, "Reading from shapefile test_get_1_outerm..."
+  call shp_open_03("test_get_1_outerm", "rb", hshp)
   call shp_read_object_03(hshp, 0, psobject)
   call dbfreadattribute(hshp, 0, 0, outermost_contour_ssh)
   CALL shpclose(hshp)
diff --git a/Tests/tests.json b/Tests/tests.json
index 3adf4fde..fdab93ef 100644
--- a/Tests/tests.json
+++ b/Tests/tests.json
@@ -33,24 +33,24 @@
 	"title" : "Local_extrema_larger"
     },
     {
-	"args" : "$compil_prod_dir/test_set_outermost_contour",
+	"args" : "$compil_prod_dir/test_get_1_outerm",
 	"required": [["$input_dir/h_test_region.nc", "h.nc"],
 		     ["$tests_old_dir/Local_extrema/test_local_extrema.nc", "extr_map.nc"]],
-	"title" : "Set_outermost_contour",
+	"title" : "Get_1_outerm",
 	"input" : "&main_nml /\n"
     },
     {
-	"args" : "$compil_prod_dir/test_set_outermost_contour",
+	"args" : "$compil_prod_dir/test_get_1_outerm",
 	"required": [["$input_dir/h_test_region.nc", "h.nc"],
 		     ["$input_dir/extr_map_negative_2_8.nc", "extr_map.nc"]],
-	"title" : "Set_outermost_contour_noise_2_8",
+	"title" : "Get_1_outerm_noise_2_8",
 	"input" : "&main_nml /\n"
     },
     {
-	"args" : "$compil_prod_dir/test_set_outermost_contour",
+	"args" : "$compil_prod_dir/test_get_1_outerm",
 	"required": [["$input_dir/h_test_region.nc", "h.nc"],
 		     ["$input_dir/extr_map_negative_2.nc", "extr_map.nc"]],
-	"title" : "Set_outermost_contour_noise_2",
+	"title" : "Get_1_outerm_noise_2",
 	"input" : "&main_nml /\n"
     },
     {
@@ -68,7 +68,7 @@
     {
 	"args" : ["$compil_prod_dir/test_mean_speed",
 		  "$input_dir/uv_test_region.nc",
-		  "$tests_old_dir/Set_outermost_contour/test_set_outermost_contour"],
+		  "$tests_old_dir/Get_1_outerm/test_get_1_outerm"],
 	"title" : "Mean_speed",
 	"input" : "&main_nml /\n"
     },
@@ -85,9 +85,9 @@
 	"required": [["$input_dir/h_outermost.nc", "h.nc"],
 		     ["$input_dir/uv_outermost.nc", "uv.nc"],
 		     ["$input_dir/extr_map_outermost.nc", "extr_map.nc"],
-		     "$tests_old_dir/Set_outermost_contour/test_set_outermost_contour.shp",
-		     "$tests_old_dir/Set_outermost_contour/test_set_outermost_contour.shx",
-		     "$tests_old_dir/Set_outermost_contour/test_set_outermost_contour.dbf"],
+		     "$tests_old_dir/Get_1_outerm/test_get_1_outerm.shp",
+		     "$tests_old_dir/Get_1_outerm/test_get_1_outerm.shx",
+		     "$tests_old_dir/Get_1_outerm/test_get_1_outerm.dbf"],
 	"input" : "&main_nml /\n"
     },
     {
@@ -96,9 +96,9 @@
 	"required": [["$input_dir/h_test_region.nc", "h.nc"],
 		     ["$input_dir/uv_test_region.nc", "uv.nc"],
 		     ["$input_dir/extr_map_negative_2_8.nc", "extr_map.nc"],
-		     "$tests_old_dir/Set_outermost_contour_noise_2_8/test_set_outermost_contour.shp",
-		     "$tests_old_dir/Set_outermost_contour_noise_2_8/test_set_outermost_contour.shx",
-		     "$tests_old_dir/Set_outermost_contour_noise_2_8/test_set_outermost_contour.dbf"],
+		     "$tests_old_dir/Get_1_outerm_noise_2_8/test_get_1_outerm.shp",
+		     "$tests_old_dir/Get_1_outerm_noise_2_8/test_get_1_outerm.shx",
+		     "$tests_old_dir/Get_1_outerm_noise_2_8/test_get_1_outerm.dbf"],
 	"input": "&MAIN_NML IND_TARG_EXTR=19,11 /\n"
     },
     {
diff --git a/depend.mk b/depend.mk
index 9433baa3..36c32cb8 100644
--- a/depend.mk
+++ b/depend.mk
@@ -2,9 +2,9 @@ dispatch_snapshot.o : write_eddy.o send_snapshot.o derived_types.o
 get_snapshot.o : set_all_outerm.o set_max_speed.o receive_snapshot.o local_extrema.o derived_types.o 
 receive_snapshot.o : derived_types.o 
 send_snapshot.o : derived_types.o 
-set_all_outerm.o : set_outermost_contour.o derived_types.o 
+set_all_outerm.o : get_1_outerm.o derived_types.o 
 set_max_speed.o : spherical_polygon_area.o mean_speed.o max_speed_contour_ssh.o inside_4.o good_contour.o derived_types.o 
-set_outermost_contour.o : spherical_polygon_area.o outermost_possible_level.o good_contour.o derived_types.o 
+get_1_outerm.o : spherical_polygon_area.o outermost_possible_level.o good_contour.o derived_types.o 
 test_get_snapshot.o : get_snapshot.o dispatch_snapshot.o derived_types.o 
 test_good_contour.o : good_contour.o 
 test_inside_4.o : inside_4.o 
@@ -12,5 +12,5 @@ test_local_extrema.o : local_extrema.o
 test_max_speed_contour_ssh.o : max_speed_contour_ssh.o 
 test_mean_speed.o : mean_speed.o 
 test_set_max_speed.o : set_max_speed.o derived_types.o 
-test_set_outermost_contour.o : set_outermost_contour.o derived_types.o 
+test_get_1_outerm.o : get_1_outerm.o derived_types.o 
 write_eddy.o : derived_types.o 
diff --git a/file_list b/file_list
index a441a372..d7ad655a 100644
--- a/file_list
+++ b/file_list
@@ -11,7 +11,7 @@ receive_snapshot.f
 send_snapshot.f
 set_all_outerm.f
 set_max_speed.f
-set_outermost_contour.f
+get_1_outerm.f
 spherical_polygon_area.f
 test_get_snapshot.f
 test_good_contour.f
@@ -20,5 +20,5 @@ test_local_extrema.f
 test_max_speed_contour_ssh.f
 test_mean_speed.f
 test_set_max_speed.f
-test_set_outermost_contour.f
+test_get_1_outerm.f
 write_eddy.f
-- 
GitLab