Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RoutingPP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IPSL
LMD
InTro
RoutingPP
Commits
3eaecfa0
Commit
3eaecfa0
authored
5 years ago
by
POLCHER Jan
Browse files
Options
Downloads
Patches
Plain Diff
Some clean-up of the code
parent
20b3f417
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
F90subroutines/routing_reg.f90
+1
-3
1 addition, 3 deletions
F90subroutines/routing_reg.f90
Interface.py
+2
-6
2 additions, 6 deletions
Interface.py
RoutingPreProc.py
+2
-2
2 additions, 2 deletions
RoutingPreProc.py
with
5 additions
and
11 deletions
F90subroutines/routing_reg.f90
+
1
−
3
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.
...
...
This diff is collapsed.
Click to expand it.
Interface.py
+
2
−
6
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
)
:
...
...
This diff is collapsed.
Click to expand it.
RoutingPreProc.py
+
2
−
2
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment