Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4746)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4747)
@@ -22,9 +22,12 @@
 ! Current revisions:
 ! -----------------
-! 
-! 
+!
+!
 ! Former revisions:
 ! -----------------
 ! $Id$
+! Fix window absorptivity calculation (correctly account for 2-sided reflection)
+! 
+! 4738 2020-10-14 08:05:07Z maronga
 ! Updating building data base (on behalf of Sascha Rissmann)
 !
@@ -5152,5 +5155,6 @@
     INTEGER(iwp)  ::  i,j,k,kw, m    !< running indices
 
-    REAL(wp)  ::  win_absorp  !< absorption coefficient from transmissivity
+    REAL(wp)  ::  win_absorp        !< absorption coefficient from transmissivity
+    REAL(wp)  ::  win_nonrefl_1side !< non-reflected fraction after outer glass boundary
 
     REAL(wp), DIMENSION(nzb_wall:nzt_wall)  ::  wall_mod        !<
@@ -5257,5 +5261,18 @@
 !--    During spinup the tempeature inside window layers is not calculated to make larger timesteps possible
        IF ( .NOT. during_spinup )  THEN
-          win_absorp = -log( surf%transmissivity(m) ) / surf%zw_window(nzt_wall,m)
+!
+!--       Reflectivity in glass windows is considered as equal on frontal and rear side of the
+!--       glass, which together make total reflectivity (albedo for win fraction).
+          win_nonrefl_1side = 1.0 - ( surf%albedo(m,ind_wat_win) + surf%transmissivity(m)         &
+                                      + 1.0_wp                                                    &
+                                      - sqrt( ( surf%albedo(m,ind_wat_win)                        &
+                                                + surf%transmissivity(m) + 1.0_wp ) ** 2          &
+                                              - 4 * surf%albedo(m,ind_wat_win) ) ) / 2.0_wp
+!
+!--       Absorption coefficient is calculated using zw from internal tranmissivity, which only
+!--       considers absorption without the effects of reflection.
+          win_absorp = -log( ( surf%transmissivity(m) + surf%albedo(m,ind_wat_win) - 1.0_wp       &
+                               + win_nonrefl_1side ) / win_nonrefl_1side )                        &
+                       / surf%zw_window(nzt_wall,m)
 !
 !--       Prognostic equation for ground/roof window temperature t_window takes absorption
@@ -5267,7 +5284,7 @@
                                 * surf%ddz_window(nzb_wall+1,m)                                   &
                                 + surf%wghf_eb_window(m)                                          &
-                                + surf%rad_sw_in(m)                                               &
+                                + surf%rad_sw_in(m) * win_nonrefl_1side                           &
                                 * ( 1.0_wp - exp( -win_absorp                                     &
-                                    * surf%zw_window(nzb_wall,m) ) ) - surf%rad_sw_out(m)         &
+                                    * surf%zw_window(nzb_wall,m) ) )                              &
                               ) * surf%ddz_window_stag(nzb_wall,m)
 
@@ -5288,8 +5305,7 @@
                            * ( t_window%val(kw,m) - t_window%val(kw-1,m) )                        &
                            * surf%ddz_window(kw,m)                                                &
-                           + surf%rad_sw_in(m)                                                    &
+                           + surf%rad_sw_in(m) * win_nonrefl_1side                                &
                            * ( exp( -win_absorp * surf%zw_window(kw-1,m) )                        &
-                           - exp(-win_absorp * surf%zw_window(kw,m) )                             &
-                             ) - surf%rad_sw_out(m)                                               &
+                             - exp( -win_absorp * surf%zw_window(kw,  m) ) )                      &
                              ) * surf%ddz_window_stag(kw,m)
 
@@ -5301,10 +5317,7 @@
                                  * surf%ddz_window(nzt_wall,m)                                    &
                                  + surf%iwghf_eb_window(m)                                        &
-                                 + surf%rad_sw_in(m)                                              &
-                                 * ( exp( -win_absorp                                             &
-                                 * surf%zw_window(nzt_wall-1,m) )                                 &
-                                 - exp( -win_absorp                                               &
-                                 * surf%zw_window(nzt_wall,m) )                                   &
-                                   ) - surf%rad_sw_out(m)                                         &
+                                 + surf%rad_sw_in(m) * win_nonrefl_1side                          &
+                                 * ( exp( -win_absorp * surf%zw_window(nzt_wall-1,m) )            &
+                                   - exp( -win_absorp * surf%zw_window(nzt_wall,  m) ) )          &
                                    ) * surf%ddz_window_stag(nzt_wall,m)
 
