SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
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:7