SURFEX v8.1
General documentation of Surfex
teb_morpho.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 teb_morpho(HPROGRAM, T )
7 ! ###########################################################################################################
8 !
9 !!**** *TEB_MORPHO*
10 !!
11 !! PURPOSE
12 !! -------
13 !!**** routine to verify and compute the canyon/building morphology in TEB
14 !!
15 !!** METHOD
16 !! ------
17 !! the routine controls the canyon/building morphology
18 !! - in the case of low building fraction (lower than 10^-4)
19 !! - in the case of high building fraction (higher than 0.9999)
20 !! - building height
21 !! - in the case of low road fraction
22 !! - in the case of low/hight wall surface ratio
23 !!
24 !! EXTERNAL
25 !! --------
26 !!
27 !! IMPLICIT ARGUMENTS
28 !! ------------------
29 !!
30 !! REFERENCE
31 !! ---------
32 !!
33 !! AUTHOR
34 !! ------
35 !! G. Pigeon *Meteo France*
36 !!
37 !! MODIFICATIONS
38 !! -------------
39 !! Original 10/2011
40 !! C. de Munck and A. lemonsu 05/2013 : - corrections in case of too high WALL_O_HOR (6.)
41 !! - final check of parameters range added
42 !----------------------------------------------------------------------------------------------
43 !
44 !* 0. DECLARATIONS
45 ! ------------
46 !
47 USE modd_teb_n, ONLY : teb_t
48 !
49 USE modi_get_luout
50 USE modi_abor1_sfx
51 !
52 IMPLICIT NONE
53 !
54 !* 0.1 Declarations of arguments
55 ! -------------------------
56 !
57  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling surf. schemes
58 !
59 TYPE(teb_t), INTENT(INOUT) :: T
60 !
61 !* 0.2 Declarations of local variables
62 !
63 INTEGER :: JJ
64 INTEGER :: ILUOUT
65 !
66 REAL, DIMENSION(SIZE(T%XBLD)) :: ZWALL_O_BLD ! Initial wall to built surface ratio
67 REAL, DIMENSION(SIZE(T%XBLD)) :: ZWALL_O_HOR ! Initial wall to horizontal surface ratio
68 !
69 REAL, DIMENSION(2) :: ZRANGE_BLD = (/ 0.0001 , 0.9999 /) ! Range allowed for T%XBLD variation
70 REAL, DIMENSION(2) :: ZRANGE_ROAD = (/ 0.0001 , 0.9999 /) ! Range allowed for T%XROAD variation
71 REAL, DIMENSION(2) :: ZRANGE_BLD_HEIGHT = (/ 3. , 829.84 /) ! Range allowed for T%XBLD_HEIGHT variation
72 REAL, DIMENSION(2) :: ZRANGE_WALL_O_HOR = (/ 0.00012 , 322. /) ! Range allowed for T%XWALL_O_HOR variation
73 !
74 !
75 !* 1. Get listing file for warnings
76 !
77  CALL get_luout(hprogram, iluout)
78 !
79 
80 zwall_o_bld(:) = 0.
81 zwall_o_hor(:) = 0.
82 
83 DO jj=1,SIZE(t%XBLD)
84  !
85  !* 2. Control building height no lower than 3.m and no higher than 829.84m
86  ! reference: http://en.wikipedia.org/wiki/List_of_tallest_buildings_and_structures_in_the_world (2011)
87  ! and control Z0_TOWN
88  !
89  IF (t%XBLD_HEIGHT(jj) < zrange_bld_height(1) ) THEN
90  t%XBLD_HEIGHT(jj) = zrange_bld_height(1)
91  ENDIF
92  IF (t%XBLD_HEIGHT(jj) > zrange_bld_height(2)) &
93  CALL abor1_sfx('TEB_MORPHO: T%XBLD_HEIGHT higher than 829.84, highest building in the world, should be lower')
94  !
95  IF (t%XZ0_TOWN(jj) > t%XBLD_HEIGHT(jj)) THEN
96  CALL abor1_sfx('TEB_MORPHO: T%XZ0_TOWN higher than T%XBLD_HEIGHT, should be lower')
97  ENDIF
98  !
99  !* 3. Control no and almost no building in the cell
100  ! authorize building up to 10m and W_O_H 0.001
101  !
102  IF (t%XBLD(jj) < zrange_bld(1) ) THEN
103  t%XBLD(jj) = zrange_bld(1)
104  t%XGARDEN(jj) = min(t%XGARDEN(jj), 1.-2.*t%XBLD(jj))
105  ENDIF
106  !
107  !* 4. Control only building in the cell: could occur for high resolution
108  ! theoretically W_O_H could be 0. -> impose that at least the wall surface is equal to the mesh perimeter x building
109  ! height for a mesh size of 100 x 100m; the waste heat is released at the roof level
110  !
111  IF (t%XBLD(jj) > zrange_bld(2)) THEN
112  t%XBLD(jj) = zrange_bld(2)
113  IF (t%XGARDEN(jj) > 0.) THEN
114  t%XGARDEN(jj) = 0.
115  ENDIF
116  ENDIF
117  !
118  !* 5. Control wall surface low respective to building density and building height: pb of the input
119  ! Evaluation of the minimum woh is done for mesh size of 1000. m
120  ! wall surface of the building evaluated considering 1 square building
121  !
122  IF (t%XWALL_O_HOR(jj) < 4. * sqrt(t%XBLD(jj))*t%XBLD_HEIGHT(jj)/1000.) THEN
123  t%XWALL_O_HOR(jj) = 4. * sqrt(t%XBLD(jj))*t%XBLD_HEIGHT(jj)/1000.
124  ENDIF
125  !
126  !* 6. Control facade surface vs building height, case of too high WALL_O_HOR
127  !
128  t%XWALL_O_BLD(jj) = t%XWALL_O_HOR(jj)/t%XBLD(jj)
129  !
130  IF (t%XWALL_O_BLD(jj) > (0.4 * t%XBLD_HEIGHT(jj))) THEN ! <=> side_of_building < 10 m
131  !
132  zwall_o_hor(jj) = t%XWALL_O_HOR(jj)
133  zwall_o_bld(jj) = t%XWALL_O_BLD(jj)
134  !
135  t%XWALL_O_HOR(jj) = 0.4 * t%XBLD (jj) * t%XBLD_HEIGHT(jj) ! correction WOHOR v2.1
136  t%XWALL_O_BLD(jj) = t%XWALL_O_HOR(jj) / t%XBLD (jj) ! correction WOHOR v2.1
137 
138  ENDIF
139  !
140  !* 7. Verify road
141  !
142  t%XROAD (jj) = 1.-(t%XGARDEN(jj)+t%XBLD(jj))
143  IF (t%XROAD(jj) <= zrange_road(1) ) THEN
144  t%XROAD(jj) = zrange_road(1)
145  t%XGARDEN(jj) = max(t%XGARDEN(jj) - zrange_road(1), 0.)
146  IF (t%XH_TRAFFIC(jj) > 0. .OR. t%XLE_TRAFFIC(jj) > 0.) THEN
147  t%XH_TRAFFIC(jj) = 0.
148  t%XLE_TRAFFIC(jj) = 0.
149  ENDIF
150  ENDIF
151  !
152  !* 8. Final check of parameters range
153  !
154  IF ( t%XBLD(jj) < zrange_bld(1) .OR. t%XBLD(jj) > zrange_bld(2) ) THEN
155  WRITE(iluout,*) 'WARNING : T%XBLD is still out of range after final corrections &
156  &for grid mesh',jj,' : ',t%XBLD(jj)
157  ENDIF
158  !
159  IF ( t%XBLD_HEIGHT(jj) < zrange_bld_height(1) .OR. t%XBLD_HEIGHT(jj) > zrange_bld_height(2) ) THEN
160  WRITE(iluout,*) 'WARNING : T%XBLD_HEIGHT is still out of range after final corrections &
161  &for grid mesh',jj,' : ',t%XBLD_HEIGHT(jj)
162  ENDIF
163  !
164  IF ( t%XWALL_O_HOR(jj) < zrange_wall_o_hor(1) .OR. t%XWALL_O_HOR(jj) > zrange_wall_o_hor(2) ) THEN
165  WRITE(iluout,*) 'WARNING : T%XWALL_O_HOR is still out of range after final corrections &
166  &for grid mesh',jj,' : ',t%XWALL_O_HOR(jj)
167  ENDIF
168  !
169  IF ( t%XWALL_O_BLD(jj) - (0.4 * t%XBLD_HEIGHT(jj)) > 10e-16 ) THEN
170  WRITE(iluout,*) 'WARNING : T%XWALL_O_BLD is still too high after final corrections &
171  &for grid mesh',jj,' : ',t%XWALL_O_BLD(jj)
172  ENDIF
173  !
174 ENDDO
175 !
176 !
177 !* 9. Compute morphometric parameters
178 !
179 t%XCAN_HW_RATIO(:) = 0.5 * t%XWALL_O_HOR(:) / (1.-t%XBLD(:))
180 !
181 !* relative surface fraction
182 !
183 t%XROAD_O_GRND(:) = t%XROAD(:) / (t%XROAD(:) + t%XGARDEN(:))
184 t%XGARDEN_O_GRND(:) = t%XGARDEN(:) / (t%XROAD(:) + t%XGARDEN(:))
185 t%XWALL_O_GRND(:) = t%XWALL_O_HOR(:) / (t%XROAD(:) + t%XGARDEN(:))
186 !
187 !* Sky-view-factors:
188 !
189 t%XSVF_ROAD (:) = (sqrt(t%XCAN_HW_RATIO(:)**2+1.) - t%XCAN_HW_RATIO(:))
190 t%XSVF_GARDEN(:) = t%XSVF_ROAD(:)
191 t%XSVF_WALL (:) = 0.5*(t%XCAN_HW_RATIO(:)+1.-sqrt(t%XCAN_HW_RATIO(:)**2+1.))/t%XCAN_HW_RATIO(:)
192 !
193 END SUBROUTINE teb_morpho
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
subroutine teb_morpho(HPROGRAM, T)
Definition: teb_morpho.F90:7
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7