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
4a604f39
Commit
4a604f39
authored
Oct 21, 2020
by
POLCHER Jan
🚴🏾
Browse files
Take care of the case when there are no stations to be stored in the graph file.
parent
8be1ae13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
GraphHydro.py
GraphHydro.py
+0
-1
Locations.py
Locations.py
+16
-15
No files found.
GraphHydro.py
View file @
4a604f39
...
...
@@ -176,7 +176,6 @@ class HydroGraph :
outnf
.
createDimension
(
'bnd'
,
nbcorners
)
outnf
.
createDimension
(
'inflow'
,
self
.
max_inflow
)
outnf
.
createDimension
(
'stnperhtu'
,
nlmax
)
outnf
.
createDimension
(
'locations'
,
nblocated
)
else
:
outnf
=
None
#
...
...
Locations.py
View file @
4a604f39
...
...
@@ -212,20 +212,21 @@ class Locations :
if
part
.
rank
==
0
:
# Create new dimension
monmax
=
np
.
max
(
monnb
)
moncoord
=
(
'htumon'
,)
outnf
.
createDimension
(
moncoord
[
0
],
monmax
)
infocoord
=
(
'locinfo'
,)
outnf
.
createDimension
(
infocoord
[
0
],
5
)
# Create variable for the list of stations
locvar
=
outnf
.
createVariable
(
locname
,
vtyp
,
infocoord
+
loccoord
)
locvar
.
title
=
loctitle
locvar
.
units
=
locunits
locvar
.
description
=
"ID, i-index, j-index, HTU-index, monitoring-index"
locvar
[:,:]
=
locationlist
# Create variable for the indices of the HTU to monitor
monvar
=
outnf
.
createVariable
(
monname
,
vtyp
,
moncoord
+
spacecoord
)
monvar
.
title
=
montitle
monvar
.
units
=
monunits
monvar
[:,:,:]
=
htumon
[
0
:
monmax
,:,:]
if
monmax
>
0
:
moncoord
=
(
'htumon'
,)
outnf
.
createDimension
(
moncoord
[
0
],
monmax
)
infocoord
=
(
'locinfo'
,)
outnf
.
createDimension
(
infocoord
[
0
],
5
)
# Create variable for the list of stations
locvar
=
outnf
.
createVariable
(
locname
,
vtyp
,
infocoord
+
loccoord
)
locvar
.
title
=
loctitle
locvar
.
units
=
locunits
locvar
.
description
=
"ID, i-index, j-index, HTU-index, monitoring-index"
locvar
[:,:]
=
locationlist
# Create variable for the indices of the HTU to monitor
monvar
=
outnf
.
createVariable
(
monname
,
vtyp
,
moncoord
+
spacecoord
)
monvar
.
title
=
montitle
monvar
.
units
=
monunits
monvar
[:,:,:]
=
htumon
[
0
:
monmax
,:,:]
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