PageRenderTime 60ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/wrfv2_fire/phys/module_sf_bep_bem.F

http://github.com/jbeezley/wrf-fire
FORTRAN Legacy | 4101 lines | 2560 code | 730 blank | 811 comment | 59 complexity | 5fab623c5deab0dceb0cde135a58a9af MD5 | raw file
Possible License(s): AGPL-1.0

Large files files are truncated, but you can click here to view the full file

  1. MODULE module_sf_bep_bem
  2. !USE module_model_constants
  3. USE module_sf_urban
  4. USE module_sf_bem
  5. ! SGClarke 09/11/2008
  6. ! Access urban_param.tbl values through calling urban_param_init in module_physics_init
  7. ! for CASE (BEPSCHEME) select sf_urban_physics
  8. !
  9. ! -----------------------------------------------------------------------
  10. ! Dimension for the array used in the BEP module
  11. ! -----------------------------------------------------------------------
  12. integer nurbm ! Maximum number of urban classes
  13. parameter (nurbm=3)
  14. integer ndm ! Maximum number of street directions
  15. parameter (ndm=2)
  16. integer nz_um ! Maximum number of vertical levels in the urban grid
  17. parameter(nz_um=13)
  18. integer ng_u ! Number of grid levels in the ground
  19. parameter (ng_u=10)
  20. integer nwr_u ! Number of grid levels in the walls or roofs
  21. parameter (nwr_u=10)
  22. integer nf_u !Number of grid levels in the floors (BEM)
  23. parameter (nf_u=10)
  24. integer ngb_u !Number of grid levels in the ground below building (BEM)
  25. parameter (ngb_u=10)
  26. real dz_u ! Urban grid resolution
  27. parameter (dz_u=5.)
  28. integer nbui_max !maximum number of types of buildings in an urban class
  29. parameter (nbui_max=4) !must be less or equal than nz_um
  30. !---------------------------------------------------------------------------------
  31. !Parameters of the windows. The glasses of windows are considered without films -
  32. !Read the paper of J.Karlsson and A.Roos(2000):"modelling the angular behaviour -
  33. !of the total solar energy transmittance of windows".Solar Energy Vol.69,No.4, -
  34. !pp. 321-329, for more details. -
  35. !---------------------------------------------------------------------------------
  36. integer p_num !number of panes in the windows (1,2 or 3)
  37. parameter (p_num=2)
  38. integer q_num !category number for the windows (q_num= 4, standard glasses)
  39. parameter(q_num=4) !Possible values 1,2,...,10
  40. ! The change of ng_u, nwr_u should be done in agreement with the block data
  41. ! in the routine "surf_temp"
  42. ! -----------------------------------------------------------------------
  43. ! Constant used in the BEP module
  44. ! -----------------------------------------------------------------------
  45. real vk ! von Karman constant
  46. real g_u ! Gravity acceleration
  47. real pi !
  48. real r ! Perfect gas constant
  49. real cp_u ! Specific heat at constant pressure
  50. real rcp_u !
  51. real sigma !
  52. real p0 ! Reference pressure at the sea level
  53. real cdrag ! Drag force constant
  54. real latent ! Latent heat of vaporization [J/kg] (used in BEM)
  55. parameter(vk=0.40,g_u=9.81,pi=3.141592653,r=287.,cp_u=1004.)
  56. parameter(rcp_u=r/cp_u,sigma=5.67e-08,p0=1.e+5,cdrag=0.4,latent=2.45e+06)
  57. ! -----------------------------------------------------------------------
  58. CONTAINS
  59. subroutine BEP_BEM(FRC_URB2D,UTYPE_URB2D,itimestep,dz8w,dt,u_phy,v_phy, &
  60. th_phy,rho,p_phy,swdown,glw, &
  61. gmt,julday,xlong,xlat, &
  62. declin_urb,cosz_urb2d,omg_urb2d, &
  63. num_urban_layers, &
  64. trb_urb4d,tw1_urb4d,tw2_urb4d,tgb_urb4d, &
  65. tlev_urb3d,qlev_urb3d,tw1lev_urb3d,tw2lev_urb3d, &
  66. tglev_urb3d,tflev_urb3d,sf_ac_urb3d,lf_ac_urb3d, &
  67. cm_ac_urb3d,sfvent_urb3d,lfvent_urb3d, &
  68. sfwin1_urb3d,sfwin2_urb3d, &
  69. sfw1_urb3d,sfw2_urb3d,sfr_urb3d,sfg_urb3d, &
  70. a_u,a_v,a_t,a_e,b_u,b_v, &
  71. b_t,b_e,b_q,dlg,dl_u,sf,vl, &
  72. rl_up,rs_abs,emiss,grdflx_urb,qv_phy, &
  73. ids,ide, jds,jde, kds,kde, &
  74. ims,ime, jms,jme, kms,kme, &
  75. its,ite, jts,jte, kts,kte)
  76. implicit none
  77. !------------------------------------------------------------------------
  78. ! Input
  79. !------------------------------------------------------------------------
  80. INTEGER :: ids,ide, jds,jde, kds,kde, &
  81. ims,ime, jms,jme, kms,kme, &
  82. its,ite, jts,jte, kts,kte, &
  83. itimestep
  84. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: DZ8W
  85. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: P_PHY
  86. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: RHO
  87. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: TH_PHY
  88. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: T_PHY
  89. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: U_PHY
  90. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: V_PHY
  91. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: U
  92. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: V
  93. REAL, DIMENSION( ims:ime , jms:jme ) :: GLW
  94. REAL, DIMENSION( ims:ime , jms:jme ) :: swdown
  95. REAL, DIMENSION( ims:ime, jms:jme ) :: UST
  96. INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(IN ):: UTYPE_URB2D
  97. REAL, DIMENSION( ims:ime , jms:jme ), INTENT(IN ):: FRC_URB2D
  98. REAL, INTENT(IN ) :: GMT
  99. INTEGER, INTENT(IN ) :: JULDAY
  100. REAL, DIMENSION( ims:ime, jms:jme ), &
  101. INTENT(IN ) :: XLAT, XLONG
  102. REAL, INTENT(IN) :: DECLIN_URB
  103. REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: COSZ_URB2D
  104. REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: OMG_URB2D
  105. INTEGER, INTENT(IN ) :: num_urban_layers
  106. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: trb_urb4d
  107. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tw1_urb4d
  108. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tw2_urb4d
  109. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tgb_urb4d
  110. !New variables used for BEM
  111. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: qv_phy
  112. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tlev_urb3d
  113. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: qlev_urb3d
  114. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tw1lev_urb3d
  115. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tw2lev_urb3d
  116. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tglev_urb3d
  117. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: tflev_urb3d
  118. REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: lf_ac_urb3d
  119. REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: sf_ac_urb3d
  120. REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: cm_ac_urb3d
  121. REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: sfvent_urb3d
  122. REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: lfvent_urb3d
  123. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: sfwin1_urb3d
  124. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: sfwin2_urb3d
  125. !End variables
  126. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: sfw1_urb3d
  127. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: sfw2_urb3d
  128. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: sfr_urb3d
  129. REAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: sfg_urb3d
  130. real z(ims:ime,kms:kme,jms:jme) ! Vertical coordinates
  131. REAL, INTENT(IN ):: DT ! Time step
  132. !
  133. !------------------------------------------------------------------------
  134. ! Output
  135. !------------------------------------------------------------------------
  136. !
  137. ! Implicit and explicit components of the source and sink terms at each levels,
  138. ! the fluxes can be computed as follow: FX = A*X + B example: t_fluxes = a_t * pt + b_t
  139. real a_u(ims:ime,kms:kme,jms:jme) ! Implicit component for the momemtum in X-direction (center)
  140. real a_v(ims:ime,kms:kme,jms:jme) ! Implicit component for the momemtum in Y-direction (center)
  141. real a_t(ims:ime,kms:kme,jms:jme) ! Implicit component for the temperature
  142. real a_e(ims:ime,kms:kme,jms:jme) ! Implicit component for the TKE
  143. real b_u(ims:ime,kms:kme,jms:jme) ! Explicit component for the momemtum in X-direction (center)
  144. real b_v(ims:ime,kms:kme,jms:jme) ! Explicit component for the momemtum in Y-direction (center)
  145. real b_t(ims:ime,kms:kme,jms:jme) ! Explicit component for the temperature
  146. real b_e(ims:ime,kms:kme,jms:jme) ! Explicit component for the TKE
  147. real b_q(ims:ime,kms:kme,jms:jme) ! Explicit component for the Humidity
  148. real dlg(ims:ime,kms:kme,jms:jme) ! Height above ground (L_ground in formula (24) of the BLM paper).
  149. real dl_u(ims:ime,kms:kme,jms:jme) ! Length scale (lb in formula (22) ofthe BLM paper).
  150. ! urban surface and volumes
  151. real sf(ims:ime,kms:kme,jms:jme) ! surface of the urban grid cells
  152. real vl(ims:ime,kms:kme,jms:jme) ! volume of the urban grid cells
  153. ! urban fluxes
  154. real rl_up(ims:ime,jms:jme) ! upward long wave radiation
  155. real rs_abs(ims:ime,jms:jme) ! absorbed short wave radiation
  156. real emiss(ims:ime,jms:jme) ! emissivity averaged for urban surfaces
  157. real grdflx_urb(ims:ime,jms:jme) ! ground heat flux for urban areas
  158. !------------------------------------------------------------------------
  159. ! Local
  160. !------------------------------------------------------------------------
  161. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  162. ! Building parameters
  163. real alag_u(nurbm) ! Ground thermal diffusivity [m^2 s^-1]
  164. real alaw_u(nurbm) ! Wall thermal diffusivity [m^2 s^-1]
  165. real alar_u(nurbm) ! Roof thermal diffusivity [m^2 s^-1]
  166. real csg_u(nurbm) ! Specific heat of the ground material [J m^3 K^-1]
  167. real csw_u(nurbm) ! Specific heat of the wall material [J m^3 K^-1]
  168. real csr_u(nurbm) ! Specific heat of the roof material [J m^3 K^-1]
  169. real twini_u(nurbm) ! Initial temperature inside the building's wall [K]
  170. real trini_u(nurbm) ! Initial temperature inside the building's roof [K]
  171. real tgini_u(nurbm) ! Initial road temperature
  172. !
  173. ! for twini_u, and trini_u the initial value at the deepest level is kept constant during the simulation
  174. !
  175. ! Radiation paramters
  176. real albg_u(nurbm) ! Albedo of the ground
  177. real albw_u(nurbm) ! Albedo of the wall
  178. real albr_u(nurbm) ! Albedo of the roof
  179. real albwin_u(nurbm) ! Albedo of the windows
  180. real emwind_u(nurbm) ! Emissivity of windows
  181. real emg_u(nurbm) ! Emissivity of ground
  182. real emw_u(nurbm) ! Emissivity of wall
  183. real emr_u(nurbm) ! Emissivity of roof
  184. ! fww,fwg,fgw,fsw,fsg are the view factors used to compute the long wave
  185. ! and the short wave radation.
  186. real fww(nz_um,nz_um,ndm,nurbm) ! from wall to wall
  187. real fwg(nz_um,ndm,nurbm) ! from wall to ground
  188. real fgw(nz_um,ndm,nurbm) ! from ground to wall
  189. real fsw(nz_um,ndm,nurbm) ! from sky to wall
  190. real fws(nz_um,ndm,nurbm) ! from sky to wall
  191. real fsg(ndm,nurbm) ! from sky to ground
  192. ! Roughness parameters
  193. real z0g_u(nurbm) ! The ground's roughness length
  194. real z0r_u(nurbm) ! The roof's roughness length
  195. ! Street parameters
  196. integer nd_u(nurbm) ! Number of street direction for each urban class
  197. real strd_u(ndm,nurbm) ! Street length (fix to greater value to the horizontal length of the cells)
  198. real drst_u(ndm,nurbm) ! Street direction
  199. real ws_u(ndm,nurbm) ! Street width
  200. real bs_u(ndm,nurbm) ! Building width
  201. real h_b(nz_um,nurbm) ! Bulding's heights
  202. real d_b(nz_um,nurbm) ! Probability that a building has an height h_b
  203. real ss_u(nz_um,nurbm) ! Probability that a building has an height equal to z
  204. real pb_u(nz_um,nurbm) ! Probability that a building has an height greater or equal to z
  205. ! Grid parameters
  206. integer nz_u(nurbm) ! Number of layer in the urban grid
  207. real z_u(nz_um) ! Height of the urban grid levels
  208. ! MT
  209. real cop_u(nurbm)
  210. real pwin_u(nurbm)
  211. real beta_u(nurbm)
  212. integer sw_cond_u(nurbm)
  213. real time_on_u(nurbm)
  214. real time_off_u(nurbm)
  215. real targtemp_u(nurbm)
  216. real gaptemp_u(nurbm)
  217. real targhum_u(nurbm)
  218. real gaphum_u(nurbm)
  219. real perflo_u(nurbm)
  220. real hsesf_u(nurbm)
  221. real hsequip(24)
  222. ! 1D array used for the input and output of the routine "urban"
  223. real z1D(kms:kme) ! vertical coordinates
  224. real ua1D(kms:kme) ! wind speed in the x directions
  225. real va1D(kms:kme) ! wind speed in the y directions
  226. real pt1D(kms:kme) ! potential temperature
  227. real da1D(kms:kme) ! air density
  228. real pr1D(kms:kme) ! air pressure
  229. real pt01D(kms:kme) ! reference potential temperature
  230. real zr1D ! zenith angle
  231. real deltar1D ! declination of the sun
  232. real ah1D ! hour angle (it should come from the radiation routine)
  233. real rs1D ! solar radiation
  234. real rld1D ! downward flux of the longwave radiation
  235. real tw1D(2*ndm,nz_um,nwr_u,nbui_max) ! temperature in each layer of the wall
  236. real tg1D(ndm,ng_u) ! temperature in each layer of the ground
  237. real tr1D(ndm,nz_um,nwr_u) ! temperature in each layer of the roof
  238. !
  239. !New variable for BEM
  240. !
  241. real tlev1D(nz_um,nbui_max) ! temperature in each floor and in each different type of building
  242. real qlev1D(nz_um,nbui_max) ! specific humidity in each floor and in each different type of building
  243. real twlev1D(2*ndm,nz_um,nbui_max) ! temperature in each window in each floor in each different type of building
  244. real tglev1D(ndm,ngb_u,nbui_max) ! temperature in each layer of the ground below of a type of building
  245. real tflev1D(ndm,nf_u,nz_um-1,nbui_max)! temperature in each layer of the floors in each building
  246. real lflev1D(nz_um,nz_um) ! latent heat flux due to the air conditioning systems
  247. real sflev1D(nz_um,nz_um) ! sensible heat flux due to the air conditioning systems
  248. real lfvlev1D(nz_um,nz_um) ! latent heat flux due to ventilation
  249. real sfvlev1D(nz_um,nz_um) ! sensible heat flux due to ventilation
  250. real sfwin1D(2*ndm,nz_um,nbui_max) ! sensible heat flux from windows
  251. real consumlev1D(nz_um,nz_um) ! consumption due to the air conditioning systems
  252. real qv1D(kms:kme) ! specific humidity
  253. real meso_urb ! constant to link meso and urban scales [¯2]
  254. real d_urb(nz_um)
  255. real sf_ac
  256. integer ibui,nbui
  257. integer nlev(nz_um)
  258. !
  259. !End new variables
  260. !
  261. real sfw1D(2*ndm,nz_um,nbui_max) ! sensible heat flux from walls
  262. real sfg1D(ndm) ! sensible heat flux from ground (road)
  263. real sfr1D(ndm,nz_um) ! sensible heat flux from roofs
  264. real sf1D(kms:kme) ! surface of the urban grid cells
  265. real vl1D(kms:kme) ! volume of the urban grid cells
  266. real a_u1D(kms:kme) ! Implicit component of the momentum sources or sinks in the X-direction
  267. real a_v1D(kms:kme) ! Implicit component of the momentum sources or sinks in the Y-direction
  268. real a_t1D(kms:kme) ! Implicit component of the heat sources or sinks
  269. real a_e1D(kms:kme) ! Implicit component of the TKE sources or sinks
  270. real b_u1D(kms:kme) ! Explicit component of the momentum sources or sinks in the X-direction
  271. real b_v1D(kms:kme) ! Explicit component of the momentum sources or sinks in the Y-direction
  272. real b_t1D(kms:kme) ! Explicit component of the heat sources or sinks
  273. real b_ac1D(kms:kme)
  274. real b_e1D(kms:kme) ! Explicit component of the TKE sources or sinks
  275. real b_q1D(kms:kme) ! Explicit component of the Humidity sources or sinks
  276. real dlg1D(kms:kme) ! Height above ground (L_ground in formula (24) of the BLM paper).
  277. real dl_u1D(kms:kme) ! Length scale (lb in formula (22) ofthe BLM paper)
  278. real time_bep
  279. ! arrays used to collapse indexes
  280. integer ind_zwd(nbui_max,nz_um,nwr_u,ndm)
  281. integer ind_gd(ng_u,ndm)
  282. integer ind_zd(nbui_max,nz_um,ndm)
  283. integer ind_zdf(nz_um,ndm)
  284. integer ind_zrd(nz_um,nwr_u,ndm)
  285. !
  286. integer ind_bd(nbui_max,nz_um)
  287. integer ind_wd(nbui_max,nz_um,ndm)
  288. integer ind_gbd(nbui_max,ngb_u,ndm)
  289. integer ind_fbd(nbui_max,nf_u,nz_um-1,ndm)
  290. !
  291. integer ix,iy,iz,iurb,id,iz_u,iw,ig,ir,ix1,iy1,k
  292. integer it, nint
  293. integer iii
  294. real tempo
  295. logical first
  296. character(len=80) :: text
  297. data first/.true./
  298. save first,time_bep
  299. save alag_u,alaw_u,alar_u,csg_u,csw_u,csr_u, &
  300. albg_u,albw_u,albr_u,emg_u,emw_u,emr_u,fww,fwg,fgw,fsw,fws,fsg, &
  301. z0g_u,z0r_u, nd_u,strd_u,drst_u,ws_u,bs_u,h_b,d_b,ss_u,pb_u, &
  302. nz_u,z_u,albwin_u,emwind_u , &
  303. cop_u, pwin_u, beta_u, sw_cond_u, time_on_u, time_off_u, targtemp_u, &
  304. gaptemp_u, targhum_u, gaphum_u, perflo_u, hsesf_u, hsequip
  305. !------------------------------------------------------------------------
  306. ! Calculation of the momentum, heat and turbulent kinetic fluxes
  307. ! produced by buildings
  308. !
  309. ! Reference:
  310. ! Martilli, A., Clappier, A., Rotach, M.W.:2002, 'AN URBAN SURFACE EXCHANGE
  311. ! PARAMETERISATION FOR MESOSCALE MODELS', Boundary-Layer Meteorolgy 104:
  312. ! 261-304
  313. !
  314. ! F. Salamanca and A. Martilli, 2009: 'A new Building Energy Model coupled
  315. ! with an Urban Canopy Parameterization for urban climate simulations_part II.
  316. ! Validation with one dimension off-line simulations'. Theor Appl Climatol
  317. ! DOI 10.1007/s00704-009-0143-8
  318. !------------------------------------------------------------------------
  319. !prepare the arrays to collapse indexes
  320. if(num_urban_layers.lt.nbui_max*nz_um*ndm*max(nwr_u,ng_u))then
  321. write(*,*)'num_urban_layers too small, please increase to at least ', nbui_max*nz_um*ndm*max(nwr_u,ng_u)
  322. stop
  323. endif
  324. !
  325. !New conditions for BEM
  326. !
  327. if(num_urban_layers.lt.nbui_max*nz_um)then !limit for indoor temperature and indoor humidity
  328. write(*,*)'num_urban_layers too small, please increase to at least ', nbui_max*nz_um
  329. stop
  330. endif
  331. if(num_urban_layers.lt.nbui_max*nz_um*ndm)then !limit for window temperature
  332. write(*,*)'num_urban_layers too small, please increase to at least ', nbui_max*nz_um*ndm
  333. stop
  334. endif
  335. if(num_urban_layers.lt.nbui_max*ndm*ngb_u)then !limit for ground temperature below a building
  336. write(*,*)'num_urban_layers too small, please increase to at least ', nbui_max*ndm*ngb_u
  337. stop
  338. endif
  339. if(num_urban_layers.lt.(nz_um-1)*nbui_max*ndm*nf_u)then !limit for floor temperature
  340. write(*,*)'num_urban_layers too small, please increase to at least ', nbui_max*ndm*nf_u*(nz_um-1),num_urban_layers
  341. stop
  342. endif
  343. if (ndm.ne.2)then
  344. write(*,*) 'number of directions is not correct',ndm
  345. stop
  346. endif
  347. !
  348. !End of new conditions
  349. !
  350. !
  351. !Initialize collapse indexes
  352. !
  353. ind_zwd=0
  354. ind_gd=0
  355. ind_zd=0
  356. ind_zdf=0
  357. ind_zrd=0
  358. ind_bd=0
  359. ind_wd=0
  360. ind_gbd=0
  361. ind_fbd=0
  362. !
  363. !End initialization indexes
  364. !
  365. iii=0
  366. do ibui=1,nbui_max
  367. do iz_u=1,nz_um
  368. do iw=1,nwr_u
  369. do id=1,ndm
  370. iii=iii+1
  371. ind_zwd(ibui,iz_u,iw,id)=iii
  372. enddo
  373. enddo
  374. enddo
  375. enddo
  376. iii=0
  377. do ig=1,ng_u
  378. do id=1,ndm
  379. iii=iii+1
  380. ind_gd(ig,id)=iii
  381. enddo
  382. enddo
  383. iii=0
  384. do ibui=1,nbui_max
  385. do iz_u=1,nz_um
  386. do id=1,ndm
  387. iii=iii+1
  388. ind_zd(ibui,iz_u,id)=iii
  389. enddo
  390. enddo
  391. enddo
  392. iii=0
  393. do iz_u=1,nz_um
  394. do iw=1,nwr_u
  395. do id=1,ndm
  396. iii=iii+1
  397. ind_zrd(iz_u,iw,id)=iii
  398. enddo
  399. enddo
  400. enddo
  401. !
  402. !New indexes for BEM
  403. !
  404. iii=0
  405. do iz_u=1,nz_um
  406. do id=1,ndm
  407. iii=iii+1
  408. ind_zdf(iz_u,id)=iii
  409. enddo ! id
  410. enddo ! iz_u
  411. iii=0
  412. do ibui=1,nbui_max !Type of building
  413. do iz_u=1,nz_um !vertical levels
  414. iii=iii+1
  415. ind_bd(ibui,iz_u)=iii
  416. enddo !iz_u
  417. enddo !ibui
  418. iii=0
  419. do ibui=1,nbui_max !type of building
  420. do iz_u=1,nz_um !vertical levels
  421. do id=1,ndm !direction
  422. iii=iii+1
  423. ind_wd(ibui,iz_u,id)=iii
  424. enddo !id
  425. enddo !iz_u
  426. enddo !ibui
  427. iii=0
  428. do ibui=1,nbui_max!type of building
  429. do iw=1,ngb_u !layers in the wall (ground below a building)
  430. do id=1,ndm !direction
  431. iii=iii+1
  432. ind_gbd(ibui,iw,id)=iii
  433. enddo !id
  434. enddo !iw
  435. enddo !ibui
  436. iii=0
  437. do ibui=1,nbui_max !type of building
  438. do iw=1,nf_u !layers in the wall (floor)
  439. do iz_u=1,nz_um-1 !vertical levels
  440. do id=1,ndm !direction
  441. iii=iii+1
  442. ind_fbd(ibui,iw,iz_u,id)=iii
  443. enddo !id
  444. enddo !iz_u
  445. enddo !iw
  446. enddo !ibui
  447. !
  448. !End of new indexes
  449. !
  450. do ix=its,ite
  451. do iy=jts,jte
  452. z(ix,kts,iy)=0.
  453. do iz=kts+1,kte+1
  454. z(ix,iz,iy)=z(ix,iz-1,iy)+dz8w(ix,iz-1,iy)
  455. enddo
  456. enddo
  457. enddo
  458. if (first) then ! True only on first call
  459. call init_para(alag_u,alaw_u,alar_u,csg_u,csw_u,csr_u,&
  460. twini_u,trini_u,tgini_u,albg_u,albw_u,albr_u,albwin_u,emg_u,emw_u,&
  461. emr_u,emwind_u,z0g_u,z0r_u,nd_u,strd_u,drst_u,ws_u,bs_u,h_b,d_b,&
  462. cop_u, pwin_u, beta_u, sw_cond_u, time_on_u, time_off_u, &
  463. targtemp_u, gaptemp_u, targhum_u, gaphum_u, perflo_u, hsesf_u, hsequip)
  464. !Initialisation of the urban parameters and calculation of the view factor
  465. call icBEP(fww,fwg,fgw,fsw,fws,fsg, &
  466. z0g_u,z0r_u, &
  467. nd_u,strd_u,ws_u,bs_u,h_b,d_b,ss_u,pb_u, &
  468. nz_u,z_u)
  469. first=.false.
  470. endif ! first
  471. do ix=its,ite
  472. do iy=jts,jte
  473. if (FRC_URB2D(ix,iy).gt.0.) then ! Calling BEP only for existing urban classes.
  474. iurb=UTYPE_URB2D(ix,iy)
  475. ibui=0
  476. nlev=0
  477. nbui=0
  478. d_urb=0.
  479. do iz=1,nz_um
  480. if(ss_u(iz,iurb).gt.0) then
  481. ibui=ibui+1
  482. nlev(ibui)=iz-1
  483. d_urb(ibui)=ss_u(iz,iurb)
  484. nbui=ibui
  485. endif
  486. end do !iz
  487. if (nbui.gt.nbui_max) then
  488. write (*,*) 'nbui_max must be increased to',nbui
  489. stop
  490. endif
  491. do iz= kts,kte
  492. ua1D(iz)=u_phy(ix,iz,iy)
  493. va1D(iz)=v_phy(ix,iz,iy)
  494. pt1D(iz)=th_phy(ix,iz,iy)
  495. da1D(iz)=rho(ix,iz,iy)
  496. pr1D(iz)=p_phy(ix,iz,iy)
  497. ! pt01D(iz)=th_phy(ix,iz,iy)
  498. pt01D(iz)=300.
  499. z1D(iz)=z(ix,iz,iy)
  500. qv1D(iz)=qv_phy(ix,iz,iy)
  501. a_u1D(iz)=0.
  502. a_v1D(iz)=0.
  503. a_t1D(iz)=0.
  504. a_e1D(iz)=0.
  505. b_u1D(iz)=0.
  506. b_v1D(iz)=0.
  507. b_t1D(iz)=0.
  508. b_ac1D(iz)=0.
  509. b_e1D(iz)=0.
  510. enddo
  511. z1D(kte+1)=z(ix,kte+1,iy)
  512. do id=1,ndm
  513. do iz_u=1,nz_um
  514. do iw=1,nwr_u
  515. do ibui=1,nbui_max
  516. tw1D(2*id-1,iz_u,iw,ibui)=tw1_urb4d(ix,ind_zwd(ibui,iz_u,iw,id),iy)
  517. tw1D(2*id,iz_u,iw,ibui)=tw2_urb4d(ix,ind_zwd(ibui,iz_u,iw,id),iy)
  518. enddo
  519. enddo
  520. enddo
  521. enddo
  522. do id=1,ndm
  523. do ig=1,ng_u
  524. tg1D(id,ig)=tgb_urb4d(ix,ind_gd(ig,id),iy)
  525. enddo
  526. do iz_u=1,nz_um
  527. do ir=1,nwr_u
  528. tr1D(id,iz_u,ir)=trb_urb4d(ix,ind_zrd(iz_u,ir,id),iy)
  529. enddo
  530. enddo
  531. enddo
  532. !
  533. !Initialize variables for BEM
  534. !
  535. tlev1D=0. !Indoor temperature
  536. qlev1D=0. !Indoor humidity
  537. twlev1D=0. !Window temperature
  538. tglev1D=0. !Ground temperature
  539. tflev1D=0. !Floor temperature
  540. sflev1D=0. !Sensible heat flux from the a.c.
  541. lflev1D=0. !latent heat flux from the a.c.
  542. consumlev1D=0.!consumption of the a.c.
  543. sfvlev1D=0. !Sensible heat flux from natural ventilation
  544. lfvlev1D=0. !Latent heat flux from natural ventilation
  545. sfwin1D=0. !Sensible heat flux from windows
  546. sfw1D=0. !Sensible heat flux from walls
  547. do iz_u=1,nz_um !vertical levels
  548. do ibui=1,nbui_max !Type of building
  549. tlev1D(iz_u,ibui)= tlev_urb3d(ix,ind_bd(ibui,iz_u),iy)
  550. qlev1D(iz_u,ibui)= qlev_urb3d(ix,ind_bd(ibui,iz_u),iy)
  551. enddo !ibui
  552. enddo !iz_u
  553. do id=1,ndm !direction
  554. do iz_u=1,nz_um !vertical levels
  555. do ibui=1,nbui_max !type of building
  556. twlev1D(2*id-1,iz_u,ibui)=tw1lev_urb3d(ix,ind_wd(ibui,iz_u,id),iy)
  557. twlev1D(2*id,iz_u,ibui)=tw2lev_urb3d(ix,ind_wd(ibui,iz_u,id),iy)
  558. sfwin1D(2*id-1,iz_u,ibui)=sfwin1_urb3d(ix,ind_wd(ibui,iz_u,id),iy)
  559. sfwin1D(2*id,iz_u,ibui)=sfwin2_urb3d(ix,ind_wd(ibui,iz_u,id),iy)
  560. enddo !ibui
  561. enddo !iz_u
  562. enddo !id
  563. do id=1,ndm !direction
  564. do iw=1,ngb_u !layer in the wall
  565. do ibui=1,nbui_max !type of building
  566. tglev1D(id,iw,ibui)=tglev_urb3d(ix,ind_gbd(ibui,iw,id),iy)
  567. enddo !ibui
  568. enddo !iw
  569. enddo !id
  570. do id=1,ndm !direction
  571. do iw=1,nf_u !layer in the walls
  572. do iz_u=1,nz_um-1 !verticals levels
  573. do ibui=1,nbui_max !type of building
  574. tflev1D(id,iw,iz_u,ibui)=tflev_urb3d(ix,ind_fbd(ibui,iw,iz_u,id),iy)
  575. enddo !ibui
  576. enddo ! iz_u
  577. enddo !iw
  578. enddo !id
  579. !
  580. !End initialization for BEM
  581. !
  582. do id=1,ndm
  583. do iz=1,nz_um
  584. do ibui=1,nbui_max !type of building
  585. sfw1D(2*id-1,iz,ibui)=sfw1_urb3d(ix,ind_zd(ibui,iz,id),iy)
  586. sfw1D(2*id,iz,ibui)=sfw2_urb3d(ix,ind_zd(ibui,iz,id),iy)
  587. enddo
  588. enddo
  589. enddo
  590. do id=1,ndm
  591. sfg1D(id)=sfg_urb3d(ix,id,iy)
  592. enddo
  593. do id=1,ndm
  594. do iz=1,nz_um
  595. sfr1D(id,iz)=sfr_urb3d(ix,ind_zdf(iz,id),iy)
  596. enddo
  597. enddo
  598. rs1D=swdown(ix,iy)
  599. rld1D=glw(ix,iy)
  600. zr1D=acos(COSZ_URB2D(ix,iy))
  601. deltar1D=DECLIN_URB
  602. ah1D=OMG_URB2D(ix,iy)
  603. call BEP1D(iurb,kms,kme,kts,kte,z1D,dt,ua1D,va1D,pt1D,da1D,pr1D,pt01D, &
  604. zr1D,deltar1D,ah1D,rs1D,rld1D, &
  605. alag_u,alaw_u,alar_u,csg_u,csw_u,csr_u, &
  606. albg_u,albw_u,albr_u,albwin_u,emg_u,emw_u,emr_u, &
  607. emwind_u,fww,fwg,fgw,fsw,fws,fsg, &
  608. z0g_u,z0r_u, &
  609. nd_u,strd_u,drst_u,ws_u,bs_u,h_b,d_b,ss_u,pb_u, &
  610. nz_u,z_u, &
  611. cop_u,pwin_u,beta_u,sw_cond_u,time_on_u, &
  612. time_off_u,targtemp_u,gaptemp_u,targhum_u, &
  613. gaphum_u, perflo_u, hsesf_u, hsequip, &
  614. tw1D,tg1D,tr1D,sfw1D,sfg1D,sfr1D, &
  615. a_u1D,a_v1D,a_t1D,a_e1D, &
  616. b_u1D,b_v1D,b_t1D,b_ac1D,b_e1D,b_q1D, &
  617. dlg1D,dl_u1D,sf1D,vl1D,rl_up(ix,iy), &
  618. rs_abs(ix,iy),emiss(ix,iy),grdflx_urb(ix,iy), &
  619. qv1D,tlev1D,qlev1D,sflev1D,lflev1D,consumlev1D, &
  620. sfvlev1D,lfvlev1D,twlev1D,tglev1D,tflev1D,sfwin1D,&
  621. ix,iy)
  622. do id=1,ndm ! direction
  623. do iz=1,nz_um !vertical levels
  624. do ibui=1,nbui_max !type of building
  625. sfw1_urb3d(ix,ind_zd(ibui,iz,id),iy)=sfw1D(2*id-1,iz,ibui)
  626. sfw2_urb3d(ix,ind_zd(ibui,iz,id),iy)=sfw1D(2*id,iz,ibui)
  627. enddo
  628. enddo
  629. enddo
  630. do id=1,ndm
  631. sfg_urb3d(ix,id,iy)=sfg1D(id)
  632. enddo
  633. do id=1,ndm
  634. do iz=1,nz_um
  635. sfr_urb3d(ix,ind_zdf(iz,id),iy)=sfr1D(id,iz)
  636. enddo
  637. enddo
  638. do id=1,ndm
  639. do iz_u=1,nz_um
  640. do iw=1,nwr_u
  641. do ibui=1,nbui_max
  642. tw1_urb4d(ix,ind_zwd(ibui,iz_u,iw,id),iy)=tw1D(2*id-1,iz_u,iw,ibui)
  643. tw2_urb4d(ix,ind_zwd(ibui,iz_u,iw,id),iy)=tw1D(2*id,iz_u,iw,ibui)
  644. enddo
  645. enddo
  646. enddo
  647. enddo
  648. do id=1,ndm
  649. do ig=1,ng_u
  650. tgb_urb4d(ix,ind_gd(ig,id),iy)=tg1D(id,ig)
  651. enddo
  652. do iz_u=1,nz_um
  653. do ir=1,nwr_u
  654. trb_urb4d(ix,ind_zrd(iz_u,ir,id),iy)=tr1D(id,iz_u,ir)
  655. enddo
  656. enddo
  657. enddo
  658. !
  659. !Outputs of BEM
  660. !
  661. do ibui=1,nbui_max !type of building
  662. do iz_u=1,nz_um !vertical levels
  663. tlev_urb3d(ix,ind_bd(ibui,iz_u),iy)=tlev1D(iz_u,ibui)
  664. qlev_urb3d(ix,ind_bd(ibui,iz_u),iy)=qlev1D(iz_u,ibui)
  665. enddo !iz_u
  666. enddo !ibui
  667. do id=1,ndm !direction
  668. do iz_u=1,nz_um !vertical levels
  669. do ibui=1,nbui_max !type of building
  670. tw1lev_urb3d(ix,ind_wd(ibui,iz_u,id),iy)=twlev1D(2*id-1,iz_u,ibui)
  671. tw2lev_urb3d(ix,ind_wd(ibui,iz_u,id),iy)=twlev1D(2*id,iz_u,ibui)
  672. sfwin1_urb3d(ix,ind_wd(ibui,iz_u,id),iy)=sfwin1D(2*id-1,iz_u,ibui)
  673. sfwin2_urb3d(ix,ind_wd(ibui,iz_u,id),iy)=sfwin1D(2*id,iz_u,ibui)
  674. enddo !ibui
  675. enddo !iz_u
  676. enddo !id
  677. do id=1,ndm !direction
  678. do iw=1,ngb_u !layers in the walls
  679. do ibui=1,nbui_max !type of building
  680. tglev_urb3d(ix,ind_gbd(ibui,iw,id),iy)=tglev1D(id,iw,ibui)
  681. enddo !ibui
  682. enddo !iw
  683. enddo !id
  684. do id=1,ndm !direction
  685. do iw=1,nf_u !layer in the walls
  686. do iz_u=1,nz_um-1 !verticals levels
  687. do ibui=1,nbui_max !type of building
  688. tflev_urb3d(ix,ind_fbd(ibui,iw,iz_u,id),iy)=tflev1D(id,iw,iz_u,ibui)
  689. enddo !ibui
  690. enddo !iz_u
  691. enddo !iw
  692. enddo !id
  693. sf_ac_urb3d(ix,iy)=0.
  694. lf_ac_urb3d(ix,iy)=0.
  695. cm_ac_urb3d(ix,iy)=0.
  696. sfvent_urb3d(ix,iy)=0.
  697. lfvent_urb3d(ix,iy)=0.
  698. meso_urb=(1./4.)*FRC_URB2D(ix,iy)/((bs_u(1,iurb)+ws_u(1,iurb))*bs_u(2,iurb))+ &
  699. (1./4.)*FRC_URB2D(ix,iy)/((bs_u(2,iurb)+ws_u(2,iurb))*bs_u(1,iurb))
  700. ibui=0
  701. nlev=0
  702. nbui=0
  703. d_urb=0.
  704. do iz=1,nz_um
  705. if(ss_u(iz,iurb).gt.0) then
  706. ibui=ibui+1
  707. nlev(ibui)=iz-1
  708. d_urb(ibui)=ss_u(iz,iurb)
  709. nbui=ibui
  710. endif
  711. end do !iz
  712. do ibui=1,nbui !type of building
  713. do iz_u=1,nlev(ibui) !vertical levels
  714. sf_ac_urb3d(ix,iy)=sf_ac_urb3d(ix,iy)+meso_urb*d_urb(ibui)*sflev1D(iz_u,ibui)
  715. lf_ac_urb3d(ix,iy)=lf_ac_urb3d(ix,iy)+meso_urb*d_urb(ibui)*lflev1D(iz_u,ibui)
  716. cm_ac_urb3d(ix,iy)=cm_ac_urb3d(ix,iy)+meso_urb*d_urb(ibui)*consumlev1D(iz_u,ibui)
  717. sfvent_urb3d(ix,iy)=sfvent_urb3d(ix,iy)+meso_urb*d_urb(ibui)*sfvlev1D(iz_u,ibui)
  718. lfvent_urb3d(ix,iy)=lfvent_urb3d(ix,iy)+meso_urb*d_urb(ibui)*lfvlev1D(iz_u,ibui)
  719. enddo !iz_u
  720. enddo !ibui
  721. !
  722. !Add the latent heat exchanged throughout the ventilation in the lf_ac_urb3d output variable.
  723. !it is only a print variable
  724. !
  725. ! lf_ac_urb3d(ix,iy)=lf_ac_urb3d(ix,iy)+lfvent_urb3d(ix,iy)
  726. !
  727. lf_ac_urb3d(ix,iy)=lf_ac_urb3d(ix,iy)-lfvent_urb3d(ix,iy)
  728. !
  729. !End outputs of bem
  730. !
  731. sf_ac=0.
  732. do iz= kts,kte
  733. sf(ix,iz,iy)=sf1D(iz)
  734. vl(ix,iz,iy)=vl1D(iz)
  735. a_u(ix,iz,iy)=a_u1D(iz)
  736. a_v(ix,iz,iy)=a_v1D(iz)
  737. a_t(ix,iz,iy)=a_t1D(iz)
  738. a_e(ix,iz,iy)=a_e1D(iz)
  739. b_u(ix,iz,iy)=b_u1D(iz)
  740. b_v(ix,iz,iy)=b_v1D(iz)
  741. b_t(ix,iz,iy)=b_t1D(iz)
  742. sf_ac=sf_ac+b_ac1D(iz)*da1D(iz)*cp_u*dz8w(ix,iz,iy)*vl1D(iz)*FRC_URB2D(ix,iy)
  743. b_e(ix,iz,iy)=b_e1D(iz)
  744. b_q(ix,iz,iy)=b_q1D(iz)
  745. dlg(ix,iz,iy)=dlg1D(iz)
  746. dl_u(ix,iz,iy)=dl_u1D(iz)
  747. enddo
  748. sf(ix,kte+1,iy)=sf1D(kte+1)
  749. endif ! FRC_URB2D
  750. enddo ! iy
  751. enddo ! ix
  752. time_bep=time_bep+dt
  753. return
  754. end subroutine BEP_BEM
  755. ! ===6=8===============================================================72
  756. subroutine BEP1D(iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, &
  757. zr,deltar,ah,rs,rld, &
  758. alag_u,alaw_u,alar_u,csg_u,csw_u,csr_u, &
  759. albg_u,albw_u,albr_u,albwin_u,emg_u,emw_u,emr_u, &
  760. emwind_u,fww,fwg,fgw,fsw,fws,fsg, &
  761. z0g_u,z0r_u, &
  762. nd_u,strd_u,drst_u,ws_u,bs_u,h_b,d_b,ss_u,pb_u, &
  763. nz_u,z_u, &
  764. cop_u,pwin_u,beta_u,sw_cond_u,time_on_u, &
  765. time_off_u,targtemp_u,gaptemp_u,targhum_u, &
  766. gaphum_u, perflo_u, hsesf_u, hsequip, &
  767. tw,tg,tr,sfw,sfg,sfr, &
  768. a_u,a_v,a_t,a_e, &
  769. b_u,b_v,b_t,b_ac,b_e,b_q, &
  770. dlg,dl_u,sf,vl,rl_up,rs_abs,emiss,grdflx_urb, &
  771. qv,tlev,qlev,sflev,lflev,consumlev, &
  772. sfvlev,lfvlev,twlev,tglev,tflev,sfwin,ix,iy)
  773. ! ----------------------------------------------------------------------
  774. ! This routine computes the effects of buildings on momentum, heat and
  775. ! TKE (turbulent kinetic energy) sources or sinks and on the mixing length.
  776. ! It provides momentum, heat and TKE sources or sinks at different levels of a
  777. ! mesoscale grid defined by the altitude of its cell interfaces "z" and
  778. ! its number of levels "nz".
  779. ! The meteorological input parameters (wind, temperature, solar radiation)
  780. ! are specified on the "mesoscale grid".
  781. ! The inputs concerning the building and street charateristics are defined
  782. ! on a "urban grid". The "urban grid" is defined with its number of levels
  783. ! "nz_u" and its space step "dz_u".
  784. ! The input parameters are interpolated on the "urban grid". The sources or sinks
  785. ! are calculated on the "urban grid". Finally the sources or sinks are
  786. ! interpolated on the "mesoscale grid".
  787. ! Mesoscale grid Urban grid Mesoscale grid
  788. !
  789. ! z(4) --- ---
  790. ! | |
  791. ! | |
  792. ! | Interpolation Interpolation |
  793. ! | Sources or sinks calculation |
  794. ! z(3) --- ---
  795. ! | ua ua_u --- uv_a a_u |
  796. ! | va va_u | uv_b b_u |
  797. ! | pt pt_u --- uh_b a_v |
  798. ! z(2) --- | etc... etc...---
  799. ! | z_u(1) --- |
  800. ! | | |
  801. ! z(1) ------------------------------------------------------------
  802. !
  803. ! Reference:
  804. ! Martilli, A., Clappier, A., Rotach, M.W.:2002, 'AN URBAN SURFACE EXCHANGE
  805. ! PARAMETERISATION FOR MESOSCALE MODELS', Boundary-Layer Meteorolgy 104:
  806. ! 261-304
  807. ! ----------------------------------------------------------------------
  808. implicit none
  809. ! ----------------------------------------------------------------------
  810. ! INPUT:
  811. ! ----------------------------------------------------------------------
  812. ! Data relative to the "mesoscale grid"
  813. integer kms,kme,kts,kte
  814. real z(kms:kme) ! Altitude above the ground of the cell interfaces.
  815. real ua(kms:kme) ! Wind speed in the x direction
  816. real va(kms:kme) ! Wind speed in the y direction
  817. real pt(kms:kme) ! Potential temperature
  818. real da(kms:kme) ! Air density
  819. real pr(kms:kme) ! Air pressure
  820. real pt0(kms:kme) ! Reference potential temperature (could be equal to "pt")
  821. real qv(kms:kme) ! Specific humidity
  822. real dt ! Time step
  823. real zr ! Zenith angle
  824. real deltar ! Declination of the sun
  825. real ah ! Hour angle
  826. real rs ! Solar radiation
  827. real rld ! Downward flux of the longwave radiation
  828. ! Data relative to the "urban grid"
  829. integer iurb ! Current urban class
  830. ! Building parameters
  831. real alag_u(nurbm) ! Ground thermal diffusivity [m^2 s^-1]
  832. real alaw_u(nurbm) ! Wall thermal diffusivity [m^2 s^-1]
  833. real alar_u(nurbm) ! Roof thermal diffusivity [m^2 s^-1]
  834. real csg_u(nurbm) ! Specific heat of the ground material [J m^3 K^-1]
  835. real csw_u(nurbm) ! Specific heat of the wall material [J m^3 K^-1]
  836. real csr_u(nurbm) ! Specific heat of the roof material [J m^3 K^-1]
  837. ! Radiation parameters
  838. real albg_u(nurbm) ! Albedo of the ground
  839. real albw_u(nurbm) ! Albedo of the wall
  840. real albr_u(nurbm) ! Albedo of the roof
  841. real albwin_u(nurbm) ! Albedo of the windows
  842. real emwind_u(nurbm) ! Emissivity of windows
  843. real emg_u(nurbm) ! Emissivity of ground
  844. real emw_u(nurbm) ! Emissivity of wall
  845. real emr_u(nurbm) ! Emissivity of roof
  846. ! fww,fwg,fgw,fsw,fsg are the view factors used to compute the long and
  847. ! short wave radation.
  848. ! The calculation of these factor is explained in the Appendix A of the BLM paper
  849. real fww(nz_um,nz_um,ndm,nurbm) ! from wall to wall
  850. real fwg(nz_um,ndm,nurbm) ! from wall to ground
  851. real fgw(nz_um,ndm,nurbm) ! from ground to wall
  852. real fsw(nz_um,ndm,nurbm) ! from sky to wall
  853. real fws(nz_um,ndm,nurbm) ! from wall to sky
  854. real fsg(ndm,nurbm) ! from sky to ground
  855. ! Roughness parameters
  856. real z0g_u(nurbm) ! The ground's roughness length
  857. real z0r_u(nurbm) ! The roof's roughness length
  858. ! Street parameters
  859. integer nd_u(nurbm) ! Number of street direction for each urban class
  860. real strd_u(ndm,nurbm) ! Street length (set to a greater value then the horizontal length of the cells)
  861. real drst_u(ndm,nurbm) ! Street direction
  862. real ws_u(ndm,nurbm) ! Street width
  863. real bs_u(ndm,nurbm) ! Building width
  864. real h_b(nz_um,nurbm) ! Bulding's heights
  865. real d_b(nz_um,nurbm) ! The probability that a building has an height "h_b"
  866. real ss_u(nz_um,nurbm) ! The probability that a building has an height equal to "z"
  867. real pb_u(nz_um,nurbm) ! The probability that a building has an height greater or equal to "z"
  868. ! Grid parameters
  869. integer nz_u(nurbm) ! Number of layer in the urban grid
  870. real z_u(nz_um) ! Height of the urban grid levels
  871. ! MT
  872. real cop_u(nurbm)
  873. real pwin_u(nurbm)
  874. real beta_u(nurbm)
  875. integer sw_cond_u(nurbm)
  876. real time_on_u(nurbm)
  877. real time_off_u(nurbm)
  878. real targtemp_u(nurbm)
  879. real gaptemp_u(nurbm)
  880. real targhum_u(nurbm)
  881. real gaphum_u(nurbm)
  882. real perflo_u(nurbm)
  883. real hsesf_u(nurbm)
  884. real hsequip(24)
  885. ! ----------------------------------------------------------------------
  886. ! INPUT-OUTPUT
  887. ! ----------------------------------------------------------------------
  888. ! Data relative to the "urban grid" which should be stored from the current time step to the next one
  889. real tw(2*ndm,nz_um,nwr_u,nbui_max) ! Temperature in each layer of the wall [K]
  890. real tr(ndm,nz_um,nwr_u) ! Temperature in each layer of the roof [K]
  891. real tg(ndm,ng_u) ! Temperature in each layer of the ground [K]
  892. real sfw(2*ndm,nz_um,nbui_max) ! Sensible heat flux from walls
  893. real sfg(ndm) ! Sensible heat flux from ground (road)
  894. real sfr(ndm,nz_um) ! Sensible heat flux from roofs
  895. real gfg(ndm) ! Heat flux transferred from the surface of the ground (road) towards the interior
  896. real gfr(ndm,nz_um) ! Heat flux transferred from the surface of the roof towards the interior
  897. real gfw(2*ndm,nz_um,nbui_max) ! Heat flux transfered from the surface of the walls towards the interior
  898. ! ----------------------------------------------------------------------
  899. ! OUTPUT:
  900. ! ----------------------------------------------------------------------
  901. ! Data relative to the "mesoscale grid"
  902. real sf(kms:kme) ! Surface of the "mesoscale grid" cells taking into account the buildings
  903. real vl(kms:kme) ! Volume of the "mesoscale grid" cells taking into account the buildings
  904. ! Implicit and explicit components of the source and sink terms at each levels,
  905. ! the fluxes can be computed as follow: FX = A*X + B example: Heat fluxes = a_t * pt + b_t
  906. real a_u(kms:kme) ! Implicit component of the momentum sources or sinks in the X-direction
  907. real a_v(kms:kme) ! Implicit component of the momentum sources or sinks in the Y-direction
  908. real a_t(kms:kme) ! Implicit component of the heat sources or sinks
  909. real a_e(kms:kme) ! Implicit component of the TKE sources or sinks
  910. real b_u(kms:kme) ! Explicit component of the momentum sources or sinks in the X-direction
  911. real b_v(kms:kme) ! Explicit component of the momentum sources or sinks in the Y-direction
  912. real b_t(kms:kme) ! Explicit component of the heat sources or sinks
  913. real b_ac(kms:kme)
  914. real b_e(kms:kme) ! Explicit component of the TKE sources or sinks
  915. real b_q(kms:kme) ! Explicit component of the humidity sources or sinks
  916. real dlg(kms:kme) ! Height above ground (L_ground in formula (24) of the BLM paper).
  917. real dl_u(kms:kme) ! Length scale (lb in formula (22) ofthe BLM paper).
  918. ! ----------------------------------------------------------------------
  919. ! LOCAL:
  920. ! ----------------------------------------------------------------------
  921. real dz(kms:kme) ! vertical space steps of the "mesoscale grid"
  922. ! Data interpolated from the "mesoscale grid" to the "urban grid"
  923. real ua_u(nz_um) ! Wind speed in the x direction
  924. real va_u(nz_um) ! Wind speed in the y direction
  925. real pt_u(nz_um) ! Potential temperature
  926. real da_u(nz_um) ! Air density
  927. real pt0_u(nz_um) ! Reference potential temperature
  928. real pr_u(nz_um) ! Air pressure
  929. real qv_u(nz_um) !Specific humidity
  930. ! Data defining the building and street charateristics
  931. real alag(ng_u) ! Ground thermal diffusivity for the current urban class [m^2 s^-1]
  932. real csg(ng_u) ! Specific heat of the ground material of the current urban class [J m^3 K^-1]
  933. real csr(nwr_u) ! Specific heat of the roof material for the current urban class [J m^3 K^-1]
  934. real csw(nwr_u) ! Specific heat of the wall material for the current urban class [J m^3 K^-1]
  935. real z0(ndm,nz_um) ! Roughness lengths "profiles"
  936. real ws(ndm) ! Street widths of the current urban class
  937. real bs(ndm) ! Building widths of the current urban class
  938. real strd(ndm) ! Street lengths for the current urban class
  939. real drst(ndm) ! Street directions for the current urban class
  940. real ss(nz_um) ! Probability to have a building with height h
  941. real pb(nz_um) ! Probability to have a building with an height equal
  942. ! Solar radiation at each level of the "urban grid"
  943. real rsg(ndm) ! Short wave radiation from the ground
  944. real rsw(2*ndm,nz_um) ! Short wave radiation from the walls
  945. real rlg(ndm) ! Long wave radiation from the ground
  946. real rlw(2*ndm,nz_um) ! Long wave radiation from the walls
  947. ! Potential temperature of the surfaces at each level of the "urban grid"
  948. real ptg(ndm) ! Ground potential temperatures
  949. real ptr(ndm,nz_um) ! Roof potential temperatures
  950. real ptw(2*ndm,nz_um,nbui_max) ! Walls potential temperatures
  951. ! Explicit and implicit component of the momentum, temperature and TKE sources or sinks on
  952. ! vertical surfaces (walls) ans horizontal surfaces (roofs and street)
  953. ! The fluxes can be computed as follow: Fluxes of X = A*X + B
  954. ! Example: Momentum fluxes on vertical surfaces = uva_u * ua_u + uvb_u
  955. real uhb_u(ndm,nz_um) ! U (wind component) Horizontal surfaces, B (explicit) term
  956. real uva_u(2*ndm,nz_um) ! U (wind component) Vertical surfaces, A (implicit) term
  957. real uvb_u(2*ndm,nz_um) ! U (wind component) Vertical surfaces, B (explicit) term
  958. real vhb_u(ndm,nz_um) ! V (wind component) Horizontal surfaces, B (explicit) term
  959. real vva_u(2*ndm,nz_um) ! V (wind component) Vertical surfaces, A (implicit) term
  960. real vvb_u(2*ndm,nz_um) ! V (wind component) Vertical surfaces, B (explicit) term
  961. real thb_u(ndm,nz_um) ! Temperature Horizontal surfaces, B (explicit) term
  962. real tva_u(2*ndm,nz_um) ! Temperature Vertical surfaces, A (implicit) term
  963. real tvb_u(2*ndm,nz_um) ! Temperature Vertical surfaces, B (explicit) term
  964. real tvb_ac(2*ndm,nz_um)
  965. real ehb_u(ndm,nz_um) ! Energy (TKE) Horizontal surfaces, B (explicit) term
  966. real evb_u(2*ndm,nz_um) ! Energy (TKE) Vertical surfaces, B (explicit) term
  967. real qhb_u(ndm,nz_um) ! Humidity Horizontal surfaces, B (explicit) term
  968. real qvb_u(2*ndm,nz_um) ! Humidity Vertical surfaces, B (explicit) term
  969. !
  970. real rs_abs ! solar radiation absorbed by urban surfaces
  971. real rl_up ! longwave radiation emitted by urban surface to the atmosphere
  972. real emiss ! mean emissivity of the urban surface
  973. real grdflx_urb ! ground heat flux
  974. real dt_int ! internal time step
  975. integer nt_int ! number of internal time step
  976. integer iz,id, it_int
  977. integer iw,ix,iy
  978. !---------------------------------------
  979. !New variables uses in BEM
  980. !----------------------------------------
  981. real tmp_u(nz_um) !Air Temperature [K]
  982. real dzw(nwr_u) !Layer sizes in the walls
  983. real dzr(nwr_u) !Layer sizes in the roofs
  984. real dzf(nf_u) !Layer sizes in the floors
  985. real dzgb(ngb_u) !Layer sizes in the ground below the buildings
  986. real csgb(ngb_u) !Specific heat of the ground material below the buildings
  987. !of the current urban class at each ground levels[J m^3 K^-1]
  988. real csf(nf_u) !Specific heat of the floors mat

Large files files are truncated, but you can click here to view the full file