Commit 33e79de1 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Small correction for mon-proc case

parent 8748d90e
......@@ -206,7 +206,7 @@ def finalfetch(part, routing_area, basin_count, route_togrid, route_tobasin, fet
maxdiff_sorted = 0.0
else :
maxdiff_sorted = np.max(np.abs(sorted_outareas[0:largest_pos]-old_sorted))
old_sorted[:] = sorted_outareas[0:largest_pos]
old_sorted[:] = sorted_outareas[0:largest_pos]
iter_count += 1
#
......@@ -402,12 +402,12 @@ class HydroSuper :
# Precision in m^2 of the upstream areas when sorting.
sorted_outareas = (np.unique(np.rint(np.array(xtmp)/prec))*prec)[::-1]
# If mono-proc no need to iterate as fetch produces the full result.
l = min(sorted_outareas.shape[0],largest_pos)
if part.size == 1 :
maxdiff_sorted = 0.0
else :
l = min(sorted_outareas.shape[0],largest_pos)
maxdiff_sorted = np.max(np.abs(sorted_outareas[0:largest_pos]-old_sorted[0:l]))
old_sorted[:l] = sorted_outareas[0:largest_pos]
old_sorted[:l] = sorted_outareas[0:largest_pos]
iter_count += 1
self.fetch_basin = np.copy(fetch_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