diff --git a/Interface.py b/Interface.py index 3e1daaa95a399be5431196b9fc3b6e5799456865..04e2a82e991fb636b3e242da120027190ea79d80 100644 --- a/Interface.py +++ b/Interface.py @@ -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)