SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
sso_be04_frictionn.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 sso_be04_friction_n (SSCP, USS, &
7  ptstep,psea,puref,prhoa,pu,pv,psfu,psfv)
8 ! ###############################################################################
9 !
10 !!**** *SSO_BE04_FRICTION_n * - Computes subgrid-scale orography friction
11 ! according to several options:
12 ! CROUGH='Z01D' : orographic roughness length
13 ! CROUGH='Z04D' : orographic roughness length
14 ! variable with wind direction
15 !!
16 !! PURPOSE
17 !! -------
18 !
19 !!** METHOD
20 !! ------
21 !!
22 !! REFERENCE
23 !! ---------
24 !!
25 !!
26 !! AUTHOR
27 !! ------
28 !! V. Masson
29 !!
30 !! MODIFICATIONS
31 !! -------------
32 !! Original 05/2010
33 !----------------------------------------------------------------
34 !
35 !
36 !
39 !
40 USE modd_surf_par, ONLY : xundef
41 USE modd_canopy_turb, ONLY : xalpsbl
42 USE modd_csts, ONLY : xkarman
43 !
44 !
45 USE yomhook ,ONLY : lhook, dr_hook
46 USE parkind1 ,ONLY : jprb
47 !
48 USE modi_canopy_evol
49 USE modi_canopy_grid_update
50 USE modi_sso_beljaars04
51 !
52 IMPLICIT NONE
53 !
54 !* 0.1 declarations of arguments
55 !
56 !
57 TYPE(sso_canopy_t), INTENT(INOUT) :: sscp
58 TYPE(surf_atm_sso_t), INTENT(INOUT) :: uss
59 !
60 REAL, INTENT(IN) :: ptstep ! time step
61 REAL, DIMENSION(:), INTENT(IN) :: psea ! Sea fraction (-)
62 REAL, DIMENSION(:), INTENT(IN) :: puref ! Wind forcing height (m)
63 REAL, DIMENSION(:), INTENT(IN) :: prhoa ! air density (kg/m3)
64 REAL, DIMENSION(:), INTENT(IN) :: pu ! zonal wind (m/s)
65 REAL, DIMENSION(:), INTENT(IN) :: pv ! meridian wind (m/s)
66 REAL, DIMENSION(:), INTENT(INOUT) :: psfu ! zonal momentum flux (Pa)
67 REAL, DIMENSION(:), INTENT(INOUT) :: psfv ! meridian momentum flux (Pa)
68 !
69 !* 0.2 declarations of local variables
70 !
71 REAL, DIMENSION(SIZE(PU)) :: zwind ! wind strength (m/s)
72 REAL, DIMENSION(SIZE(PU)) :: zsso_stdev! SSO standard deviation (m)
73 REAL, DIMENSION(SIZE(PU)) :: zustar ! friction velocity
74 !
75 !* canopy variables
76 !
77 REAL, DIMENSION(SIZE(PU)) :: zta ! temperature (K)
78 REAL, DIMENSION(SIZE(PU)) :: zqa ! specific humidity (kg/m3)
79 REAL, DIMENSION(SIZE(PU)) :: zpa ! pressure (Pa)
80 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zt
81 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zq
82 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zlmo
83 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zlm
84 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zleps
85 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zp
86 REAL, DIMENSION(SIZE(PU)) :: zsflux_t
87 REAL, DIMENSION(SIZE(PU)) :: zsflux_q
88 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zforc_t
89 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zdforc_tdt
90 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zforc_q
91 REAL, DIMENSION(SIZE(PU),SSCP%NLVL) :: zdforc_qdq
92 REAL, DIMENSION(SIZE(PU)) :: zalfath
93 REAL, DIMENSION(SIZE(PU)) :: zbetath
94 REAL, DIMENSION(SIZE(PU)) :: zalfaq
95 REAL, DIMENSION(SIZE(PU)) :: zbetaq
96 !
97 REAL, DIMENSION(SIZE(PU), SSCP%NLVL) :: zforc_u ! tendency due to drag force for wind
98 REAL, DIMENSION(SIZE(PU), SSCP%NLVL) :: zdforc_udu ! formal derivative of
99 ! ! tendency due to drag force for wind
100 REAL, DIMENSION(SIZE(PU), SSCP%NLVL) :: zforc_e ! tendency due to drag force for TKE
101 REAL, DIMENSION(SIZE(PU), SSCP%NLVL) :: zdforc_ede ! formal derivative of
102 ! ! tendency due to drag force for TKE
103 INTEGER :: ini ! number of points
104 INTEGER :: ji ! number of points loop counter
105 INTEGER :: jlayer ! vertical loop counter
106 REAL, DIMENSION(SIZE(PU)) :: zh ! Canopy height (m)
107 REAL, DIMENSION(SIZE(PU)) :: zsflux_u ! Surface flux u'w' (m2/s2)
108 REAL, DIMENSION(SIZE(PU)) :: zalfau ! V+(1) = alfa u'w'(1) + beta ! not used
109 REAL, DIMENSION(SIZE(PU)) :: zbetau ! V+(1) = alfa u'w'(1) + beta ! not used
110 REAL(KIND=JPRB) :: zhook_handle
111 !
112 !-------------------------------------------------------------------------------------
113 !
114 !
115 !* 1. Initializations
116 ! ---------------
117 !
118 !* 1.1 Grid definition
119 ! ---------------
120 IF (lhook) CALL dr_hook('SSO_BE04_FRICTION_N',0,zhook_handle)
121 ini = SIZE(pu)
122 !
123 zh = 0.
124  CALL canopy_grid_update(ini,sscp%NLVL,zh,puref,sscp%XZ,sscp%XZF,sscp%XDZ,sscp%XDZF)
125 !
126 !* 1.2 Wind
127 ! ----
128 !
129 zwind = sqrt(pu**2+pv**2)
130 !
131 zsflux_u = - sqrt(psfu**2+psfv**2)
132 !
133 !
134 !* 1.3 Canopy profiles at first time step (neutral case)
135 ! ----------------------------------
136 !
137 IF (any(sscp%XU(:,sscp%NLVL)==xundef)) THEN
138  DO jlayer=1,sscp%NLVL
139  DO ji=1,ini
140  sscp%XU (ji,jlayer) = max( zwind(ji) + sqrt(-zsflux_u(ji)) / xkarman &
141  * log(sscp%XZ(ji,jlayer)/sscp%XZ(ji,sscp%NLVL)) , 0.)
142  sscp%XTKE(ji,jlayer) = - xalpsbl * zsflux_u(ji)
143  ENDDO
144  ENDDO
145 ENDIF
146 !
147 !
148 !-------------------------------------------------------------------------------------
149 !
150 !* 2. Subgrid-scale orographic drag (Beljaars et al 2004)
151 ! -----------------------------
152 !
153 zsso_stdev = uss%XSSO_STDEV
154 WHERE (zsso_stdev==xundef) zsso_stdev=0.
155 !
156 zforc_u(:,:)= 0.
157 zdforc_udu(:,:)= 0.
158 zforc_e(:,:) = 0.
159 zdforc_ede(:,:) = 0.
160 !
161 !* computes tendencies on wind and Tke due to subgridscale orography
162  CALL sso_beljaars04(uss, &
163  ini,sscp%NLVL,sscp%XZ,zsso_stdev,sscp%XU,zforc_u,zdforc_udu )
164 !
165 DO jlayer=1,sscp%NLVL
166  DO ji=1,ini
167  zforc_u(ji,sscp%NLVL) = zforc_u(ji,sscp%NLVL) * (1.0-psea(ji))
168  zdforc_udu(ji,sscp%NLVL) = zdforc_udu(ji,sscp%NLVL) * (1.0-psea(ji))
169  ENDDO
170 ENDDO
171 !
172 !-------------------------------------------------------------------------------------
173 !
174 !* 3. Computes coefficients for implicitation
175 ! ---------------------------------------
176 !
177 zta(:) = xundef
178 zqa(:) = xundef
179 zpa(:) = xundef
180 zsflux_t(:) = xundef
181 zsflux_q(:) = xundef
182 zt(:,:) = xundef
183 zq(:,:) = xundef
184 zlmo(:,:) = xundef
185 zp(:,:) = xundef
186 zforc_t(:,:) = xundef
187 zdforc_tdt(:,:) = xundef
188 zforc_q(:,:) = xundef
189 zdforc_qdq(:,:) = xundef
190 !
191  CALL canopy_evol(ini, sscp%NLVL, ptstep, 2, sscp%XZ, zwind, zta, zqa, zpa, prhoa, &
192  zsflux_u, zsflux_t, zsflux_q, &
193  zforc_u, zdforc_udu, zforc_e, zdforc_ede, &
194  zforc_t, zdforc_tdt, zforc_q, zdforc_qdq, &
195  sscp%XZ, sscp%XZF, sscp%XDZ, sscp%XDZF, sscp%XU, sscp%XTKE, zt, zq, zlmo, zlm, &
196  zleps, zp, zustar, &
197  zalfau, zbetau, zalfath, zbetath, zalfaq, zbetaq, &
198  oneutral=.true. )
199 !
200 !-------------------------------------------------------------------------------------
201 !
202 !
203 ! Momentum fluxes if canopy is used
204 !
205 WHERE (zwind>0.)
206  psfu(:) = - pu(:)/zwind(:) * zustar(:)**2 * prhoa(:)
207  psfv(:) = - pv(:)/zwind(:) * zustar(:)**2 * prhoa(:)
208 END WHERE
209 !
210 IF (lhook) CALL dr_hook('SSO_BE04_FRICTION_N',1,zhook_handle)
211 !
212 !-------------------------------------------------------------------------------------
213 !
214 END SUBROUTINE sso_be04_friction_n
subroutine sso_beljaars04(USS, KI, KLVL, PZ, PSSO_STDEV, PU, PFORC_U, PDFORC_UDU)
subroutine canopy_grid_update(KI, KLVL, PH, PZFORC, PZ, PZF, PDZ, PDZF)
subroutine sso_be04_friction_n(SSCP, USS, PTSTEP, PSEA, PUREF, PRHOA, PU, PV, PSFU, PSFV)
subroutine canopy_evol(KI, KLVL, PTSTEP, KIMPL, PZZ, PWIND, PTA, PQA, PPA, PRHOA, PSFLUX_U, PSFLUX_T, PSFLUX_Q, PFORC_U, PDFORC_UDU, PFORC_E, PDFORC_EDE, PFORC_T, PDFORC_TDT, PFORC_Q, PDFORC_QDQ, PZ, PZF, PDZ, PDZF, PU, PTKE, PT, PQ, PLMO, PLM, PLEPS, PP, PUSTAR, PALFAU, PBETAU, PALFATH, PBETATH, PALFAQ, PBETAQ, ONEUTRAL)
Definition: canopy_evol.F90:6