Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3176)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3178)
@@ -28,4 +28,8 @@
 ! -----------------
 ! $Id$
+! Revise concept for calculation of effective radiative temperature and mapping
+! of radiative heating
+! 
+! 3175 2018-07-26 14:07:38Z suehring
 ! Bugfix for commit 3172
 ! 
@@ -3021,6 +3025,6 @@
                    k_topo = get_topography_top_index_ji( j, i, 's' )
                    DO k = k_topo+1, nzt+1
-                      rad_lw_hr(k,j,i)     = rrtm_lwhr(0,k)  * d_hours_day
-                      rad_lw_cs_hr(k,j,i)  = rrtm_lwhrc(0,k) * d_hours_day
+                      rad_lw_hr(k,j,i)     = rrtm_lwhr(0,k-k_topo)  * d_hours_day
+                      rad_lw_cs_hr(k,j,i)  = rrtm_lwhrc(0,k-k_topo) * d_hours_day
                    ENDDO
                 ENDDO
@@ -3359,6 +3363,6 @@
 !--                Save heating rates (convert from K/d to K/h)
                    DO k = k_topo+1, nzt+1
-                      rad_lw_hr(k,j,i)     = rrtm_lwhr(0,k)  * d_hours_day
-                      rad_lw_cs_hr(k,j,i)  = rrtm_lwhrc(0,k) * d_hours_day
+                      rad_lw_hr(k,j,i)     = rrtm_lwhr(0,k-k_topo)  * d_hours_day
+                      rad_lw_cs_hr(k,j,i)  = rrtm_lwhrc(0,k-k_topo) * d_hours_day
                    ENDDO
 
@@ -4974,7 +4978,12 @@
 !--  See below for more explanation.
 !--  (3) temperature
-!      t_rad_urb = ( (pemitlw - pabslw + emissivity_urb*pinlw) / &
-!           (emissivity_urb*sigma_sb * area_hor) )**0.25_wp
-
+!--   first we calculate an effective horizontal area to account for
+!--   the effect of vertical surfaces (which contributes to LW emission)
+!--   We simply use the ratio of the total LW to the incoming LW flux 
+      area_hor = pinlw/rad_lw_in_diff(nyn,nxl)
+      t_rad_urb = ( (pemitlw - pabslw + emissivity_urb*pinlw) / &
+           (emissivity_urb*sigma_sb * area_hor) )**0.25_wp
+write(9,*) t_rad_urb
+flush(9)
 !
 !--  It has been turned out that the effective radiative temperature is far 
@@ -4983,47 +4992,47 @@
 !--  surface temperature from all surface elements, resulting in more 
 !--  physically meaningful radiative forcings.           
-     pt_surf_urb_l    = 0.0_wp
-     count_surfaces_l = 0.0_wp
-     DO  m = 1, surf_lsm_h%ns
-        k                = surf_lsm_h%k(m)
-        pt_surf_urb_l    = pt_surf_urb_l + surf_lsm_h%pt_surface(m)            &
-                           * ( hyp(k) / 100000.0_wp )**0.286_wp
-        count_surfaces_l = count_surfaces_l + 1.0_wp
-     ENDDO
-     DO  m = 1, surf_usm_h%ns
-        k                = surf_usm_h%k(m)
-        pt_surf_urb_l    = pt_surf_urb_l + surf_usm_h%pt_surface(m)            &
-                           * ( hyp(k) / 100000.0_wp )**0.286_wp
-        count_surfaces_l = count_surfaces_l + 1.0_wp
-     ENDDO
-     DO  l = 0, 3
-        DO  m = 1, surf_lsm_v(l)%ns
-           k                = surf_lsm_v(l)%k(m)
-           pt_surf_urb_l    = pt_surf_urb_l + surf_lsm_v(l)%pt_surface(m)      &
-                           * ( hyp(k) / 100000.0_wp )**0.286_wp
-           count_surfaces_l = count_surfaces_l + 1.0_wp
-        ENDDO
-        DO  m = 1, surf_usm_v(l)%ns
-           k                = surf_usm_v(l)%k(m)
-           pt_surf_urb_l    = pt_surf_urb_l + surf_usm_v(l)%pt_surface(m)      &
-                           * ( hyp(k) / 100000.0_wp )**0.286_wp
-           count_surfaces_l = count_surfaces_l + 1.0_wp
-        ENDDO
-     ENDDO
-     
-     pt_surf_urb    = 0.0_wp
-     count_surfaces = 0.0_wp
-     
-#if defined( __parallel )
-     CALL MPI_ALLREDUCE( count_surfaces_l, count_surfaces, 1, MPI_REAL,        &
-                         MPI_SUM, comm2d, ierr)
-     CALL MPI_ALLREDUCE( pt_surf_urb_l,  pt_surf_urb,      1, MPI_REAL,        &
-                         MPI_SUM, comm2d, ierr)
-#else
-     count_surfaces_l = count_surfaces
-     pt_surf_urb_l    = pt_surf_urb
-#endif     
-
-     t_rad_urb = pt_surf_urb / count_surfaces
+!      pt_surf_urb_l    = 0.0_wp
+!      count_surfaces_l = 0.0_wp
+!      DO  m = 1, surf_lsm_h%ns
+!         k                = surf_lsm_h%k(m)
+!         pt_surf_urb_l    = pt_surf_urb_l + surf_lsm_h%pt_surface(m)            &
+!                            * ( hyp(k) / 100000.0_wp )**0.286_wp
+!         count_surfaces_l = count_surfaces_l + 1.0_wp
+!      ENDDO
+!      DO  m = 1, surf_usm_h%ns
+!         k                = surf_usm_h%k(m)
+!         pt_surf_urb_l    = pt_surf_urb_l + surf_usm_h%pt_surface(m)            &
+!                            * ( hyp(k) / 100000.0_wp )**0.286_wp
+!         count_surfaces_l = count_surfaces_l + 1.0_wp
+!      ENDDO
+!      DO  l = 0, 3
+!         DO  m = 1, surf_lsm_v(l)%ns
+!            k                = surf_lsm_v(l)%k(m)
+!            pt_surf_urb_l    = pt_surf_urb_l + surf_lsm_v(l)%pt_surface(m)      &
+!                            * ( hyp(k) / 100000.0_wp )**0.286_wp
+!            count_surfaces_l = count_surfaces_l + 1.0_wp
+!         ENDDO
+!         DO  m = 1, surf_usm_v(l)%ns
+!            k                = surf_usm_v(l)%k(m)
+!            pt_surf_urb_l    = pt_surf_urb_l + surf_usm_v(l)%pt_surface(m)      &
+!                            * ( hyp(k) / 100000.0_wp )**0.286_wp
+!            count_surfaces_l = count_surfaces_l + 1.0_wp
+!         ENDDO
+!      ENDDO
+!      
+!      pt_surf_urb    = 0.0_wp
+!      count_surfaces = 0.0_wp
+!      
+! #if defined( __parallel )
+!      CALL MPI_ALLREDUCE( count_surfaces_l, count_surfaces, 1, MPI_REAL,        &
+!                          MPI_SUM, comm2d, ierr)
+!      CALL MPI_ALLREDUCE( pt_surf_urb_l,  pt_surf_urb,      1, MPI_REAL,        &
+!                          MPI_SUM, comm2d, ierr)
+! #else
+!      count_surfaces_l = count_surfaces
+!      pt_surf_urb_l    = pt_surf_urb
+! #endif     
+! 
+!      t_rad_urb = pt_surf_urb / count_surfaces
      
     CONTAINS
