SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
sat_area_frac.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 sat_area_frac(PDEF,PAS,GTOPD)
8 ! ########################
9 !
10 !!***** * SAT_AREA_FRAC *
11 !
12 !! PURPOSE
13 !! -------
14 !
15 !
16 !
17 !
18 !!** METHOD
19 !! ------
20 !
21 !! EXTERNAL
22 !! --------
23 !!
24 !! none
25 !!
26 !! IMPLICIT ARGUMENTS
27 !! ------------------
28 !!
29 !!
30 !!
31 !!
32 !!
33 !! REFERENCE
34 !! ---------
35 !!
36 !!
37 !!
38 !! AUTHOR
39 !! ------
40 !!
41 !! K. Chancibault * LTHE / Meteo-France *
42 !!
43 !! MODIFICATIONS
44 !! -------------
45 !!
46 !! Original 27/11/2006
47 !! 03/2014 (B. Vincendon) computation based of pixels counts instead of areas
48 !
49 !----------------------------------------------------------------------
50 !* 0. DECLARATIONS
51 ! ------------
52 !
53 USE modd_topodyn, ONLY : nncat, nnmc, xdxt
54 USE modd_coupling_topd, ONLY : nmaskt, nnpix
55 USE modd_surf_par, ONLY : xundef, nundef
56 !
57 USE yomhook ,ONLY : lhook, dr_hook
58 USE parkind1 ,ONLY : jprb
59 !
60 IMPLICIT NONE
61 !
62 !* 0.1 declarations of arguments
63 !
64 REAL, DIMENSION(:,:),INTENT(IN) :: pdef ! deficit
65 REAL, DIMENSION(:), INTENT(OUT) :: pas !contributive area fraction in Isba meshes
66 LOGICAL, DIMENSION(:), INTENT(INOUT) :: gtopd !
67 !
68 !* 0.2 declarations of local variables
69 INTEGER :: jj, ji
70 REAL, DIMENSION(SIZE(PAS,1)) :: zcount
71 REAL(KIND=JPRB) :: zhook_handle
72 !-----------------------------------------------------------------------
73 IF (lhook) CALL dr_hook('SAT_AREA_FRAC',0,zhook_handle)
74 !
75 !* 0. Initialization:
76 !
77 pas(:)=0.0
78 !
79 DO jj=1,nncat
80  IF (gtopd(jj)) THEN
81  DO ji=1,nnmc(jj)
82  IF (pdef(jj,ji)==0.0 .AND. nmaskt(jj,ji)/=nundef .AND. nmaskt(jj,ji)/=0) THEN
83  pas(nmaskt(jj,ji)) = pas(nmaskt(jj,ji)) +1.
84  ENDIF
85  ENDDO
86  ENDIF
87 ENDDO
88 !
89 ! Calculation of the saturated area ratio in each Isba mesh
90 WHERE ((nnpix/=0.).AND.(pas/=xundef))
91  pas(:) = pas(:) / nnpix(:)
92 ENDWHERE
93 !
94 IF (lhook) CALL dr_hook('SAT_AREA_FRAC',1,zhook_handle)
95 !
96 END SUBROUTINE sat_area_frac
subroutine sat_area_frac(PDEF, PAS, GTOPD)