SURFEX v8.1
General documentation of Surfex
mass_layer_e_budget.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 mass_layer_e_budget(B, PTSTEP, PFLX_BLD_MA, PDQS_MA, PIMB_MA, PRADHT_IN, &
7  PRAD_WL_MA, PRAD_RF_MA, PRAD_WIN_MA, PLOAD_MA, &
8  PRAD_FL_MA, PCONV_MA_BLD )
9 ! ##########################################################################
10 !
11 !!**** *MASS_LAYER_E_BUDGET*
12 !!
13 !! PURPOSE
14 !! -------
15 !
16 ! Computes the evoultion of building floor temperatures
17 !
18 !
19 !!** METHOD
20 ! ------
21 !
22 ! 6 : equations for evolution of Ts_floor
23 ! *************************************************************
24 !
25 ! dTf_k(t) / dt = 1/(df_k*Cf_k) * (- 2*Kf_k-1*(Tf_k-Tf_k-1)/(df_k-1 +df_k)
26 ! - 2*Kf_k *(Tf_k-Tf_k+1)/(df_k+1 +df_k) )
27 !
28 ! dTf_1(t) / dt = 1/(df_1*Cf_1) * (- 2*Kw_1*(Tw_1-Tw_2)/(dw_1 +dw_2))
29 !
30 ! with
31 !
32 ! K*_k = (d*_k+ d*_k+1)/(d*_k/k*_k+ d*_k+1/k*_k+1)
33 !
34 !
35 ! The system is implicited (or semi-implicited).
36 !
37 ! ZIMPL=1 ---> implicit system
38 ! ZIMPL=0.5 ---> semi-implicit system
39 ! ZIMPL=0 ---> explicit system
40 !
41 !
42 !
43 !
44 !! EXTERNAL
45 !! --------
46 !!
47 !!
48 !! IMPLICIT ARGUMENTS
49 !! ------------------
50 !!
51 !! MODD_CST
52 !!
53 !!
54 !! REFERENCE
55 !! ---------
56 !!
57 !!
58 !! AUTHOR
59 !! ------
60 !!
61 !! G. Pigeon * Meteo-France *
62 !!
63 !! MODIFICATIONS
64 !! -------------
65 !! Original 11/11
66 !! G. Pigeon 09/12 modif internal convection coef
67 !-------------------------------------------------------------------------------
68 !
69 !* 0. DECLARATIONS
70 ! ------------
71 !
72 USE modd_bem_n, ONLY : bem_t
73 !
74 USE modi_layer_e_budget_get_coef
75 USE modi_layer_e_budget
76 USE mode_conv_doe
77 !
78 USE yomhook ,ONLY : lhook, dr_hook
79 USE parkind1 ,ONLY : jprb
80 !
81 IMPLICIT NONE
82 !
83 !* 0.1 declarations of arguments
84 !
85 TYPE(bem_t), INTENT(INOUT) :: B
86 !
87 REAL, INTENT(IN) :: PTSTEP ! time step
88 REAL, DIMENSION(:), INTENT(OUT) :: PFLX_BLD_MA !flux from building to floor
89 REAL, DIMENSION(:), INTENT(OUT) :: PDQS_MA !heat storage inside the floor
90 REAL, DIMENSION(:), INTENT(OUT) :: PIMB_MA !floor energy residual imbalance for verification
91 REAL, DIMENSION(:), INTENT(IN) :: PRADHT_IN ! Indoor radiant heat transfer coefficient
92  ! [W K-1 m-2]
93 REAL, DIMENSION(:), INTENT(IN) :: PRAD_RF_MA ! rad. fluxes from roof to floor[W m-2(roof)]
94 REAL, DIMENSION(:), INTENT(IN) :: PRAD_WL_MA ! rad. fluxes from wall to floor[W m-2(wall)]
95 REAL, DIMENSION(:), INTENT(IN) :: PRAD_WIN_MA ! rad. fluxes from win to floor[W m-2(win)]
96 REAL, DIMENSION(:), INTENT(IN) :: PLOAD_MA ! solar and internal load to the floor
97 REAL, DIMENSION(:), INTENT(IN) :: PRAD_FL_MA ! rad. fluxes from floor to mass [W m-2(floor)]
98 REAL, DIMENSION(:), INTENT(OUT) :: PCONV_MA_BLD ! conv. fluxes from floor to bld [W m-2(floor)]
99 !
100 !* 0.2 declarations of local variables
101 !
102 !
103 REAL :: ZIMPL=1.0 ! implicit coefficient
104 REAL :: ZEXPL=0.0 ! explicit coefficient
105 !
106 REAL, DIMENSION(SIZE(B%XT_MASS,1),SIZE(B%XT_MASS,2)) :: ZA,& ! lower diag.
107  ZB,& ! main diag.
108  ZC,& ! upper diag.
109  ZY ! r.h.s.
110 !
111 REAL, DIMENSION(SIZE(B%XT_MASS,1)) :: ZTS_MA ! surf. mass temp.
112  ! used during calculation
113 REAL, DIMENSION(SIZE(B%XT_MASS,1)) :: ZTS_MA_CONV ! surf. mass temp. used for conv flux
114 REAL, DIMENSION(SIZE(B%XT_MASS,1)) :: ZCHTC_IN_MA ! Indoor floor convec heat transfer coefficient
115  ! [W K-1 m-2(bld)]
116 INTEGER :: JJ
117 REAL(KIND=JPRB) :: ZHOOK_HANDLE
118 !-------------------------------------------------------------------------------
119 IF (lhook) CALL dr_hook('MASS_LAYER_E_BUDGET',0,zhook_handle)
120 !
121 ! *Convection heat transfer coefficients [W m-2 K-1] from EP Engineering Reference
122 !
123 zchtc_in_ma(:) = chtc_vert_doe(b%XT_MASS(:,1), b%XTI_BLD(:))
124 DO jj=1,SIZE(zchtc_in_ma)
125  zchtc_in_ma(jj) = max(1., zchtc_in_ma(jj))
126 ENDDO
127 !
128  CALL layer_e_budget_get_coef( b%XT_MASS, ptstep, zimpl, b%XHC_FLOOR, b%XTC_FLOOR, b%XD_FLOOR/2., &
129  za, zb, zc, zy )
130 !
131 zts_ma(:) = b%XT_MASS(:,1)
132 
133 zb(:,1) = zb(:,1) + zimpl * 4./3. * zchtc_in_ma(:)
134 
135 zy(:,1) = zy(:,1) &
136  + zchtc_in_ma(:) * (b%XTI_BLD(:) - 1./3. * b%XT_MASS(:, 1) * (4 * zexpl -1.)) &
137  + b%XF_MASS_WIN (:) * prad_win_ma(:) + b%XF_MASS_WALL (:) * prad_wl_ma(:) &
138  + b%XF_MASS_FLOOR (:) * (prad_rf_ma(:) +prad_fl_ma(:)) + pload_ma(:)
139 !
140  CALL layer_e_budget( b%XT_MASS, ptstep, zimpl, b%XHC_FLOOR, b%XTC_FLOOR, b%XD_FLOOR/2., &
141  za, zb, zc, zy, pdqs_ma )
142 !
143 !* calculation of temperature used in energy balance calculation
144 ! -------------------------------------------------------------
145 !
146 zts_ma_conv(:) = zimpl * 4./3. * b%XT_MASS(:,1) +1./3 * zts_ma(:) * (4 * zexpl -1.)
147 zts_ma(:) = zexpl * zts_ma(:) + zimpl * b%XT_MASS(:,1)
148 !
149 !* calculation of convection flux between mass and building air
150 ! ------------------------------------------------------------
151 !
152 pconv_ma_bld(:) = zchtc_in_ma(:) * (zts_ma_conv(:) - b%XTI_BLD(:))
153 !
154 !* For diagnostics calculation of flux exchanged between the mass and the
155 ! indoor
156 ! ------------------------------------------------
157 !
158 pflx_bld_ma(:) = - pconv_ma_bld(:) + b%XF_MASS_WIN (:) * prad_win_ma(:) &
159  + b%XF_MASS_WALL (:) * prad_wl_ma(:) &
160  + b%XF_MASS_FLOOR (:) * (prad_rf_ma(:) + prad_fl_ma(:)) + pload_ma(:)
161 !
162 !* Floor residual energy imbalance for verification
163 ! ------------------------------------------------
164 !
165 pimb_ma(:) = pflx_bld_ma(:) - pdqs_ma(:)
166 !
167 IF (lhook) CALL dr_hook('MASS_LAYER_E_BUDGET',1,zhook_handle)
168 !-------------------------------------------------------------------------------
169 END SUBROUTINE mass_layer_e_budget
subroutine mass_layer_e_budget(B, PTSTEP, PFLX_BLD_MA, PDQS_MA, PIMB_MA, PRADHT_IN, PRAD_WL_MA, PRAD_RF_MA, PRAD_WIN_MA, PLOAD_MA, PRAD_FL_MA, PCONV_MA_BLD)
integer, parameter jprb
Definition: parkind1.F90:32
subroutine layer_e_budget(PT, PTSTEP, PIMPL, PHC, PTC, PD, PA, PB, PC, PY, PDQS)
logical lhook
Definition: yomhook.F90:15
subroutine layer_e_budget_get_coef(PT, PTSTEP, PIMPL, PHC, PTC, PD, PA, PB, PC, PY)