Commit 358a06fc authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Make the dumpnetcdf of HydroSuper optional. It consumes too much memory.

parent 52fbfd11
......@@ -6,6 +6,7 @@ import pickle
from netCDF4 import Dataset
import RPPtools as RPP
from mpi4py import MPI
import gc
#
import sys
from inspect import currentframe, getframeinfo
......
......@@ -20,6 +20,7 @@ config.read("run.def")
nbasmax=config.getint("OverAll", "nbasmax")
numop=config.getint("OverAll", "numop")
OutGraphFile=config.get("OverAll","GraphFile")
DumpHydroSuper=config.getboolean("OverAll","DumpHydroSuper",fallback=False)
lonint=np.array(config.get("OverAll", "DiagLon").split(","),dtype=float)
latint=np.array(config.get("OverAll", "DiagLat").split(","),dtype=float)
#
......@@ -138,7 +139,9 @@ t1 = time.time()
print("Time for fetch: {:0.2f} s.".format(t1-t))
comm.Barrier()
hsuper.dumpnetcdf(OutGraphFile.replace(".nc","_HydroSuper.nc"), gg, modelgrid, part)
if DumpHydroSuper :
print("Dumping HydroSuper")
hsuper.dumpnetcdf(OutGraphFile.replace(".nc","_HydroSuper.nc"), gg, modelgrid, part)
print("Rank : {0} - Basin_count Before Truncate : ".format(part.rank), hsuper.basin_count)
hs = TR(hsuper, part, comm, modelgrid, numop = numop)
......
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