From 034c2afc2069ebd8afcd74830cf90d00320267d3 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Mon, 25 Jul 2022 13:56:16 +0200
Subject: [PATCH] Move file `write_snapshot.f90` to Common

Because we are going to use it in `Inst_eddies` too.
---
 Common/CMakeLists.txt                        | 6 +++---
 {Overlap/Tests => Common}/write_snapshot.f90 | 0
 Overlap/Tests/CMakeLists.txt                 | 7 +++----
 3 files changed, 6 insertions(+), 7 deletions(-)
 rename {Overlap/Tests => Common}/write_snapshot.f90 (100%)

diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt
index bc88f17c..8a62bbf7 100644
--- a/Common/CMakeLists.txt
+++ b/Common/CMakeLists.txt
@@ -24,7 +24,7 @@ if(MPI_Fortran_HAVE_F08_MODULE)
     shpc_open.f90 shpc_close.f90)
   target_sources(test_read_snapshot PRIVATE derived_types.f90 shpc_create.f90
     read_snapshot.f90 write_eddy.f90 read_eddy.f90 read_field_indices.f90
-    shpc_open.f90 shpc_close.f90)
+    shpc_open.f90 shpc_close.f90 write_snapshot.f90)
   target_sources(test_spher_polygon_area PRIVATE spher_polyline_area.f90)
   target_sources(test_weight PRIVATE derived_types.f90)
   target_sources(test_read_eddy PRIVATE derived_types.f90 shpc_create.f90
@@ -32,10 +32,10 @@ if(MPI_Fortran_HAVE_F08_MODULE)
     shpc_close.f90)
   target_sources(test_send_recv PRIVATE read_field_indices.f90
     read_snapshot.f90 write_eddy.f90 shpc_create.f90 read_eddy.f90
-    derived_types.f90 shpc_open.f90 shpc_close.f90)
+    derived_types.f90 shpc_open.f90 shpc_close.f90 write_snapshot.f90)
   target_sources(test_get_dispatch_snap PRIVATE read_field_indices.f90
     read_snapshot.f90 shpc_create.f90 write_eddy.f90 read_eddy.f90
-    derived_types.f90 shpc_open.f90 shpc_close.f90)
+    derived_types.f90 shpc_open.f90 shpc_close.f90 write_snapshot.f90)
   target_sources(eddy_graph PRIVATE shpc_open.f90 shpc_close.f90
     read_field_indices.f90 read_snapshot.f90 spher_polyline_area.f90
     read_eddy.f90 write_eddy.f90 derived_types.f90)
diff --git a/Overlap/Tests/write_snapshot.f90 b/Common/write_snapshot.f90
similarity index 100%
rename from Overlap/Tests/write_snapshot.f90
rename to Common/write_snapshot.f90
diff --git a/Overlap/Tests/CMakeLists.txt b/Overlap/Tests/CMakeLists.txt
index eacbad86..5b8bd140 100644
--- a/Overlap/Tests/CMakeLists.txt
+++ b/Overlap/Tests/CMakeLists.txt
@@ -4,7 +4,7 @@ target_link_libraries(test_overlap Shapelib_03::shapelib_03 Geometry::geometry
   Contour_531::contour_531 gpc_f Jumble::jumble Numer_Rec_95::numer_rec_95)
 
 # test_read_snapshot
-add_executable(test_read_snapshot test_read_snapshot.f90 write_snapshot.f90)
+add_executable(test_read_snapshot test_read_snapshot.f90)
 target_link_libraries(test_read_snapshot NetCDF95::netcdf95
   Shapelib_03::shapelib_03 Contour_531::contour_531 gpc_f
   Jumble::jumble NetCDF_Fortran::netcdff Numer_Rec_95::numer_rec_95)
@@ -25,15 +25,14 @@ target_link_libraries(test_read_eddy Shapelib_03::shapelib_03
   Contour_531::contour_531 gpc_f Jumble::jumble)
 
 # test_send_recv
-add_executable(test_send_recv test_send_recv.f90 write_snapshot.f90)
+add_executable(test_send_recv test_send_recv.f90)
 target_link_libraries(test_send_recv PRIVATE MPI::MPI_Fortran
   Shapelib_03::shapelib_03 EZMPI::ezmpi Contour_531::contour_531 gpc_f
   NetCDF95::netcdf95 Jumble::jumble NetCDF_Fortran::netcdff
   Numer_Rec_95::numer_rec_95)
 
 # test_get_dispatch_snap
-add_executable(test_get_dispatch_snap test_get_dispatch_snap.f90
-  write_snapshot.f90)
+add_executable(test_get_dispatch_snap test_get_dispatch_snap.f90)
 target_link_libraries(test_get_dispatch_snap Shapelib_03::shapelib_03
   Jumble::jumble Contour_531::contour_531 EZMPI::ezmpi NetCDF95::netcdf95
   gpc_f NetCDF_Fortran::netcdff MPI::MPI_Fortran Numer_Rec_95::numer_rec_95)
-- 
GitLab