Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 1973)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 1976)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Radiation actions are now done directly in the respective module
 ! 
 ! Former revisions:
@@ -138,9 +138,5 @@
 
     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_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
+        ONLY:  radiation, radiation_3d_data_averaging
 
 
@@ -291,58 +287,4 @@
                 qv_av = 0.0_wp
 
-             CASE ( 'rad_net*' )
-                IF ( .NOT. ALLOCATED( rad_net_av ) )  THEN
-                   ALLOCATE( rad_net_av(nysg:nyng,nxlg:nxrg) )
-                ENDIF
-                rad_net_av = 0.0_wp
-
-             CASE ( 'rad_lw_in' )
-                IF ( .NOT. ALLOCATED( rad_lw_in_av ) )  THEN
-                   ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-                ENDIF
-                rad_lw_in_av = 0.0_wp
-
-             CASE ( 'rad_lw_out' )
-                IF ( .NOT. ALLOCATED( rad_lw_out_av ) )  THEN
-                   ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-                ENDIF
-                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
-                   ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-                ENDIF
-                rad_sw_in_av = 0.0_wp
-
-             CASE ( 'rad_sw_out' )
-                IF ( .NOT. ALLOCATED( rad_sw_out_av ) )  THEN
-                   ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-                ENDIF
-                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
@@ -429,4 +371,10 @@
                 IF ( land_surface )  THEN
                    CALL lsm_3d_data_averaging( 'allocate', doav(ii) )
+                ENDIF
+
+!
+!--             Radiation quantity
+                IF ( radiation )  THEN
+                   CALL radiation_3d_data_averaging( 'allocate', doav(ii) )
                 ENDIF
 
@@ -655,83 +603,4 @@
              ENDDO
 
-          CASE ( 'rad_net*' )
-             DO  i = nxlg, nxrg
-                DO  j = nysg, nyng
-                   rad_net_av(j,i) = rad_net_av(j,i) + rad_net(j,i)
-                ENDDO
-             ENDDO
-
-          CASE ( 'rad_lw_in' )
-             DO  i = nxlg, nxrg
-                DO  j = nysg, nyng
-                   DO  k = nzb, nzt+1
-                      rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) + rad_lw_in(k,j,i)
-                   ENDDO
-                ENDDO
-             ENDDO
-
-          CASE ( 'rad_lw_out' )
-             DO  i = nxlg, nxrg
-                DO  j = nysg, nyng
-                   DO  k = nzb, nzt+1
-                      rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) + rad_lw_out(k,j,i)
-                   ENDDO
-                ENDDO
-             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' )
-             DO  i = nxlg, nxrg
-                DO  j = nysg, nyng
-                   DO  k = nzb, nzt+1
-                      rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) + rad_sw_in(k,j,i)
-                   ENDDO
-                ENDDO
-             ENDDO
-
-          CASE ( 'rad_sw_out' )
-             DO  i = nxlg, nxrg
-                DO  j = nysg, nyng
-                   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
-             ENDDO
-
           CASE ( 'rho' )
              DO  i = nxlg, nxrg
@@ -854,4 +723,10 @@
 
 !
+!--          Radiation quantity
+             IF ( radiation )  THEN
+                CALL radiation_3d_data_averaging( 'sum', doav(ii) )
+             ENDIF
+
+!
 !--          User-defined quantity
              CALL user_3d_data_averaging( 'sum', doav(ii) )
