Skip to content
Snippets Groups Projects
Commit 33e79de1 authored by POLCHER Jan's avatar POLCHER Jan :bicyclist_tone4:
Browse files

Small correction for mon-proc case

parent 8748d90e
No related branches found
No related tags found
No related merge requests found
...@@ -206,7 +206,7 @@ def finalfetch(part, routing_area, basin_count, route_togrid, route_tobasin, fet ...@@ -206,7 +206,7 @@ def finalfetch(part, routing_area, basin_count, route_togrid, route_tobasin, fet
maxdiff_sorted = 0.0 maxdiff_sorted = 0.0
else : else :
maxdiff_sorted = np.max(np.abs(sorted_outareas[0:largest_pos]-old_sorted)) 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 iter_count += 1
# #
...@@ -402,12 +402,12 @@ class HydroSuper : ...@@ -402,12 +402,12 @@ class HydroSuper :
# Precision in m^2 of the upstream areas when sorting. # Precision in m^2 of the upstream areas when sorting.
sorted_outareas = (np.unique(np.rint(np.array(xtmp)/prec))*prec)[::-1] 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. # 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 : if part.size == 1 :
maxdiff_sorted = 0.0 maxdiff_sorted = 0.0
else : else :
l = min(sorted_outareas.shape[0],largest_pos)
maxdiff_sorted = np.max(np.abs(sorted_outareas[0:largest_pos]-old_sorted[0:l])) 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 iter_count += 1
self.fetch_basin = np.copy(fetch_basin) self.fetch_basin = np.copy(fetch_basin)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment