Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 5250724b authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Adds the index of the HTU which is considered representative for the grid. It...

Adds the index of the HTU which is considered representative for the grid. It is currently the HTU with the largest upstream area. This will allow 2D diagnostics in ORCHIDEE.
parent be3594b0
......@@ -98,6 +98,18 @@ def addparameters(outnf, version, part, tcst, vtyp, NCFillValue, lim_floodcri) :
limfloodcri[:] = lim_floodcri
return
#
# Determine which HTU will be taken as representative for the gri to diagnose 2D fields for the rivers.
#
def GridRepHTU(fetch) :
ni,nhtu = fetch.shape
rephtu = np.zeros((ni))
for i in range(ni) :
mm = fetch[i,:]
mm[mm>=NCFillValue]=0
# Transform to F indexing
rephtu[i] = np.argmax(mm)+1
return rephtu
#
#
#
class HydroGraph :
......@@ -432,6 +444,12 @@ class HydroGraph :
self.add_variable(outnf, procgrid, NCFillValue, part, ('z','y','x'), \
"fetch", "Fetch contributing to each HTU", "m^2", self.routing_fetch[:,:], vtyp)
#
#
#
gridrephtu = GridRepHTU(self.routing_fetch[:,:])
self.add_variable(outnf, procgrid, NCFillValue, part, ('y','x'), \
"gridrephtu", "Representative HTU for the grid", "-", gridrephtu[:], vtyp)
#
# Build and save a map of all the structures located on the graph
#
locations.addtonetcdf(self.nbpt, self.nbasmax, outnf, procgrid, part, ('y','x'), ('locations',), vtyp)
......
......@@ -10,7 +10,7 @@ import time
#
# Version of RoutingPP
#
Version=2.5
Version=2.6
#
# Get the information from the configuration file.
#
......
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