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
3eaecfa0
Commit
3eaecfa0
authored
Jul 05, 2019
by
POLCHER Jan
🚴🏾
Browse files
Some clean-up of the code
parent
20b3f417
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
11 deletions
+5
-11
F90subroutines/routing_reg.f90
F90subroutines/routing_reg.f90
+1
-3
Interface.py
Interface.py
+2
-6
RoutingPreProc.py
RoutingPreProc.py
+2
-2
No files found.
F90subroutines/routing_reg.f90
View file @
3eaecfa0
...
...
@@ -1987,7 +1987,7 @@ SUBROUTINE routing_reg_linkup(nbpt, neighbours, nwbas, basin_count, basin_area,
!
!
!! PARAMETERS
LOGICAL
,
PARAMETER
::
debug
=
.
TRU
E.
!! (true/false)
LOGICAL
,
PARAMETER
::
debug
=
.
FALS
E.
!! (true/false)
!
!_ ================================================================================================================================
!
...
...
@@ -3258,8 +3258,6 @@ SUBROUTINE routing_reg_truncate(nbpt, nbasmax, gridarea, contfrac, nwbas, num_la
!
DO
ib
=
1
,
nbpt
DO
WHILE
(
basin_count
(
ib
)
.GT.
nbasmax
)
!
WRITE
(
numout
,
*
)
'HAMMER, ib, basin_count :'
,
ib
,
basin_count
(
ib
)
!
! Here we simply put the smallest basins into the largest ones. It is really a brute force
! method but it will only be applied if everything has failed.
...
...
Interface.py
View file @
3eaecfa0
...
...
@@ -204,7 +204,7 @@ class HydroSuper :
self
.
nbcoastal
,
self
.
coastal_basin
,
float
(
hydrodata
.
basinsmax
))
return
#
def
fetch
(
self
,
part
,
modelgrid
)
:
def
fetch
(
self
,
part
)
:
#
fetch_basin
=
np
.
zeros
(
self
.
basin_area
.
shape
,
dtype
=
np
.
float32
,
order
=
'F'
)
#
...
...
@@ -245,8 +245,6 @@ class HydroSuper :
#
#
#
yy
=
modelgrid
.
landscatter
(
np
.
sum
(
self
.
fetch_basin
,
axis
=
1
)
/
np
.
sum
(
self
.
basin_area
,
axis
=
1
))
print
(
"Rank :"
+
str
(
part
.
rank
)
+
" OUT of fetch =+=+=+=+=+=+=+=+=+=
\n
"
+
str
(
yy
)
+
"
\n
=+=+=+=+=+=+=+=+=+="
)
self
.
num_largest
=
routing_interface
.
rivclassification
(
part
.
landcorelist
,
self
.
basin_count
,
self
.
outflow_grid
,
self
.
outflow_basin
,
\
self
.
fetch_basin
,
self
.
largest_rivarea
)
print
(
"Rank :"
+
str
(
part
.
rank
)
+
" Area of smallest large rivers : "
,
self
.
largest_rivarea
,
" Nb of Large rivers on proc : "
,
self
.
num_largest
)
...
...
@@ -255,7 +253,7 @@ class HydroSuper :
#
#
class
HydroGraph
:
def
__init__
(
self
,
nbasmax
,
hydrosuper
,
part
,
modelgrid
)
:
def
__init__
(
self
,
nbasmax
,
hydrosuper
,
part
)
:
self
.
nbasmax
=
nbasmax
self
.
routing_area
,
self
.
routing_cg
,
self
.
topo_resid
,
self
.
route_nbbasin
,
self
.
route_togrid
,
self
.
route_tobasin
,
self
.
route_nbintobas
,
\
self
.
global_basinid
,
self
.
route_outlet
,
self
.
route_type
,
self
.
origin_nbintobas
,
self
.
routing_fetch
=
\
...
...
@@ -271,8 +269,6 @@ class HydroGraph :
self
.
num_largest
=
routing_interface
.
finalrivclass
(
part
.
landcorelist
,
self
.
route_togrid
,
self
.
route_tobasin
,
self
.
routing_fetch
,
\
hydrosuper
.
largest_rivarea
)
#
yy
=
modelgrid
.
landscatter
(
np
.
sum
(
self
.
routing_fetch
,
axis
=
1
)
/
np
.
sum
(
self
.
routing_area
,
axis
=
1
))
print
(
"Rank :"
+
str
(
part
.
rank
)
+
" OUT of truncate =+=+=+=+=+=+=+=+=+=
\n
"
+
str
(
yy
)
+
"
\n
=+=+=+=+=+=+=+=+=+="
)
return
#
def
dumpnetcdf
(
self
,
filename
,
globalgrid
,
procgrid
,
part
)
:
...
...
RoutingPreProc.py
View file @
3eaecfa0
...
...
@@ -172,9 +172,9 @@ del hoverlap
gc
.
collect
()
print
(
"=================== Compute fetch ===================="
)
hsuper
.
fetch
(
part
,
modelgrid
)
hsuper
.
fetch
(
part
)
hgraph
=
IF
.
HydroGraph
(
nbasmax
,
hsuper
,
part
,
modelgrid
)
hgraph
=
IF
.
HydroGraph
(
nbasmax
,
hsuper
,
part
)
hgraph
.
dumpnetcdf
(
OutGraphFile
,
gg
,
modelgrid
,
part
)
...
...
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