SURFEX v8.1
General documentation of Surfex
flowdown.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !-----------------------------------------------------------------
6 ! ###################
7  SUBROUTINE flowdown(KNMC,PVAR,PCONN,KLINE)
8 ! ###################
9 !
10 !!**** *FLOWDOWN*
11 !
12 !! PURPOSE
13 !! -------
14 ! to propagate data between pixels of a catchment in function of its topography
15 !
16 !
17 !!** METHOD
18 !! ------
19 !
20 !! EXTERNAL
21 !! --------
22 !!
23 !! none
24 !!
25 !! IMPLICIT ARGUMENTS
26 !! ------------------
27 !!
28 !!
29 !!
30 !!
31 !!
32 !! REFERENCE
33 !! ---------
34 !!
35 !!
36 !!
37 !! AUTHOR
38 !! ------
39 !!
40 !! K. Chancibault * CNRM / Meteo-France *
41 !! G-M Saulnier * LTHE *
42 !!
43 !! MODIFICATIONS
44 !! -------------
45 !!
46 !! Original 14/01/2005
47 !-------------------------------------------------------------------------------
48 !
49 !* 0. DECLARATIONS
50 ! ------------
51 !
52 USE yomhook ,ONLY : lhook, dr_hook
53 USE parkind1 ,ONLY : jprb
54 !
55 IMPLICIT NONE
56 !
57 !* 0.1 declarations of arguments
58 !
59 INTEGER, INTENT(IN) :: KNMC ! catchment grid points number
60 REAL, DIMENSION(:), INTENT(INOUT) :: PVAR ! variable to propagate
61 REAL, DIMENSION(:,:), INTENT(IN) :: PCONN ! catchment grid points connections
62 INTEGER, DIMENSION(:), INTENT(IN) :: KLINE !
63 !
64 !* 0.2 declarations of local variables
65 !
66 INTEGER :: JJ, JI ! work variables
67 INTEGER :: JNUP ! number of upslope pixels
68 INTEGER :: JCOL ! third index of the pixel in the array XCONN
69 INTEGER :: JREF ! index of the upslope pixel in the topo domain
70 REAL :: ZFAC ! propagation factor between this pixel and the
71  ! upslope one
72 REAL(KIND=JPRB) :: ZHOOK_HANDLE
73 !------------------------------------------------------------------------------
74 IF (lhook) CALL dr_hook('FLOWDOWN',0,zhook_handle)
75 !
76 DO jj=1,knmc
77  jnup = int(pconn(jj,4))
78  DO ji=1,jnup
79  jcol = ((ji-1)*2) + 5
80  jref = int(pconn(jj,jcol))
81  zfac = pconn(jj,jcol+1)
82  pvar(jj) = pvar(jj) + pvar(kline(jref)) * zfac
83  ENDDO
84 ENDDO
85 !
86 IF (lhook) CALL dr_hook('FLOWDOWN',1,zhook_handle)
87 !
88 END SUBROUTINE flowdown
subroutine flowdown(KNMC, PVAR, PCONN, KLINE)
Definition: flowdown.F90:8
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15