Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
IPSL
LMD
InTro
RoutingPP
Commits
a3c2a6c0
Commit
a3c2a6c0
authored
Jan 11, 2021
by
POLCHER Jan
🚴🏾
Browse files
Maximum time step is added to the routing graph file.
parent
8317c779
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
GraphHydro.py
GraphHydro.py
+8
-2
No files found.
GraphHydro.py
View file @
a3c2a6c0
...
...
@@ -173,7 +173,7 @@ class HydroGraph :
if
part
.
rank
==
0
:
gvar
[
gvar
>=
NCFillValue
]
=
np
.
nan
#
hist
,
bin_edges
=
np
.
histogram
(
gvar
,
bins
=
nbbins
,
range
=
(
0
,
max
(
10000
,
np
.
nanmax
(
gvar
))))
hist
,
bin_edges
=
np
.
histogram
(
gvar
[
~
np
.
isnan
(
gvar
)]
,
bins
=
nbbins
,
range
=
(
0
,
max
(
10000
,
np
.
nanmax
(
gvar
))))
topobins
=
outnf
.
createVariable
(
"topobins"
,
vtyp
,
(
'nbbnds'
,
'nbbins'
))
topobins
.
title
=
"Topographic index"
topobins
.
units
=
"km"
...
...
@@ -184,7 +184,7 @@ class HydroGraph :
topohist
.
units
=
"counts"
topohist
[:]
=
hist
[:]
#
thist
,
tbin_edges
=
np
.
histogram
(
gvar
*
tcst
.
stream_tcst
,
bins
=
nbbins
,
range
=
(
0
,
RPP
.
OneDay
/
8
))
thist
,
tbin_edges
=
np
.
histogram
(
gvar
[
~
np
.
isnan
(
gvar
)]
*
tcst
.
stream_tcst
,
bins
=
nbbins
,
range
=
(
0
,
RPP
.
OneDay
/
8
))
tbins
=
outnf
.
createVariable
(
"tstepbins"
,
vtyp
,
(
'nbbnds'
,
'nbbins'
))
tbins
.
title
=
"Time bins"
tbins
.
units
=
"s"
...
...
@@ -194,6 +194,12 @@ class HydroGraph :
ncvar
.
title
=
"Stable timestep distribution"
ncvar
.
units
=
"count"
ncvar
[:]
=
thist
[:]
#
maxtstep
=
np
.
quantile
(
gvar
[
~
np
.
isnan
(
gvar
)],
0.1
)
mtstep
=
outnf
.
createVariable
(
"MaxTimeStep"
,
vtyp
,
(
'dimpara'
),
fill_value
=
NCFillValue
)
mtstep
.
title
=
"The maximum time-step possible given the distribution of HTU properties"
mtstep
.
units
=
"s"
mtstep
[:]
=
maxtstep
return
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment