Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 335)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 336)
@@ -78,4 +78,7 @@
 skip_particles_for_tail (init_particles)
 
+Value of vertical_particle_advection may differ for each particle group
+(advec_particles, header, modules) 
+
 First constant in array den also defined as type double. (eqn_state_seawater)
 
@@ -115,4 +118,8 @@
 on. (time_integration)
 
+Bugfix: qsws was calculated in case of constant heatflux = .FALSE. (prandtl_fluxes)
+
+Bugfix: averaging along z is not allowed for 2d quantities (e.g. u* and z0) (data_output_2d)
+
 Typographical errors (netcdf)
 
@@ -122,4 +129,7 @@
 Small bugfix concerning 3d 64bit netcdf output format (header)
 
+Bugfix: dt_fixed removed from the restart file, because otherwise, no change
+from a fixed to a variable timestep would be possible in restart runs.
+(read_var_list, write_var_list)
 
-advec_particles, check_parameters, cpu_log, header, init_3d_model, init_particles, modules, netcdf, time_integration
+advec_particles, check_parameters, cpu_log, data_output_2d, header, init_3d_model, init_particles, modules, netcdf, prandtl_fluxes, read_var_list, time_integration, write_var_list
Index: palm/trunk/SOURCE/advec_particles.f90
===================================================================
--- palm/trunk/SOURCE/advec_particles.f90	(revision 335)
+++ palm/trunk/SOURCE/advec_particles.f90	(revision 336)
@@ -5,4 +5,5 @@
 ! -----------------
 ! Particle attributes are set with new routine set_particle_attributes.
+! Vertical particle advection depends on the particle group.
 ! Output of NetCDF messages with aid of message handling routine.
 ! Output of messages replaced by message handling routine
@@ -898,5 +899,5 @@
 !--       Same procedure for interpolation of the w velocity-component (adopt
 !--       index i from v velocity-component)
-          IF ( vertical_particle_advection )  THEN
+          IF ( vertical_particle_advection(particles(n)%group) )  THEN
              j = particles(n)%y * ddy
              k = particles(n)%z / dz + offset_ocean_nzt_m1
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 335)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 336)
@@ -6,4 +6,5 @@
 ! simulated_time in NetCDF output replaced by time_since_reference_point.
 ! Output of NetCDF messages with aid of message handling routine.
+! Bugfix: averaging along z is not allowed for 2d quantities (e.g. u* and z0)
 ! Output of messages replaced by message handling routine.
 !
@@ -578,5 +579,5 @@
 !
 !--                If required, carry out averaging along z
-                   IF ( section(is,s) == -1 )  THEN
+                   IF ( section(is,s) == -1  .AND.  .NOT. two_d )  THEN
 
                       local_2d = 0.0
Index: palm/trunk/SOURCE/eqn_state_seawater.f90
===================================================================
--- palm/trunk/SOURCE/eqn_state_seawater.f90	(revision 335)
+++ palm/trunk/SOURCE/eqn_state_seawater.f90	(revision 336)
@@ -76,5 +76,7 @@
 !
 !--             Pressure is needed in dbar
-                p1 = hyp(0) * 1E-4
+!                p1 = hyp(0) * 1E-4
+!                p1 = 0.0
+                p1 = hyp(k) * 1E-4
                 p2 = p1 * p1
                 p3 = p2 * p1
@@ -132,5 +134,7 @@
 !
 !--       Pressure is needed in dbar
-          p1 = hyp(0) * 1E-4
+!          p1 = hyp(0) * 1E-4
+!          p1 = 0.0
+          p1 = hyp(k) * 1E-4
           p2 = p1 * p1
           p3 = p2 * p1
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 335)
+++ palm/trunk/SOURCE/header.f90	(revision 336)
@@ -7,5 +7,5 @@
 ! Coupling with independent precursor runs.
 ! Output of messages replaced by message handling routine.
-! Output of cluster_size
+! Output of several additional dvr parameters
 ! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left,
 ! canyon_wall_south, conserve_volume_flow_mode, dp_external, dp_level_b, 
@@ -108,5 +108,5 @@
 
     INTEGER ::  av, bh, blx, bly, bxl, bxr, byn, bys, ch, cwx, cwy, cxl, cxr, &
-                cyn, cys, i, ihost, io, j, l, ll, mpi_type
+                cyn, cys, i, ihost, io, j, l, ll, m, mpi_type
     REAL    ::  cpuseconds_per_simulated_second
 
@@ -1019,4 +1019,5 @@
        i = 1
        l = 0
+       m = 0
        DO WHILE ( mode_dvrp(i) /= ' ' )
           IF ( mode_dvrp(i)(1:10) == 'isosurface' )  THEN
@@ -1024,17 +1025,37 @@
              l = l + 1
              IF ( do3d(0,j) /= ' ' )  THEN
-                WRITE ( io, 361 )  TRIM( do3d(0,j) ), threshold(l)
+                WRITE ( io, 361 )  TRIM( do3d(0,j) ), threshold(l), &
+                                   isosurface_color(:,l)
              ENDIF
           ELSEIF ( mode_dvrp(i)(1:6) == 'slicer' )  THEN
              READ ( mode_dvrp(i), '(6X,I2)' )  j
-             IF ( do2d(0,j) /= ' ' )  WRITE ( io, 362 )  TRIM( do2d(0,j) )
+             m = m + 1
+             IF ( do2d(0,j) /= ' ' )  THEN
+                WRITE ( io, 362 )  TRIM( do2d(0,j) ), &
+                                   slicer_range_limits_dvrp(:,m)
+             ENDIF
           ELSEIF ( mode_dvrp(i)(1:9) == 'particles' )  THEN
-             WRITE ( io, 363 )
+             WRITE ( io, 363 )  dvrp_psize
+             IF ( particle_dvrpsize /= 'none' )  THEN
+                WRITE ( io, 364 )  'size', TRIM( particle_dvrpsize ), &
+                                   dvrpsize_interval
+             ENDIF
+             IF ( particle_color /= 'none' )  THEN
+                WRITE ( io, 364 )  'color', TRIM( particle_color ), &
+                                   color_interval
+             ENDIF
           ENDIF
           i = i + 1
        ENDDO
 
-       IF ( TRIM( topography ) /= 'flat'  .AND.  cluster_size > 1 )  THEN
-          WRITE ( io, 364 )  cluster_size
+       WRITE ( io, 365 )  groundplate_color, superelevation_x, &
+                          superelevation_y, superelevation, clip_dvrp_l, &
+                          clip_dvrp_r, clip_dvrp_s, clip_dvrp_n
+
+       IF ( TRIM( topography ) /= 'flat' )  THEN
+          WRITE ( io, 366 )  topography_color
+          IF ( cluster_size > 1 )  THEN
+             WRITE ( io, 367 )  cluster_size
+          ENDIF
        ENDIF
 
@@ -1301,5 +1322,4 @@
        IF ( particles_per_point > 1 )  WRITE ( io, 489 )  particles_per_point
        WRITE ( io, 495 )  total_number_of_particles
-       IF ( .NOT. vertical_particle_advection )  WRITE ( io, 482 )
        IF ( maximum_number_of_tailpoints /= 0 )  THEN
           WRITE ( io, 483 )  maximum_number_of_tailpoints
@@ -1343,4 +1363,5 @@
           WRITE ( io, 493 )  psl(i), psr(i), pss(i), psn(i), psb(i), pst(i), &
                              pdx(i), pdy(i), pdz(i)
+          IF ( .NOT. vertical_particle_advection(i) )  WRITE ( io, 482 )
        ENDDO
 
@@ -1602,8 +1623,19 @@
             '       Directory:        ',A// &
             '       The sequence contains:')
-361 FORMAT ('       Isosurface of ',A,'  Threshold value: ', E12.3)
-362 FORMAT ('       Sectional plane ',A)
-363 FORMAT ('       Particles')
-364 FORMAT (/'       Polygon reduction for topography: cluster_size = ', I1)
+361 FORMAT ('       Isosurface of ',A,'  Threshold value: ', E12.3/ &
+            '       Isosurface color: (',F4.2,',',F4,2,',',F4.2,') (R,G,B)')
+362 FORMAT ('       Slicer plane ',A/ &
+            '       Slicer limits: [',F6.2,',',F6.2,']')
+363 FORMAT ('       Particles'/ &
+            '          particle size:  ',F7.2,' m')
+364 FORMAT ('          particle ',A,' controlled by "',A,'" with interval [', &
+                       F6.2,',',F6.2,']')
+365 FORMAT (/'       Groundplate color: (',F4.2,',',F4,2,',',F4.2,') (R,G,B)'/ &
+            '       Superelevation along (x,y,z): (',F4.1,',',F4.1,',',F4.1, &
+                     ')'/ &
+            '       Clipping limits: from x = ',F9.1,' m to x = ',F9.1,' m'/ &
+            '                        from y = ',F9.1,' m to y = ',F9.1,' m')
+366 FORMAT (/'       Topography color: (',F4.2,',',F4,2,',',F4.2,') (R,G,B)')
+367 FORMAT ('       Polygon reduction for topography: cluster_size = ', I1)
 #endif
 #if defined( __spectra )
@@ -1715,5 +1747,5 @@
             '       Particles are sorted every ',F9.1,' s'/)
 481 FORMAT ('       Particles have random start positions'/)
-482 FORMAT ('       Particles are advected only horizontally'/)
+482 FORMAT ('          Particles are advected only horizontally'/)
 483 FORMAT ('       Particles have tails with a maximum of ',I3,' points')
 484 FORMAT ('            Number of tails of the total domain: ',I10/ &
Index: palm/trunk/SOURCE/init_ocean.f90
===================================================================
--- palm/trunk/SOURCE/init_ocean.f90	(revision 335)
+++ palm/trunk/SOURCE/init_ocean.f90	(revision 336)
@@ -24,4 +24,5 @@
     USE control_parameters
     USE eqn_state_seawater_mod
+    USE pegrid
     USE grid_variables
     USE indices
@@ -29,7 +30,9 @@
     IMPLICIT NONE
 
-    INTEGER ::  k
+    INTEGER ::  k, n
 
     REAL    ::  sa_l, pt_l, rho_l
+
+    REAL, DIMENSION(nzb:nzt+1) ::  rho_init
 
     ALLOCATE( hyp(nzb:nzt+1) )
@@ -45,19 +48,49 @@
 
     hyp(nzt)      = hyp(nzt+1) + rho_surface * g * 0.5 * dzu(nzt+1)
-    rho_reference = rho_surface * 0.5 * dzu(nzt+1)
+    rho_init(nzt) = rho_surface
 
     DO  k = nzt-1, 0, -1
+       hyp(k) = hyp(k+1) + rho_surface * g * dzu(k)
+    ENDDO
 
-       sa_l = 0.5 * ( sa_init(k) + sa_init(k+1) )
-       pt_l = 0.5 * ( pt_init(k) + pt_init(k+1) )
+    IF ( myid == 0 )  THEN
+       print*,'hydro pres using rho_surface'
+       DO  k = nzt+1, 0, -1
+          print*, 'k = ', k, ' hyp = ', hyp(k)
+       ENDDO
+       print*, ' '
+    ENDIF
 
-       rho_l = eqn_state_seawater_func( hyp(k+1), pt_l, sa_l )
+    DO  n = 1, 5
 
-       hyp(k)        = hyp(k+1) + rho_l * g * dzu(k+1)
-       rho_reference = rho_reference + rho_l * dzu(k+1)
+       rho_reference = rho_surface * 0.5 * dzu(nzt+1)
+
+       DO  k = nzt-1, 0, -1
+
+          sa_l = 0.5 * ( sa_init(k) + sa_init(k+1) )
+          pt_l = 0.5 * ( pt_init(k) + pt_init(k+1) )
+
+          rho_init(k) = eqn_state_seawater_func( hyp(k), pt_l, sa_l )
+
+          rho_reference = rho_reference + rho_init(k) * dzu(k+1)
+
+       ENDDO
+
+       rho_reference = rho_reference / ( zw(nzt) - zu(nzb) )
+
+       DO  k = nzt-1, 0, -1
+          hyp(k) = hyp(k+1) + g * 0.5 * ( rho_init(k) + rho_init(k+1 ) ) * &
+                              dzu(k+1)
+       ENDDO
+
+       IF ( myid == 0 )  THEN
+          print*,'hydro pres / rho  n = ', n
+          DO  k = nzt+1, 0, -1
+             print*, 'k = ', k, ' hyp = ', hyp(k), ' rho = ', rho_init(k)
+          ENDDO
+          print*, ' '
+       ENDIF
 
     ENDDO
-
-    rho_reference = rho_reference / ( zw(nzt) - zu(nzb) )
 
 !
@@ -70,5 +103,5 @@
 
        prho_reference = prho_reference + dzu(k+1) * &
-                        eqn_state_seawater_func( hyp(0), pt_l, sa_l )
+                        eqn_state_seawater_func( 0.0, pt_l, sa_l )
 
     ENDDO
Index: palm/trunk/SOURCE/init_particles.f90
===================================================================
--- palm/trunk/SOURCE/init_particles.f90	(revision 335)
+++ palm/trunk/SOURCE/init_particles.f90	(revision 336)
@@ -54,4 +54,5 @@
     USE arrays_3d
     USE control_parameters
+    USE dvrp_variables
     USE grid_variables
     USE indices
@@ -441,4 +442,11 @@
 
 !
+!--    Particles will probably become none-uniform, if their size and color
+!--    will be determined by flow variables
+       IF ( particle_color /= 'none'  .OR.  particle_dvrpsize /= 'none' )  THEN
+          uniform_particles = .FALSE.
+       ENDIF
+
+!
 !--    Set the beginning of the particle tails and their age
        IF ( use_particle_tails )  THEN
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 335)
+++ palm/trunk/SOURCE/modules.f90	(revision 336)
@@ -10,4 +10,5 @@
 ! interval_*_dvrp_prt, isosurface_color, particle_color, particle_dvrpsize,
 ! topography color in dvrp_variables,
+! vertical_particle_advection is a 1d-array,
 ! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left, 
 ! canyon_wall_south, conserve_volume_flow_mode, coupling_start_time,
@@ -971,6 +972,9 @@
                 uniform_particles = .TRUE., use_particle_tails = .FALSE.,      &
                 use_sgs_for_particles = .FALSE.,                               &
-                vertical_particle_advection = .TRUE.,                          &
                 write_particle_statistics = .FALSE.
+
+    LOGICAL, DIMENSION(max_number_of_particle_groups) ::                       &
+                vertical_particle_advection = .TRUE.
+
     LOGICAL, DIMENSION(:), ALLOCATABLE ::  particle_mask, tail_mask
 
Index: palm/trunk/SOURCE/package_parin.f90
===================================================================
--- palm/trunk/SOURCE/package_parin.f90	(revision 335)
+++ palm/trunk/SOURCE/package_parin.f90	(revision 336)
@@ -52,5 +52,5 @@
                                   dt_dvrp, dvrpsize_interval, dvrp_directory,  &
                                   dvrp_file, dvrp_host, dvrp_output,           &
-                                  dvrp_password, dvrp_username,                &
+                                  dvrp_password, dvrp_psize, dvrp_username,    &
                                   groundplate_color, isosurface_color,         &
                                   mode_dvrp, particle_color, particle_dvrpsize,&
@@ -67,5 +67,5 @@
                                   density_ratio, radius, dt_dopts,             &
                                   dt_min_part, dt_prel, dt_sort_particles,     &
-                                  dt_write_particle_data, dvrp_psize,          &
+                                  dt_write_particle_data,                      &
                                   end_time_prel, initial_weighting_factor,     &
                                   maximum_number_of_particles,                 &
Index: palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- palm/trunk/SOURCE/read_var_list.f90	(revision 335)
+++ palm/trunk/SOURCE/read_var_list.f90	(revision 336)
@@ -4,4 +4,5 @@
 ! Current revisions:
 ! -----------------
+! dt_fixed is read into a dummy variable.
 ! Output of messages replaced by message handling routine.
 ! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left, 
@@ -77,4 +78,6 @@
     CHARACTER (LEN=10) ::  binary_version, version_on_file
     CHARACTER (LEN=30) ::  variable_chr
+
+    LOGICAL ::  ldum
 
 
@@ -266,5 +269,9 @@
              READ ( 13 )  drag_coefficient
           CASE ( 'dt_fixed' )
-             READ ( 13 )  dt_fixed
+             READ ( 13 )  ldum   ! restart files created before rev 333
+                                 ! contained dt_fixed by mistake; it is still
+                                 ! read here in order to allow usage of these
+                                 ! older restart files; can be removed in a
+                                 ! later version
           CASE ( 'dt_pr_1d' )
              READ ( 13 )  dt_pr_1d
Index: palm/trunk/SOURCE/write_var_list.f90
===================================================================
--- palm/trunk/SOURCE/write_var_list.f90	(revision 335)
+++ palm/trunk/SOURCE/write_var_list.f90	(revision 336)
@@ -4,4 +4,6 @@
 ! Actual revisions:
 ! -----------------
+! bugfix: -dt_fixed, because otherwise, restart runs cannot change from a
+! fixed to a free timestep.
 ! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left, 
 ! canyon_wall_south, conserve_volume_flow_mode, coupling_start_time,
@@ -194,6 +196,4 @@
     WRITE ( 14 )  'drag_coefficient              '
     WRITE ( 14 )  drag_coefficient
-    WRITE ( 14 )  'dt_fixed                      '
-    WRITE ( 14 )  dt_fixed
     WRITE ( 14 )  'dt_pr_1d                      '
     WRITE ( 14 )  dt_pr_1d
