Commit 56e82d69 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Propose various metods to compute topoindex on the HTUs. The river length and...

Propose various metods to compute topoindex on the HTUs. The river length and elevation change within the HTU are not archived in the routing-graph file.
parent c8b9a77d
......@@ -454,11 +454,11 @@ 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_beta_fp, fetch_basin, &
& 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, 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, route_nbbasin, route_togrid, route_tobasin, route_nbintobas, &
& routing_cg, topo_resid, 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)
!
......@@ -490,7 +490,9 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: basin_orog_max !!
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 (m)
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_rlen
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: basin_rdz
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: basin_beta_fp
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: fetch_basin !!
INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: outflow_grid !! Type of outflow on the grid box (unitless)
......@@ -516,7 +518,9 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
REAL(r_std), DIMENSION(nbpt,nbasmax), INTENT(out) :: routing_beta
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 (m)
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_rlen !!
REAL(r_std), DIMENSION(nbpt,nbasmax), INTENT(out) :: topo_rdz !!
INTEGER(i_std), DIMENSION(nbpt), INTENT(out) :: route_nbbasin !!
INTEGER(i_std), DIMENSION(nbpt,nbasmax), INTENT(out) :: route_togrid !! Grid into which the basin flows (unitless)
INTEGER(i_std), DIMENSION(nbpt,nbasmax), INTENT(out) :: route_tobasin !! Basin in to which the water goes (unitless)
......@@ -532,8 +536,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_beta_fp, fetch_basin, basin_id, basin_coor, basin_type, basin_flowdir, &
& outflow_grid, outflow_basin, inflow_number, inflow_grid, inflow_basin, floodcri)
& basin_cg, basin_topoind, 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
routing_orog_mean(:,:) = rfillval
......@@ -542,6 +546,8 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
routing_floodp(:,:) = rfillval
routing_cg(:,:,:) = rfillval
topo_resid(:,:) = rfillval
topo_rlen(:,:) = rfillval
topo_rdz(:,:) = rfillval
route_nbbasin(:) = ifillval
route_togrid(:,:) = ifillval
route_tobasin(:,:) = ifillval
......@@ -562,7 +568,11 @@ SUBROUTINE finish_truncate(nbpt, inflowmax, nbasmax, nwbas, num_largest, gridare
routing_orog_max(ij,ib) = routing_orog_max_glo(ij,ib)
routing_floodp(ij,ib) = routing_floodp_glo(ij,ib)
routing_cg(ij,ib,:) = routing_cg_glo(ij,ib,:)
!
topo_resid(ij,ib) = topo_resid_glo(ij,ib)
topo_rlen(ij,ib) = topo_rlen_glo(ij,ib)
topo_rdz(ij,ib) = topo_rdz_glo(ij,ib)
!
route_nbbasin(:) = route_count_glo(:)
route_togrid(ij,ib) = route_togrid_glo(ij,ib)
route_tobasin(ij,ib) = route_tobasin_glo(ij,ib)
......@@ -630,9 +640,9 @@ 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_beta_fp, fetch_basin, basin_id, basin_coor, basin_type, basin_flowdir,&
& outflow_grid, outflow_basin, inflow_number, inflow_grid, inflow_basin)
& 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, outflow_basin, inflow_number, inflow_grid, inflow_basin)
!
!
USE ioipsl
......@@ -660,7 +670,9 @@ 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 (m)
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_rlen
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: basin_rdz
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: basin_beta_fp
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: fetch_basin !!
INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: outflow_grid !! Type of outflow on the grid box (unitless)
......@@ -711,9 +723,9 @@ 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_beta_fp,&
& fetch_basin, basin_id, basin_coor, basin_type, basin_flowdir, outflow_grid, outflow_basin, inflow_number,&
& inflow_grid, inflow_basin)
& 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, outflow_basin, inflow_number, inflow_grid, inflow_basin)
END IF
END IF
END DO
......
This diff is collapsed.
......@@ -68,9 +68,9 @@ 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.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 = \
self.routing_floodp,self.routing_beta, self.routing_cg, self.topo_resid, 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, \
num_largest = hydrosuper.num_largest, gridarea = modelgrid.area, \
cfrac = modelgrid.contfrac, gridcenters = np.array(modelgrid.centers), \
......@@ -79,6 +79,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_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, \
basin_coor = hydrosuper.basin_outcoor, basin_type = hydrosuper.basin_type, \
......@@ -312,7 +313,11 @@ class HydroGraph :
self.add_tstepdistrib(outnf, procgrid, NCFillValue, part, self.topo_resid[:,:], self.routing_area[:,:], \
vtyp, nbbins, tcst)
#
# Geometric properties of HTU
self.add_variable(outnf, procgrid, NCFillValue, part, ('z','y','x'), \
"riverlen", "Mean river length within HTU", "m", self.topo_rlen[:,:], vtyp)
self.add_variable(outnf, procgrid, NCFillValue, part, ('z','y','x'), \
"riverdz", "Mean river elevation change within HTU", "m", self.topo_rdz[:,:], vtyp)
# Inflow number
self.add_variable(outnf, procgrid, NCFillValue, part, ('z','y','x'), \
"route_innum", "Number of inflow", "-", self.route_innum[:,:], vtyp, orig_type="int")
......
......@@ -362,7 +362,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_beta_fp = self.basin_beta_fp, fetch_basin = self.fetch_basin,\
basin_cg = self.basin_cg, basin_topoind = self.basin_topoind, 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, \
inflow_number = self.inflow_number, inflow_grid = self.inflow_grid, inflow_basin = self.inflow_basin)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment