SURFEX v8.1
General documentation of Surfex
fapair.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 fapair(PABC, PFD_SKY, PIA, PLAI, PXMUS, PSSA_SUP, PSSA_INF, &
7  PB_SUP, PB_INF, PALB_VEG, PALB_SOIL, OSHADE, &
8  PFAPR, PFAPR_BS, PLAI_EFF, PIACAN, &
9  PIACAN_SHADE, PIACAN_SUNLIT, PFRAC_SUN )
10 ! #########################################################################
11 !
12 !!**** *FAPAIR*
13 !!
14 !! PURPOSE
15 !! -------
16 !! Calculates fraction of absorbed photosynthetic active radiation (FAPAR) and
17 !! fraction of absorbed near infrared (FAPIR) of vegetation and bare soil.
18 !!
19 !!** METHOD
20 !! ------
21 !! Carrer et al.
22 !!
23 !! EXTERNAL
24 !! --------
25 !! none
26 !!
27 !! IMPLICIT ARGUMENTS
28 !! ------------------
29 !!
30 !! USE MODD_SURF_PAR
31 !! USE MODD_CSTS
32 !! USE MODD_CO2V_PAR
33 !! USE MODI_CCETR_PAIR
34 !!
35 !! REFERENCE
36 !! ---------
37 !! Carrer et al, 2013 (doi:10.1002/jgrg20070)
38 !!
39 !! AUTHOR
40 !! ------
41 !! D. Carrer * Meteo-France *
42 !!
43 !! MODIFICATIONS
44 !! -------------
45 !! Original 01/04/2011
46 !! Commented by C. Delire 07/13
47 !! C. Delire 08/13 : moved calculation of diffuse fraction from here to radiative_transfert.F90
48 !! A. Boone 02/17 : corrected computation of PFAPR_BS
49 !!
50 !!-------------------------------------------------------------------------------
51 USE modd_surf_par, ONLY : xundef
52 USE modd_co2v_par, ONLY : xk_sup, xk_inf, xxsi_sup, xxsi_inf ! clumping index parameters (Carrer et al 2.1.3)
53 !
54 USE modd_surfex_mpi, ONLY : nrank
55 USE modi_ccetr_pair
56 !
57 USE yomhook ,ONLY : lhook, dr_hook
58 USE parkind1 ,ONLY : jprb
59 !
60 !* 0. DECLARATIONS
61 ! ------------
62 !
63 IMPLICIT NONE
64 !
65 !* 0.1 declarations of arguments
66 !
67 REAL, DIMENSION(:), INTENT(IN) :: PABC ! abscissa needed for integration
68 ! ! of net assimilation and stomatal
69 ! ! conductance over canopy depth
70 REAL, DIMENSION(:), INTENT(IN) :: PFD_SKY ! fraction of diffused radiation in sky
71 REAL, DIMENSION(:), INTENT(IN) :: PIA ! incident PAR or NIR
72 REAL, DIMENSION(:), INTENT(IN) :: PLAI ! leaf area index
73 REAL, DIMENSION(:), INTENT(IN) :: PXMUS ! cosine of solar zenith angle
74 REAL, INTENT(IN) :: PSSA_SUP, PSSA_INF !single scatering albedo (PAR or NIR)
75 REAL, DIMENSION(:), INTENT(IN) :: PB_SUP, PB_INF !sigma parameter in clumping (Table 1, eq4)
76 REAL, DIMENSION(:), INTENT(IN) :: PALB_VEG, PALB_SOIL
77 LOGICAL, DIMENSION(:), INTENT(IN) :: OSHADE ! OSHADE = if 1 shading activated
78 !
79 REAL, DIMENSION(:), INTENT(OUT) :: PFAPR
80 REAL, DIMENSION(:), INTENT(OUT) :: PFAPR_BS
81 REAL, DIMENSION(:), OPTIONAL, INTENT(OUT) :: PLAI_EFF
82 !
83 REAL, DIMENSION(:,:), OPTIONAL, INTENT(OUT) :: PIACAN ! PAR in the canopy at different gauss level
84 REAL, DIMENSION(:,:), OPTIONAL, INTENT(OUT) :: PIACAN_SHADE ! PAR in the canopy at different gauss level
85 REAL, DIMENSION(:,:), OPTIONAL, INTENT(OUT) :: PIACAN_SUNLIT ! PAR in the canopy at different gauss level
86 REAL, DIMENSION(:,:), OPTIONAL, INTENT(OUT) :: PFRAC_SUN ! fraction of sunlit leaves
87 !
88 !* 0.2 declarations of local variables
89 !
90 !
91 REAL, DIMENSION(SIZE(PLAI)) :: ZXIA, ZXIA_SUP, ZKMUSP_SUP, ZKMUSP_INF
92 REAL, DIMENSION(SIZE(PLAI)) :: ZB_DR_SUP, ZB_DR_INF, ZOMEGA_DR_SUP, ZOMEGA_DR_INF, &
93  ZOMEGA_DF_SUP, ZOMEGA_DF_INF
94 ! ZXIA = abs. radiation of vegetation
95 REAL, DIMENSION(SIZE(PLAI)) :: ZTR, ZFD_VEG, ZFD_SUP, ZLAI_EFF0, ZLAI_EFF
96 ! ZTR = transmittance
97 ! ZFD_VEG, ZFD_SUP = fraction of radiation diffused by the considered medium (vegetation)
98 !REAL, DIMENSION(SIZE(PLAI)) :: ZXIA_SUNLIT, ZXIA_SHADE, ZLAI_SUNLIT, ZLAI_SHADE
99 ! ZXIA_SUNLIT = absorbed PAR of sunlit leaves
100 ! ZXIA_SHADE = absorbed PAR of shaded leaves
101 ! ZLAI_SUNLIT = LAI of sunlit leaves
102 ! ZLAI_SHADE = LAI of shaded leaves
103 !REAL, DIMENSION(SIZE(PLAI)) :: ZRN_SUNLIT, ZRN_SHADE
104 REAL, DIMENSION(SIZE(PLAI),SIZE(PABC)) :: ZIACAN, ZIACAN_SUNLIT, ZIACAN_SHADE, ZFRAC_SUN
105 REAL :: ZABC, ZWEIGHT, ZCOEF, ZSUP, ZINF, &
106  ZSSA_SUP, ZSSA_INF, ZB_DF_SUP, ZB_DF_INF
107 ! ZABC = abscissa needed for integration
108 ! of net assimilation and stomatal
109 ! conductance over canopy depth (working scalar)
110 ! ZSUP, ZINF = d_sup and d_inf from Table 1. Carrer et al.
111 !
112 INTEGER :: JINT, I ! index for loops
113 REAL(KIND=JPRB) :: ZHOOK_HANDLE
114 !-------------------------------------------------------------------------------
115 IF (lhook) CALL dr_hook('FAPAIR',0,zhook_handle)
116 !
117 ! initialisation
118 !
119 ztr(:) = 1.0
120 !
121 zxia_sup(:) = 0.
122 !
123 zfd_veg(:) = 0.
124 zfd_sup(:) = 0.
125 !
126 !ZXIA_SUNLIT(:) = 0.
127 !ZXIA_SHADE(:) = 0.
128 !ZLAI_SUNLIT(:) = 0.
129 !ZLAI_SHADE(:) = 0.
130 !
131 zlai_eff(:) = 0.
132 !
133 ziacan(:,:) = 0.
134 ziacan_sunlit(:,:) = 0.
135 ziacan_shade(:,:) = 0.
136 zfrac_sun(:,:) = 0.
137 !
138 pfapr(:) = 0.
139 pfapr_bs(:) = 0.
140 !PRN_SHADE(:) = 0.
141 !PRN_SUNLIT(:) = 0.
142 !
143 !
144 IF (pabc(SIZE(pabc)).GT.0.8) zfd_veg(:) = min(pfd_sky(:),1.)
145 ! set param sup / inf
146 !
147 zssa_sup = sqrt(1.-pssa_sup)
148 zssa_inf = sqrt(1.-pssa_inf)
149 !
150 zsup = - 0.461 * xxsi_sup + 3.8 ! d_sup Carrer et al Table 1
151 zinf = - 0.461 * xxsi_inf + 3.8 ! d_inf Carrer et al Table 1
152 !
153 DO i=1,SIZE(pia)
154  IF (pia(i).NE.0.) THEN
155  zkmusp_sup(i) = exp(-xk_sup*(acos(pxmus(i)))**zsup)
156  zkmusp_inf(i) = exp(-xk_inf*(acos(pxmus(i)))**zinf)
157  ! direct case
158  ! Directional albedo of upper/lower layer
159  zb_dr_sup(i) = 1.-(1.-zssa_sup)/(1.+2.*pxmus(i)*zssa_sup) ! Carrer et al. b_dr Table 1
160  zb_dr_inf(i) = 1.-(1.-zssa_sup)/(1.+2.*pxmus(i)*zssa_inf)
161  ! CLUMPING INDEX
162  zomega_dr_sup(i) = 1. / (1.+ pb_sup(i)*zkmusp_sup(i)) ! Carrer et al. eq. 4a
163  zomega_dr_inf(i) = 1. / (1.+ pb_inf(i)*zkmusp_inf(i))
164  ! diffuse case
165  ! CLUMPING INDEX
166  zomega_df_sup(i) = (1.+pb_sup(i)/2.)/(1.+pb_sup(i)) ! Carrer et al. eq. 4b
167  zomega_df_inf(i) = (1.+pb_inf(i)/2.)/(1.+pb_inf(i))
168  ENDIF
169 ENDDO
170 !
171 ! Non-directional albedo of diffuse
172 zb_df_sup = 1.-(1.-zssa_sup)/(1.+ zssa_sup)
173 zb_df_inf = 1.-(1.-zssa_inf)/(1.+ zssa_inf)
174 !
175 ! Integration over the canopy: SIZE(PABC) increments
176 ! are used to approximate the integral. And to calculate
177 ! absorded fluxes within the canopy and in the bare soil
178 DO jint = SIZE(pabc),1,-1
179 !
180  zabc = 1. ! normalized height unit of the layer above
181  IF (jint.LT.SIZE(pabc)) zabc = pabc(jint+1)
182  zweight = zabc - pabc(jint)
183  !
184  IF (pabc(jint).GT.0.8) THEN
185  ! Compute transmittance of each level
186  CALL ccetr_pair (jint, pabc(jint), zabc, pia, pxmus, zb_dr_sup, &
187  zomega_dr_sup, zomega_df_sup, zb_df_sup, plai, &
188  palb_veg, palb_soil, pfd_sky, zfd_veg, ztr, &
189  zxia, zlai_eff0 )
190  ELSE
191  CALL ccetr_pair (jint, pabc(jint), zabc, pia, pxmus, zb_dr_inf, &
192  zomega_dr_inf, zomega_df_inf, zb_df_inf, plai, &
193  palb_veg, palb_soil, pfd_sky, zfd_veg, ztr, &
194  zxia, zlai_eff0 )
195  ENDIF
196  !
197  DO i=1,SIZE(pia)
198  !
199  zxia(i) = max(0.,zxia(i))
200  ziacan(i,jint) = max(0.,zxia(i)-zxia_sup(i))
201  zxia_sup(i) = zxia(i)
202  !
203  zlai_eff0(i) = max(0.,zlai_eff0(i))
204  zlai_eff(i) = zlai_eff(i) + zlai_eff0(i)
205  !
206  !calculate a FAPAR/FAPIR of the entire canopy
207  pfapr(i) = pfapr(i) + ziacan(i,jint)
208  !
209  !------------------------------------------------------
210  ! If LSHADE=0 no shading, only sunlit leaves
211  ! If LSHADE=1 shading
212  ! PIACAN is used to calculate An of each level within the canopy in cotwores
213  ! ZIACAN_SUNLIT used for net assimilation of a sunlit leave in COTWO
214  ! ZIACAN_SHADE used in A-gs for net assimilation of a shaded leave in COTWO
215  IF (oshade(i)) THEN
216  !
217  !sunlit leaves
218  !absorbed PAR of an equivalent canopy representative of the layer of leaves eq. (8)
219  zcoef = (1.0-zfd_sup(i))/ztr(i)+ zfd_sup(i)
220  ziacan_sunlit(i,jint) = zcoef/(zweight*max(0.0001,plai(i)))*ziacan(i,jint)
221  !not sunlit leaves
222  ziacan_shade(i,jint) = max(0.,zfd_sup(i)/(zweight*max(0.0001,plai(i)))*ziacan(i,jint))
223  !
224  !ZXIA_SUNLIT(I) = ZXIA_SUNLIT(I) + ZWEIGHT*ZTR(I) *ZIACAN_SUNLIT(I,JINT)
225  !ZLAI_SUNLIT(I) = ZLAI_SUNLIT(I) + ZWEIGHT*ZTR(I)*ZCOEF*PLAI(I)
226  !
227  !ZXIA_SHADE(I) = ZXIA_SHADE(I) + ZWEIGHT*(1-ZTR(I)) *ZIACAN_SHADE(I,JINT)
228  !ZLAI_SHADE(I) = ZLAI_SHADE(I) + ZWEIGHT*(1-ZTR(I))*ZFD_SUP(I)*PLAI(I)
229  !
230  zfrac_sun(i,jint) = ztr(i) !fraction of sunlit leaves
231  !
232  ELSE
233  !
234  ziacan_sunlit(i,jint) = max(0.,ziacan(i,jint)/(zweight*max(0.0001,plai(i))))
235  !ZLAI_SUNLIT(I) = ZLAI_SUNLIT(I) + ZWEIGHT*PLAI(I)
236  !
237  ENDIF
238  !
239  zfd_sup(i) = zfd_veg(i)
240  !
241  ENDDO
242  !
243 END DO
244 !
245 !
246 WHERE (pia(:).NE.0.)
247  pfapr(:) = pfapr(:) / pia(:)
248  pfapr_bs(:)= ztr(:)*(1.-palb_soil(:)*(1. - palb_veg(:)*(1.-ztr(:))))
249 END WHERE
250 !
251 !WHERE (ZLAI_SHADE(:) .NE.0.) ZRN_SHADE(:) = ZXIA_SHADE(:) / ZLAI_SHADE(:)
252 !WHERE (ZLAI_SUNLIT(:).NE.0.) ZRN_SUNLIT(:) = ZXIA_SUNLIT(:)/ ZLAI_SUNLIT(:)
253 !
254 IF (PRESENT(plai_eff)) plai_eff = zlai_eff
255 IF (PRESENT(piacan)) piacan = ziacan
256 IF (PRESENT(piacan_sunlit)) piacan_sunlit = ziacan_sunlit
257 IF (PRESENT(piacan_shade)) piacan_shade = ziacan_shade
258 IF (PRESENT(pfrac_sun)) pfrac_sun = zfrac_sun
259 !
260 IF (lhook) CALL dr_hook('FAPAIR',1,zhook_handle)
261 !
262 END SUBROUTINE fapair
subroutine ccetr_pair(KNIV, PABC, PABC_SUP, PIA, PXMUS, PB_DR, POMEGA_DR, POMEGA_DF, PB_DF, PLAI, PALB_VEG, PALB_SOIL, PFD_SKY, PFD_VEG, PTR, PXIA, PLAI_EFF)
Definition: ccetr_pair.F90:10
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
subroutine fapair(PABC, PFD_SKY, PIA, PLAI, PXMUS, PSSA_SUP, PSSA_INF, PB_SUP, PB_INF, PALB_VEG, PALB_SOIL, OSHADE, PFAPR, PFAPR_BS, PLAI_EFF, PIACAN, PIACAN_SHADE, PIACAN_SUNLIT, PFRAC_SUN)
Definition: fapair.F90:10
logical lhook
Definition: yomhook.F90:15