SURFEX v8.1
General documentation of Surfex
albedo.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 albedo(HALBEDO, PEK, PSNOW, OMASK )
7 ! ####################################################################
8 !
9 !!**** *ALBEDO*
10 !!
11 !! PURPOSE
12 !! -------
13 ! computes the albedo of for different types (patches)
14 ! of natural continental parts, from
15 ! vegetation albedo and soil albedo.
16 ! Soil albedo is estimated from sand fraction.
17 ! A correction due to the soil humidity is used.
18 !
19 !
20 !!** METHOD
21 !! ------
22 !
23 !! EXTERNAL
24 !! --------
25 !!
26 !! IMPLICIT ARGUMENTS
27 !! ------------------
28 !!
29 !!
30 !! REFERENCE
31 !! ---------
32 !!
33 !!
34 !! AUTHOR
35 !! ------
36 !! F.Solmon / V. Masson
37 !!
38 !! MODIFICATIONS
39 !! -------------
40 !! Original
41 !! 01/2004 Externalization (V. Masson)
42 !-------------------------------------------------------------------------------
43 !
44 !* 0. DECLARATIONS
45 ! ------------
46 !
47 USE modd_isba_n, ONLY : isba_pe_t
48 !
49 USE modd_data_cover_par, ONLY : nvt_snow
50 USE modd_snow_par, ONLY : xansmax
51 USE modd_surf_par, ONLY : xundef
52 !
53 !
54 USE yomhook ,ONLY : lhook, dr_hook
55 USE parkind1 ,ONLY : jprb
56 !
57 IMPLICIT NONE
58 !
59 !* 0.1 declarations of arguments
60 ! -------------------------
61 !
62  CHARACTER(LEN=*), INTENT(IN) :: HALBEDO
63 ! Albedo dependance wxith surface soil water content
64 ! "EVOL" = albedo evolves with soil wetness
65 ! "DRY " = constant albedo value for dry soil
66 ! "WET " = constant albedo value for wet soil
67 ! "MEAN" = constant albedo value for medium soil wetness
68 !
69 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
70 !
71 REAL, DIMENSION(:), INTENT(IN), OPTIONAL :: PSNOW ! fraction of permanent snow and ice
72 LOGICAL, DIMENSION(:), INTENT(IN), OPTIONAL :: OMASK ! mask where computations are done
73 !
74 !* 0.2 declarations of local variables
75 ! -------------------------------
76 !
77 LOGICAL, DIMENSION(SIZE(PEK%XVEG)) :: GMASK
78 !
79 REAL, DIMENSION(SIZE(PEK%XVEG)) :: ZSNOW
80 INTEGER :: JP !loop index for patches
81 REAL(KIND=JPRB) :: ZHOOK_HANDLE
82 !-------------------------------------------------------------------------------
83 !
84 IF (lhook) CALL dr_hook('ALBEDO',0,zhook_handle)
85 IF (halbedo=='USER' .AND. lhook) CALL dr_hook('ALBEDO',1,zhook_handle)
86 IF (halbedo=='USER') RETURN
87 !
88 gmask(:) = .true.
89 IF (PRESENT(omask)) gmask(:) = omask(:)
90 !
91 WHERE (gmask(:))
92  pek%XALBVIS (:) = xundef
93  pek%XALBNIR (:) = xundef
94  pek%XALBUV (:) = xundef
95 END WHERE
96 !
97 zsnow(:) = 0.
98 IF (PRESENT(psnow)) zsnow(:) = psnow(:)
99 !
100 WHERE (gmask(:) .AND. pek%XVEG(:)/=xundef)
101 
102  pek%XALBVIS(:) = ( (1.-pek%XVEG(:)) * pek%XALBVIS_SOIL(:) + pek%XVEG(:) * pek%XALBVIS_VEG (:)) &
103  * (1-zsnow(:)) + xansmax * zsnow(:)
104  !
105  pek%XALBNIR(:) = ( (1.-pek%XVEG(:)) * pek%XALBNIR_SOIL(:) + pek%XVEG(:) * pek%XALBNIR_VEG (:)) &
106  * (1-zsnow(:)) + xansmax * zsnow(:)
107  !
108  pek%XALBUV (:) = ( (1.-pek%XVEG(:)) * pek%XALBUV_SOIL (:) + pek%XVEG(:) * pek%XALBUV_VEG (:)) &
109  * (1-zsnow(:)) + xansmax * zsnow(:)
110 END WHERE
111 !
112 IF (lhook) CALL dr_hook('ALBEDO',1,zhook_handle)
113 !-------------------------------------------------------------------------------
114 !
115 END SUBROUTINE albedo
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
subroutine albedo(HALBEDO, PEK, PSNOW, OMASK)
Definition: albedo.F90:7