From 33e79de172858ee60b2fb1f7e7fd0b7b5e4eb871 Mon Sep 17 00:00:00 2001 From: POLCHER Jan <jan.polcher@lmd.jussieu.fr> Date: Tue, 26 May 2020 00:51:35 +0200 Subject: [PATCH] Small correction for mon-proc case --- Interface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Interface.py b/Interface.py index 3e1daaa..04e2a82 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) -- GitLab