SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
canopy_evol_tke.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 canopy_evol_tke(KI,KLVL,PTSTEP,PRHOA, &
7  pz,pzf,pdz,pdzf, &
8  pforc_e,pdforc_ede, &
9  pu,pth,puw,pwth,pwq,pleps,ptke )
10 ! #########################################
11 !
12 !!**** *CANOPY_EVOL_TKE* - evolution of wind in canopy
13 !!
14 !!
15 !! PURPOSE
16 !! -------
17 !!
18 !!** METHOD
19 !! ------
20 !!
21 !! EXTERNAL
22 !! --------
23 !!
24 !!
25 !! IMPLICIT ARGUMENTS
26 !! ------------------
27 !!
28 !! REFERENCE
29 !! ---------
30 !!
31 !!
32 !! AUTHOR
33 !! ------
34 !! V. Masson *Meteo France*
35 !!
36 !! MODIFICATIONS
37 !! -------------
38 !! Original 07/2006
39 !-------------------------------------------------------------------------------
40 !
41 !* 0. DECLARATIONS
42 ! ------------
43 !
44 USE modi_tridiag_surf
45 USE modd_canopy_turb, ONLY : xced, xtkemin
46 USE modd_csts, ONLY : xg, xrd, xrv
47 !
48 !
49 USE yomhook ,ONLY : lhook, dr_hook
50 USE parkind1 ,ONLY : jprb
51 !
52 IMPLICIT NONE
53 !
54 !* 0.1 Declarations of arguments
55 ! -------------------------
56 !
57 INTEGER, INTENT(IN) :: ki ! number of horizontal points
58 INTEGER, INTENT(IN) :: klvl ! number of levels in canopy
59 REAL, INTENT(IN) :: ptstep ! time-step (s)
60 REAL, DIMENSION(KI), INTENT(IN) :: prhoa ! Air density (kg/m3)
61 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pz ! Z at full levels (m)
62 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pzf ! Z at half levels (m)
63 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pdz ! deltaZ between canopy half levels,
64 ! ! located at full levels (m)
65 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pdzf ! deltaZ between canopy (full) levels,
66 ! ! located at half levels (m)
67 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pforc_e ! tendency of wind due to canopy drag (m2/s3)
68 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pdforc_ede! formal derivative of the tendency of
69 ! ! wind due to canopy drag (1/s)
70 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pu ! wind speed at canopy levels (m/s)
71 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pth ! pot. temp. at canopy levels (K)
72 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: puw ! turbulent flux (at half levels) (m2/s2)
73 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pwth ! w'Th' flux (at half levels) (mK/s)
74 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pwq ! w'q' flux (at half levels) (kg/m2/s)
75 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pleps ! dissipative length (full levels) (m)
76 REAL, DIMENSION(KI,KLVL), INTENT(INOUT) :: ptke ! TKE at canopy levels
77 !
78 !
79 !* 0.2 Declarations of local variables
80 ! -------------------------------
81 !
82 INTEGER :: jlayer ! loop counter on layers
83 !
84 REAL, DIMENSION(KI,KLVL) :: zdudz ! dU/dz at mid levels
85 REAL, DIMENSION(KI,KLVL) :: zdp ! dynamical production at full levels
86 ! ! (at full levels)
87 REAL, DIMENSION(KI,KLVL) :: ztp ! thermal production at full levels
88 ! ! (at full levels)
89 REAL, DIMENSION(KI,KLVL) :: zdiss_o_tke ! dissipation/TKE ratio at full levels
90 REAL, DIMENSION(KI,KLVL) :: zf ! turbulent flux at mid levels
91 REAL, DIMENSION(KI,KLVL) :: zdfddvdz ! derivative of turbulent flux as a
92 ! ! function of vertical gradient of wind variable
93 ! ! (at mid levels)
94 REAL, DIMENSION(KI,KLVL) :: zext ! external forcing at full levels
95 REAL, DIMENSION(KI,KLVL) :: zdextdv ! derivative of external forcing as a
96 ! ! function of vertical variable
97 ! ! (at full levels)
98 REAL, DIMENSION(KI,KLVL) :: ztke ! TKE at canopy levels (work var.)
99 REAL(KIND=JPRB) :: zhook_handle
100 !
101 !-------------------------------------------------------------------------------
102 !
103 !
104 !* 1. initializations
105 ! ---------------
106 !
107 !* external forces
108 !
109 IF (lhook) CALL dr_hook('CANOPY_EVOL_TKE',0,zhook_handle)
110 zext = 0.
111 zdextdv = 0.
112 !
113 !* turbulent flux
114 !
115 zf = 0.
116 zdfddvdz = 0.
117 !
118 !-------------------------------------------------------------------------------
119 !
120 !* 2. wind vertical derivative mid layers (at half levels below full levels)
121 ! ------------------------
122 !
123 zdudz(:,:) = -999.
124 DO jlayer=2,klvl
125  zdudz(:,jlayer) = (pu(:,jlayer) - pu(:,jlayer-1)) / pdzf(:,jlayer)
126 END DO
127 !-------------------------------------------------------------------------------
128 !
129 !* 3. Dynamical production of TKE (at full levels)
130 ! ---------------------------
131 !
132 zdp(:,:) = -999.
133 !
134 !* first level using an extrapolation using a 1/z law
135 zdp(:,1) = - puw(:,2) * zdudz(:,2) * (pzf(:,2)/pz(:,1))
136 
137 ! other levels
138 DO jlayer=2,klvl-1
139  zdp(:,jlayer) = - 0.5 * (puw(:,jlayer) * zdudz(:,jlayer) ) &
140  - 0.5 * (puw(:,jlayer+1) * zdudz(:,jlayer+1))
141 END DO
142 !
143 !* upper level using an extrapolation using a 1/z law
144 zdp(:,klvl) = - puw(:,klvl) * zdudz(:,klvl) * (pzf(:,klvl)/pz(:,klvl))
145 !
146 !* adds dynamical production in non-transport forces
147 zext = zext + zdp
148 zdextdv = zdextdv + 0.
149 !
150 !-------------------------------------------------------------------------------
151 !
152 !* 4. Thermal production of TKE (at full levels)
153 ! -------------------------
154 !
155 ztp(:,:) = -999.
156 !
157 ! other levels
158 DO jlayer=1,klvl-1
159  ztp(:,jlayer) = xg/pth(:,jlayer) * 0.5 * ( (pwth(:,jlayer)+ pwth(:,jlayer+1)) &
160  + (xrv/xrd-1) * (pwq(:,jlayer) + pwq(:,jlayer) )/prhoa(:) )
161 END DO
162 !
163 !* upper level
164 ztp(:,klvl) = xg/pth(:,klvl) * pwth(:,klvl)
165 !
166 !* adds dynamical production in non-transport forces
167 zext = zext + ztp
168 zdextdv = zdextdv + 0.
169 !
170 !-------------------------------------------------------------------------------
171 !
172 !* 4. Dissipation/TKE ratio (to prepare implicitation of dissipation)
173 ! ---------------------
174 !
175 zdiss_o_tke = - xced * sqrt(ptke(:,:)) / pleps(:,:)
176 !
177 !* adds dissipation in non-transport forces
178 zext = zext + zdiss_o_tke * ptke(:,:)
179 zdextdv = zdextdv + 1.5 * zdiss_o_tke
180 !
181 !-------------------------------------------------------------------------------
182 !
183 !* 6. Adds Creation force due to canopy
184 ! ---------------------------------
185 !
186 !
187 zext = zext + pforc_e(:,:)
188 zdextdv = zdextdv + pdforc_ede(:,:)
189 
190 
191 !-------------------------------------------------------------------------------
192 !
193 !* 7. Evolution of TKE due to Dyn prod, Dissipation and Drag production
194 ! -----------------------------------------------------------------
195 !
196 !* note that dissipation is implicited
197 !
198  CALL tridiag_surf(ptke,zf,zdfddvdz,zext,zdextdv,ptstep, &
199  pdzf,pdz,ztke )
200 !
201 !-------------------------------------------------------------------------------
202 !
203 !* 7. New value of TKE (at full levels)
204 ! ----------------
205 !
206 ptke(:,:) = ztke(:,:)
207 !
208 !-------------------------------------------------------------------------------
209 !
210 !* 8. Security at all levels : set minimum threshold
211 ! ----------------------
212 !
213 ptke(:,:) = max(ptke,xtkemin)
214 IF (lhook) CALL dr_hook('CANOPY_EVOL_TKE',1,zhook_handle)
215 !
216 !----------------------------------------------------------------
217 !
218 END SUBROUTINE canopy_evol_tke
subroutine canopy_evol_tke(KI, KLVL, PTSTEP, PRHOA, PZ, PZF, PDZ, PDZF, PFORC_E, PDFORC_EDE, PU, PTH, PUW, PWTH, PWQ, PLEPS, PTKE)
subroutine tridiag_surf(PVARM, PF, PDFDDTDZ, PEXT, PDEXTDV, PTSTEP, PDZZ, PDZM, PVARP, OIMPL, PALFA, PBETA)
Definition: tridiag_surf.F90:6