diff --git a/CHANGES.rst b/CHANGES.rst index 8e6390cd..018a140e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,6 +12,9 @@ Changelog of threedigrid-builder ------------------- - Define new boundary condition types. + +- Add boundaries to quadtree line administration. + - Handle open YZ profiles correctly when the middle is higher than the sides. diff --git a/libthreedigrid/cells.f90 b/libthreedigrid/cells.f90 index a9c6ec29..f5c7bf2c 100644 --- a/libthreedigrid/cells.f90 +++ b/libthreedigrid/cells.f90 @@ -264,6 +264,7 @@ subroutine set_quarter_admin(nodk, nodm, nodn, line, kcu, quarter_line, quarter_ ! When adjacent cells differ in size due to refinement, each quadrant is associated with its own line for the larger cell. The smaller cell will have the same flow line for both quadrants. Hence the "if" structure. ! Same logic applies to finding neighbouring nodes for quarters. ! The cell quadrant index is illustrated above. + do l=1, liutot nodd = line(l, 1) + 1 ! This is a 0-based python index, therefore +1 nodu = line(l, 2) + 1 @@ -384,7 +385,7 @@ subroutine set_quarter_admin(nodk, nodm, nodn, line, kcu, quarter_line, quarter_ select case(kcu(l)) case(LINE_2D_BOUNDARY_WEST) quarter_line(get_quarter_idx(nodu, 1), 1) = l - 1 - quarter_line(get_quarter_idx(nodu, 3), 1) = l + quarter_line(get_quarter_idx(nodu, 3), 1) = l - 1 quarter_neighbour(get_quarter_idx(nodu, 1), 1) = nodd - 1 quarter_neighbour(get_quarter_idx(nodu, 3), 1) = nodd - 1 case(LINE_2D_BOUNDARY_EAST) diff --git a/threedigrid_builder/application.py b/threedigrid_builder/application.py index 64fa2651..1653c798 100644 --- a/threedigrid_builder/application.py +++ b/threedigrid_builder/application.py @@ -80,7 +80,6 @@ def _make_gridadmin( node_id_counter=node_id_counter, line_id_counter=line_id_counter, ) - grid.set_quarter_administration(quadtree) if grid.meta.has_groundwater: grid.add_groundwater( @@ -95,6 +94,7 @@ def _make_gridadmin( line_id_counter, ) + grid.set_quarter_administration(quadtree) dem_average_areas = db.get_dem_average_areas() grid.set_dem_averaged_cells(dem_average_areas)