Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 348)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 354)
@@ -40,5 +40,10 @@
 (data_output_2d, user_data_output_2d)
 
-check_for_restart, check_parameters, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, init_coupling, init_dvrp, init_grid, init_3d_model, header, modules, mrun, package_parin, parin, prognostic_equations, read_var_list, surface_coupler, timestep, time_integration, user_check_parameters, user_data_output_2d, user_data_output_dvrp, user_header, user_init_grid, write_var_list
+xy cross section output of surface heatfluxes (latent, sensible) 
+(average_3d_data, check_parameters, data_output_2d, modules, read_3d_binary, 
+sum_up_3d_data, write_3d_binary)
+
+
+average_3d_data, check_for_restart, check_parameters, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, init_coupling, init_dvrp, init_grid, init_3d_model, header, modules, mrun, package_parin, parin, prognostic_equations, read_3d_binary, read_var_list, surface_coupler, timestep, time_integration, user_check_parameters, user_data_output_2d, user_data_output_dvrp, user_header, user_init_grid, write_3d_binary, write_var_list
 
 New: set_particle_attributes, set_slicer_attributes_dvrp
Index: palm/trunk/SOURCE/average_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/average_3d_data.f90	(revision 348)
+++ palm/trunk/SOURCE/average_3d_data.f90	(revision 354)
@@ -63,4 +63,11 @@
              ENDDO
 
+          CASE ( 'qsws*' )
+             DO  i = nxl-1, nxr+1
+                DO  j = nys-1, nyn+1
+                   qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d )
+                ENDDO
+             ENDDO
+
           CASE ( 'lwp*' )
              DO  i = nxl-1, nxr+1
@@ -168,5 +175,5 @@
                 ENDDO
              ENDDO
-             
+          
           CASE ( 'rho' )
              DO  i = nxl-1, nxr+1
@@ -193,4 +200,11 @@
                       sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d )
                    ENDDO
+                ENDDO
+             ENDDO
+             
+         CASE ( 'shf*' )
+             DO  i = nxl-1, nxr+1
+                DO  j = nys-1, nyn+1
+                   shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d )
                 ENDDO
              ENDDO
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 348)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 354)
@@ -2365,5 +2365,5 @@
              unit = 'psu'
 
-          CASE ( 'u*', 't*', 'lwp*', 'pra*', 'prr*', 'z0*' )
+          CASE ( 'u*', 't*', 'lwp*', 'pra*', 'prr*', 'qsws*', 'shf*', 'z0*' )
              IF ( k == 0  .OR.  data_output(i)(ilen-2:ilen) /= '_xy' )  THEN
                 message_string = 'illegal value for data_output: "' // &
@@ -2392,12 +2392,19 @@
                 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 )
              ENDIF
-
-
-             IF ( TRIM( var ) == 'u*'   )  unit = 'm/s'
-             IF ( TRIM( var ) == 't*'   )  unit = 'K'
-             IF ( TRIM( var ) == 'lwp*' )  unit = 'kg/kg*m'
-             IF ( TRIM( var ) == 'pra*' )  unit = 'mm'
-             IF ( TRIM( var ) == 'prr*' )  unit = 'mm/s'
-             IF ( TRIM( var ) == 'z0*'  )  unit = 'm'
+             IF ( TRIM( var ) == 'qsws*'  .AND.  .NOT. humidity )  THEN
+                message_string = 'output of "' // TRIM( var ) // '" requi' // &
+                                 'res humidity = .TRUE.'
+                CALL message( 'check_parameters', 'PA0322', 1, 2, 0, 6, 0 )
+             ENDIF
+
+             IF ( TRIM( var ) == 'lwp*'   )  unit = 'kg/kg*m'
+             IF ( TRIM( var ) == 'pra*'   )  unit = 'mm'
+             IF ( TRIM( var ) == 'prr*'   )  unit = 'mm/s'
+             IF ( TRIM( var ) == 'qsws*'  )  unit = 'kgm/kgs'
+             IF ( TRIM( var ) == 'shf*'   )  unit = 'K*m/s'
+             IF ( TRIM( var ) == 't*'     )  unit = 'K'
+             IF ( TRIM( var ) == 'u*'     )  unit = 'm/s'
+             IF ( TRIM( var ) == 'z0*'    )  unit = 'm'
+
 
           CASE ( 'p', 'pt', 'u', 'v', 'w' )
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 348)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 354)
@@ -375,4 +375,22 @@
                 IF ( mode == 'xy' )  level_z = zu
 
+             CASE ( 'qsws*_xy' )        ! 2d-array
+                IF ( av == 0 ) THEN
+                   DO  i = nxl-1, nxr+1
+                      DO  j = nys-1, nyn+1 
+                         local_pf(i,j,nzb+1) =  qsws(j,i)
+                      ENDDO
+                   ENDDO
+                ELSE
+                   DO  i = nxl-1, nxr+1
+                      DO  j = nys-1, nyn+1 
+                         local_pf(i,j,nzb+1) =  qsws_av(j,i)
+                      ENDDO
+                   ENDDO
+                ENDIF
+                resorted = .TRUE.
+                two_d = .TRUE.
+                level_z(nzb+1) = zu(nzb+1)
+
              CASE ( 'qv_xy', 'qv_xz', 'qv_yz' )
                 IF ( av == 0 )  THEN
@@ -410,4 +428,22 @@
                    to_be_resorted => sa_av
                 ENDIF
+
+             CASE ( 'shf*_xy' )        ! 2d-array
+                IF ( av == 0 ) THEN
+                   DO  i = nxl-1, nxr+1
+                      DO  j = nys-1, nyn+1 
+                         local_pf(i,j,nzb+1) =  shf(j,i)
+                      ENDDO
+                   ENDDO
+                ELSE
+                   DO  i = nxl-1, nxr+1
+                      DO  j = nys-1, nyn+1 
+                         local_pf(i,j,nzb+1) =  shf_av(j,i)
+                      ENDDO
+                   ENDDO
+                ENDIF
+                resorted = .TRUE.
+                two_d = .TRUE.
+                level_z(nzb+1) = zu(nzb+1)
 
              CASE ( 't*_xy' )        ! 2d-array
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 348)
+++ palm/trunk/SOURCE/modules.f90	(revision 354)
@@ -193,6 +193,6 @@
 !------------------------------------------------------------------------------!
 
-    REAL, DIMENSION(:,:), ALLOCATABLE ::  lwp_av, precipitation_rate_av, &
-                                          ts_av, us_av, z0_av
+    REAL, DIMENSION(:,:), ALLOCATABLE ::  lwp_av, precipitation_rate_av,       &
+                                          qsws_av, shf_av,ts_av, us_av, z0_av
 
     REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET :: &
@@ -312,5 +312,5 @@
     CHARACTER (LEN=7),  DIMENSION(100) ::  do3d_comp_prec = ' '
     CHARACTER (LEN=10), DIMENSION(10)  ::  data_output_format = ' '
-    CHARACTER (LEN=10), DIMENSION(100) ::  data_output = ' ',    &
+    CHARACTER (LEN=11), DIMENSION(100) ::  data_output = ' ',    &
                                            data_output_user = ' ', doav = ' '
     CHARACTER (LEN=10), DIMENSION(300) ::  data_output_pr = ' '
Index: palm/trunk/SOURCE/read_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/read_3d_binary.f90	(revision 348)
+++ palm/trunk/SOURCE/read_3d_binary.f90	(revision 354)
@@ -521,4 +521,12 @@
                                           tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1)
 
+                CASE ( 'qsws_av' )
+                   IF ( .NOT. ALLOCATED( qsws_av ) )  THEN
+                      ALLOCATE( qsws_av(nys-1:nyn+1,nxl-1:nxr+1) )
+                   ENDIF  
+                   IF ( k == 1 )  READ ( 13 )  tmp_2d
+                   qsws_av(nysc-1:nync+1,nxlc-1:nxrc+1) = &
+                                          tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1)
+
                 CASE ( 'qswst' )
                    IF ( k == 1 )  READ ( 13 )  tmp_2d
@@ -610,5 +618,11 @@
                    shf_m(nysc-1:nync+1,nxlc-1:nxrc+1) = &
                                           tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1)
-
+                CASE ( 'shf_av' )
+                   IF ( .NOT. ALLOCATED( shf_av ) )  THEN
+                      ALLOCATE( shf_av(nys-1:nyn+1,nxl-1:nxr+1) )
+                   ENDIF
+                   IF ( k == 1 )  READ ( 13 )  tmp_2d
+                   shf_av(nysc-1:nync+1,nxlc-1:nxrc+1) = &
+                                          tmp_2d(nysf-1:nynf+1,nxlf-1:nxrf+1)
                 CASE ( 'spectrum_x' )
                    IF ( k == 1 )  THEN
Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 348)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 354)
@@ -129,4 +129,10 @@
                 ql_vp_av = 0.0
 
+             CASE ( 'qsws*' )
+                IF ( .NOT. ALLOCATED( qsws_av ) )  THEN
+                   ALLOCATE( qsws_av(nys-1:nyn+1,nxl-1:nxr+1) )
+                ENDIF
+                qsws_av = 0.0
+
              CASE ( 'qv' )
                 IF ( .NOT. ALLOCATED( qv_av ) )  THEN
@@ -152,4 +158,10 @@
                 ENDIF
                 sa_av = 0.0
+
+             CASE ( 'shf*' )
+                IF ( .NOT. ALLOCATED( shf_av ) )  THEN
+                   ALLOCATE( shf_av(nys-1:nyn+1,nxl-1:nxr+1) )
+                ENDIF
+                shf_av = 0.0
 
              CASE ( 't*' )
Index: palm/trunk/SOURCE/write_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/write_3d_binary.f90	(revision 348)
+++ palm/trunk/SOURCE/write_3d_binary.f90	(revision 354)
@@ -139,4 +139,7 @@
           WRITE ( 14 )  'qsws_m              ';  WRITE ( 14 ) qsws_m
        ENDIF
+       IF ( ALLOCATED( qsws_av ) )  THEN
+          WRITE ( 14 )  'qsws_av             ';  WRITE ( 14 )  qsws_av
+       ENDIF
        WRITE ( 14 )  'qswst               ';  WRITE ( 14 ) qswst
        IF ( timestep_scheme(1:5) /= 'runge' )  THEN
@@ -182,4 +185,7 @@
     IF ( timestep_scheme(1:5) /= 'runge' )  THEN
        WRITE ( 14 )  'shf_m               ';  WRITE ( 14 )  shf_m
+    ENDIF
+    IF ( ALLOCATED( shf_av ) )  THEN
+       WRITE ( 14 )  'shf_av              ';  WRITE ( 14 )  shf_av
     ENDIF
     IF ( ALLOCATED( spectrum_x ) )  THEN
