Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 1298)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 1299)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! enable usage of large_scale subsidence in combination with large_scale_forcing
+! output for profile of large scale vertical velocity w_subs added
 !
 ! Former revisions:
@@ -1354,8 +1355,28 @@
 !
 !-- Initialize large scale subsidence if required
-    IF ( subs_vertical_gradient_level(1) /= -9999999.9 )  THEN
-       large_scale_subsidence = .TRUE.
-       CALL init_w_subsidence
-    ENDIF
+    If ( large_scale_subsidence )  THEN
+       IF ( subs_vertical_gradient_level(1) /= -9999999.9 .AND. &
+                                     .NOT. large_scale_forcing )  THEN
+          CALL init_w_subsidence
+       ENDIF
+!
+!--    In case large_scale_forcing is used, profiles for subsidence velocity
+!--    are read in from file LSF_DATA
+
+       IF ( subs_vertical_gradient_level(1) == -9999999.9 .AND. &
+                                     .NOT. large_scale_forcing )  THEN
+          message_string = 'There is no default large scale vertical ' // &
+                           'velocity profile set. Specify the subsidence ' // &
+                           'velocity profile via subs_vertical_gradient and ' // &
+                           'subs_vertical_gradient_level.'
+          CALL message( 'check_parameters', 'PA0380', 1, 2, 0, 6, 0 )
+       ENDIF
+    ELSE
+        IF ( subs_vertical_gradient_level(1) /= -9999999.9 )  THEN
+           message_string = 'Enable usage of large scale subsidence by ' // &
+                            'setting large_scale_subsidence = .T..'
+          CALL message( 'check_parameters', 'PA0381', 1, 2, 0, 6, 0 )
+        ENDIF
+    ENDIF    
 
 !
@@ -2723,4 +2744,16 @@
              hom(:,2,79,:) = SPREAD( zu, 2, statistic_regions+1 )
 
+          CASE ( 'w_subs' )
+             IF ( .NOT. large_scale_subsidence )  THEN
+                message_string = 'data_output_pr = ' // &
+                                 TRIM( data_output_pr(i) ) // ' is not imp' // &
+                                 'lemented for large_scale_subsidence = .FALSE.'
+                CALL message( 'check_parameters', 'PA0382', 1, 2, 0, 6, 0 )
+             ELSE
+                dopr_index(i) = 80
+                dopr_unit(i)  = 'm/s'
+                hom(:,2,80,:) = SPREAD( zu, 2, statistic_regions+1 )
+             ENDIF
+
           CASE DEFAULT
 
Index: palm/trunk/SOURCE/flow_statistics.f90
===================================================================
--- palm/trunk/SOURCE/flow_statistics.f90	(revision 1298)
+++ palm/trunk/SOURCE/flow_statistics.f90	(revision 1299)
@@ -21,5 +21,5 @@
 ! Current revisions:
 ! -----------------
-!
+! Output of large scale vertical velocity w_subs
 !
 ! Former revisions:
@@ -1164,4 +1164,5 @@
        hom(:,1,78,sr) = ug             ! ug
        hom(:,1,79,sr) = vg             ! vg
+       hom(:,1,80,sr) = w_subs         ! w_subs
 
        hom(:,1,pr_palm-1,sr) = sums(:,pr_palm-1)
@@ -2784,4 +2785,5 @@
        hom(:,1,78,sr) = ug             ! ug
        hom(:,1,79,sr) = vg             ! vg
+       hom(:,1,80,sr) = w_subs         ! w_subs
 
        hom(:,1,pr_palm-1,sr) = sums(:,pr_palm-1)
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 1298)
+++ palm/trunk/SOURCE/header.f90	(revision 1299)
@@ -20,5 +20,7 @@
 ! Current revisions:
 ! -----------------
-! 
+! output for using large_scale subsidence in combination 
+! with large_scale_forcing
+! reformatting, more detailed explanations
 !
 ! Former revisions:
@@ -368,5 +370,5 @@
     IF ( momentum_advec == 'pw-scheme' )  THEN
        WRITE ( io, 113 )
-    ELSEIF (momentum_advec == 'ws-scheme' ) THEN
+    ELSEIF (momentum_advec == 'ws-scheme' )  THEN
        WRITE ( io, 503 )
     ENDIF
@@ -578,8 +580,8 @@
     ENDIF
 
-    IF ( plant_canopy ) THEN
+    IF ( plant_canopy )  THEN
 
        WRITE ( io, 280 ) canopy_mode, pch_index, drag_coefficient
-       IF ( passive_scalar ) THEN
+       IF ( passive_scalar )  THEN
           WRITE ( io, 281 ) scalar_exchange_coefficient,   &
                             leaf_surface_concentration
@@ -717,5 +719,5 @@
        WRITE ( io, 303 )
        IF ( constant_heatflux )  THEN
-          IF ( large_scale_forcing .AND. lsf_surf ) THEN
+          IF ( large_scale_forcing .AND. lsf_surf )  THEN
              WRITE ( io, 306 )  shf(0,0)
           ELSE
@@ -725,5 +727,5 @@
        ENDIF
        IF ( humidity  .AND.  constant_waterflux )  THEN
-          IF ( large_scale_forcing .AND. lsf_surf ) THEN
+          IF ( large_scale_forcing .AND. lsf_surf )  THEN
              WRITE ( io, 311 ) qsws(0,0)
           ELSE
@@ -1227,5 +1229,5 @@
 !
 !-- Spectra output
-    IF ( dt_dosp /= 9999999.9 ) THEN
+    IF ( dt_dosp /= 9999999.9 )  THEN
        WRITE ( io, 370 )
 
@@ -1269,5 +1271,5 @@
 !
 !-- Cloud physics parameters
-    IF ( cloud_physics ) THEN
+    IF ( cloud_physics )  THEN
        WRITE ( io, 415 )
        WRITE ( io, 416 ) surface_pressure, r_d, rho_surface, cp, l_v
@@ -1307,5 +1309,5 @@
     ENDDO
 
-    IF ( .NOT. large_scale_forcing ) THEN
+    IF ( .NOT. large_scale_forcing )  THEN
        WRITE ( io, 423 )  TRIM( coordinates ), TRIM( ugcomponent ), &
                           TRIM( gradients ), TRIM( slices )
@@ -1343,5 +1345,5 @@
     ENDDO
 
-    IF ( .NOT. large_scale_forcing ) THEN
+    IF ( .NOT. large_scale_forcing )  THEN
        WRITE ( io, 424 )  TRIM( coordinates ), TRIM( vgcomponent ), &
                           TRIM( gradients ), TRIM( slices )
@@ -1382,5 +1384,5 @@
     ENDDO
 
-    IF ( .NOT. nudging ) THEN
+    IF ( .NOT. nudging )  THEN
        WRITE ( io, 420 )  TRIM( coordinates ), TRIM( temperatures ), &
                           TRIM( gradients ), TRIM( slices )
@@ -1421,5 +1423,5 @@
 
        IF ( humidity )  THEN
-          IF ( .NOT. nudging ) THEN
+          IF ( .NOT. nudging )  THEN
              WRITE ( io, 421 )  TRIM( coordinates ), TRIM( temperatures ), &
                                 TRIM( gradients ), TRIM( slices )
@@ -1498,6 +1500,13 @@
        ENDDO
 
-       WRITE ( io, 426 )  TRIM( coordinates ), TRIM( temperatures ), &
-                          TRIM( gradients ), TRIM( slices )
+ 
+       IF ( .NOT. large_scale_forcing )  THEN
+          WRITE ( io, 426 )  TRIM( coordinates ), TRIM( temperatures ), &
+                             TRIM( gradients ), TRIM( slices )
+        ELSE
+           WRITE ( io, 460 ) 
+       ENDIF
+
+
     ENDIF
 
@@ -1734,6 +1743,6 @@
            /'     starting from dp_level_b =', F8.3, 'm', A /)
 153 FORMAT (' --> Large-scale vertical motion is used in the ', &
-                  'prognostic equation for')
-154 FORMAT ('     the potential temperature')
+                  'prognostic equation(s) for')
+154 FORMAT ('     the scalar(s) only')
 155 FORMAT (' --> Nudging is used - initial profiles for u, v, pt and q ',& 
                   'correspond to the')
@@ -1996,5 +2005,5 @@
              '    NUDGING_DATA')
 429 FORMAT (/'    Geostrophic wind profiles (ug, vg) are are taken from file '/ &
-             '    LSF_DATA_DATA')
+             '    LSF_DATA')
 430 FORMAT (//' Cloud physics quantities / methods:'/ &
               ' ----------------------------------'/)
@@ -2023,4 +2032,6 @@
 454 FORMAT ('    TKE is not allowed to fall below ',E9.2,' (m/s)**2')
 455 FORMAT ('    initial TKE is prescribed as ',E9.2,' (m/s)**2')
+460 FORMAT (/'    Profiles for large scale vertical velocity are '/ &
+             '    taken from file LSF_DATA')
 470 FORMAT (//' Actions during the simulation:'/ &
               ' -----------------------------'/)
Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 1298)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 1299)
@@ -23,5 +23,6 @@
 ! Current revisions:
 ! ------------------
-!
+! Allocate w_subs due to extension of large scale subsidence in combination
+! with large scale forcing data (LSF_DATA)
 !
 ! Former revisions:
@@ -542,4 +543,11 @@
 
 !
+!-- 1D-array for large scale subsidence velocity
+    IF ( large_scale_subsidence )  THEN
+       ALLOCATE ( w_subs(nzb:nzt+1) )
+       w_subs = 0.0
+    ENDIF
+
+!
 !-- 3D-arrays for the leaf area density and the canopy drag coefficient
     IF ( plant_canopy ) THEN
Index: palm/trunk/SOURCE/ls_forcing.f90
===================================================================
--- palm/trunk/SOURCE/ls_forcing.f90	(revision 1298)
+++ palm/trunk/SOURCE/ls_forcing.f90	(revision 1299)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! Ensure a zero large scale vertical velocity at the surface
+! Bugfix: typo in case of boundary condition in if-clause
 !
 ! Former revisions:
@@ -39,5 +40,5 @@
 ! ------------
 ! Calculates large scale forcings (geostrophic wind and subsidence velocity) as 
-! well as surfaces fluxes dependend on time given in an external file (LSF_DATA).
+! well as surfaces fluxes dependent on time given in an external file (LSF_DATA).
 ! Code is based in parts on DALES and UCLA-LES.
 !--------------------------------------------------------------------------------!
@@ -110,5 +111,5 @@
 
           IF ( ierrn < 0 )  THEN
-            WRITE ( message_string, * ) 'No time dependend surface variables ',&
+            WRITE ( message_string, * ) 'No time dependent surface variables ',&
                               'in&LSF_DATA for end of run found'
 
@@ -119,5 +120,5 @@
 
        IF ( time_surf(1) > end_time )  THEN
-          WRITE ( message_string, * ) 'No time dependend surface variables in ',&
+          WRITE ( message_string, * ) 'No time dependent surface variables in ',&
                                      '&LSF_DATA for end of run found - ',  &
                                      'lsf_surf is set to FALSE'
@@ -146,5 +147,5 @@
              READ ( finput, *, IOSTAT=ierrn ) hash, time_vert(t)
              IF ( ierrn < 0 )  THEN 
-                WRITE( message_string, * ) 'No time dependend vertical profiles',&
+                WRITE( message_string, * ) 'No time dependent vertical profiles',&
                                  ' in&LSF_DATA for end of run found'
                 CALL message( 'ls_forcing', 'PA0372', 1, 2, 0, 6, 0 )
@@ -158,5 +159,5 @@
           IF ( ierrn /= 0 )  THEN
              message_string = 'errors in file LSF_DATA'
-             CALL message( 'nudging', 'PA0369', 1, 2, 0, 6, 0 )
+             CALL message( 'ls_forcing', 'PA0369', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -166,5 +167,5 @@
           IF ( ierrn /= 0 )  THEN
              message_string = 'errors in file LSF_DATA'
-             CALL message( 'nudging', 'PA0369', 1, 2, 0, 6, 0 )
+             CALL message( 'ls_forcing', 'PA0369', 1, 2, 0, 6, 0 )
           ENDIF
 
@@ -183,5 +184,5 @@
                 IF ( ierrn /= 0 )  THEN
                    message_string = 'errors in file LSF_DATA'
-                   CALL message( 'nudging', 'PA0369', 1, 2, 0, 6, 0 )
+                   CALL message( 'ls_forcing', 'PA0369', 1, 2, 0, 6, 0 )
                 ENDIF
 
@@ -200,4 +201,8 @@
        ENDDO 
 
+!
+!--    Large scale vertical velocity has to be zero at the surface
+       wsubs_vert(nzb,:) = 0.0
+ 
        IF ( time_vert(1) > end_time )  THEN
           WRITE ( message_string, * ) 'Time dependent large scale profile ',&
@@ -262,5 +267,5 @@
           q_surface = q_surf(t) + fac * ( q_surf(t+1) - q_surf(t) )
 
-       ELSEIF ( ibc_pt_b == 1 )  THEN
+       ELSEIF ( ibc_q_b == 1 )  THEN
 
           qsws = qsws_surf(t) + fac * ( qsws_surf(t+1) - qsws_surf(t) )
