From 4cda5c88aea8e186eec66de9ebf3072eddd07a1d Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Tue, 25 May 2021 17:29:26 +0200
Subject: [PATCH] Polish

---
 Inst_eddies/Analysis/distribution_function.py      |  3 ++-
 Inst_eddies/Documentation_texfol/documentation.tex | 11 +++++------
 Overlap/Documentation_texfol/documentation.tex     | 13 +++++++++----
 Overlap/eddy_graph_in.sh                           |  3 +++
 Overlap/write_edge.f90                             | 10 +++++-----
 5 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/Inst_eddies/Analysis/distribution_function.py b/Inst_eddies/Analysis/distribution_function.py
index 4d528987..bb384fb7 100755
--- a/Inst_eddies/Analysis/distribution_function.py
+++ b/Inst_eddies/Analysis/distribution_function.py
@@ -129,7 +129,8 @@ def plot_all(dict_list, label = None):
     
 if __name__ == "__main__":
     import sys
-    
+
+    if len(sys.argv) != 2: sys.exit("Required argument: directory")
     d = read(sys.argv[1])
     plot_all([d])
     plt.show()
diff --git a/Inst_eddies/Documentation_texfol/documentation.tex b/Inst_eddies/Documentation_texfol/documentation.tex
index 01b521f9..e3090883 100644
--- a/Inst_eddies/Documentation_texfol/documentation.tex
+++ b/Inst_eddies/Documentation_texfol/documentation.tex
@@ -16,7 +16,7 @@
 
 \usepackage{hyperref}
 
-\hypersetup{pdftitle={Documentation}, pdfauthor={Lionel
+\hypersetup{pdftitle={Instantaneous eddies}, pdfauthor={Lionel
     Guez}, hypertexnames=false, pdfborderstyle={/S/U/W 1}}
 
 \usepackage{algorithm}
@@ -837,23 +837,22 @@ arguments.
 \section{Tests}
 
 Pour faire des tests : données au 1\ier{} janvier 2006. Tests sur
-différents domaines. Cf. figure (\ref{fig:regions}).
+différents domaines. Cf. figure (\ref{fig:regions}) et
+\verb+domains.ods+.
 \begin{figure}[htbp]
   \centering
   \includegraphics[width=\textwidth]{regions}
   \caption{Régions pour les tests.}
   \label{fig:regions}
 \end{figure}
-Régions 1, 2 et 3 : 29 $\times$ 17, 57 $\times$ 33; 120 $\times$ 120,
-contenant respectivement 8, 27 et 216 extremums.
 
 Pour la région 1, coin en :
 \begin{equation*}
   \lambda = \np{5.125}^\circ, \phi = -\np{36.375}^\circ
 \end{equation*}
 soit $(\np[rad]{0.0894}, - \np[rad]{0.6349})$. Indices base 1 du coin
-: 21, 215. Pas de grille : \np{0.25}°, soit \np[rad]{0.0044}. 5
-minimums et 3 maximums dans ce cadre. Cf. figure (\ref{fig:extrema}).
+: 21, 215. 5 minimums et 3 maximums dans ce cadre. Cf. figure
+(\ref{fig:extrema}).
 \begin{figure}[htbp]
   \centering
   \includegraphics[width=\textwidth]{extrema}
diff --git a/Overlap/Documentation_texfol/documentation.tex b/Overlap/Documentation_texfol/documentation.tex
index 9283f7d2..3ec05404 100644
--- a/Overlap/Documentation_texfol/documentation.tex
+++ b/Overlap/Documentation_texfol/documentation.tex
@@ -16,7 +16,7 @@
 
 \usepackage{hyperref}
 
-\hypersetup{pdftitle={Documentation}, pdfauthor={Lionel
+\hypersetup{pdftitle={Overlap}, pdfauthor={Lionel
     Guez}, hypertexnames=false, pdfborderstyle={/S/U/W 1}}
 
 \usepackage{algorithm}
@@ -166,9 +166,6 @@ Cf. discussion dans
   du programme de détection des tourbillons instantanés}, § \og Résumé
 du problème de géométrie algorithmique\fg{}.
 
-Compilation et exécution testées avec NAG Fortran Compiler Release
-6.2.
-
 Dans le programme de recouvrement, idée d'admettre des tourbillons
 dont les numéros à une date donnée n'iraient pas forcément de 1 au
 nombre de tourbillons visibles. L'intérêt serait de pouvoir traiter
@@ -950,4 +947,12 @@ intervenir les tourbillons interpolés le poids associé aux tourbillons
 visibles entre lesquels on interpole. Normalement, ce choix doit
 donner un poids plus faible à ces arcs.
 
+\section{Tests}
+
+Compilation et exécution testées avec NAG Fortran Compiler Release
+6.2.
+
+Révision ed60f10, ifort \verb+19.0+, sur ciclad, 1 processus MPI, test
+EGg. Temps d'exécution en mode debug : 34 s, en mode release : 9 s.
+
 \end{document}
diff --git a/Overlap/eddy_graph_in.sh b/Overlap/eddy_graph_in.sh
index 26298fc0..f3876bbf 100755
--- a/Overlap/eddy_graph_in.sh
+++ b/Overlap/eddy_graph_in.sh
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+# This program creates edgelists and interpolated eddies. You run it
+# only once and it processes both anticyclones and cyclones.
+
 # Note: no need to sort number_eddies.csv, already sorted by construction.
 
 if (($# != 2))
diff --git a/Overlap/write_edge.f90 b/Overlap/write_edge.f90
index 1093e25a..69538262 100644
--- a/Overlap/write_edge.f90
+++ b/Overlap/write_edge.f90
@@ -12,13 +12,13 @@ contains
     integer, intent(in):: k1, i1, k2, i2
     real, intent(in):: w
 
+    ! Local:
+    integer unit_edge
+
     !--------------------------------------------------------------------
 
-    if (cyclone) then
-       write(unit_edge_cyclo, fmt = *) k1, i1, k2, i2, w
-    else
-       write(unit_edge_anti, fmt = *) k1, i1, k2, i2, w
-    end if
+    unit_edge = merge(unit_edge_cyclo, unit_edge_anti, cyclone)
+    write(unit_edge, fmt = *) k1, i1, k2, i2, w
     
   end subroutine write_edge
 
-- 
GitLab