Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 1985)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 1992)
@@ -19,5 +19,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! New checks for top_scalarflux
+! Bugfixes concerning data output of profiles in case of passive_scalar
 ! 
 ! Former revisions:
@@ -1706,5 +1707,5 @@
           message_string = 'boundary condition: bc_sa_t = "' //                &
                            TRIM( bc_sa_t ) // '" is not allowed with ' //      &
-                           'constant_top_salinityflux = .TRUE.'
+                           'top_salinityflux /= 0.0'
           CALL message( 'check_parameters', 'PA0070', 1, 2, 0, 6, 0 )
        ENDIF
@@ -1749,4 +1750,17 @@
        CALL check_bc_scalars( 's', bc_s_b, ibc_s_b, 'PA0073', 'PA0074',        &
                               constant_scalarflux, s_surface_initial_change )
+
+       IF ( top_scalarflux == 9999999.9_wp )  constant_top_scalarflux = .FALSE.
+!
+!--    A fixed scalar concentration at the top implies Dirichlet boundary
+!--    condition for scalar. Hence, in this case specification of a constant 
+!--    scalar flux is forbidden.
+       IF ( ( ibc_s_t == 0 .OR. ibc_s_t == 2 )  .AND.  constant_top_scalarflux &
+               .AND.  top_scalarflux /= 0.0_wp )  THEN
+          message_string = 'boundary condition: bc_s_t = "' //                 &
+                           TRIM( bc_sa_t ) // '" is not allowed with ' //      &
+                           'top_scalarflux /= 0.0'
+          CALL message( 'check_parameters', 'PA0441', 1, 2, 0, 6, 0 )
+       ENDIF
     ENDIF
 !
@@ -2210,11 +2224,11 @@
                 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
              ELSE
-                dopr_index(i) = 41
+                dopr_index(i) = 117
                 dopr_unit(i)  = 'kg/m3'
-                hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 )
+                hom(:,2,117,:) = SPREAD( zu, 2, statistic_regions+1 )
                 IF ( data_output_pr(i)(1:1) == '#' )  THEN
-                   dopr_initial_index(i) = 26
-                   hom(:,2,26,:)         = SPREAD( zu, 2, statistic_regions+1 )
-                   hom(nzb,2,26,:)       = 0.0_wp    ! because zu(nzb) is negative
+                   dopr_initial_index(i) = 117
+                   hom(:,2,117,:)        = SPREAD( zu, 2, statistic_regions+1 )
+                   hom(nzb,2,117,:)      = 0.0_wp    ! because zu(nzb) is negative
                    data_output_pr(i)     = data_output_pr(i)(2:)
                 ENDIF
@@ -2331,7 +2345,7 @@
                 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
              ELSE
-                dopr_index(i) = 48
+                dopr_index(i) = 119
                 dopr_unit(i)  = 'kg/m3 m/s'
-                hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 )
+                hom(:,2,119,:) = SPREAD( zw, 2, statistic_regions+1 )
              ENDIF
 
@@ -2343,7 +2357,7 @@
                 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
              ELSE
-                dopr_index(i) = 49
+                dopr_index(i) = 116
                 dopr_unit(i)  = 'kg/m3 m/s'
-                hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 )
+                hom(:,2,116,:) = SPREAD( zw, 2, statistic_regions+1 )
              ENDIF
 
@@ -2355,7 +2369,7 @@
                 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
              ELSE
-                dopr_index(i) = 50
+                dopr_index(i) = 120
                 dopr_unit(i)  = 'kg/m3 m/s'
-                hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 )
+                hom(:,2,120,:) = SPREAD( zw, 2, statistic_regions+1 )
              ENDIF
 
@@ -3916,4 +3930,6 @@
        ELSEIF ( bc_t == 'neumann' )  THEN
           ibc_t = 1
+       ELSEIF ( bc_t == 'initial_gradient' )  THEN
+          ibc_t = 2
        ELSEIF ( bc_t == 'nested' )  THEN
           ibc_t = 3
