Commit 098102aa authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Introduces a parameter to avoid too small HTUs in findbasins.

parent 7fa832f8
...@@ -533,6 +533,7 @@ CONTAINS ...@@ -533,6 +533,7 @@ CONTAINS
INTEGER(i_std) :: option, il_trib, jl_trib, changes !! INTEGER(i_std) :: option, il_trib, jl_trib, changes !!
INTEGER(i_std) :: nbdiv, il_upstr, jl_upstr INTEGER(i_std) :: nbdiv, il_upstr, jl_upstr
REAL(r_std) :: fac_glo_trib, fac_loc_trib, fac_loc_main, fac_loc_upstr REAL(r_std) :: fac_glo_trib, fac_loc_trib, fac_loc_main, fac_loc_upstr
REAL(r_std), PARAMETER :: htufrac_min=0.01
! !
!_ ================================================================================================================================ !_ ================================================================================================================================
! !
...@@ -780,15 +781,15 @@ CONTAINS ...@@ -780,15 +781,15 @@ CONTAINS
! !
! In this case nbdiv = 3 only if the upstream or downstream are not too ! In this case nbdiv = 3 only if the upstream or downstream are not too
! small (>1% of the grid) ! small (>1% of the grid)
IF ((fac_loc_upstr / REAL(totsz) .GT. 1./ REAL(100)) .AND. & IF ((fac_loc_upstr / REAL(totsz) .GT. htufrac_min) .AND. &
& ((fac_loc_main-fac_loc_trib-fac_loc_upstr)/REAL(totsz) .GT. 1./REAL(100))) THEN & ((fac_loc_main-fac_loc_trib-fac_loc_upstr)/REAL(totsz) .GT. htufrac_min)) THEN
nbdiv = 3 nbdiv = 3
ELSE ELSE
nbdiv = 2 nbdiv = 2
END IF END IF
! Perform the operation if the tributary is large enough (global fac) ! Perform the operation if the tributary is large enough (global fac)
! and if the HTU is not too small -> more than 4 pixels ! and if the HTU is not too small -> more than 4 pixels
IF (( fac_glo_trib .GT. fac_lim ) .AND. ( fac_loc_trib/REAL(totsz) .GT. 1./REAL(100))) THEN IF (( fac_glo_trib .GT. fac_lim ) .AND. ( fac_loc_trib/REAL(totsz) .GT. htufrac_min )) THEN
changes = changes + 1 changes = changes + 1
CALL routing_reg_divbas_cut(nb_htu, nbv, nbi, nbj, ibas,toutloc(ibas,1), toutloc(ibas,2),& CALL routing_reg_divbas_cut(nb_htu, nbv, nbi, nbj, ibas,toutloc(ibas,1), toutloc(ibas,2),&
& tsz(ibas), toutbas(ibas), toutdir(ibas), & & tsz(ibas), toutbas(ibas), toutdir(ibas), &
...@@ -821,7 +822,7 @@ CONTAINS ...@@ -821,7 +822,7 @@ CONTAINS
nbdiv = 2 nbdiv = 2
! !
! Check with the local fac if the tributary is not too small (>2%) ! Check with the local fac if the tributary is not too small (>2%)
IF ( fac_loc_trib / REAL(totsz) .GT. 1./REAL(100) ) THEN IF ( fac_loc_trib / REAL(totsz) .GT. htufrac_min ) THEN
changes = changes + 1 changes = changes + 1
CALL routing_reg_divbas_cut(nb_htu, nbv, nbi, nbj, ibas,toutloc(ibas,1), toutloc(ibas,2),& CALL routing_reg_divbas_cut(nb_htu, nbv, nbi, nbj, ibas,toutloc(ibas,1), toutloc(ibas,2),&
& tsz(ibas), toutbas(ibas), toutdir(ibas), & & tsz(ibas), toutbas(ibas), toutdir(ibas), &
......
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