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