Commit 20533bf1 authored by Anthony's avatar Anthony
Browse files

Light corrections

parent 0d953cb8
......@@ -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
......
......@@ -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
......@@ -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.
#
......
......@@ -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.
#
......
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