From 8fd7073ce42134548edea3acfb11f3a64b9f07fd Mon Sep 17 00:00:00 2001
From: Anthony <anthony.schrapffer@polytechnique.fr>
Date: Mon, 18 May 2020 23:25:37 +0200
Subject: [PATCH] Update experiments

---
 .../BuildHTUs_SAM.pbs}                        |  9 ++--
 .../BuildHTUs_IP.pbs => AmSud/Weight.pbs}     |  7 ++-
 tests/{Pantanal_n48 => AmSud}/run.def         |  8 ++--
 tests/EuroSW/BuildHTUs_EuroSW.pbs             | 48 +++++++++++++++++++
 tests/EuroSW/run.def                          | 26 ++++++++++
 tests/{Iberia_n48 => Iberia}/BuildHTUs_IP.pbs |  2 +-
 tests/{Iberia_n48 => Iberia}/run.def          |  0
 .../BuildHTUs_IP.pbs}                         | 21 ++++++--
 .../run.def                                   |  0
 tests/Pantanal_n48_regular/run.def            | 32 -------------
 10 files changed, 103 insertions(+), 50 deletions(-)
 rename tests/{Pantanal_n48/BuildHTUs_Pantanal.pbs => AmSud/BuildHTUs_SAM.pbs} (84%)
 rename tests/{Iberia_n48_regular/BuildHTUs_IP.pbs => AmSud/Weight.pbs} (84%)
 rename tests/{Pantanal_n48 => AmSud}/run.def (72%)
 create mode 100644 tests/EuroSW/BuildHTUs_EuroSW.pbs
 create mode 100644 tests/EuroSW/run.def
 rename tests/{Iberia_n48 => Iberia}/BuildHTUs_IP.pbs (95%)
 rename tests/{Iberia_n48 => Iberia}/run.def (100%)
 rename tests/{Pantanal_n48_regular/BuildHTUs_Pantanal.pbs => Iberia_regular/BuildHTUs_IP.pbs} (59%)
 rename tests/{Iberia_n48_regular => Iberia_regular}/run.def (100%)
 delete mode 100644 tests/Pantanal_n48_regular/run.def

diff --git a/tests/Pantanal_n48/BuildHTUs_Pantanal.pbs b/tests/AmSud/BuildHTUs_SAM.pbs
similarity index 84%
rename from tests/Pantanal_n48/BuildHTUs_Pantanal.pbs
rename to tests/AmSud/BuildHTUs_SAM.pbs
index 057d3a8..84185d4 100644
--- a/tests/Pantanal_n48/BuildHTUs_Pantanal.pbs
+++ b/tests/AmSud/BuildHTUs_SAM.pbs
@@ -3,10 +3,9 @@
 #PBS -N BuildHTUs_P
 #
 #PBS -j oe
-#PBS -l nodes=1:ppn=48
-#PBS -l walltime=128:00:00
-#PBS -l mem=180gb
-#PBS -l vmem=180gb
+#PBS -l nodes=1:ppn=64
+#PBS -l walltime=6:00:00
+#PBS -l vmem=240g,mem=200g
 #
 cd ${PBS_O_WORKDIR}
 export NSLOTS=$(($PBS_NUM_NODES*$PBS_NUM_PPN))
@@ -17,7 +16,7 @@ source ../../Environment
 #
 # Clean-up. Weights are kept for future runs.
 #
-/bin/rm -f DocumentationInterface *.nc *.txt
+/bin/rm -f DocumentationInterface *graph.nc *.txt check.out
 #
 # Run the Python code to generate the HTUs and write them into a netCDF file.
 #
diff --git a/tests/Iberia_n48_regular/BuildHTUs_IP.pbs b/tests/AmSud/Weight.pbs
similarity index 84%
rename from tests/Iberia_n48_regular/BuildHTUs_IP.pbs
rename to tests/AmSud/Weight.pbs
index 8885780..0bfe8a7 100644
--- a/tests/Iberia_n48_regular/BuildHTUs_IP.pbs
+++ b/tests/AmSud/Weight.pbs
@@ -1,10 +1,10 @@
 #!/bin/bash
 #
-#PBS -N BuildHTUs_IP
+#PBS -N Weights
 #
 #PBS -j oe
 #PBS -l nodes=1:ppn=64
-#PBS -l walltime=12:00:00
+#PBS -l walltime=128:00:00
 #PBS -l mem=240gb
 #PBS -l vmem=240gb
 #
@@ -20,9 +20,8 @@ source ../../Environment
 /bin/rm -f DocumentationInterface *graph.nc *.txt
 #
 # Run the Python code to generate the HTUs and write them into a netCDF file.
-# It will also generate the weights if needed.
 #
-mpirun -n ${NSLOTS} python ../../RoutingPreProc.py
+mpirun -n ${NSLOTS} python ../../WeightsOnly.py
 if [ $? -gt 0 ] ; then
     echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
     echo "X    Run on Iberian Peninsula failed    X"
diff --git a/tests/Pantanal_n48/run.def b/tests/AmSud/run.def
similarity index 72%
rename from tests/Pantanal_n48/run.def
rename to tests/AmSud/run.def
index e14dbab..16090c5 100644
--- a/tests/Pantanal_n48/run.def
+++ b/tests/AmSud/run.def
@@ -5,9 +5,9 @@
 EarthRadius = 6370000.
 #
 ModelGridFile = /bdd/MEDI/workspaces/polcher/WRF_Forcing/AmSud-A/geo_em.d01.nc
-WEST_EAST = -66.75, -52.25
-SOUTH_NORTH = -23.5, -13.5
-HydroFile = /homedata/aschrapffer/RoutingNc_AS/SouthAmerica_FP/routing.nc
+# WEST_EAST = -90.75, -30.25
+# SOUTH_NORTH = -55.25, 25.5
+HydroFile = /homedata/aschrapffer/routingnc/AmSud/routing.nc
 #
 # FORTRAN interface parameters
 #
@@ -23,7 +23,7 @@ numop = 100
 #
 # Output
 #
-GraphFile = AmSud_A_Pantanal_graph.nc
+GraphFile = AmSud_A_graph.nc
 #
 # Diagnostics
 # You need to provide an interval in longitude and Latitude.
diff --git a/tests/EuroSW/BuildHTUs_EuroSW.pbs b/tests/EuroSW/BuildHTUs_EuroSW.pbs
new file mode 100644
index 0000000..591f3ee
--- /dev/null
+++ b/tests/EuroSW/BuildHTUs_EuroSW.pbs
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+#PBS -N BuildHTUs_EuroSW
+#
+#PBS -j oe
+#PBS -l nodes=2:ppn=32
+#PBS -l walltime=12:00:00
+#PBS -l vmem=500g,mem=240g
+#
+cd ${PBS_O_WORKDIR}
+export NSLOTS=$(($PBS_NUM_NODES*$PBS_NUM_PPN))
+#
+# Set the right Python 3 Anaconda environment
+#
+source ../../Environment
+#
+# Clean-up. Weights are kept for future runs.
+#
+/bin/rm -f DocumentationInterface *.txt
+#
+# If weights file does not exist, then compute it quickly
+#
+if [ ! -e Weights.nc ] ; then
+    mpirun -n ${NSLOTS} python ../../WeightsOnly.py
+    if [ $? -gt 0 ] ; then
+	exit
+    else
+	echo "======================================="
+	echo "= Weight computed                     ="
+	ls -l Weights.nc
+	echo "======================================="	
+    fi
+fi
+#
+# Run the Python code to generate the HTUs and write them into a netCDF file.
+#
+mpirun -n ${NSLOTS} python ../../RoutingPreProc.py
+if [ $? -gt 0 ] ; then
+    echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+    echo "X    Run on EuroSW failed               X"
+    echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+else
+    echo "======================================="
+    echo "= Run on EuroSW successful            ="
+    echo "======================================="
+fi
+#
+ls -l
diff --git a/tests/EuroSW/run.def b/tests/EuroSW/run.def
new file mode 100644
index 0000000..f83c017
--- /dev/null
+++ b/tests/EuroSW/run.def
@@ -0,0 +1,26 @@
+[OverAll]
+#
+#
+#
+EarthRadius = 6370000.
+#
+ModelGridFile = /bdd/MEDI/workspaces/polcher/NewRouting/geo_EuroSW.nc
+HydroFile = /bdd/MEDI/workspaces/polcher/NewRouting/routing_MED.nc
+#
+# FORTRAN interface parameters
+#
+Documentation = true
+#
+# Configuration for the graph to be generated
+#
+nbasmax = 35
+#
+# Output
+#
+GraphFile = LC_Spain_test_graph.nc
+#
+# Diagnostics
+# You need to provide an interval in longitude and Latitude.
+#
+DiagLon = 3.9, 3.9
+DiagLat = 40.0, 40.0
diff --git a/tests/Iberia_n48/BuildHTUs_IP.pbs b/tests/Iberia/BuildHTUs_IP.pbs
similarity index 95%
rename from tests/Iberia_n48/BuildHTUs_IP.pbs
rename to tests/Iberia/BuildHTUs_IP.pbs
index 4744225..6fd4258 100644
--- a/tests/Iberia_n48/BuildHTUs_IP.pbs
+++ b/tests/Iberia/BuildHTUs_IP.pbs
@@ -17,7 +17,7 @@ source ../../Environment
 #
 # Clean-up. Weights are kept for future runs.
 #
-/bin/rm -f DocumentationInterface *graph.nc *.txt
+/bin/rm -f DocumentationInterface *graph.nc *.txt check.out
 #
 # If weights file does not exist, then compute it quickly
 #
diff --git a/tests/Iberia_n48/run.def b/tests/Iberia/run.def
similarity index 100%
rename from tests/Iberia_n48/run.def
rename to tests/Iberia/run.def
diff --git a/tests/Pantanal_n48_regular/BuildHTUs_Pantanal.pbs b/tests/Iberia_regular/BuildHTUs_IP.pbs
similarity index 59%
rename from tests/Pantanal_n48_regular/BuildHTUs_Pantanal.pbs
rename to tests/Iberia_regular/BuildHTUs_IP.pbs
index ae26af8..930284f 100644
--- a/tests/Pantanal_n48_regular/BuildHTUs_Pantanal.pbs
+++ b/tests/Iberia_regular/BuildHTUs_IP.pbs
@@ -1,10 +1,10 @@
 #!/bin/bash
 #
-#PBS -N BuildHTUs_P
+#PBS -N BuildHTUs_IP
 #
 #PBS -j oe
-#PBS -l nodes=1:ppn=48
-#PBS -l walltime=128:00:00
+#PBS -l nodes=1:ppn=64
+#PBS -l walltime=12:00:00
 #PBS -l mem=240gb
 #PBS -l vmem=240gb
 #
@@ -17,9 +17,22 @@ source ../../Environment
 #
 # Clean-up. Weights are kept for future runs.
 #
-/bin/rm -f DocumentationInterface *.nc *.txt
+/bin/rm -f DocumentationInterface *graph.nc *.txt check.out
+#
+if [ ! -e Weights.nc ] ; then
+    mpirun -n ${NSLOTS} python ../../WeightsOnly.py
+    if [ $? -gt 0 ] ; then
+        exit
+    else
+        echo "======================================="
+        echo "= Weight computed                     ="
+        ls -l Weights.nc
+        echo "======================================="  
+    fi
+fi
 #
 # Run the Python code to generate the HTUs and write them into a netCDF file.
+# It will also generate the weights if needed.
 #
 mpirun -n ${NSLOTS} python ../../RoutingPreProc.py
 if [ $? -gt 0 ] ; then
diff --git a/tests/Iberia_n48_regular/run.def b/tests/Iberia_regular/run.def
similarity index 100%
rename from tests/Iberia_n48_regular/run.def
rename to tests/Iberia_regular/run.def
diff --git a/tests/Pantanal_n48_regular/run.def b/tests/Pantanal_n48_regular/run.def
deleted file mode 100644
index 6b4d1d4..0000000
--- a/tests/Pantanal_n48_regular/run.def
+++ /dev/null
@@ -1,32 +0,0 @@
-[OverAll]
-#
-#
-#
-EarthRadius = 6370000.
-#
-ModelGridFile = /bdd/ORCHIDEE_Forcing/BC/OOL/OL2/WFDEI_CRU/WFDEI_CRU_1994.nc 
-WEST_EAST = -68.75, -53.25
-SOUTH_NORTH = -24.5, -14.25
-HydroFile = /homedata/aschrapffer/RoutingNc_AS/SouthAmerica_FP/routing.nc
-#
-# FORTRAN interface parameters
-#
-Documentation = true
-#
-# Configuration for the graph to be generated
-#
-nbasmax = 35
-#
-# Number of operation of simplification performed together
-#
-numop = 50
-#
-# Output
-#
-GraphFile = WFDEI_CRU_Pantanal_test_graph.nc
-#
-# Diagnostics
-# You need to provide an interval in longitude and Latitude.
-#
-DiagLon = 3.9, 3.9
-DiagLat = 40.0, 40.0
-- 
GitLab