diff --git a/F90subroutines/routing_reg.f90 b/F90subroutines/routing_reg.f90 index f38a21fac3f9c0e95f78af68311fb382ea9070b0..2ed9fc4dadcddb61520b3636348ea39484196019 100644 --- a/F90subroutines/routing_reg.f90 +++ b/F90subroutines/routing_reg.f90 @@ -2707,6 +2707,10 @@ SUBROUTINE routing_reg_end_truncate(nbpt, nbasmax, gridarea, contfrac, nwbas, nu ! DO ib=1,nbpt DO ij=1,basin_count(ib) + ! Flowing out of the grid + IF ( route_togrid_glo(ib,ij) .EQ. 0 ) THEN + route_tobasin_glo(ib,ij) = nbasmax + 2 + route_togrid_glo(ib,ij) = ib ! River flows IF ( route_togrid_glo(ib,ij) .EQ. -1 ) THEN route_tobasin_glo(ib,ij) = nbasmax + 2 diff --git a/RPPtools.py b/RPPtools.py index 04c7e3c2bce889f9b09d89ed372c080376d0ed6a..63ff806d2749ee6bd4609fad0b0ae21b3d057838 100644 --- a/RPPtools.py +++ b/RPPtools.py @@ -192,6 +192,7 @@ class compweights : self.area = [] self.lon = [] self.lat = [] + self.hpts = [] # innf=Dataset(weightfile, 'r') # @@ -205,6 +206,7 @@ class compweights : self.area.append(innf.variables["hydro_area"][0:maxhpts,i]) self.lon.append(innf.variables["hydro_lon"][0:maxhpts,i]) self.lat.append(innf.variables["hydro_lat"][0:maxhpts,i]) + self.hpts.append(maxhpts) # innf.close() # Find the indicis of the points on the HydroGrid using the coordinates. @@ -371,15 +373,17 @@ class compweights : mxval,nbp=landind.shape for ib in range(nbp) : if ~np.isnan(landind[0,ib]) : + maxhpts = len(hlon[:,ib]) j,i=landind[:,ib] self.mask[j,i] = 1.0 self.proc[j,i] = ib self.gindex[0,nib] = j self.gindex[1,nib] = i - self.hindex[0,:,nib] = hindj[:,ib] - self.hindex[1,:,nib] = hindi[:,ib] - self.hlon[:,nib] = hlon[:,ib] - self.hlat[:,nib] = hlat[:,ib] - self.harea[:,nib] = harea[:,ib] + self.hindex[0,:maxhpts,nib] = np.reshape(hindj[:,ib],self.hindex[0,:maxhpts,nib].shape) + self.hindex[1,:maxhpts,nib] = np.reshape(hindi[:,ib],self.hindex[1,:maxhpts,nib].shape) + self.hlon[:maxhpts,nib] = hlon[:,ib] + self.hlat[:maxhpts,nib] = hlat[:,ib] + self.harea[:maxhpts,nib] = harea[:,ib] + nib = nib+1 return nib diff --git a/tests/Iberia_n48/BuildHTUs_IP.pbs b/tests/Iberia_n48/BuildHTUs_IP.pbs index b8e56839afb5cdb8667d3c2719b6e4bd0854b9d0..11dbcddc5954f459a62a920625ea7b647cf89bca 100644 --- a/tests/Iberia_n48/BuildHTUs_IP.pbs +++ b/tests/Iberia_n48/BuildHTUs_IP.pbs @@ -17,7 +17,7 @@ source ../../Environment # # Clean-up. Weights are kept for future runs. # -/bin/rm -f DocumentationInterface *.nc *.txt +/bin/rm -f DocumentationInterface *graph.nc *.txt # # Run the Python code to generate the HTUs and write them into a netCDF file. # diff --git a/tests/Iberia_n48_regular/BuildHTUs_IP.pbs b/tests/Iberia_n48_regular/BuildHTUs_IP.pbs index 5b84498c79c6e4ff7ac2a901fe46c735bc3e5c02..8e9e843b684a7bbe6648e3b17c22da11d008c938 100644 --- a/tests/Iberia_n48_regular/BuildHTUs_IP.pbs +++ b/tests/Iberia_n48_regular/BuildHTUs_IP.pbs @@ -17,7 +17,7 @@ source ../../Environment # # Clean-up. Weights are kept for future runs. # -/bin/rm -f DocumentationInterface *.nc *.txt +/bin/rm -f DocumentationInterface *graph.nc *.txt # # Run the Python code to generate the HTUs and write them into a netCDF file. #