Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 1683)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 1691)
@@ -14,10 +14,11 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 1997-2014 Leibniz Universitaet Hannover
+! Copyright 1997-2015 Leibniz Universitaet Hannover
 !--------------------------------------------------------------------------------!
 !
 ! Current revisions:
 ! -----------------
-! 
+! Added output of Obukhov length and radiative heating rates for RRTMG. 
+! Corrected output of LWC.
 ! 
 ! Former revisions:
@@ -84,9 +85,9 @@
 
     USE arrays_3d,                                                             &
-        ONLY:  dzw, e, nr, p, pt, q, qc, ql, ql_c, ql_v, qr, qsws, rho, sa,    &
+        ONLY:  dzw, e, nr, ol, p, pt, q, qc, ql, ql_c, ql_v, qr, qsws, rho, sa,&
                shf, ts, u, us, v, vpt, w, z0, z0h
 
     USE averaging,                                                             &
-        ONLY:  e_av, lpt_av, lwp_av, nr_av, p_av, pc_av, pr_av, prr_av,        &
+        ONLY:  e_av, lpt_av, lwp_av, nr_av, ol_av, p_av, pc_av, pr_av, prr_av, &
                precipitation_rate_av, pt_av, q_av, qc_av, ql_av, ql_c_av,      &
                ql_v_av, ql_vp_av, qr_av, qsws_av, qv_av, rho_av, s_av, sa_av,  &
@@ -97,5 +98,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  average_count_3d, cloud_physics, doav, doav_n
+        ONLY:  average_count_3d, cloud_physics, doav, doav_n, rho_surface
 
     USE cpulog,                                                                &
@@ -120,6 +121,9 @@
     USE radiation_model_mod,                                                   &
         ONLY:  rad_net, rad_net_av, rad_sw_in, rad_sw_in_av, rad_sw_out,       &
-               rad_sw_out_av, rad_lw_in, rad_lw_in_av, rad_lw_out,             &
-               rad_lw_out_av
+               rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr,        &
+               rad_sw_hr_av, rad_lw_in, rad_lw_in_av, rad_lw_out,              &
+               rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr,        &
+               rad_lw_hr_av
+
 
     IMPLICIT NONE
@@ -215,4 +219,10 @@
                 nr_av = 0.0_wp
 
+             CASE ( 'ol*' )
+                IF ( .NOT. ALLOCATED( ol_av ) )  THEN
+                   ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) )
+                ENDIF
+                ol_av = 0.0_wp
+
              CASE ( 'p' )
                 IF ( .NOT. ALLOCATED( p_av ) )  THEN
@@ -347,4 +357,16 @@
                 rad_lw_out_av = 0.0_wp
 
+             CASE ( 'rad_lw_cs_hr' )
+                IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) )  THEN
+                   ALLOCATE( rad_lw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) )
+                ENDIF
+                rad_lw_cs_hr_av = 0.0_wp
+
+             CASE ( 'rad_lw_hr' )
+                IF ( .NOT. ALLOCATED( rad_lw_hr_av ) )  THEN
+                   ALLOCATE( rad_lw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) )
+                ENDIF
+                rad_lw_hr_av = 0.0_wp
+
              CASE ( 'rad_sw_in' )
                 IF ( .NOT. ALLOCATED( rad_sw_in_av ) )  THEN
@@ -359,4 +381,16 @@
                 rad_sw_out_av = 0.0_wp
 
+             CASE ( 'rad_sw_cs_hr' )
+                IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) )  THEN
+                   ALLOCATE( rad_sw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) )
+                ENDIF
+                rad_sw_cs_hr_av = 0.0_wp
+
+             CASE ( 'rad_sw_hr' )
+                IF ( .NOT. ALLOCATED( rad_sw_hr_av ) )  THEN
+                   ALLOCATE( rad_sw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) )
+                ENDIF
+                rad_sw_hr_av = 0.0_wp
+
              CASE ( 'rho' )
                 IF ( .NOT. ALLOCATED( rho_av ) )  THEN
@@ -530,6 +564,6 @@
              DO  i = nxlg, nxrg
                 DO  j = nysg, nyng
-                   lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) * &
-                                                    dzw(1:nzt+1) )
+                   lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i)            &
+                                               * dzw(1:nzt+1) ) * rho_surface
                 ENDDO
              ENDDO
@@ -557,4 +591,11 @@
                       nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i)
                    ENDDO
+                ENDDO
+             ENDDO
+
+          CASE ( 'ol*' )
+             DO  i = nxlg, nxrg
+                DO  j = nysg, nyng
+                   ol_av(j,i) = ol_av(j,i) + ol(j,i)
                 ENDDO
              ENDDO
@@ -777,4 +818,21 @@
              ENDDO
 
+          CASE ( 'rad_lw_cs_hr' )
+             DO  i = nxlg, nxrg
+                DO  j = nysg, nyng
+                   DO  k = nzb, nzt+1
+                      rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) + rad_lw_cs_hr(k,j,i)
+                   ENDDO
+                ENDDO
+             ENDDO
+
+          CASE ( 'rad_lw_hr' )
+             DO  i = nxlg, nxrg
+                DO  j = nysg, nyng
+                   DO  k = nzb, nzt+1
+                      rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) + rad_lw_hr(k,j,i)
+                   ENDDO
+                ENDDO
+             ENDDO
 
           CASE ( 'rad_sw_in' )
@@ -792,4 +850,22 @@
                    DO  k = nzb, nzt+1
                       rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) + rad_sw_out(k,j,i)
+                   ENDDO
+                ENDDO
+             ENDDO
+
+          CASE ( 'rad_sw_cs_hr' )
+             DO  i = nxlg, nxrg
+                DO  j = nysg, nyng
+                   DO  k = nzb, nzt+1
+                      rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) + rad_sw_cs_hr(k,j,i)
+                   ENDDO
+                ENDDO
+             ENDDO
+
+          CASE ( 'rad_sw_hr' )
+             DO  i = nxlg, nxrg
+                DO  j = nysg, nyng
+                   DO  k = nzb, nzt+1
+                      rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) + rad_sw_hr(k,j,i)
                    ENDDO
                 ENDDO
