SURFEX v8.1
General documentation of Surfex
init_vegn.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 init_veg_n(IO, KK, PK, PEK, DTV, &
7  OSURF_DIAG_ALBEDO, PDIR_ALB, PSCA_ALB, PEMIS_OUT, PTSRAD )
8 !#############################################################
9 !
10 !!**** *INIT_VEG_n* - routine to initialize ISBA
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !!** METHOD
16 !! ------
17 !!
18 !! EXTERNAL
19 !! --------
20 !!
21 !!
22 !! IMPLICIT ARGUMENTS
23 !! ------------------
24 !!
25 !! REFERENCE
26 !! ---------
27 !!
28 !!
29 !! AUTHOR
30 !! ------
31 !! V. Masson *Meteo France*
32 !!
33 !! MODIFICATIONS
34 !!
35 !! B. Decharme 01/16 : Bug when vegetation veg, z0 and emis are imposed whith interactive vegetation
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
43 USE modd_data_isba_n, ONLY : data_isba_t
44 !
46 USE modd_snow_par, ONLY : xemissn
47 USE modd_surf_par, ONLY : xundef, nundef
48 !
49 USE modi_init_snow_lw
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 TYPE(isba_options_t), INTENT(INOUT) :: IO
63 TYPE(isba_k_t), INTENT(INOUT) :: KK
64 TYPE(isba_p_t), INTENT(INOUT) :: PK
65 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
66 TYPE(data_isba_t), INTENT(INOUT) :: DTV
67 !
68 LOGICAL, INTENT(OUT) :: OSURF_DIAG_ALBEDO
69 !
70 REAL, DIMENSION(:,:), INTENT(OUT) :: PDIR_ALB
71 REAL, DIMENSION(:,:), INTENT(OUT) :: PSCA_ALB
72 REAL, DIMENSION(:), INTENT(OUT) :: PEMIS_OUT
73 REAL, DIMENSION(:), INTENT(OUT) :: PTSRAD
74 !
75 !* 0.2 Declarations of local variables
76 ! -------------------------------
77 !
78 INTEGER :: JI ! loop increment
79 !
80 REAL(KIND=JPRB) :: ZHOOK_HANDLE
81 !
82 !-------------------------------------------------------------------------------
83 !
84 ! Initialisation for IO
85 !
86 IF (lhook) CALL dr_hook('INIT_VEG_n',0,zhook_handle)
87 !
88 !-------------------------------------------------------------------------------
89 !
90 !* 2. Radiative fields and snow/flood fracion initialization:
91 ! -------------------------------------------------------
92 !
93 !* snow long-wave properties (not initialized in read_gr_snow)
94 !
95  CALL init_snow_lw(xemissn,pek%TSNOW)
96 !
97 !-------------------------------------------------------------------------------
98 !
99 !* z0 and vegetation fraction estimated from LAI if not imposed
100 IF (io%CPHOTO=='NIT' .OR. io%CPHOTO=='NCB') THEN
101  DO ji=1,pk%NSIZE_P
102  IF(pek%XLAI(ji)/=xundef) THEN
103  pek%XLAI (ji) = max(pek%XLAIMIN(ji),pek%XLAI(ji))
104  IF (.NOT.dtv%LIMP_Z0) &
105  pek%XZ0 (ji) = z0v_from_lai(pek%XLAI(ji),pk%XH_TREE(ji),pk%XVEGTYPE_PATCH(ji,:),io%LAGRI_TO_GRASS)
106  IF (.NOT.dtv%LIMP_VEG) &
107  pek%XVEG (ji) = veg_from_lai(pek%XLAI(ji),pk%XVEGTYPE_PATCH(ji,:),io%LAGRI_TO_GRASS)
108  IF (.NOT.dtv%LIMP_EMIS) &
109  pek%XEMIS(ji) = emis_from_veg(pek%XVEG(ji),pk%XVEGTYPE_PATCH(ji,:))
110  END IF
111  END DO
112 END IF
113 !
114 !-------------------------------------------------------------------------------
115 !
116 IF (io%LTR_ML) THEN
117  ALLOCATE(pek%XFAPARC (pk%NSIZE_P))
118  ALLOCATE(pek%XFAPIRC (pk%NSIZE_P))
119  ALLOCATE(pek%XLAI_EFFC (pk%NSIZE_P))
120  ALLOCATE(pek%XMUS (pk%NSIZE_P))
121  pek%XFAPARC (:) = 0.
122  pek%XFAPIRC (:) = 0.
123  pek%XLAI_EFFC (:) = 0.
124  pek%XMUS (:) = 0.
125 ELSE
126  ALLOCATE(pek%XFAPARC (0))
127  ALLOCATE(pek%XFAPIRC (0))
128  ALLOCATE(pek%XLAI_EFFC (0))
129  ALLOCATE(pek%XMUS (0))
130 ENDIF
131 !
132 !-------------------------------------------------------------------------------
133 !
134 !* albedo per tile and averaged albedo, emissivity and radiative temperature
135 !
136 ALLOCATE(pek%XALBNIR_SOIL(pk%NSIZE_P))
137 ALLOCATE(pek%XALBVIS_SOIL(pk%NSIZE_P))
138 ALLOCATE(pek%XALBUV_SOIL (pk%NSIZE_P))
139 ALLOCATE(pek%XALBNIR (pk%NSIZE_P))
140 ALLOCATE(pek%XALBVIS (pk%NSIZE_P))
141 ALLOCATE(pek%XALBUV (pk%NSIZE_P))
142 pek%XALBNIR_SOIL(:) = xundef
143 pek%XALBVIS_SOIL(:) = xundef
144 pek%XALBUV_SOIL (:) = xundef
145 pek%XALBNIR (:) = xundef
146 pek%XALBVIS (:) = xundef
147 pek%XALBUV (:) = xundef
148 !
149 osurf_diag_albedo = .true.
150 !
151 !* Initialization of total albedo, emissivity and snow/flood fractions
152 !
153 ALLOCATE(pek%XPSN (pk%NSIZE_P))
154 ALLOCATE(pek%XPSNG(pk%NSIZE_P))
155 ALLOCATE(pek%XPSNV(pk%NSIZE_P))
156 pek%XPSN = 0.0
157 pek%XPSNG = 0.0
158 pek%XPSNV = 0.0
159 !
160 IF(pek%TSNOW%SCHEME=='EBA')THEN
161  ALLOCATE(pek%XPSNV_A(pk%NSIZE_P))
162  pek%XPSNV_A = 0.0
163 ELSE
164  ALLOCATE(pek%XPSNV_A(0))
165 ENDIF
166 !
167 pdir_alb = xundef
168 psca_alb = xundef
169 pemis_out= xundef
170 ptsrad = xundef
171 !
172 IF (lhook) CALL dr_hook('INIT_VEG_n',1,zhook_handle)
173 !
174 END SUBROUTINE init_veg_n
subroutine init_veg_n(IO, KK, PK, PEK, DTV, OSURF_DIAG_ALBEDO, PDIR_ALB, PSCA_ALB, PEMIS_OUT, PTSRAD)
Definition: init_vegn.F90:8
subroutine init_snow_lw(PEMISSN, TPSNOW)
Definition: init_snow_lw.F90:7
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
integer, parameter nundef
logical lhook
Definition: yomhook.F90:15