Commit 8748d90e authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Some small corrections and improved the test for Mallorca

parent 8e7b5a10
......@@ -77,7 +77,7 @@ class HydroGrid :
DEBUG("# Range Lon :"+str(np.min(self.lon))+" -- "+str(np.max(self.lon)))
DEBUG("# Range Lat :"+str(np.min(self.lat))+" -- "+str(np.max(self.lat)))
#
if not os.path.exists(wfile):
if wfile is None or not os.path.exists(wfile):
self.polyll, self.polylist, self.centers, self.radius, self.index = corners(self.lon, self.lat)
def select(self, c, r) :
......
......@@ -18,7 +18,7 @@ import time
import configparser
config=configparser.ConfigParser()
config.read("run.def")
saveweights=config.get("OverAll", "SaveWeights", fallback="true")
saveweights=config.get("OverAll", "WeightFile", fallback=None)
EarthRadius=config.getfloat("OverAll", "EarthRadius", fallback=6370000.0)
#
# Logging in MPI : https://groups.google.com/forum/#!topic/mpi4py/SaNzc8bdj6U
......@@ -75,7 +75,7 @@ def maxradius(cent, lon, lat) :
radius=[]
for lx, ly in zip(lon, lat) :
radius.append(np.sqrt((cent[0]-lx)**2+(cent[1]-ly)**2))
return max(radius)
return np.max(np.array(radius))
#
# Simple routine to dump a field into a file.
#
......@@ -138,7 +138,7 @@ class compweights :
#
# Only compute the weights if the file does not exist.
#
if not os.path.exists(wfile) :
if wfile is None or not os.path.exists(wfile) :
INFO("Computing weights")
nbpts = len(modelgrid.centers)
i = 0
......@@ -195,9 +195,9 @@ class compweights :
INFO(str(part.rank)+" Area Overlap error : "+str(min(overlaperr))+"-"+str(max(overlaperr))+\
" Nb of Hydro grid overlaping : "+str(min(self.hpts))+"-"+str(max(self.hpts)) )
#
self.dumpweights(wfile, part, modelgrid, hydrogrid)
if wfile is not None :
self.dumpweights(wfile, part, modelgrid, hydrogrid)
#
##self.printtest([15,19], part, modelgrid)
#
else :
#
......
......@@ -21,7 +21,7 @@ nbasmax=config.getint("OverAll", "nbasmax")
numop=config.getint("OverAll", "numop", fallback=100)
OutGraphFile=config.get("OverAll","GraphFile")
DumpHydroSuper=config.getboolean("OverAll","DumpHydroSuper",fallback=False)
wfile=config.get("OverAll","WeightFile",fallback="Weights.nc")
wfile=config.get("OverAll","WeightFile",fallback=None)
#
import ModelGrid as MG
import Partition as PA
......
......@@ -3,7 +3,7 @@
#PBS -N BuildHTUs_Mallorca
#
#PBS -j oe
#PBS -l nodes=1:ppn=2
#PBS -l nodes=1:ppn=32
#PBS -l walltime=4:00:00
#PBS -l mem=80gb
#PBS -l vmem=80gb
......@@ -17,42 +17,38 @@ source ../../Environment
#
# Clean-up
#
/bin/rm -f DocumentationInterface *.nc *.txt
/bin/rm -f DocumentationInterface *.txt
#
# Force RoutingPreProc to recompute the weights.
#
/bin/rm -rf Weights
#
# 1 Proc
# 2 Proc
#
mpirun -n 1 python ../../RoutingPreProc.py
/bin/rm -f run.def
cp run_MEDCORDEX.def run.def
mpirun -n 2 python ../../RoutingPreProc.py
if [ $? -gt 0 ] ; then
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "X Run on 1 Proc failed X"
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
exit
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "X Run MECORDEX on 2 Proc failed X"
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
else
echo "============================"
echo "= Run on 1 Proc successful ="
echo "============================"
mv MEDCORDEX_test_graph.nc MEDCORDEX_test_graph_n1.nc
mv MEDCORDEX_test_graph_HydroSuper.nc MEDCORDEX_test_graph_HydroSuper_n1.nc
echo "======================================"
echo "= Run MEDCORDEX on 2 Proc successful ="
echo "======================================"
ls -lt
fi
#
# More points on 32 proc
#
# 2 Proc
#
mpirun -n 2 python ../../RoutingPreProc.py
/bin/rm -f run.def
cp run_EuroSW.def run.def
mpirun -n 32 python ../../RoutingPreProc.py
if [ $? -gt 0 ] ; then
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "X Run on 2 Proc failed X"
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "X Run EuroSW on 32 Proc failed X"
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
else
echo "============================"
echo "= Run on 2 Proc successful ="
echo "============================"
mv MEDCORDEX_test_graph.nc MEDCORDEX_test_graph_n2.nc
mv MEDCORDEX_test_graph_HydroSuper.nc MEDCORDEX_test_graph_HydroSuper_n2.nc
echo "===================================="
echo "= Run EuroSW on 32 Proc successful ="
echo "===================================="
ls -lt
fi
ls -l
[OverAll]
#
#
#
EarthRadius = 6370000.
#
ModelGridFile = /bdd/MEDI/workspaces/polcher/NewRouting/geo_EuroSW.nc
HydroFile = /bdd/MEDI/workspaces/polcher/NewRouting/routing_MED.nc
# Mallorca
WEST_EAST = 2.2, 3.6
SOUTH_NORTH = 39.20, 40.10
#
WeightFile = EuroSW_Weights.nc
#
# FORTRAN interface parameters
#
Documentation = true
#
# Configuration for the graph to be generated
#
nbasmax = 35
#
# Output
#
GraphFile = EuroSW_test_graph.nc
#
\ No newline at end of file
......@@ -4,10 +4,10 @@
EarthRadius = 6370000.
#
ModelGridFile = /bdd/MEDI/workspaces/polcher/NewRouting/geo_MEDCORDEX.nc
HydroFile = /bdd/MEDI/workspaces/polcher/NewRouting/routing_MED.nc
# Mallorca
WEST_EAST = 2.3, 3.5
SOUTH_NORTH = 39.00, 40.1
HydroFile = /bdd/MEDI/workspaces/polcher/NewRouting/routing_MED.nc
#
# FORTRAN interface parameters
#
......@@ -25,8 +25,3 @@ numop = 200
#
GraphFile = MEDCORDEX_test_graph.nc
#
# Diagnostics
# You need to provide an interval in longitude and Latitude.
#
DiagLon = 3.9, 3.9
DiagLat = 40.0, 40.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment