Commit 328dc536 authored by Anthony's avatar Anthony
Browse files

Linkup new case : when the minimum hierarchy of a basin is in two different grid points

parent 8163e023
......@@ -2291,13 +2291,20 @@ SUBROUTINE routing_reg_linkup(nbpt, neighbours, nwbas, basin_count, basin_area,
dop = minhloc(basin_id(sp,sb),1)
bop = minhloc(basin_id(sp,sb),2)
IF ((dop < undef_int ) .AND. (dop .GT. 0) .AND. (bop < undef_int) .AND. (bop .GT. 0)) THEN
!basin_hierarchy(sp,sb) = basin_hierarchy(dop,bop)
CALL routing_updateflow(sp, sb, dop, bop, nbpt,nwbas, nbxmax*8, outflow_grid, outflow_basin, &
& inflow_number, inflow_grid, inflow_basin)
found = 1
WRITE(numout,*) "Lowest basin hierarchy in the neighbours grid points"
WRITE(numout,*) "hierarch of (sp,sb)", basin_hierarchy(sp,sb)
WRITE(numout,*) "Lowest basinid hierarch", basin_hierarchy(dop,bop)
! It is possible that the lowest hierarchy is in two grid cells
! In this case, if we have an error for this routing_updateflow
! We go to next step and make it a coastal flow
IF (outflow_basin(sp, sb) < undef_int) THEN
found = 1
WRITE(numout,*) "Lowest basin hierarchy in the neighbours grid points"
ELSE
WRITE(numout,*) "Lowest hierarchy may be in two different grid points"
END IF
WRITE(numout,*) "hierarch of (sp,sb)", basin_hierarchy(sp,sb)
WRITE(numout,*) "Lowest basinid hierarch", basin_hierarchy(dop,bop)
END IF
END IF
END DO
......
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