Commit 77cb5d70 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Variable in Interface.py need to be in float32 else not compatible with F90 code.

The addition of a landsendtohalo to fetch_basin does not work. Leads to a lock-up in truncate.
parent ab294cc9
......@@ -194,7 +194,7 @@ Parameters
----------
corepts : input rank-1 array('i') with bounds (nbcore)
basin_count : input rank-1 array('i') with bounds (nbpt)
basin_area : in/output rank-2 array('f') with bounds (nbpt,nwbas)
basin_area : input rank-2 array('f') with bounds (nbpt,nwbas)
basin_id : input rank-2 array('i') with bounds (nbpt,nwbas)
basin_hierarchy : input rank-2 array('f') with bounds (nbpt,nwbas)
basin_fac : input rank-2 array('f') with bounds (nbpt,nwbas)
......
......@@ -344,13 +344,13 @@ SUBROUTINE fetch(nbpt, nwbas, nbcore, corepts, basin_count, basin_area, basin_id
INTEGER(i_std), INTENT (in) :: nbcore
INTEGER(i_std), DIMENSION(nbcore), INTENT(in) :: corepts
INTEGER(i_std), DIMENSION(nbpt), INTENT(in) :: basin_count !!
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: basin_area !!
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(in) :: basin_area !!
INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(in) :: basin_id !!
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(in) :: basin_hierarchy
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(in) :: basin_fac
INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(in) :: outflow_grid !! Type of outflow on the grid box (unitless)
INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(in) :: outflow_basin !!
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(in) :: partial_sum
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(in) :: partial_sum
!
!! IN-OUTPUT VARIABLES
REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: fetch_basin !!
......
......@@ -166,12 +166,12 @@ class HydroSuper :
# Order of magnitude for the area precision in m^2.
prec = 100.0
#
fetch_basin = np.zeros(self.basin_area.shape, dtype=np.float64, order='F')
fetch_basin = np.zeros(self.basin_area.shape, dtype=np.float32, order='F')
#
self.basin_area = routing_interface.areanorm(self.basin_count, self.basin_area, self.outflow_grid)
partial_sum = np.zeros(self.basin_area.shape, dtype=np.float64, order='F')
partial_sum = np.zeros(self.basin_area.shape, dtype=np.float32, order='F')
#
old_sorted = np.zeros(largest_pos, dtype=np.float64, order='F')
old_sorted = np.zeros(largest_pos, dtype=np.float32, order='F')
#
maxdiff_sorted = prec*prec
iter_count = 0
......@@ -196,7 +196,7 @@ class HydroSuper :
maxdiff_sorted = np.max(np.abs(sorted_outareas[0:largest_pos]-old_sorted))
old_sorted[:] = sorted_outareas[0:largest_pos]
iter_count += 1
self.fetch_basin = np.copy(fetch_basin)
#
# Upstream area of the smalest river we call largest rivers.
......
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