SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
average_tsurf.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  SUBROUTINE average_tsurf(PFRAC_TILE, PTSURF_TILE, PTSURF)
7 ! ######################################################
8 !
9 !
10 !!**** *AVERAGE_TSURF*
11 !!
12 !! PURPOSE
13 !! -------
14 ! Average the surface temperature from the land and water surfaces depending on the
15 ! fraction of each surface cover type in the mesh area.
16 !
17 !!** METHOD
18 !! ------
19 !
20 !! EXTERNAL
21 !! --------
22 !!
23 !! IMPLICIT ARGUMENTS
24 !! ------------------
25 !!
26 !!
27 !! REFERENCE
28 !! ---------
29 !!
30 !! AUTHOR
31 !! ------
32 !! B. Decharme * Meteo-France *
33 !!
34 !! MODIFICATIONS
35 !! -------------
36 !! Original 23/04/2013
37 !-------------------------------------------------------------------------------
38 !
39 !* 0. DECLARATIONS
40 ! ------------
41 !
42 !
43 USE modd_surf_par, ONLY : xundef
44 !
45 !
46 !
47 USE yomhook ,ONLY : lhook, dr_hook
48 USE parkind1 ,ONLY : jprb
49 !
50 IMPLICIT NONE
51 !
52 !* 0.1 declarations of arguments
53 !
54 !
55 !* 0.1 declarations of arguments
56 !
57 REAL, DIMENSION(:,:), INTENT(IN) :: pfrac_tile ! Fraction in a mesh-area of
58 REAL, DIMENSION(:,:), INTENT(IN) :: ptsurf_tile ! surface effective temperature (K)
59 REAL, DIMENSION(:), INTENT(OUT):: ptsurf ! surface effective temperature (K)
60 !
61 !* 0.2 declarations of local variables
62 !
63 INTEGER :: ini, inp ! dimenssion
64 INTEGER :: ji, jp ! loop counter
65 !
66 REAL(KIND=JPRB) :: zhook_handle
67 !-------------------------------------------------------------------------------
68 !
69 IF (lhook) CALL dr_hook('AVERAGE_TSURF',0,zhook_handle)
70 !
71 ini = SIZE(pfrac_tile,1)
72 inp = SIZE(pfrac_tile,2)
73 !
74 ptsurf(:) = 0.
75 !
76 DO jp = 1,inp
77  DO ji = 1,ini
78  ptsurf(ji) = ptsurf(ji) + pfrac_tile(ji,jp) * ptsurf_tile(ji,jp)
79  ENDDO
80 ENDDO
81 !
82 IF (lhook) CALL dr_hook('AVERAGE_TSURF',1,zhook_handle)
83 
84 !-------------------------------------------------------------------------------
85 !
86 END SUBROUTINE average_tsurf
subroutine average_tsurf(PFRAC_TILE, PTSURF_TILE, PTSURF)