SURFEX v8.1
General documentation of Surfex
write_diag_misc_tebn.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 write_diag_misc_teb_n (DTCO, HSELECT, U, DMTC, DMT, DMTO, &
7  GDD, GDDE, GDDEC, GRD, GRDE, GRDEC, &
8  T, TOP, HPROGRAM,KTEB_PATCH)
9 ! #################################
10 !
11 !!**** *WRITE_DIAG_MISC_TEB* - writes the TEB diagnostic fields
12 !!
13 !! PURPOSE
14 !! -------
15 !!
16 !!
17 !!** METHOD
18 !! ------
19 !!
20 !! REFERENCE
21 !! ---------
22 !!
23 !!
24 !! AUTHOR
25 !! ------
26 !! P. Le Moigne *Meteo France*
27 !!
28 !! MODIFICATIONS
29 !! -------------
30 !! Original 10/2004
31 !-------------------------------------------------------------------------------
32 !
33 !* 0. DECLARATIONS
34 ! ------------
35 !
36 !
38 USE modd_surf_atm_n, ONLY : surf_atm_t
41 USE modd_teb_n, ONLY : teb_t
43 !
44 USE modd_diag_n, ONLY : diag_t
46 !
47 USE modi_init_io_surf_n
49 USE modd_surf_par, ONLY : xundef
50 USE modi_end_io_surf_n
51 !
52 !
53 USE yomhook ,ONLY : lhook, dr_hook
54 USE parkind1 ,ONLY : jprb
55 !
56 IMPLICIT NONE
57 !
58 !* 0.1 Declarations of arguments
59 ! -------------------------
60 !
61 !
62 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
63  CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: HSELECT
64 TYPE(surf_atm_t), INTENT(INOUT) :: U
65 TYPE(diag_misc_teb_t), INTENT(INOUT) :: DMTC
66 TYPE(diag_misc_teb_t), INTENT(INOUT) :: DMT
67 TYPE(diag_misc_teb_options_t), INTENT(INOUT) :: DMTO
68 TYPE(teb_t), INTENT(INOUT) :: T
69 TYPE(teb_options_t), INTENT(INOUT) :: TOP
70 !
71 TYPE(diag_t), INTENT(INOUT) :: GDD
72 TYPE(diag_evap_isba_t), INTENT(INOUT) :: GDDE
73 TYPE(diag_evap_isba_t), INTENT(INOUT) :: GDDEC
74 TYPE(diag_t), INTENT(INOUT) :: GRD
75 TYPE(diag_evap_isba_t), INTENT(INOUT) :: GRDE
76 TYPE(diag_evap_isba_t), INTENT(INOUT) :: GRDEC
77 !
78  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling
79 INTEGER, INTENT(IN) :: KTEB_PATCH ! patch number being written
80 !
81 !* 0.2 Declarations of local variables
82 ! -------------------------------
83 !
84 INTEGER :: IRESP ! IRESP : return-code if a problem appears
85  CHARACTER(LEN=3) :: YPATCH ! Prefix for current patch
86  CHARACTER(LEN=12) :: YRECFM ! Name of the article to be read
87  CHARACTER(LEN=100):: YCOMMENT ! Comment string
88 REAL(KIND=JPRB) :: ZHOOK_HANDLE
89 !
90 !-------------------------------------------------------------------------------
91 !
92 ! Initialisation for IO
93 ! ---------------------
94 !
95 IF (lhook) CALL dr_hook('WRITE_DIAG_MISC_TEB_N',0,zhook_handle)
96 !
97 !-------------------------------------------------------------------------------
98 !
99 IF (dmto%LSURF_MISC_BUDGET) THEN
100  !
101  ypatch = ' '
102  IF (top%NTEB_PATCH>1) WRITE(ypatch,fmt='(A,I1,A)') 'T',kteb_patch,'_'
103  !
104  CALL init_io_surf_n(dtco, u, hprogram,'TOWN ','TEB ','WRITE','TEB_DIAGNOSTICS.OUT.nc')
105  !
106  !* Miscellaneous fields :
107  ! ----------------------
108  !
109  yrecfm='D_RD'
110  ycomment='Road fraction'
111  CALL write_surf(hselect,hprogram,yrecfm,t%XROAD(:),iresp,hcomment=ycomment)
112  !
113  yrecfm='Z0_TOWN'
114  yrecfm=adjustl(ypatch//yrecfm)
115  ycomment='town roughness length'
116  CALL write_surf(hselect,hprogram,yrecfm,t%XZ0_TOWN(:),iresp,hcomment=ycomment)
117  !
118  yrecfm='XQF_BLD'
119  yrecfm=adjustl(ypatch//yrecfm)
120  ycomment='domestic heating'//' (W/m2)'
121  CALL write_surf(hselect,hprogram,yrecfm,dmt%XQF_BLD(:),iresp,hcomment=ycomment)
122  !
123  yrecfm='XQF_TOWN'
124  yrecfm=adjustl(ypatch//yrecfm)
125  ycomment='total anthropogenic heat'//' (W/m2)'
126  CALL write_surf(hselect,hprogram,yrecfm,dmt%XQF_TOWN(:),iresp,hcomment=ycomment)
127  !
128  yrecfm='XDQS_TOWN'
129  yrecfm=adjustl(ypatch//yrecfm)
130  ycomment='heat storage inside building'//' (W/m2)'
131  CALL write_surf(hselect,hprogram,yrecfm,dmt%XDQS_TOWN(:),iresp,hcomment=ycomment)
132  !
133  yrecfm='RUNOFF_TW'
134  yrecfm=adjustl(ypatch//yrecfm)
135  ycomment='aggregated runoff for town'//' (kg/m2/s)'
136  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRUNOFF_TOWN(:),iresp,hcomment=ycomment)
137  !
138  yrecfm='RN_RD'
139  yrecfm=adjustl(ypatch//yrecfm)
140  ycomment=' net radiation at road'//' (W/m2)'
141  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_ROAD(:),iresp,hcomment=ycomment)
142  !
143  yrecfm='H_RD'
144  yrecfm=adjustl(ypatch//yrecfm)
145  ycomment='road sensible heat flux'//' (W/m2)'
146  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_ROAD(:),iresp,hcomment=ycomment)
147  !
148  yrecfm='LE_RD'
149  yrecfm=adjustl(ypatch//yrecfm)
150  ycomment='road latent heat flux'//' (W/m2)'
151  CALL write_surf(hselect,hprogram,yrecfm,dmt%XLE_ROAD(:),iresp,hcomment=ycomment)
152  !
153  yrecfm='GFLUX_RD'
154  yrecfm=adjustl(ypatch//yrecfm)
155  ycomment='net road conduction flux'//' (W/m2)'
156  CALL write_surf(hselect,hprogram,yrecfm,dmt%XGFLUX_ROAD(:),iresp,hcomment=ycomment)
157  !
158  yrecfm='RUNOFF_RD'
159  yrecfm=adjustl(ypatch//yrecfm)
160  ycomment='road surface runoff'//' (kg/m2/s)'
161  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRUNOFF_ROAD(:),iresp,hcomment=ycomment)
162  !
163  IF (top%CWALL_OPT=='UNIF') THEN
164  !
165  yrecfm='RN_WL'
166  yrecfm=adjustl(ypatch//yrecfm)
167  ycomment='net radiation for wall '//yrecfm//' (W/m2)'
168  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_WALL_A(:),iresp,hcomment=ycomment)
169  !
170  yrecfm='H_WL'
171  yrecfm=adjustl(ypatch//yrecfm)
172  ycomment='wall sensible heat flux'//yrecfm//' (W/m2)'
173  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_WALL_A(:),iresp,hcomment=ycomment)
174  !
175  yrecfm='GFLUX_WL'
176  yrecfm=adjustl(ypatch//yrecfm)
177  ycomment='net wall conduction flux'//yrecfm//' (W/m2)'
178  CALL write_surf(hselect,hprogram,yrecfm,dmt%XGFLUX_WALL_A(:),iresp,hcomment=ycomment)
179  !
180  ELSE
181  !
182  yrecfm='RN_WLA'
183  yrecfm=adjustl(ypatch//yrecfm)
184  ycomment='net radiation for wall A'//yrecfm//' (W/m2)'
185  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_WALL_A(:),iresp,hcomment=ycomment)
186  !
187  yrecfm='H_WLA'
188  yrecfm=adjustl(ypatch//yrecfm)
189  ycomment='wall A sensible heat flux'//yrecfm//' (W/m2)'
190  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_WALL_A(:),iresp,hcomment=ycomment)
191  !
192  yrecfm='GFLUX_WLA'
193  yrecfm=adjustl(ypatch//yrecfm)
194  ycomment='net wall A conduction flux'//yrecfm//' (W/m2)'
195  CALL write_surf(hselect,hprogram,yrecfm,dmt%XGFLUX_WALL_A(:),iresp,hcomment=ycomment)
196  !
197  yrecfm='RN_WLB'
198  yrecfm=adjustl(ypatch//yrecfm)
199  ycomment='net radiation for wall B'//yrecfm//' (W/m2)'
200  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_WALL_B(:),iresp,hcomment=ycomment)
201  !
202  yrecfm='H_WLB'
203  yrecfm=adjustl(ypatch//yrecfm)
204  ycomment='wall B sensible heat flux'//yrecfm//' (W/m2)'
205  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_WALL_B(:),iresp,hcomment=ycomment)
206  !
207  yrecfm='GFLUX_WLB'
208  yrecfm=adjustl(ypatch//yrecfm)
209  ycomment='net wall B conduction flux'//yrecfm//' (W/m2)'
210  CALL write_surf(hselect,hprogram,yrecfm,dmt%XGFLUX_WALL_B(:),iresp,hcomment=ycomment)
211  !
212  ENDIF
213  !
214  yrecfm='RN_RF'
215  yrecfm=adjustl(ypatch//yrecfm)
216  ycomment='net radiation for roof'//yrecfm//' (W/m2)'
217  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_ROOF(:),iresp,hcomment=ycomment)
218  !
219  yrecfm='H_RF'
220  yrecfm=adjustl(ypatch//yrecfm)
221  ycomment='roof sensible heat flux'//yrecfm//' (W/m2)'
222  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_ROOF(:),iresp,hcomment=ycomment)
223  !
224  yrecfm='LE_RF'
225  yrecfm=adjustl(ypatch//yrecfm)
226  ycomment='roof latent heat flux'//yrecfm//' (W/m2)'
227  CALL write_surf(hselect,hprogram,yrecfm,dmt%XLE_ROOF(:),iresp,hcomment=ycomment)
228  !
229  yrecfm='GFLUX_RF'
230  yrecfm=adjustl(ypatch//yrecfm)
231  ycomment='net roof conduction flux'//yrecfm//' (W/m2)'
232  CALL write_surf(hselect,hprogram,yrecfm,dmt%XGFLUX_ROOF(:),iresp,hcomment=ycomment)
233  !
234  yrecfm='RUNOFF_RF'
235  yrecfm=adjustl(ypatch//yrecfm)
236  ycomment='aggregated roof runoff'//' (kg/m2/s)'
237  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRUNOFF_ROOF(:),iresp,hcomment=ycomment)
238  !
239  !
240  IF (top%LGARDEN) THEN
241  !
242  yrecfm='RN_GD'
243  yrecfm=adjustl(ypatch//yrecfm)
244  ycomment='net radiation for GARDEN areas'//yrecfm//' (W/m2)'
245  CALL write_surf(hselect,hprogram,yrecfm,gdd%XRN(:),iresp,hcomment=ycomment)
246  !
247  yrecfm='H_GD'
248  yrecfm=adjustl(ypatch//yrecfm)
249  ycomment='GARDEN area sensible heat flux'//yrecfm//' (W/m2)'
250  CALL write_surf(hselect,hprogram,yrecfm,gdd%XH(:),iresp,hcomment=ycomment)
251  !
252  yrecfm='LE_GD'
253  yrecfm=adjustl(ypatch//yrecfm)
254  ycomment='GARDEN area latent heat flux'//yrecfm//' (W/m2)'
255  CALL write_surf(hselect,hprogram,yrecfm,gdd%XLE(:),iresp,hcomment=ycomment)
256  !
257  yrecfm='GFLUX_GD'
258  yrecfm=adjustl(ypatch//yrecfm)
259  ycomment='net GARDEN area conduction flux'//yrecfm//' (W/m2)'
260  CALL write_surf(hselect,hprogram,yrecfm,gdd%XGFLUX(:),iresp,hcomment=ycomment)
261  !
262  yrecfm='RUNOFF_GD'
263  yrecfm=adjustl(ypatch//yrecfm)
264  ycomment='garden surface runoff'//' (kg/m2/s)'
265  CALL write_surf(hselect,hprogram,yrecfm,gdde%XRUNOFF(:),iresp,hcomment=ycomment)
266  !
267  ENDIF
268  !
269  yrecfm='RN_BLT'
270  yrecfm=adjustl(ypatch//yrecfm)
271  ycomment='net radiation for built surfaces'//yrecfm//' (W/m2)'
272  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_BLT(:),iresp,hcomment=ycomment)
273  !
274  yrecfm='H_BLT'
275  yrecfm=adjustl(ypatch//yrecfm)
276  ycomment='built surface sensible heat flux'//yrecfm//' (W/m2)'
277  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_BLT(:),iresp,hcomment=ycomment)
278  !
279  yrecfm='LE_BLT'
280  yrecfm=adjustl(ypatch//yrecfm)
281  ycomment='built surface latent heat flux'//yrecfm//' (W/m2)'
282  CALL write_surf(hselect,hprogram,yrecfm,dmt%XLE_BLT(:),iresp,hcomment=ycomment)
283  !
284  yrecfm='GFLUX_BLT'
285  yrecfm=adjustl(ypatch//yrecfm)
286  ycomment='built surface conduction flux'//yrecfm//' (W/m2)'
287  CALL write_surf(hselect,hprogram,yrecfm,dmt%XGFLUX_BLT(:),iresp,hcomment=ycomment)
288  !
289  yrecfm='SWA_RF'
290  yrecfm=adjustl(ypatch//yrecfm)
291  ycomment='Sdown absorbed by roofs'//' (W/m2)'
292  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_ROOF(:),iresp,hcomment=ycomment)
293  !
294  yrecfm='SWA_SN_RF'
295  yrecfm=adjustl(ypatch//yrecfm)
296  ycomment='Sdown absorbed by snow on roofs'//' (W/m2)'
297  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_SNOW_ROOF(:),iresp,hcomment=ycomment)
298  !
299  yrecfm='LWA_RF'
300  yrecfm=adjustl(ypatch//yrecfm)
301  ycomment='Ldown absorbed by roofs'//' (W/m2)'
302  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_ROOF(:),iresp,hcomment=ycomment)
303  !
304  yrecfm='LWA_SN_RF'
305  yrecfm=adjustl(ypatch//yrecfm)
306  ycomment='Ldown absorbed by snow on roofs'//' (W/m2)'
307  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_SNOW_ROOF(:),iresp,hcomment=ycomment)
308  !
309  yrecfm='SWA_RD'
310  yrecfm=adjustl(ypatch//yrecfm)
311  ycomment='Sdown absorbed by roads'//' (W/m2)'
312  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_ROAD(:),iresp,hcomment=ycomment)
313  !
314  yrecfm='SWA_SN_RD'
315  yrecfm=adjustl(ypatch//yrecfm)
316  ycomment='Sdown absorbed by snow on roads'//' (W/m2)'
317  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_SNOW_ROAD(:),iresp,hcomment=ycomment)
318  !
319  yrecfm='LWA_RD'
320  yrecfm=adjustl(ypatch//yrecfm)
321  ycomment='Ldown absorbed by roads'//' (W/m2)'
322  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_ROAD(:),iresp,hcomment=ycomment)
323  !
324  yrecfm='LWA_SN_RD'
325  yrecfm=adjustl(ypatch//yrecfm)
326  ycomment='Ldown absorbed by snow on roads'//' (W/m2)'
327  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_SNOW_ROAD(:),iresp,hcomment=ycomment)
328  !
329  IF (top%CWALL_OPT=='UNIF') THEN
330  !
331  yrecfm='SWA_WL'
332  yrecfm=adjustl(ypatch//yrecfm)
333  ycomment='Sdown absorbed by wall'//' (W/m2)'
334  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_WALL_A(:),iresp,hcomment=ycomment)
335  !
336  yrecfm='LWA_WL'
337  yrecfm=adjustl(ypatch//yrecfm)
338  ycomment='Ldown absorbed by wall '//' (W/m2)'
339  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_WALL_A(:),iresp,hcomment=ycomment)
340  !
341  ELSE
342  !
343  yrecfm='SWA_WLA'
344  yrecfm=adjustl(ypatch//yrecfm)
345  ycomment='Sdown absorbed by wall A'//' (W/m2)'
346  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_WALL_A(:),iresp,hcomment=ycomment)
347  !
348  yrecfm='LWA_WLA'
349  yrecfm=adjustl(ypatch//yrecfm)
350  ycomment='Ldown absorbed by wall A'//' (W/m2)'
351  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_WALL_A(:),iresp,hcomment=ycomment)
352  !
353  yrecfm='SWA_WLB'
354  yrecfm=adjustl(ypatch//yrecfm)
355  ycomment='Sdown absorbed by wall B'//' (W/m2)'
356  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_WALL_B(:),iresp,hcomment=ycomment)
357  !
358  yrecfm='LWA_WLB'
359  yrecfm=adjustl(ypatch//yrecfm)
360  ycomment='Ldown absorbed by wall B'//' (W/m2)'
361  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_WALL_B(:),iresp,hcomment=ycomment)
362  !
363  ENDIF
364  !
365  IF (top%LGARDEN) THEN
366  !
367  yrecfm='SWA_GD'
368  yrecfm=adjustl(ypatch//yrecfm)
369  ycomment='Sdown absorbed by GARDEN areas'//' (W/m2)'
370  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_GARDEN(:),iresp,hcomment=ycomment)
371  !
372  yrecfm='LWA_GD'
373  yrecfm=adjustl(ypatch//yrecfm)
374  ycomment='Ldown absorbed by GARDEN areas'//' (W/m2)'
375  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_GARDEN(:),iresp,hcomment=ycomment)
376  !
377  ENDIF
378  !
379  yrecfm='REF_SW_GO'
380  yrecfm=adjustl(ypatch//yrecfm)
381  ycomment='Total solar rad reflected by ground '//' (W/m2)'
382  CALL write_surf(hselect,hprogram,yrecfm,dmt%XREF_SW_GRND(:),iresp,hcomment=ycomment)
383  !
384  yrecfm='LWE_GO'
385  yrecfm=adjustl(ypatch//yrecfm)
386  ycomment='LW emitted by ground'//' (W/m2)'
387  CALL write_surf(hselect,hprogram,yrecfm,dmt%XEMIT_LW_GRND(:),iresp,hcomment=ycomment)
388  !
389  yrecfm='REF_SW_FA'
390  yrecfm=adjustl(ypatch//yrecfm)
391  ycomment='Total solar rad reflected by facade '//' (W/m2)'
392  CALL write_surf(hselect,hprogram,yrecfm,dmt%XREF_SW_FAC(:),iresp,hcomment=ycomment)
393  !
394  yrecfm='LWE_FA'
395  yrecfm=adjustl(ypatch//yrecfm)
396  ycomment='LW emitted by facade'//' (W/m2)'
397  CALL write_surf(hselect,hprogram,yrecfm,dmt%XEMIT_LW_FAC(:),iresp,hcomment=ycomment)
398  !
399  IF (top%CBEM=='BEM') THEN
400  !
401  yrecfm='CL_CURT'
402  yrecfm=adjustl(ypatch//yrecfm)
403  ycomment='Current Cooling system temperature set point'//' (K)'
404  CALL write_surf(hselect,hprogram,yrecfm,dmt%XTCOOL_TARGET(:),iresp,hcomment=ycomment)
405  !
406  yrecfm='HT_CURT'
407  yrecfm=adjustl(ypatch//yrecfm)
408  ycomment='Current Heating system temperature set point'//' (K)'
409  CALL write_surf(hselect,hprogram,yrecfm,dmt%XTHEAT_TARGET(:),iresp,hcomment=ycomment)
410  !
411  yrecfm='QIN_CUR'
412  yrecfm=adjustl(ypatch//yrecfm)
413  ycomment='Current Building internal heat loads'//' (W m-2(floor))'
414  CALL write_surf(hselect,hprogram,yrecfm,dmt%XQIN(:),iresp,hcomment=ycomment)
415  !
416  yrecfm='XFLX_BLD'
417  yrecfm=adjustl(ypatch//yrecfm)
418  ycomment='heat flux from bld'//' (W/m2)'
419  CALL write_surf(hselect,hprogram,yrecfm,dmt%XFLX_BLD(:),iresp,hcomment=ycomment)
420  !
421  yrecfm='H_BLD_CL'
422  yrecfm=adjustl(ypatch//yrecfm)
423  ycomment='sensible cooling demand'//' (W/m2)'
424  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_BLD_COOL(:),iresp,hcomment=ycomment)
425  !
426  yrecfm='T_BLD_CL'
427  yrecfm=adjustl(ypatch//yrecfm)
428  ycomment='Total cooling demand'//' (W/m2)'
429  CALL write_surf(hselect,hprogram,yrecfm,dmt%XT_BLD_COOL(:),iresp,hcomment=ycomment)
430  !
431  yrecfm='H_BLD_HT'
432  yrecfm=adjustl(ypatch//yrecfm)
433  ycomment='sensible heating demand'//' (W/m2)'
434  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_BLD_HEAT(:),iresp,hcomment=ycomment)
435  !
436  yrecfm='LE_BLD_CL'
437  yrecfm=adjustl(ypatch//yrecfm)
438  ycomment='latent cooling demand'//' (W/m2)'
439  CALL write_surf(hselect,hprogram,yrecfm,dmt%XLE_BLD_COOL(:),iresp,hcomment=ycomment)
440  !
441  yrecfm='LE_BLD_HT'
442  yrecfm=adjustl(ypatch//yrecfm)
443  ycomment='latent heating demand'//' (W/m2)'
444  CALL write_surf(hselect,hprogram,yrecfm,dmt%XLE_BLD_HEAT(:),iresp,hcomment=ycomment)
445  !
446  yrecfm='H_WASTE'
447  yrecfm=adjustl(ypatch//yrecfm)
448  ycomment='sensible waste heat from HVAC'//' (W/m2)'
449  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_WASTE(:),iresp,hcomment=ycomment)
450  !
451  yrecfm='LE_WASTE'
452  yrecfm=adjustl(ypatch//yrecfm)
453  ycomment='latent waste heat from HVAC'//' (W/m2)'
454  CALL write_surf(hselect,hprogram,yrecfm,dmt%XLE_WASTE(:),iresp,hcomment=ycomment)
455  !
456  yrecfm='HVAC_CL'
457  yrecfm=adjustl(ypatch//yrecfm)
458  ycomment='cooling energy consumption'//' (W/m2)'
459  CALL write_surf(hselect,hprogram,yrecfm,dmt%XHVAC_COOL(:),iresp,hcomment=ycomment)
460  !
461  yrecfm='HVAC_HT'
462  yrecfm=adjustl(ypatch//yrecfm)
463  ycomment='heating energy consumption'//' (W/m2)'
464  CALL write_surf(hselect,hprogram,yrecfm,dmt%XHVAC_HEAT(:),iresp,hcomment=ycomment)
465  !
466  yrecfm='CAP_SYS'
467  yrecfm=adjustl(ypatch//yrecfm)
468  ycomment='Actual capacity of the cooling system'//' (W m-2(bld))'
469  CALL write_surf(hselect,hprogram,yrecfm,dmt%XCAP_SYS(:),iresp,hcomment=ycomment)
470  !
471  yrecfm='M_SYS'
472  yrecfm=adjustl(ypatch//yrecfm)
473  ycomment='Actual HVAC mass flow rate'//' (kg s-1 m-2(bld))'
474  CALL write_surf(hselect,hprogram,yrecfm,dmt%XM_SYS(:),iresp,hcomment=ycomment)
475  !
476  yrecfm='COP'
477  yrecfm=adjustl(ypatch//yrecfm)
478  ycomment='Actual COP of the cooling system'//' ()'
479  CALL write_surf(hselect,hprogram,yrecfm,dmt%XCOP(:),iresp,hcomment=ycomment)
480  !
481  yrecfm='Q_SYS'
482  yrecfm=adjustl(ypatch//yrecfm)
483  ycomment='Supply air specific humidity'//' (kg kg-1)'
484  CALL write_surf(hselect,hprogram,yrecfm,dmt%XQ_SYS(:),iresp,hcomment=ycomment)
485  !
486  yrecfm='T_SYS'
487  yrecfm=adjustl(ypatch//yrecfm)
488  ycomment='Supply air temperature'//' (K)'
489  CALL write_surf(hselect,hprogram,yrecfm,dmt%XT_SYS(:),iresp,hcomment=ycomment)
490  !
491  yrecfm='TR_SW_WIN'
492  yrecfm=adjustl(ypatch//yrecfm)
493  ycomment='Solar radiation transmitted through windows'//' (W m-2(bld))'
494  CALL write_surf(hselect,hprogram,yrecfm,dmt%XTR_SW_WIN(:),iresp,hcomment=ycomment)
495  !
496  yrecfm='FAN_POWER'
497  yrecfm=adjustl(ypatch//yrecfm)
498  ycomment='HVAC fan power'//' (W m-2(bld))'
499  CALL write_surf(hselect,hprogram,yrecfm,dmt%XFAN_POWER(:),iresp,hcomment=ycomment)
500  !
501  yrecfm='T_RAD_IND'
502  yrecfm=adjustl(ypatch//yrecfm)
503  ycomment='Indoor mean radiant temperature'//' (K)'
504  CALL write_surf(hselect,hprogram,yrecfm,dmt%XT_RAD_IND(:),iresp,hcomment=ycomment)
505  !
506  yrecfm='HU_BLD'
507  yrecfm=adjustl(ypatch//yrecfm)
508  ycomment='Indoor relative humidity'//' (-)'
509  CALL write_surf(hselect,hprogram,yrecfm,dmt%XHU_BLD(:),iresp,hcomment=ycomment)
510  !
511  yrecfm='SWA_WIN'
512  yrecfm=adjustl(ypatch//yrecfm)
513  ycomment='Sdown absorbed by windows'//' (W/m2)'
514  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_WIN(:),iresp,hcomment=ycomment)
515  !
516  yrecfm='LWA_WIN'
517  yrecfm=adjustl(ypatch//yrecfm)
518  ycomment='Ldown absorbed by windows'//' (W/m2)'
519  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_WIN(:),iresp,hcomment=ycomment)
520  !
521  ENDIF
522  !
523  IF (top%LGREENROOF) THEN
524  !
525  WHERE (t%XGREENROOF(:) == 0.)
526  grd%XRN (:) = xundef
527  grd%XH (:) = xundef
528  grd%XLE (:) = xundef
529  grd%XGFLUX (:) = xundef
530  !
531  dmt%XABS_SW_GREENROOF(:) = xundef
532  dmt%XABS_LW_GREENROOF(:) = xundef
533  dmt%XG_GREENROOF_ROOF(:) = xundef
534  !
535  grde%XRUNOFF(:) = xundef
536  grde%XDRAIN (:) = xundef
537  END WHERE
538  !
539  yrecfm='RN_GR'
540  yrecfm=adjustl(ypatch//yrecfm)
541  ycomment='net radiation for GREENROOFs'//' (W/m2)'
542  CALL write_surf(hselect,hprogram,yrecfm,grd%XRN(:),iresp,hcomment=ycomment)
543  !
544  yrecfm='H_GR'
545  yrecfm=adjustl(ypatch//yrecfm)
546  ycomment='sensible heat flux for GREENROOFs'//' (W/m2)'
547  CALL write_surf(hselect,hprogram,yrecfm,grd%XH(:),iresp,hcomment=ycomment)
548  !
549  yrecfm='LE_GR'
550  yrecfm=adjustl(ypatch//yrecfm)
551  ycomment='latent heat flux for GREENROOFs'//' (W/m2)'
552  CALL write_surf(hselect,hprogram,yrecfm,grd%XLE(:),iresp,hcomment=ycomment)
553  !
554  yrecfm='GFLUX_GR'
555  yrecfm=adjustl(ypatch//yrecfm)
556  ycomment='net conduction flux for GREENROOFs'//' (W/m2)'
557  CALL write_surf(hselect,hprogram,yrecfm,grd%XGFLUX(:),iresp,hcomment=ycomment)
558  !
559  yrecfm='SWA_GR'
560  yrecfm=adjustl(ypatch//yrecfm)
561  ycomment='Sdown absorbed by GREENROOFs'//' (W/m2)'
562  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_GREENROOF(:),iresp,hcomment=ycomment)
563  !
564  yrecfm='LWA_GR'
565  yrecfm=adjustl(ypatch//yrecfm)
566  ycomment='Ldown absorbed by GREENROOFs'//' (W/m2)'
567  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_GREENROOF(:),iresp,hcomment=ycomment)
568  !
569  yrecfm='G_GR_ROOF'
570  yrecfm=adjustl(ypatch//yrecfm)
571  ycomment='heat flux between GREENROOF and ROOF'//' (W/m2)'
572  CALL write_surf(hselect,hprogram,yrecfm,dmt%XG_GREENROOF_ROOF(:),iresp,hcomment=ycomment)
573  !
574  yrecfm='RUNOFF_GR'
575  yrecfm=adjustl(ypatch//yrecfm)
576  ycomment='GREENROOF soil surface runoff'//' (kg/m2/s)'
577  CALL write_surf(hselect,hprogram,yrecfm,grde%XRUNOFF(:),iresp,hcomment=ycomment)
578  !
579  yrecfm='DRAIN_GR'
580  yrecfm=adjustl(ypatch//yrecfm)
581  ycomment='GREENROOF total vertical drainage'//' (kg/m2/s)'
582  CALL write_surf(hselect,hprogram,yrecfm,grde%XDRAIN(:),iresp,hcomment=ycomment)
583  !
584  WHERE (t%XGREENROOF(:) == 1.)
585  dmt%XRN_STRLROOF(:) = xundef
586  dmt%XH_STRLROOF(:) = xundef
587  dmt%XLE_STRLROOF(:) = xundef
588  dmt%XGFLUX_STRLROOF(:) = xundef
589  dmt%XRUNOFF_STRLROOF(:) = xundef
590  END WHERE
591  !
592  yrecfm='RN_SR'
593  yrecfm=adjustl(ypatch//yrecfm)
594  ycomment='structural roof net radiation'//yrecfm//' (W/m2)'
595  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_STRLROOF(:),iresp,hcomment=ycomment)
596  !
597  yrecfm='H_SR'
598  yrecfm=adjustl(ypatch//yrecfm)
599  ycomment='structural roof sensible heat flux'//yrecfm//' (W/m2)'
600  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_STRLROOF(:),iresp,hcomment=ycomment)
601  !
602  yrecfm='LE_SR'
603  yrecfm=adjustl(ypatch//yrecfm)
604  ycomment='structural roof latent heat flux'//yrecfm//' (W/m2)'
605  CALL write_surf(hselect,hprogram,yrecfm,dmt%XLE_STRLROOF(:),iresp,hcomment=ycomment)
606  !
607  yrecfm='GFLUX_SR'
608  yrecfm=adjustl(ypatch//yrecfm)
609  ycomment='structural roof conduction flux'//yrecfm//' (W/m2)'
610  CALL write_surf(hselect,hprogram,yrecfm,dmt%XGFLUX_STRLROOF(:),iresp,hcomment=ycomment)
611  !
612  yrecfm='RUNOFF_SR'
613  yrecfm=adjustl(ypatch//yrecfm)
614  ycomment='structural roof surface runoff'//' (kg/m2/s)'
615  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRUNOFF_STRLROOF(:),iresp,hcomment=ycomment)
616  !
617  ENDIF
618  !
619  !* solar panels
620  IF (top%LSOLAR_PANEL) THEN
621  yrecfm='SWA_SP'
622  yrecfm=adjustl(ypatch//yrecfm)
623  ycomment='Shortwave absorbed by solar panels on roofs'//' (W/m2 panel)'
624  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_SW_PANEL(:),iresp,hcomment=ycomment)
625  !
626  yrecfm='LWA_SP'
627  yrecfm=adjustl(ypatch//yrecfm)
628  ycomment='Longwave absorbed by solar panels on roofs'//' (W/m2 panel)'
629  CALL write_surf(hselect,hprogram,yrecfm,dmt%XABS_LW_PANEL(:),iresp,hcomment=ycomment)
630  !
631  yrecfm='RN_SP'
632  yrecfm=adjustl(ypatch//yrecfm)
633  ycomment='Net radiation of solar panels on roofs'//' (W/m2 panel)'
634  CALL write_surf(hselect,hprogram,yrecfm,dmt%XRN_PANEL(:),iresp,hcomment=ycomment)
635  !
636  yrecfm='H_SP'
637  yrecfm=adjustl(ypatch//yrecfm)
638  ycomment='Sensible Heat flux from solar panels on roofs'//' (W/m2 panel)'
639  CALL write_surf(hselect,hprogram,yrecfm,dmt%XH_PANEL(:),iresp,hcomment=ycomment)
640  !
641  yrecfm='PHOT_SP'
642  yrecfm=adjustl(ypatch//yrecfm)
643  ycomment='Photovolatic production '//' (W/m2 photovoltaic panel)'
644  CALL write_surf(hselect,hprogram,yrecfm,dmt%XPHOT_PROD_PANEL(:),iresp,hcomment=ycomment)
645  !
646  yrecfm='THER_SP'
647  yrecfm=adjustl(ypatch//yrecfm)
648  ycomment='Hot Water production '//' (W/m2 thermal panel)'
649  CALL write_surf(hselect,hprogram,yrecfm,dmt%XTHER_PROD_PANEL(:),iresp,hcomment=ycomment)
650  !
651  yrecfm='PROD_SP'
652  yrecfm=adjustl(ypatch//yrecfm)
653  ycomment='Production by solar panels on roofs'//' (W/m2 panel)'
654  CALL write_surf(hselect,hprogram,yrecfm,dmt%XPROD_PANEL(:),iresp,hcomment=ycomment)
655  !
656  yrecfm='PHOT_BLD'
657  yrecfm=adjustl(ypatch//yrecfm)
658  ycomment='Photovolatic production '//' (W/m2 bld)'
659  CALL write_surf(hselect,hprogram,yrecfm,dmt%XPHOT_PROD_BLD(:),iresp,hcomment=ycomment)
660  !
661  yrecfm='THER_BLD'
662  yrecfm=adjustl(ypatch//yrecfm)
663  ycomment='Hot Water production '//' (W/m2 bld)'
664  CALL write_surf(hselect,hprogram,yrecfm,dmt%XTHER_PROD_BLD(:),iresp,hcomment=ycomment)
665  !
666  END IF
667  !
668  !*
669  !* 3. Cumulated fields
670  ! ----------------
671  !
672  CALL end_io_surf_n(hprogram)
673  CALL init_io_surf_n(dtco, u,hprogram,'TOWN ','TEB ','WRITE','TEB_DIAG_CUMUL.OUT.nc')
674  !
675  IF (top%CBEM=='BEM') THEN
676  !
677  yrecfm='HVACC_CL'
678  yrecfm=adjustl(ypatch//yrecfm)
679  ycomment='cumulated cooling energy consumption'//' (J/m2)'
680  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XHVAC_COOL(:),iresp,hcomment=ycomment)
681  !
682  yrecfm='HVACC_HT'
683  yrecfm=adjustl(ypatch//yrecfm)
684  ycomment='cumulated heating energy consumption'//' (J/m2)'
685  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XHVAC_HEAT(:),iresp,hcomment=ycomment)
686  !
687  END IF
688  !
689  yrecfm='RUNOFFC_TW'
690  yrecfm=adjustl(ypatch//yrecfm)
691  ycomment='cumulated aggregated runoff for town'//' (kg/m2)'
692  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XRUNOFF_TOWN(:),iresp,hcomment=ycomment)
693  !
694  yrecfm='RUNOFFC_RD'
695  yrecfm=adjustl(ypatch//yrecfm)
696  ycomment='cumulated road surface runoff'//' (kg/m2 road)'
697  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XRUNOFF_ROAD(:),iresp,hcomment=ycomment)
698  !
699  yrecfm='RUNOFFC_RF'
700  yrecfm=adjustl(ypatch//yrecfm)
701  ycomment='cumulated aggregated roof runoff'//' (kg/m2 roof)'
702  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XRUNOFF_ROOF(:),iresp,hcomment=ycomment)
703  !
704  yrecfm='IRRIGC_RD'
705  yrecfm=adjustl(ypatch//yrecfm)
706  ycomment='cumulated road irrigation'//' (kg/m2 road)'
707  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XIRRIG_ROAD(:),iresp,hcomment=ycomment)
708  !
709  IF (top%LGARDEN) THEN
710  !
711  yrecfm='RUNOFFC_GD'
712  yrecfm=adjustl(ypatch//yrecfm)
713  ycomment='cumulated garden surface runoff'//' (kg/m2 garden)'
714  CALL write_surf(hselect,hprogram,yrecfm,gddec%XRUNOFF(:),iresp,hcomment=ycomment)
715  !
716  yrecfm='DRAINC_GD'
717  yrecfm=adjustl(ypatch//yrecfm)
718  ycomment='cumulated garden surface drainage'//' (kg/m2 garden)'
719  CALL write_surf(hselect,hprogram,yrecfm,gddec%XDRAIN(:),iresp,hcomment=ycomment)
720  !
721  yrecfm='IRRIGC_GD'
722  yrecfm=adjustl(ypatch//yrecfm)
723  ycomment='cumulated garden irrigation'//' (kg/m2 garden)'
724  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XIRRIG_GARDEN(:),iresp,hcomment=ycomment)
725  !
726  END IF
727  !
728  IF (top%LGREENROOF) THEN
729  !
730  WHERE (t%XGREENROOF(:) == 0.)
731  grdec%XRUNOFF (:) = xundef
732  grdec%XDRAIN (:) = xundef
733  dmtc%XIRRIG_GREENROOF (:) = xundef
734  END WHERE
735  !
736  yrecfm='RUNOFFC_GR'
737  yrecfm=adjustl(ypatch//yrecfm)
738  ycomment='GREENROOF cumulated soil surface runoff'//' (kg/m2 greenroof)'
739  CALL write_surf(hselect,hprogram,yrecfm,grdec%XRUNOFF(:),iresp,hcomment=ycomment)
740  !
741  yrecfm='DRAINC_GR'
742  yrecfm=adjustl(ypatch//yrecfm)
743  ycomment='GREENROOF cumulated total vertical drainage'//' (kg/m2 greenroof)'
744  CALL write_surf(hselect,hprogram,yrecfm,grdec%XDRAIN(:),iresp,hcomment=ycomment)
745  !
746  !
747  yrecfm='IRRIGC_GR'
748  yrecfm=adjustl(ypatch//yrecfm)
749  ycomment='GREENROOF cumulated irrigation'//' (kg/m2 greenroof)'
750  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XIRRIG_GREENROOF(:),iresp,hcomment=ycomment)
751  !
752  WHERE (t%XGREENROOF(:) == 1.)
753  dmtc%XRUNOFF_STRLROOF (:) = xundef
754  END WHERE
755  !
756  yrecfm='RUNOFFC_SR'
757  yrecfm=adjustl(ypatch//yrecfm)
758  ycomment='cumulated structural roof surface runoff'//' (kg/m2)'
759  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XRUNOFF_STRLROOF(:),iresp,hcomment=ycomment)
760  !
761  END IF
762  !
763  !* solar panels
764  IF (top%LSOLAR_PANEL) THEN
765  !
766  yrecfm='PHOTC_BLD'
767  yrecfm=adjustl(ypatch//yrecfm)
768  ycomment='Cumulated Photovolatic production '//' (J/m2 bld)'
769  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XPHOT_PROD_BLD(:),iresp,hcomment=ycomment)
770  !
771  yrecfm='THERC_BLD'
772  yrecfm=adjustl(ypatch//yrecfm)
773  ycomment='Cumulated Hot water production '//' (J/m2 bld)'
774  CALL write_surf(hselect,hprogram,yrecfm,dmtc%XTHER_PROD_BLD(:),iresp,hcomment=ycomment)
775  !
776  END IF
777  !
778  !-------------------------------------------------------------------------------
779  !
780  ! End of IO
781  !
782  CALL end_io_surf_n(hprogram)
783  !
784 END IF
785 !
786 IF (lhook) CALL dr_hook('WRITE_DIAG_MISC_TEB_N',1,zhook_handle)
787 !
788 END SUBROUTINE write_diag_misc_teb_n
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
subroutine end_io_surf_n(HPROGRAM)
Definition: end_io_surfn.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine write_diag_misc_teb_n(DTCO, HSELECT, U, DMTC, DMT, DMT
subroutine init_io_surf_n(DTCO, U, HPROGRAM, HMASK, HSCHEME, HACTION