SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
init_isba_sbl.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_isba_sbl(HISBA, HCPSURF, KLVL, PTSTEP, PPA, PPS, PTA, PQA, PRHOA, PU, PV, &
7  pdir_sw, psca_sw, psw_bands, prain, psnow, &
8  pzref, puref, ptg, ppatch, pwg, pwgi, pz0, psso_slope, &
9  presa, pveg, plai, pwr, prgl, prsmin, pgamma, pwrmax_cf, &
10  pz0_o_z0h, pwfc, pwsat, ptsnow, pz, pt, pq, pwind, ptke, pp)
11 ! #################################################################################
12 !
13 !!**** *INIT_WATER_SBL* - inits water SBL profiles
14 !!
15 !! PURPOSE
16 !! -------
17 !
18 !!** METHOD
19 !! ------
20 !!
21 !! REFERENCE
22 !! ---------
23 !!
24 !!
25 !! AUTHOR
26 !! ------
27 !! S. Riette
28 !!
29 !! MODIFICATIONS
30 !! -------------
31 !! Original 03/2010
32 !!------------------------------------------------------------------
33 !
35 !
36 USE modd_csts, ONLY : xcpd, xrd, xp00, xg, xlvtt
37 USE modd_surf_atm, ONLY : lnosof
38 USE modd_canopy_turb, ONLY : xalpsbl
39 !
40 USE modi_cls_tq
41 USE modi_isba_snow_frac
42 USE modi_wet_leaves_frac
43 USE modi_veg
44 USE modi_drag
45 USE modi_cls_wind
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  CHARACTER(LEN=*) , INTENT(IN) :: hisba ! type of ISBA version
55  CHARACTER(LEN=*) , INTENT(IN) :: hcpsurf ! specific heat at surface
56 REAL, INTENT(IN) :: ptstep ! timestep of the integration
57 INTEGER , INTENT(IN) :: klvl ! number of levels in canopy
58 REAL, DIMENSION(:), INTENT(IN) :: ppa ! pressure at forcing level (Pa)
59 REAL, DIMENSION(:), INTENT(IN) :: pps ! pressure at atmospheric model surface (Pa)
60 REAL, DIMENSION(:), INTENT(IN) :: pta ! air temperature forcing (K)
61 REAL, DIMENSION(:), INTENT(IN) :: pqa ! air humidity forcing (kg/m3)
62 REAL, DIMENSION(:), INTENT(IN) :: prhoa ! air density (kg/m3)
63 REAL, DIMENSION(:), INTENT(IN) :: pu ! zonal wind (m/s)
64 REAL, DIMENSION(:), INTENT(IN) :: pv ! meridian wind (m/s)
65 REAL, DIMENSION(:,:),INTENT(IN) :: pdir_sw ! direct solar radiation (on horizontal surf.)
66 ! ! (W/m2)
67 REAL, DIMENSION(:,:),INTENT(IN) :: psca_sw ! diffuse solar radiation (on horizontal surf.)
68 ! ! (W/m2)
69 REAL, DIMENSION(:), INTENT(IN) :: psw_bands ! mean wavelength of each shortwave band (m)
70 REAL, DIMENSION(:), INTENT(IN) :: psnow ! snow precipitation (kg/m2/s)
71 REAL, DIMENSION(:), INTENT(IN) :: prain ! liquid precipitation (kg/m2/s)
72 REAL, DIMENSION(:), INTENT(IN) :: pzref ! height of T,q forcing (m)
73 REAL, DIMENSION(:), INTENT(IN) :: puref ! height of wind forcing (m)
74 REAL, DIMENSION(:,:), INTENT(IN):: ptg ! surface and sub-surface soil temperature profile (K)
75 REAL, DIMENSION(:,:), INTENT(IN):: ppatch ! fraction of each tile/patch
76 REAL, DIMENSION(:,:), INTENT(IN):: pwg ! soil volumetric water content profile (m3/m3)
77 REAL, DIMENSION(:,:), INTENT(IN):: pwgi ! soil liquid water equivalent volumetric
78 REAL, DIMENSION(:,:), INTENT(IN):: pz0 ! roughness length
79 REAL, DIMENSION(:), INTENT(IN) :: psso_slope! slope of S.S.O. (-)
80 REAL, DIMENSION(:,:), INTENT(IN):: presa ! aerodynamic resistance (s/m)
81 REAL, DIMENSION(:,:), INTENT(IN):: pveg ! vegetation cover fraction (-)
82 REAL, DIMENSION(:,:), INTENT(IN):: plai ! Leaf Area Index (m2/m2)
83 REAL, DIMENSION(:,:), INTENT(IN):: pwr ! liquid water retained on the
84 ! ! foliage of the vegetation
85 ! ! canopy
86 REAL, DIMENSION(:,:), INTENT(IN):: prgl ! maximum solar radiation
87 ! ! usable in photosynthesis (W/m2)
88 REAL, DIMENSION(:,:), INTENT(IN):: prsmin ! minimum stomatal resistance (s/m)
89 REAL, DIMENSION(:,:), INTENT(IN):: pgamma ! coefficient for the calculation
90 ! ! of the surface stomatal
91 ! ! resistance
92 REAL, DIMENSION(:,:), INTENT(IN):: pwrmax_cf ! coefficient for maximum water
93 ! ! interception
94 ! ! storage capacity on the vegetation (-)
95 REAL, DIMENSION(:,:), INTENT(IN):: pz0_o_z0h ! ratio of surface roughness lengths
96 ! ! (momentum to heat) (-)
97 REAL, DIMENSION(:,:), INTENT(IN):: pwfc ! field capacity volumetric water content
98 ! ! profile (m3/m3)
99 REAL, DIMENSION(:,:), INTENT(IN):: pwsat ! porosity profile (m3/m3)
100 TYPE(surf_snow) , INTENT(IN):: ptsnow ! snow state
101 REAL, DIMENSION(:,:), INTENT(IN):: pz ! height of middle of each level grid (m)
102 !
103 REAL, DIMENSION(:,:), INTENT(OUT) :: pt ! temperature at each level in SBL (m/s)
104 REAL, DIMENSION(:,:), INTENT(OUT) :: pq ! humidity at each level in SBL (kg/m3)
105 REAL, DIMENSION(:,:), INTENT(OUT) :: pwind! wind at each level in SBL (m/s)
106 REAL, DIMENSION(:,:), INTENT(OUT) :: ptke ! Tke at each level in SBL (m2/s2)
107 REAL, DIMENSION(:,:), INTENT(OUT) :: pp ! pressure at each level in SBL (kg/m3)
108 !
109 !* 0.2 declarations of local variables
110 !
111 !* forcing variables
112 !
113 REAL, DIMENSION(SIZE(PTA)) :: zwind ! lowest atmospheric level wind speed (m/s)
114 REAL, DIMENSION(SIZE(PTA)) :: zexna ! Exner function at lowest SBL scheme level (-)
115 REAL, DIMENSION(SIZE(PTA)) :: zqa ! specific humidity (kg/m3)
116 !
117 ! SBL turbulence scheme
118 !
119 REAL, DIMENSION(SIZE(PTA)) ::zri
120 REAL, DIMENSION(SIZE(PTA)) ::zcd
121 REAL, DIMENSION(SIZE(PTA)) ::zcdn
122 REAL, DIMENSION(SIZE(PTA)) ::zch
123 REAL, DIMENSION(SIZE(PTA)) ::ztnm
124 REAL, DIMENSION(SIZE(PTA)) ::zqnm
125 REAL, DIMENSION(SIZE(PTA)) ::zhunm
126 REAL, DIMENSION(SIZE(PTA)) ::zp_slope_cos
127 REAL, DIMENSION(SIZE(PTA)) ::zz0
128 REAL, DIMENSION(SIZE(PTA)) ::zz0h
129 REAL, DIMENSION(SIZE(PTA)) ::zexns
130 REAL, DIMENSION(SIZE(PTA)) ::zts
131 REAL, DIMENSION(SIZE(PTA)) ::zhu
132 REAL, DIMENSION(SIZE(PTA)) ::zqs
133 REAL, DIMENSION(SIZE(PTA)) ::zz0eff
134 REAL, DIMENSION(SIZE(PTA)) ::zwg
135 REAL, DIMENSION(SIZE(PTA)) ::zwgi
136 REAL, DIMENSION(SIZE(PTA)) ::zveg
137 REAL, DIMENSION(SIZE(PTA)) ::zresa
138 REAL, DIMENSION(SIZE(PTA)) ::zhug
139 REAL, DIMENSION(SIZE(PTA)) ::zhugi
140 REAL, DIMENSION(SIZE(PTA)) ::zhv
141 REAL, DIMENSION(SIZE(PTA)) ::zcps
142 REAL, DIMENSION(SIZE(PTA)) ::zwrmax_cf
143 REAL, DIMENSION(SIZE(PTA)) ::zwr
144 REAL, DIMENSION(SIZE(PTA)) ::zz0_with_snow
145 REAL, DIMENSION(SIZE(PTA)) ::zpsng
146 REAL, DIMENSION(SIZE(PTA)) ::zpsnv
147 REAL, DIMENSION(SIZE(PTA)) ::zpsnv_a
148 REAL, DIMENSION(SIZE(PTA)) ::zpsn
149 REAL, DIMENSION(SIZE(PTA)) ::zsnowalb
150 REAL, DIMENSION(SIZE(PTA),SIZE(PTSNOW%WSNOW,2)) ::zsnowswe
151 REAL, DIMENSION(SIZE(PTA),SIZE(PTSNOW%WSNOW,2)) ::zsnowrho
152 REAL, DIMENSION(SIZE(PTA)) ::zffg
153 REAL, DIMENSION(SIZE(PTA)) ::zffgnos
154 REAL, DIMENSION(SIZE(PTA)) ::zffv
155 REAL, DIMENSION(SIZE(PTA)) ::zffvnos
156 REAL, DIMENSION(SIZE(PTA)) ::zff
157 REAL, DIMENSION(SIZE(PTA)) ::zrs
158 REAL, DIMENSION(SIZE(PTA)) ::zp_global_sw
159 REAL, DIMENSION(SIZE(PTA)) ::zf2
160 REAL, DIMENSION(SIZE(PTA)) ::zf5
161 REAL, DIMENSION(SIZE(PTA)) ::zlai
162 REAL, DIMENSION(SIZE(PTA)) ::zgamma
163 REAL, DIMENSION(SIZE(PTA)) ::zrgl
164 REAL, DIMENSION(SIZE(PTA)) ::zrsmin
165 REAL, DIMENSION(SIZE(PTA)) ::zdelta
166 REAL, DIMENSION(SIZE(PTA)) ::zwrmax
167 REAL, DIMENSION(SIZE(PTA)) ::zcls_wind_zon
168 REAL, DIMENSION(SIZE(PTA)) ::zcls_wind_mer
169 REAL, DIMENSION(SIZE(PTA),SIZE(PTSNOW%WSNOW,2)) ::zsum_layer
170 REAL, DIMENSION(SIZE(PTA)) ::zsum
171 REAL, DIMENSION(SIZE(PTA)) :: zleg_delta ! soil evaporation delta fn
172 REAL, DIMENSION(SIZE(PTA)) :: zlegi_delta ! soil sublimation delta fn
173 REAL, DIMENSION(SIZE(PTA)) :: zlvtt
174 !
175 INTEGER :: jswb
176 INTEGER :: jlayer
177 INTEGER :: jpatch
178 !
179 REAL, DIMENSION(SIZE(PTA),SIZE(PPATCH,2)) ::zwsnow
180 REAL(KIND=JPRB) :: zhook_handle
181 !-------------------------------------------------------------------------------------
182 !
183 IF (lhook) CALL dr_hook('INIT_ISBA_SBL',0,zhook_handle)
184 !
185 !Means over patches
186 zts = sum(ptg(:,:)*ppatch(:,:) ,dim=2)
187 zwg = sum(pwg(:,:)*ppatch(:,:) ,dim=2)
188 zwgi = sum(pwgi(:,:)*ppatch(:,:),dim=2)
189 zz0 = sum(ppatch(:,:)*pz0(:,:) ,dim=2)
190 !
191 !We choose to set ZZ0EFF and ZZ0_WITH_SNOW equal to ZZ0
192 zz0eff = zz0
193 zz0_with_snow = zz0
194 zz0h(:) = sum(ppatch(:,:) * pz0(:,:)/pz0_o_z0h(:,:),dim=2)
195 zveg(:) = sum(ppatch(:,:) * pveg(:,:) ,dim=2)
196 !
197 zp_slope_cos(:) = 1./sqrt(1.+psso_slope(:)**2)
198 IF (lnosof) zp_slope_cos(:) = 1.0
199 !
200 zresa(:) = sum(ppatch(:,:)*presa(:,:),dim=2)
201 WHERE(zveg(:)>0)
202  zlai(:)= sum(ppatch(:,:)*pveg(:,:)*plai(:,:) ,dim=2,mask=pveg(:,:)>0) / zveg(:)
203  zwrmax_cf(:)= sum(ppatch(:,:)*pveg(:,:)*pwrmax_cf(:,:),dim=2,mask=pveg(:,:)>0) / zveg(:)
204  zwr(:)= sum(ppatch(:,:)*pveg(:,:)*pwr(:,:) ,dim=2,mask=pveg(:,:)>0) / zveg(:)
205 ELSEWHERE
206  zlai(:) = plai(:,1)
207  zwrmax_cf(:) = pwrmax_cf(:,1)
208  zwr(:) = pwr(:,1)
209 ENDWHERE
210 !
211 zsum_layer(:,:) = 0.
212 zsum(:) = 0.
213 !
214 DO jlayer=1,SIZE(ptsnow%WSNOW,2)
215  zsnowswe(:,jlayer) = sum(ppatch(:,:)*ptsnow%WSNOW(:,jlayer,:),dim=2)
216  zsum_layer(:,jlayer) = sum(ppatch(:,:),dim=2,mask=ptsnow%WSNOW(:,jlayer,:)>0)
217  WHERE(zsum_layer(:,jlayer)>0)
218  zsnowrho(:,jlayer)= sum( ppatch(:,:)*ptsnow%RHO(:,jlayer,:), dim=2, &
219  mask=ptsnow%WSNOW(:,jlayer,:)>0) / zsum_layer(:,jlayer)
220  ELSEWHERE
221  zsnowrho(:,jlayer)=ptsnow%RHO(:,jlayer,1)
222  ENDWHERE
223 END DO
224 !
225 zsum(:)=sum(zsum_layer(:,:),dim=2)
226 !
227 zwsnow(:,:) = 0.
228 DO jpatch=1,SIZE(ptsnow%WSNOW,3)
229  DO jlayer=1,SIZE(ptsnow%WSNOW,2)
230  zwsnow(:,jpatch) = zwsnow(:,jpatch) + ptsnow%WSNOW(:,jlayer,jpatch)
231  ENDDO
232 ENDDO
233 !
234 WHERE(zsum(:)>0)
235  zsnowalb(:) = sum(ppatch(:,:)*ptsnow%ALB(:,:),dim=2,mask=zwsnow(:,:)>0) / zsum(:)
236 ELSEWHERE
237  zsnowalb(:) = ptsnow%ALB(:,1)
238 ENDWHERE
239 !
240 zrgl(:) = sum(ppatch(:,:) * prgl(:,:),dim=2)
241 zrsmin(:) = sum(ppatch(:,:) * prsmin(:,:),dim=2)
242 zgamma(:) = sum(ppatch(:,:) * pgamma(:,:),dim=2)
243 !
244 zexna(:) = (ppa(:)/xp00)**(xrd/xcpd)
245 zexns(:) = (pps(:)/xp00)**(xrd/xcpd)
246 zqa(:) = pqa(:) / prhoa(:)
247 zwind(:) = sqrt(pu**2+pv**2)
248 !
249 !We compute the snow fractions
250  CALL isba_snow_frac(ptsnow%SCHEME, &
251  zsnowswe, zsnowrho, zsnowalb, &
252  zveg, zlai, zz0, &
253  zpsn, zpsnv_a, zpsng, zpsnv )
254 !
255 !We compute total shortwave incoming radiation needed by veg
256 zp_global_sw(:) = 0.
257 DO jswb=1,SIZE(psw_bands)
258  zp_global_sw(:) = zp_global_sw(:) + (pdir_sw(:,jswb) + psca_sw(:,jswb))
259 END DO
260 !
261 !We choose the case HPHOTO=='NON' and a humid soil (ZF2=1) to compute ZRS
262 zf2(:)=1.0
263  CALL veg(zp_global_sw, pta, zqa, pps, zrgl, zlai, zrsmin, zgamma, zf2, zrs)
264 !Calculation of ZDELTA
265  CALL wet_leaves_frac(zwr, zveg, zwrmax_cf, zz0_with_snow, zlai, zwrmax, zdelta)
266 !
267 !We choose the case LFLOOD=false
268 zffg(:) = 0.0
269 zffgnos(:) = 0.0
270 zffv(:) = 0.0
271 zffvnos(:) = 0.0
272 zff(:) = 0.0
273 !
274 zf5(:) = 1.0
275 zlvtt(:) = xlvtt
276 !We compute ZCD, ZCH and ZRI
277  CALL drag(hisba, ptsnow%SCHEME, hcpsurf, ptstep, &
278  zts, zwg, zwgi, zexns, zexna, pta, &
279  zwind, zqa, prain, psnow, pps, zrs, &
280  zveg, zz0, zz0eff, zz0h, pwfc(:,1), pwsat(:,1), &
281  zpsng, zpsnv, pzref, puref, zp_slope_cos, zdelta, zf5, &
282  zresa, zch, zcd, zcdn, zri, zhug, zhugi, zhv, zhu, zcps, &
283  zqs, zffg, zffv, zff, zffgnos, zffvnos, zleg_delta, zlegi_delta, &
284  zwr, prhoa, zlvtt )
285 !
286 !Initialisation of T, Q, Wind and TKE on all canopy levels
287 DO jlayer=1,klvl
288  !
289  CALL cls_tq(pta, zqa, ppa, pps, pzref, zcd, zch, zri, zts, zhu, zz0h, &
290  pz(:,jlayer), ztnm, zqnm, zhunm )
291  !
292  pt(:,jlayer)=ztnm
293  pq(:,jlayer)=zqnm
294  !
295  CALL cls_wind(pu, pv, puref, zcd, zcdn, zri, pz(:,jlayer), &
296  zcls_wind_zon, zcls_wind_mer )
297  !
298  pwind(:,jlayer) = sqrt( zcls_wind_zon(:)**2 + zcls_wind_mer(:)**2 )
299  ptke(:,jlayer) = xalpsbl * zcd(:) * ( pu(:)**2 + pv(:)**2 )
300  pp(:,jlayer) = ppa(:) + xg * prhoa(:) * (pz(:,klvl) - pz(:,jlayer))
301  !
302 ENDDO
303 !
304 IF (lhook) CALL dr_hook('INIT_ISBA_SBL',1,zhook_handle)
305 !
306 END SUBROUTINE init_isba_sbl
subroutine cls_wind(PZONA, PMERA, PHW, PCD, PCDN, PRI, PHV, PZON10M, PMER10M)
Definition: cls_wind.F90:6
subroutine init_isba_sbl(HISBA, HCPSURF, KLVL, PTSTEP, PPA, PPS, PTA, PQA, PRHOA, PU, PV, PDIR_SW, PSCA_SW, PSW_BANDS, PRAIN, PSNOW, PZREF, PUREF, PTG, PPATCH, PWG, PWGI, PZ0, PSSO_SLOPE, PRESA, PVEG, PLAI, PWR, PRGL, PRSMIN, PGAMMA, PWRMAX_CF, PZ0_O_Z0H, PWFC, PWSAT, PTSNOW, PZ, PT, PQ, PWIND, PTKE, PP)
subroutine wet_leaves_frac(PWRM, PVEG, PWRMAX_CF, PZ0, PLAI, PWRMAX, PDELTA)
subroutine veg(PSW_RAD, PTA, PQA, PPS, PRGL, PLAI, PRSMIN, PGAMMA, PF2, PRS)
Definition: veg.F90:6
subroutine drag(HISBA, HSNOW_ISBA, HCPSURF, PTSTEP, PTG, PWG, PWGI, PEXNS, PEXNA, PTA, PVMOD, PQA, PRR, PSR, PPS, PRS, PVEG, PZ0, PZ0EFF, PZ0H, PWFC, PWSAT, PPSNG, PPSNV, PZREF, PUREF, PDIRCOSZW, PDELTA, PF5, PRA, PCH, PCD, PCDN, PRI, PHUG, PHUGI, PHV, PHU, PCPS, PQS, PFFG, PFFV, PFF, PFFG_NOSNOW, PFFV_NOSNOW, PLEG_DELTA, PLEGI_DELTA, PWR, PRHOA, PLVTT, PQSAT)
Definition: drag.F90:6
subroutine cls_tq(PTA, PQA, PPA, PPS, PHT, PCD, PCH, PRI, PTS, PHU, PZ0H, PH, PTNM, PQNM, PHUNM)
Definition: cls_tq.F90:6
subroutine isba_snow_frac(HSNOW, PWSNOW, PRSNOW, PASNOW, PVEG, PLAI, PZ0, PPSN, PPSNV_A, PPSNG, PPSNV)