Commit 694db137 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Merge branch 'master' of gitlab.in2p3.fr:ipsl/lmd/intro/routingpp

parents 76e81ad7 e1d4f7e9
......@@ -144,7 +144,9 @@ class HydroGraph :
def position(self, modelgrid, locations) :
npt, nbas = self.routing_fetch.shape
if len(locations.lid) > 0 :
for i,lid in enumerate(locations.lid) :
for i,lid in enumerate(locations.lid) :
# Some stations have a negative upstream area (because undefined)
if locations.upstream[i] > 0:
dist = RPP.distances(np.array(modelgrid.coordll)[:,0], np.array(modelgrid.coordll)[:,1], \
locations.lon[i], locations.lat[i])
# Calculation in km
......
......@@ -148,6 +148,7 @@ class AllStations :
self.hist = hist
#
FillValue = 1.0e+20
FillValueInt = -999
self.nbmonth = len(dates)
# Maximum options for original data
if self.mergersource is not None :
......@@ -254,7 +255,7 @@ class AllStations :
area=out.createVariable('area', 'f', ('stations',))
area.units="km^2"
area.long_name="Catchment Area"
altitude=out.createVariable('altitude', 'f', ('stations',))
altitude=out.createVariable('altitude', 'f', ('stations',), fill_value=FillValueInt)
altitude.units="m"
altitude.long_name="Altitude of Station"
#
......@@ -582,8 +583,7 @@ def stnnbchecker(C) :
if regstnnb.shape[0] < 1 :
t = reg[i]*100000+subreg[i]*1000
else :
regnum = np.min(regstnnb)
t= regnum - 1
t = np.min(regstnnb)-1
if not any(stnnb == t) :
stnnb[i] = t
C.stations[i].Number = stnnb[i]
......
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