From cf495ee08e819df74bbee754e7956ffdb7951bcd Mon Sep 17 00:00:00 2001
From: POLCHER Jan <jan.polcher@lmd.jussieu.fr>
Date: Tue, 4 Feb 2020 10:24:21 +0100
Subject: [PATCH] Some clean-up in F90Subroutines to ensure that we get less
 warnings from f2py.

---
 F90subroutines/.f2py_f2cmap          |  1 +
 F90subroutines/routing_interface.f90 | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 F90subroutines/.f2py_f2cmap

diff --git a/F90subroutines/.f2py_f2cmap b/F90subroutines/.f2py_f2cmap
new file mode 100644
index 0000000..1bcb48d
--- /dev/null
+++ b/F90subroutines/.f2py_f2cmap
@@ -0,0 +1 @@
+dict(real=dict(r_std='float', r_8='double'), integer=dict(i_std='int', i_8='long'))
diff --git a/F90subroutines/routing_interface.f90 b/F90subroutines/routing_interface.f90
index ebbacd6..2658149 100644
--- a/F90subroutines/routing_interface.f90
+++ b/F90subroutines/routing_interface.f90
@@ -385,7 +385,7 @@ SUBROUTINE rivclassification(nbpt, nwbas, nbcore, corepts, basin_count, outflow_
   INTEGER(i_std), DIMENSION(nbcore), INTENT(in)        :: corepts
   INTEGER(i_std), DIMENSION(nbpt), INTENT(in)          :: basin_count !!
   INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: outflow_grid
-  INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(in)    :: outflow_basin !!
+  INTEGER(i_std), DIMENSION(nbpt,nwbas), INTENT(inout) :: outflow_basin !!
   REAL(r_std), DIMENSION(nbpt,nwbas), INTENT(in)       :: fetch_basin !!
   REAL(r_std), INTENT(in) :: largest_rivarea
   INTEGER(i_std), INTENT (out) :: num_largest
@@ -401,6 +401,9 @@ SUBROUTINE rivclassification(nbpt, nwbas, nbcore, corepts, basin_count, outflow_
   !
   num_largest = 0
   !
+  ! Just a dummy use to avoid f2py warnings
+  outflow_basin(1,1) = outflow_basin(1,1)
+  !
   DO i=1,nbcore
      ig = fcorepts(i)
      !
@@ -647,7 +650,7 @@ SUBROUTINE finalrivclass(nbpt, nbasmax, nbcore, corepts, route_togrid, route_tob
   INTEGER(i_std), DIMENSION(nbcore), INTENT(in)          :: corepts
   INTEGER(i_std), DIMENSION(nbpt,nbasmax), INTENT(inout) :: route_togrid !! Grid into which the basin flows (unitless)
   INTEGER(i_std), DIMENSION(nbpt,nbasmax), INTENT(inout) :: route_tobasin !! Basin in to which the water goes (unitless)
-  REAL(r_std), DIMENSION(nbpt,nbasmax), INTENT(in)       :: routing_fetch !! Upstream are flowing into HTU (m^2)
+  REAL(r_std),    DIMENSION(nbpt,nbasmax), INTENT(inout) :: routing_fetch !! Upstream are flowing into HTU (m^2)
   REAL(r_std), INTENT(in) :: largest_rivarea
   INTEGER(i_std), INTENT (out) :: num_largest
   !
@@ -660,6 +663,9 @@ SUBROUTINE finalrivclass(nbpt, nbasmax, nbcore, corepts, route_togrid, route_tob
      fcorepts(i) = corepts(i)+1
   ENDDO
   !
+  ! Just a dummy use to avoid f2py warnings
+  route_togrid(1,1) = route_togrid(1,1)
+  !
   ! Redo the the distinction between river outflow and coastal flow. We can not
   ! take into account the return flow points.
   !
-- 
GitLab