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
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
IPSL
LMD
InTro
RoutingPP
Commits
7b806d25
Commit
7b806d25
authored
Mar 10, 2021
by
Anthony
Browse files
topoindex_stream variable flows to the output file
parent
71fe0f70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
19 deletions
+51
-19
F90subroutines/routing_interface.f90
F90subroutines/routing_interface.f90
+20
-8
F90subroutines/routing_reg.f90
F90subroutines/routing_reg.f90
+16
-7
GraphHydro.py
GraphHydro.py
+10
-1
Interface.py
Interface.py
+5
-3
No files found.
F90subroutines/routing_interface.f90
View file @
7b806d25
...
...
@@ -128,7 +128,8 @@ END SUBROUTINE gethydrogrid
SUBROUTINE
findbasins
(
nbpt
,
nb_htu
,
nbv
,
ijdimmax
,
nbi
,
nbj
,
trip_bx
,
basin_bx
,
fac_bx
,
hierarchy_bx
,
topoind_bx
,
&
&
rlen_bx
,
rdz_bx
,
rweight_bx
,
lshead_bx
,
nb_basin
,
basin_inbxid
,
basin_outlet
,
basin_outtp
,
&
&
basin_sz
,
basin_bxout
,
basin_bbout
,
basin_pts
,
basin_lshead
,
coast_pts
,
lontmp
,
lattmp
,
orog_bx
)
&
basin_sz
,
basin_bxout
,
basin_bbout
,
basin_pts
,
basin_lshead
,
coast_pts
,
lontmp
,
lattmp
,
orog_bx
,
&
&
basin_topoindex_stream
)
!
USE
ioipsl
USE
grid
...
...
@@ -163,6 +164,7 @@ SUBROUTINE findbasins(nbpt, nb_htu, nbv, ijdimmax, nbi, nbj, trip_bx, basin_bx,
INTEGER
,
INTENT
(
out
)
::
basin_pts
(
nbpt
,
nb_htu
,
nbv
,
2
)
!!
REAL
,
INTENT
(
out
)
::
basin_lshead
(
nbpt
,
nb_htu
)
!!
INTEGER
,
INTENT
(
out
)
::
coast_pts
(
nbpt
,
nb_htu
)
!! The coastal flow points (unitless)
REAL
,
INTENT
(
out
)
::
basin_topoindex_stream
(
nbpt
,
nb_htu
)
!!
!
! For debug and get coordinate of river outlet
!
...
...
@@ -184,7 +186,7 @@ SUBROUTINE findbasins(nbpt, nb_htu, nbv, ijdimmax, nbi, nbj, trip_bx, basin_bx,
&
rlen_bx
(
ib
,:,:),
rdz_bx
(
ib
,:,:),
rweight_bx
(
ib
,:,:),
lshead_bx
(
ib
,:,:),
diaglalo
,
nb_basin
(
ib
),
&
&
basin_inbxid
(
ib
,:),
basin_outlet
(
ib
,:,:),
basin_outtp
(
ib
,:),
basin_sz
(
ib
,:),
basin_bxout
(
ib
,:),
&
&
basin_bbout
(
ib
,:),
basin_pts
(
ib
,:,:,:),
basin_lshead
(
ib
,:),
coast_pts
(
ib
,:),
lontmp
(
ib
,:,:),
lattmp
(
ib
,:,:),&
&
orog_bx
(
ib
,:,:))
&
orog_bx
(
ib
,:,:)
,
basin_topoindex_stream
(
ib
,:)
)
ENDDO
END
SUBROUTINE
findbasins
...
...
@@ -456,11 +458,13 @@ END SUBROUTINE rivclassification
SUBROUTINE
finish_truncate
(
nbpt
,
inflowmax
,
nbasmax
,
nwbas
,
num_largest
,
gridarea
,
cfrac
,
gridcenters
,
basin_count
,
&
&
basin_notrun
,
basin_area
,
basin_orog_mean
,
basin_orog_min
,
basin_orog_max
,
&
&
basin_floodp
,
basin_cg
,
basin_topoind
,
basin_rlen
,
basin_rdz
,
basin_beta_fp
,
fetch_basin
,
&
&
basin_floodp
,
basin_cg
,
basin_topoind
,
basin_topoindex_stream
,
basin_rlen
,
&
&
basin_rdz
,
basin_beta_fp
,
fetch_basin
,
&
&
basin_id
,
basin_coor
,
basin_type
,
basin_flowdir
,
outflow_grid
,
outflow_basin
,
&
&
inflow_number
,
inflow_grid
,
inflow_basin
,
floodcri
,
routing_area
,
routing_orog_mean
,
&
&
routing_orog_min
,
routing_orog_max
,
routing_floodp
,
routing_beta
,&
&
routing_cg
,
topo_resid
,
topo_rlen
,
topo_rdz
,
route_nbbasin
,
route_togrid
,
route_tobasin
,
route_nbintobas
,
&
&
routing_orog_min
,
routing_orog_max
,
routing_floodp
,
routing_beta
,
&
&
routing_cg
,
topo_resid
,
topo_resid_stream
,
topo_rlen
,
topo_rdz
,
&
&
route_nbbasin
,
route_togrid
,
route_tobasin
,
route_nbintobas
,
&
&
global_basinid
,
route_outlet
,
route_type
,
origin_nbintobas
,
routing_fetch
,
routing_floodcri
,
&
&
rfillval
,
ifillval
)
!
...
...
@@ -493,6 +497,7 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_floodp
!!
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
,
2
),
INTENT
(
inout
)
::
basin_cg
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_topoind
!! Topographic index of the residence time for a basin (km)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_topoindex_stream
!! Topographic index of the residence time for a basin (km) - stream res.
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_rlen
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_rdz
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_beta_fp
...
...
@@ -521,6 +526,7 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
out
)
::
routing_fetch
!! Upstream are flowing into HTU (m^2)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nbasmax
,
2
),
INTENT
(
out
)
::
routing_cg
!! Centre of gravity of HTU (Lat, Lon)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
out
)
::
topo_resid
!! Topographic index of the retention time (km)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
out
)
::
topo_resid_stream
!! Topographic index of the retention time (km)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
out
)
::
topo_rlen
!!
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
out
)
::
topo_rdz
!!
INTEGER
(
i_std
),
DIMENSION
(
nbpt
),
INTENT
(
out
)
::
route_nbbasin
!!
...
...
@@ -538,7 +544,8 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
!
CALL
routing_reg_end_truncate
(
nbpt
,
nbasmax
,
gridarea
,
cfrac
,
gridcenters
,
nwbas
,
inflowmax
,
num_largest
,
&
&
basin_count
,
basin_notrun
,
basin_area
,
basin_orog_mean
,
basin_orog_min
,
basin_orog_max
,
basin_floodp
,&
&
basin_cg
,
basin_topoind
,
basin_rlen
,
basin_rdz
,
basin_beta_fp
,
fetch_basin
,
basin_id
,
basin_coor
,
&
&
basin_cg
,
basin_topoind
,
basin_topoindex_stream
,
basin_rlen
,
basin_rdz
,
&
&
basin_beta_fp
,
fetch_basin
,
basin_id
,
basin_coor
,
&
&
basin_type
,
basin_flowdir
,
outflow_grid
,
outflow_basin
,
inflow_number
,
inflow_grid
,
inflow_basin
,
floodcri
)
routing_area
(:,:)
=
rfillval
...
...
@@ -548,6 +555,7 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
routing_floodp
(:,:)
=
rfillval
routing_cg
(:,:,:)
=
rfillval
topo_resid
(:,:)
=
rfillval
topo_resid_stream
(:,:)
=
rfillval
topo_rlen
(:,:)
=
rfillval
topo_rdz
(:,:)
=
rfillval
route_nbbasin
(:)
=
ifillval
...
...
@@ -572,6 +580,7 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
routing_cg
(
ij
,
ib
,:)
=
routing_cg_glo
(
ij
,
ib
,:)
!
topo_resid
(
ij
,
ib
)
=
topo_resid_glo
(
ij
,
ib
)
topo_resid_stream
(
ij
,
ib
)
=
topo_resid_stream_glo
(
ij
,
ib
)
topo_rlen
(
ij
,
ib
)
=
topo_rlen_glo
(
ij
,
ib
)
topo_rdz
(
ij
,
ib
)
=
topo_rdz_glo
(
ij
,
ib
)
!
...
...
@@ -643,7 +652,8 @@ END SUBROUTINE finish_inflows
SUBROUTINE
killbas
(
nbpt
,
inflowmax
,
nbasmax
,
nwbas
,
ops
,
tokill
,
totakeover
,
numops
,
basin_count
,
basin_area
,
&
&
basin_orog_mean
,
basin_orog_min
,
basin_orog_max
,
basin_floodp
,
basin_cg
,
&
&
basin_topoind
,
basin_rlen
,
basin_rdz
,
basin_beta_fp
,
fetch_basin
,
basin_id
,
basin_coor
,
basin_type
,
&
&
basin_topoind
,
basin_topoindex_stream
,
basin_rlen
,
basin_rdz
,
basin_beta_fp
,
&
&
fetch_basin
,
basin_id
,
basin_coor
,
basin_type
,
&
&
basin_flowdir
,
outflow_grid
,
outflow_basin
,
inflow_number
,
inflow_grid
,
inflow_basin
)
!
!
...
...
@@ -673,6 +683,7 @@ SUBROUTINE killbas(nbpt, inflowmax, nbasmax, nwbas, ops, tokill, totakeover, num
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_floodp
!!
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
,
2
),
INTENT
(
inout
)
::
basin_cg
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_topoind
!! Topographic index of the residence time for a basin (km)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_topoindex_stream
!! Topographic index of the residence time for a basin (km)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_rlen
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_rdz
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_beta_fp
...
...
@@ -725,7 +736,8 @@ SUBROUTINE killbas(nbpt, inflowmax, nbasmax, nwbas, ops, tokill, totakeover, num
END
IF
END
DO
CALL
routing_reg_killbas
(
nbpt
,
ib
,
tok
,
totak
,
nwbas
,
inflowmax
,
basin_count
,
basin_area
,
&
&
basin_orog_mean
,
basin_orog_min
,
basin_orog_max
,
basin_floodp
,
basin_cg
,
basin_topoind
,
basin_rlen
,
&
&
basin_orog_mean
,
basin_orog_min
,
basin_orog_max
,
basin_floodp
,
basin_cg
,&
&
basin_topoind
,
basin_topoindex_stream
,
basin_rlen
,
&
&
basin_rdz
,
basin_beta_fp
,
fetch_basin
,
basin_id
,
basin_coor
,
basin_type
,
basin_flowdir
,
&
&
outflow_grid
,
outflow_basin
,
inflow_number
,
inflow_grid
,
inflow_basin
)
END
IF
...
...
F90subroutines/routing_reg.f90
View file @
7b806d25
...
...
@@ -26,6 +26,7 @@ MODULE routing_reg
!
REAL
(
r_std
),
SAVE
,
ALLOCATABLE
,
DIMENSION
(:,:,:)
::
routing_cg_glo
!! Centre of gravity of HTU (Lat, Lon)
REAL
(
r_std
),
SAVE
,
ALLOCATABLE
,
DIMENSION
(:,:)
::
topo_resid_glo
!! Topographic index of the retention time (km)
REAL
(
r_std
),
SAVE
,
ALLOCATABLE
,
DIMENSION
(:,:)
::
topo_resid_stream_glo
!! Topographic index of the retention time (km) - stream
REAL
(
r_std
),
SAVE
,
ALLOCATABLE
,
DIMENSION
(:,:)
::
topo_rlen_glo
!! HTU river length (m)
REAL
(
r_std
),
SAVE
,
ALLOCATABLE
,
DIMENSION
(:,:)
::
topo_rdz_glo
!! HTU river elevation change (m)
!
...
...
@@ -427,7 +428,7 @@ CONTAINS
SUBROUTINE
routing_reg_findbasins
(
nb_htu
,
nbv
,
ib
,
ijdimmax
,
nbi
,
nbj
,
trip
,
basin
,
fac
,
hierarchy
,
topoind
,
&
&
rlen
,
rdz
,
rweight
,
lshead
,
diaglalo
,
nb_basin
,
basin_inbxid
,
basin_outlet
,
basin_outtp
,
basin_sz
,
&
&
basin_bxout
,
basin_bbout
,
basin_pts
,
basin_lshead
,
coast_pts
,
lontmp
,
lattmp
,
orog
)
!
basin_topoindex_stream
&
basin_bxout
,
basin_bbout
,
basin_pts
,
basin_lshead
,
coast_pts
,
lontmp
,
lattmp
,
orog
,
basin_topoindex_stream
)
!
IMPLICIT
NONE
!
...
...
@@ -469,7 +470,7 @@ CONTAINS
INTEGER
(
i_std
),
INTENT
(
out
)
::
basin_bbout
(
nb_htu
)
!!
INTEGER
(
i_std
),
INTENT
(
out
)
::
basin_pts
(
nb_htu
,
nbv
,
2
)
!!
INTEGER
(
i_std
),
INTENT
(
out
)
::
coast_pts
(
nb_htu
)
!! The coastal flow points (unitless)
REAL
(
r_std
)
::
basin_topoindex_stream
(
nb_htu
)
!!
INTENT(out)
REAL
(
r_std
)
,
INTENT
(
out
)
::
basin_topoindex_stream
(
nb_htu
)
!!
!
!! LOCAL VARIABLES
LOGICAL
,
PARAMETER
::
debug
=
.FALSE.
...
...
@@ -775,7 +776,6 @@ CONTAINS
! and if the HTU is not too small -> more than 4 pixels
IF
((
fac_glo_trib
.GT.
fac_lim
)
.AND.
(
fac_loc_trib
.GT.
4
))
THEN
changes
=
changes
+
1
WRITE
(
*
,
*
)
"Here global cut"
CALL
routing_reg_divbas_cut
(
nb_htu
,
nbv
,
nbi
,
nbj
,
ibas
,
toutloc
(
ibas
,
1
),
toutloc
(
ibas
,
2
),&
&
tsz
(
ibas
),
toutbas
(
ibas
),
toutdir
(
ibas
),
&
&
toutlshead
(
ibas
),
tpts
,
trip
,
basin
,
fac
,
lontmp
,
lattmp
,
il_trib
,
jl_trib
,
&
...
...
@@ -803,7 +803,6 @@ CONTAINS
! Check with the local fac if the tributary is not too small (>1%)
IF
(
fac_loc_trib
/
REAL
(
totsz
)
.GT.
1.
/
REAL
(
100
)
)
THEN
changes
=
changes
+
1
WRITE
(
*
,
*
)
"Here local cut"
CALL
routing_reg_divbas_cut
(
nb_htu
,
nbv
,
nbi
,
nbj
,
ibas
,
toutloc
(
ibas
,
1
),
toutloc
(
ibas
,
2
),&
&
tsz
(
ibas
),
toutbas
(
ibas
),
toutdir
(
ibas
),
&
&
toutlshead
(
ibas
),
tpts
,
trip
,
basin
,
fac
,
lontmp
,
lattmp
,
il_trib
,
jl_trib
,
&
...
...
@@ -3220,7 +3219,8 @@ SUBROUTINE isin_halo(ig, nbhalo, nbpt, halopts, isinhalo)
SUBROUTINE
routing_reg_end_truncate
(
nbpt
,
nbasmax
,
gridarea
,
contfrac
,
gridcenters
,
nwbas
,&
&
inflowmax
,
num_largest
,
basin_count
,
basin_notrun
,
basin_area
,
basin_orog_mean
,&
&
basin_orog_min
,
basin_orog_max
,
basin_floodp
,
basin_cg
,
basin_topoind
,
basin_rlen
,
basin_rdz
,
&
&
basin_orog_min
,
basin_orog_max
,
basin_floodp
,
basin_cg
,
basin_topoind
,
&
&
basin_topoindex_stream
,
basin_rlen
,
basin_rdz
,
&
&
basin_beta_fp
,
fetch_basin
,
basin_id
,
basin_coor
,
basin_type
,
basin_flowdir
,
&
&
outflow_grid
,
outflow_basin
,
inflow_number
,
inflow_grid
,
inflow_basin
,
floodcri
)
!
...
...
@@ -3254,6 +3254,7 @@ SUBROUTINE routing_reg_end_truncate(nbpt, nbasmax, gridarea, contfrac, gridcente
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_floodp
!!
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
,
2
),
INTENT
(
inout
)
::
basin_cg
!!
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_topoind
!! Mean Topographic index of HTU (km)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_topoindex_stream
!! Topographic index of HTU (km) - stream
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_rlen
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_rdz
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
),
INTENT
(
inout
)
::
basin_beta_fp
!!
...
...
@@ -3315,6 +3316,7 @@ SUBROUTINE routing_reg_end_truncate(nbpt, nbasmax, gridarea, contfrac, gridcente
routing_cg_glo
(
ib
,:,:)
=
0.0
! Perhaps here we should put a NaN so we can filter it out later !!!
topo_resid_glo
(
ib
,:)
=
topoindexmin
topo_resid_stream_glo
(
ib
,:)
=
topoindexmin
topo_rlen_glo
(
ib
,:)
=
hydro_meanlen
topo_rdz_glo
(
ib
,:)
=
hydro_meandz
global_basinid_glo
(
ib
,:)
=
zero
...
...
@@ -3374,6 +3376,7 @@ SUBROUTINE routing_reg_end_truncate(nbpt, nbasmax, gridarea, contfrac, gridcente
routing_cg_glo
(
ib
,
ij
,:)
=
basin_cg
(
ib
,
ij
,:)
!
topo_resid_glo
(
ib
,
ij
)
=
basin_topoind
(
ib
,
ij
)
topo_resid_stream_glo
(
ib
,
ij
)
=
basin_topoindex_stream
(
ib
,
ij
)
topo_rlen_glo
(
ib
,
ij
)
=
basin_rlen
(
ib
,
ij
)
topo_rdz_glo
(
ib
,
ij
)
=
basin_rdz
(
ib
,
ij
)
!
...
...
@@ -3484,8 +3487,9 @@ SUBROUTINE routing_reg_end_truncate(nbpt, nbasmax, gridarea, contfrac, gridcente
!_ ================================================================================================================================
SUBROUTINE
routing_reg_killbas
(
nbpt
,
ib
,
tokill
,
totakeover
,
nwbas
,
inflowmax
,
basin_count
,
basin_area
,
&
&
basin_orog_mean
,
basin_orog_min
,
basin_orog_max
,
basin_floodp
,
basin_cg
,
basin_topoind
,
basin_rlen
,
&
&
basin_rdz
,
basin_beta_fp
,
fetch_basin
,
basin_id
,
basin_coor
,
basin_type
,
basin_flowdir
,
outflow_grid
,
&
&
basin_orog_mean
,
basin_orog_min
,
basin_orog_max
,
basin_floodp
,
basin_cg
,
basin_topoind
,
&
&
basin_topoindex_stream
,
basin_rlen
,
basin_rdz
,
basin_beta_fp
,
fetch_basin
,
&
&
basin_id
,
basin_coor
,
basin_type
,
basin_flowdir
,
outflow_grid
,
&
&
outflow_basin
,
inflow_number
,
inflow_grid
,
inflow_basin
)
!
!
...
...
@@ -3509,6 +3513,7 @@ SUBROUTINE routing_reg_killbas(nbpt, ib, tokill, totakeover, nwbas, inflowmax, b
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
)
::
basin_floodp
!!
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
,
2
)
::
basin_cg
!!
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
)
::
basin_topoind
!! Topographic index of the residence time for a basin (km)
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
)
::
basin_topoindex_stream
!! Topographic index of the residence time for a basin (km) - stream res
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
)
::
basin_rlen
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
)
::
basin_rdz
REAL
(
r_std
),
DIMENSION
(
nbpt
,
nwbas
)
::
basin_beta_fp
!!
...
...
@@ -3537,6 +3542,7 @@ SUBROUTINE routing_reg_killbas(nbpt, ib, tokill, totakeover, nwbas, inflowmax, b
!
basin_topoind
(
ib
,
totakeover
)
=
(
basin_topoind
(
ib
,
totakeover
)
*
basin_area
(
ib
,
totakeover
)
&
&
+
basin_topoind
(
ib
,
tokill
)
*
basin_area
(
ib
,
tokill
))/(
basin_area
(
ib
,
totakeover
)
+
basin_area
(
ib
,
tokill
))
!
basin_rlen
(
ib
,
totakeover
)
=
(
basin_rlen
(
ib
,
totakeover
)
+
basin_rlen
(
ib
,
tokill
))
*
0.5
basin_rdz
(
ib
,
totakeover
)
=
(
basin_rdz
(
ib
,
totakeover
)
+
basin_rdz
(
ib
,
tokill
))
*
0.5
!
...
...
@@ -3670,6 +3676,8 @@ SUBROUTINE routing_reg_killbas(nbpt, ib, tokill, totakeover, nwbas, inflowmax, b
basin_cg
(
ib
,
basin_count
(
ib
):
nwbas
,:)
=
zero
basin_topoind
(
ib
,
tokill
:
basin_count
(
ib
)
-1
)
=
basin_topoind
(
ib
,
tokill
+1
:
basin_count
(
ib
))
basin_topoind
(
ib
,
basin_count
(
ib
):
nwbas
)
=
zero
basin_topoindex_stream
(
ib
,
tokill
:
basin_count
(
ib
)
-1
)
=
basin_topoindex_stream
(
ib
,
tokill
+1
:
basin_count
(
ib
))
basin_topoindex_stream
(
ib
,
basin_count
(
ib
):
nwbas
)
=
zero
basin_rlen
(
ib
,
basin_count
(
ib
):
nwbas
)
=
zero
basin_rdz
(
ib
,
basin_count
(
ib
):
nwbas
)
=
zero
fetch_basin
(
ib
,
tokill
:
basin_count
(
ib
)
-1
)
=
fetch_basin
(
ib
,
tokill
+1
:
basin_count
(
ib
))
...
...
@@ -3749,6 +3757,7 @@ SUBROUTINE routing_reg_killbas(nbpt, ib, tokill, totakeover, nwbas, inflowmax, b
ALLOCATE
(
route_fetch_glo
(
nbpt
,
nbasmax
),
stat
=
ier
)
ALLOCATE
(
routing_cg_glo
(
nbpt
,
nbasmax
,
2
),
stat
=
ier
)
ALLOCATE
(
topo_resid_glo
(
nbpt
,
nbasmax
),
stat
=
ier
)
ALLOCATE
(
topo_resid_stream_glo
(
nbpt
,
nbasmax
),
stat
=
ier
)
ALLOCATE
(
topo_rlen_glo
(
nbpt
,
nbasmax
),
stat
=
ier
)
ALLOCATE
(
topo_rdz_glo
(
nbpt
,
nbasmax
),
stat
=
ier
)
ALLOCATE
(
route_count_glo
(
nbpt
),
stat
=
ier
)
...
...
GraphHydro.py
View file @
7b806d25
...
...
@@ -105,7 +105,7 @@ class HydroGraph :
#
#
self
.
routing_area
,
self
.
routing_orog_mean
,
self
.
routing_orog_min
,
self
.
routing_orog_max
,
\
self
.
routing_floodp
,
self
.
routing_beta
,
self
.
routing_cg
,
self
.
topo_resid
,
self
.
topo_rlen
,
\
self
.
routing_floodp
,
self
.
routing_beta
,
self
.
routing_cg
,
self
.
topo_resid
,
self
.
topo_resid_stream
,
self
.
topo_rlen
,
\
self
.
topo_rdz
,
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
,
self
.
floodcri
=
\
routing_interface
.
finish_truncate
(
nbpt
=
self
.
nbpt
,
inflowmax
=
nbxmax_in
,
nbasmax
=
nbasmax
,
nwbas
=
nwbas
,
\
...
...
@@ -116,6 +116,7 @@ class HydroGraph :
basin_orog_mean
=
hydrosuper
.
basin_orog_mean
,
basin_orog_min
=
hydrosuper
.
basin_orog_min
,
\
basin_orog_max
=
hydrosuper
.
basin_orog_max
,
basin_floodp
=
hydrosuper
.
basin_floodp
,
\
basin_cg
=
hydrosuper
.
basin_cg
,
basin_topoind
=
hydrosuper
.
basin_topoind
,
\
basin_topoindex_stream
=
hydrosuper
.
basin_topoindex_stream
,
\
basin_rlen
=
hydrosuper
.
basin_rlen
,
basin_rdz
=
hydrosuper
.
basin_rdz
,
\
basin_beta_fp
=
hydrosuper
.
basin_beta_fp
,
fetch_basin
=
hydrosuper
.
fetch_basin
,
\
basin_id
=
hydrosuper
.
basin_id
,
\
...
...
@@ -351,6 +352,14 @@ class HydroGraph :
"topoindex"
,
"Topographic index of the retention time"
,
"km"
,
self
.
topo_resid
[:,:],
vtyp
)
self
.
add_tstepdistrib
(
outnf
,
procgrid
,
NCFillValue
,
part
,
self
.
topo_resid
[:,:],
self
.
routing_area
[:,:],
\
vtyp
,
nbbins
,
tcst
)
#
# topoindex stream
self
.
add_variable
(
outnf
,
procgrid
,
NCFillValue
,
part
,
(
'z'
,
'y'
,
'x'
),
\
"topoindex_stream"
,
"Topographic index of the retention time for stream res."
,
"km"
,
self
.
topo_resid_stream
[:,:],
vtyp
)
# Add another distribution ? Or replace the other ?
#self.add_tstepdistrib(outnf, procgrid, NCFillValue, part, self.topo_resid_stream[:,:], self.routing_area[:,:], \
# vtyp, nbbins, tcst)
#
# Geometric properties of HTU
self
.
add_variable
(
outnf
,
procgrid
,
NCFillValue
,
part
,
(
'z'
,
'y'
,
'x'
),
\
...
...
Interface.py
View file @
7b806d25
...
...
@@ -172,7 +172,7 @@ class HydroSuper :
# Call findbasins
#
nb_basin
,
basin_inbxid
,
basin_outlet
,
basin_outtp
,
self
.
basin_sz
,
basin_bxout
,
basin_bbout
,
self
.
basin_pts
,
\
basin_lshead
,
coast_pts
=
\
basin_lshead
,
coast_pts
,
self
.
basin_topoindex_stream
=
\
routing_interface
.
findbasins
(
nbpt
=
self
.
nbpt
,
nb_htu
=
self
.
nbhtuext
,
nbv
=
nbv
,
nbi
=
hydrooverlap
.
nbi
,
\
nbj
=
hydrooverlap
.
nbj
,
trip_bx
=
hydrooverlap
.
trip_bx
,
\
basin_bx
=
hydrooverlap
.
basin_bx
,
fac_bx
=
hydrooverlap
.
fac_bx
,
\
...
...
@@ -184,6 +184,7 @@ class HydroSuper :
# Adjust nwbas to the maximum found over the domain
#
self
.
nwbas
=
part
.
domainmax
(
np
.
max
(
nb_basin
))
self
.
basin_topoindex_stream
=
self
.
basin_topoindex_stream
[:,:
self
.
nwbas
]
# Set the number of inflows per basin. For the moment twice the maximum number of basins.
self
.
inflowmax
=
max
(
10
,
self
.
nwbas
*
2
)
print
(
"Maximum number of basin created : {0}"
.
format
(
self
.
nwbas
))
...
...
@@ -223,7 +224,7 @@ class HydroSuper :
for
variable
in
[
self
.
basin_count
,
self
.
basin_notrun
,
self
.
basin_area
,
self
.
basin_hierarchy
,
\
self
.
basin_orog_mean
,
self
.
basin_orog_min
,
self
.
basin_orog_max
,
self
.
basin_floodp
,
\
self
.
basin_fac
,
self
.
basin_topoind
,
self
.
basin_id
,
self
.
basin_type
,
self
.
basin_flowdir
,
\
self
.
basin_lshead
,
self
.
outflow_basin
,
self
.
nbcoastal
,
self
.
coastal_basin
]:
self
.
basin_lshead
,
self
.
outflow_basin
,
self
.
nbcoastal
,
self
.
coastal_basin
,
self
.
basin_topoindex_stream
]:
part
.
landsendtohalo
(
variable
,
order
=
'F'
)
comm
.
Barrier
()
#
...
...
@@ -362,7 +363,8 @@ class HydroSuper :
totakeover
=
totakeover
,
numops
=
numops
,
basin_count
=
self
.
basin_count
,
\
basin_area
=
self
.
basin_area
,
basin_orog_mean
=
self
.
basin_orog_mean
,
\
basin_orog_min
=
self
.
basin_orog_min
,
basin_orog_max
=
self
.
basin_orog_max
,
basin_floodp
=
self
.
basin_floodp
,
\
basin_cg
=
self
.
basin_cg
,
basin_topoind
=
self
.
basin_topoind
,
basin_rlen
=
self
.
basin_rlen
,
\
basin_cg
=
self
.
basin_cg
,
basin_topoind
=
self
.
basin_topoind
,
\
basin_topoindex_stream
=
self
.
basin_topoindex_stream
,
basin_rlen
=
self
.
basin_rlen
,
\
basin_rdz
=
self
.
basin_rdz
,
basin_beta_fp
=
self
.
basin_beta_fp
,
fetch_basin
=
self
.
fetch_basin
,
\
basin_id
=
self
.
basin_id
,
basin_coor
=
self
.
basin_outcoor
,
basin_type
=
self
.
basin_type
,
\
basin_flowdir
=
self
.
basin_flowdir
,
outflow_grid
=
self
.
outflow_grid
,
outflow_basin
=
self
.
outflow_basin
,
\
...
...
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