Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 997)
+++ palm/trunk/SOURCE/Makefile	(revision 1001)
@@ -4,5 +4,5 @@
 # Current revisions:
 # ------------------
-#
+# -asselin_filter, advec_s|u|v|w_ups, spline_x|y|z
 #
 # Former revisions:
@@ -86,10 +86,8 @@
 PROG =  palm
 
-RCS =   advec_s_bc.f90 advec_s_pw.f90 advec_s_up.f90 \
-	advec_ws.f90 advec_s_ups.f90 advec_u_pw.f90 advec_u_up.f90 \
-	advec_u_ups.f90 advec_v_pw.f90 advec_v_up.f90 advec_v_ups.f90 \
-	advec_w_pw.f90 advec_w_up.f90 advec_w_ups.f90 asselin_filter.f90 \
-	average_3d_data.f90 boundary_conds.f90 buoyancy.f90 \
-	calc_liquid_water_content.f90 calc_precipitation.f90 \
+RCS =   advec_s_bc.f90 advec_s_pw.f90 advec_s_up.f90 advec_ws.f90 \
+	advec_u_pw.f90 advec_u_up.f90 advec_v_pw.f90 advec_v_up.f90 \
+	advec_w_pw.f90 advec_w_up.f90 average_3d_data.f90 boundary_conds.f90 \
+	buoyancy.f90 calc_liquid_water_content.f90 calc_precipitation.f90 \
 	calc_radiation.f90 calc_spectra.f90 check_for_restart.f90 \
 	check_open.f90 check_parameters.f90 close_file.f90 compute_vpt.f90 \
@@ -123,6 +121,6 @@
 	production_e.f90 prognostic_equations.f90 random_function.f90 \
 	random_gauss.f90 read_3d_binary.f90 read_var_list.f90 run_control.f90 \
-	set_slicer_attributes_dvrp.f90 singleton.f90 sor.f90 spline_x.f90 \
-	spline_y.f90 spline_z.f90 subsidence.f90 sum_up_3d_data.f90 \
+	set_slicer_attributes_dvrp.f90 singleton.f90 sor.f90 \
+	subsidence.f90 sum_up_3d_data.f90 \
 	surface_coupler.f90 swap_timelevel.f90 temperton_fft.f90 \
 	time_integration.f90 time_to_string.f90 timestep.f90 \
@@ -141,7 +139,6 @@
 	write_3d_binary.f90 write_compressed.f90 write_var_list.f90
 
-OBJS =  advec_s_bc.o advec_s_pw.o advec_s_up.o advec_s_ups.o advec_u_pw.o \
-	advec_u_up.o advec_u_ups.o advec_ws.o advec_v_pw.o advec_v_up.o \
-	advec_v_ups.o advec_w_pw.o advec_w_up.o advec_w_ups.o asselin_filter.o \
+OBJS =  advec_s_bc.o advec_s_pw.o advec_s_up.o advec_u_pw.o advec_u_up.o \
+	advec_ws.o advec_v_pw.o advec_v_up.o advec_w_pw.o advec_w_up.o \
 	average_3d_data.o boundary_conds.o buoyancy.o \
 	calc_liquid_water_content.o calc_precipitation.o calc_radiation.o \
@@ -173,6 +170,6 @@
 	production_e.o prognostic_equations.o random_function.o random_gauss.o \
 	read_3d_binary.o read_var_list.o run_control.o \
-	set_slicer_attributes_dvrp.o singleton.o sor.o spline_x.o spline_y.o \
-	spline_z.o subsidence.o sum_up_3d_data.o surface_coupler.o \
+	set_slicer_attributes_dvrp.o singleton.o sor.o \
+	subsidence.o sum_up_3d_data.o surface_coupler.o \
 	swap_timelevel.o temperton_fft.o time_integration.o time_to_string.o \
 	timestep.o timestep_scheme_steering.o transpose.o \
@@ -219,16 +216,11 @@
 advec_s_pw.o: modules.o
 advec_s_up.o: modules.o
-advec_s_ups.o: modules.o
 advec_u_pw.o: modules.o
 advec_u_up.o: modules.o
-advec_u_ups.o: modules.o
 advec_v_pw.o: modules.o
 advec_v_up.o: modules.o
-advec_v_ups.o: modules.o
 advec_ws.o: modules.o
 advec_w_pw.o: modules.o
 advec_w_up.o: modules.o
-advec_w_ups.o: modules.o
-asselin_filter.o: modules.o
 average_3d_data.o: modules.o
 boundary_conds.o: modules.o
@@ -340,7 +332,4 @@
 singleton.o: singleton.f90
 sor.o: modules.o
-spline_x.o: modules.o
-spline_y.o: modules.o
-spline_z.o: modules.o
 subsidence.o: modules.o
 sum_up_3d_data.o: modules.o
Index: palm/trunk/SOURCE/advec_s_ups.f90
===================================================================
--- palm/trunk/SOURCE/advec_s_ups.f90	(revision 997)
+++ 	(revision )
@@ -1,192 +1,0 @@
- SUBROUTINE advec_s_ups( s, var_char )
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-!
-! 164 2008-05-15 08:46:15Z raasch
-! Arguments removed from transpose routines
-!
-! February 2007
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.6  2004/04/30 08:02:43  raasch
-! Enlarged transposition arrays introduced
-!
-! Revision 1.1  1999/02/05 08:44:47  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Upstream-Spline advection of scalar quantities (potential temperature,
-! turbulent kinetic energy). The advection process is divided into three 
-! subsequent steps, one for each of the dimensions. The result is stored as a 
-! tendency in array tend. The computation of the cubic splines and the possible
-! execution of the Long-filter require that all grid points of the relevant 
-! dimension are available. For model runs on more than one PE therefore both the
-! advected and the advecting quantities are transposed accordingly.
-!
-! Actual arguments:
-! s        = scalar quantity to be advected (remains unchanged in this UP)
-! var_char = character string specifying the quantity to be advected
-!
-! Internally used arrays:
-! v_ad     = scalar quantity to be advected, initialized = s at the beginning,
-!            also being used as temporary storage after each time step
-! d        = advecting component (u, v, or w)
-!------------------------------------------------------------------------------!
-
-    USE advection
-    USE arrays_3d
-    USE cpulog
-    USE grid_variables
-    USE indices
-    USE interfaces
-    USE control_parameters
-
-    IMPLICIT NONE
-
-    CHARACTER (LEN=*) ::  var_char
-
-    INTEGER ::  i, j, k
-    REAL    ::  s(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
-    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  v_ad
-
-    CALL cpu_log( log_point_s(16), 'advec_s_ups', 'start' )
-
-#if defined( __parallel )
-
-!
-!-- Advection of the scalar in x-direction:
-!-- Store the scalar in temporary array v_ad (component to be advected,
-!-- boundaries are not used because they disturb the transposition)
-    ALLOCATE( v_ad(nzb+1:nzta,nys:nyna,nxl:nxra) )
-    v_ad = 0.0
-    v_ad(nzb+1:nzt,nys:nyn,nxl:nxr) = s(nzb+1:nzt,nys:nyn,nxl:nxr)
-
-!
-!-- Enlarge the size of tend, used as a working array for the transpositions
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(1:nza,nys:nyna,nxl:nxra) )
-    ENDIF
-
-!
-!-- Transpose the component to be advected: z --> x
-    CALL transpose_zx( v_ad, tend, v_ad )
-
-#else
-
-!
-!-- Advection of the scalar in x-direction:
-!-- Store the scalar in temporary array v_ad (component to be advected)
-    ALLOCATE( v_ad(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    v_ad(:,:,:) = s(:,:,:)
-
-#endif
-
-!
-!-- Advecting component (u) must be averaged out on the scalar's grid
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-              d(k,j,i) = 0.5 * ( u(k,j,i) + u(k,j,i+1) ) - u_gtrans
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-
-!
-!-- Transpose the advecting componnet: z --> x
-    CALL transpose_zx( d, tend, d )
-
-#endif
-
-!
-!-- Upstream-Spline advection of the scalar in x-direction
-    CALL spline_x( v_ad, d, var_char )
-
-!
-!-- Advection of the scalar in y-direction:
-!-- advecting component (v) must be averaged out on the scalar's grid
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-              d(k,j,i) = 0.5 * ( v(k,j,i) + v(k,j+1,i) ) - v_gtrans
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-    
-!
-!-- Transpose the advecting component: z --> y
-    CALL transpose_zx( d, tend, d )
-    CALL transpose_xy( d, tend, d )
-
-!
-!-- Transpose the component to be advected: x --> y
-    CALL transpose_xy( v_ad, tend, v_ad )
-
-#endif
-
-!
-!-- Upstream-Spline advection of the scalar in y-direction
-    CALL spline_y( v_ad, d, var_char )
-
-!
-!-- Advection of the scalar in z-direction:
-!-- the advecting component (w) must be averaged out on the scalar's grid
-!-- (weighted for non-equidistant grid)
-    d = 0.0
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             d(k,j,i) =  ( w(k,j,i) * ( zu(k) - zw(k-1) ) + &
-                           w(k-1,j,i) * ( zw(k) - zu(k) ) ) * ddzw(k)
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-
-!
-!-- Transpose the component to be advected: y --> z (= y --> x + x --> z)
-    CALL transpose_yx( v_ad, tend, v_ad )
-    CALL transpose_xz( v_ad, tend, v_ad )
-
-!
-!-- Resize tend to its normal size
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    ENDIF
-
-#endif
-
-!
-!-- Upstream-Spline advection of the scalar in z-direction
-    CALL spline_z( v_ad, d, dzu, spl_tri_zu, var_char )
-
-!
-!-- Compute the tendency term
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             tend(k,j,i) = ( v_ad(k,j,i) - s(k,j,i) ) / dt_3d 
-          ENDDO
-       ENDDO
-    ENDDO
-
-    DEALLOCATE( v_ad )
-
-    CALL cpu_log( log_point_s(16), 'advec_s_ups', 'stop' )
-
- END SUBROUTINE advec_s_ups
Index: palm/trunk/SOURCE/advec_u_ups.f90
===================================================================
--- palm/trunk/SOURCE/advec_u_ups.f90	(revision 997)
+++ 	(revision )
@@ -1,185 +1,0 @@
- SUBROUTINE advec_u_ups 
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-!
-! 164 2008-05-15 08:46:15Z raasch
-! Arguments removed from transpose routines
-!
-! February 2007
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.6  2004/04/30 08:03:19  raasch
-! Enlarged transposition arrays introduced
-!
-! Revision 1.1  1999/02/05 08:49:08  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Upstream-Spline advection of the u velocity-component. The advection process
-! is divided into three subsequent steps, one for each of the dimensions. The
-! results is stored as a tendency in array tend. The computation of the cubic
-! splines and the possible execution of the Long-filter require that all grid
-! points of the relevant dimension are available. For model runs on more than
-! one PE therefore both the advected and the advecting quantities are
-! transposed accordingly.
-!
-! Internally used arrays:
-! v_ad = scalar quantity to be advected, initialised = u at the beginning,
-!        also being used as temporary storage after each time step
-! d    = advecting component (u, v, or w)
-!------------------------------------------------------------------------------!
-
-    USE advection
-    USE arrays_3d
-    USE cpulog
-    USE grid_variables
-    USE indices
-    USE interfaces
-    USE control_parameters
-
-    IMPLICIT NONE
-
-    INTEGER :: i, j, k
-    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  v_ad
-
-    
-    CALL cpu_log( log_point_s(17), 'advec_u_ups', 'start' )
-
-#if defined( __parallel )
-
-!
-!-- Advection of u in x-direction:
-!-- Store u in temporary array v_ad (component to be advected, boundaries
-!-- are not used because they disturb the transposition)
-    ALLOCATE( v_ad(nzb+1:nzta,nys:nyna,nxl:nxra) )
-    v_ad = 0.0
-    v_ad(nzb+1:nzt,nys:nyn,nxl:nxr) = u(nzb+1:nzt,nys:nyn,nxl:nxr)
-
-!
-!-- Enlarge the size of tend, used as a working array for the transpositions
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(1:nza,nys:nyna,nxl:nxra) )
-    ENDIF
-
-!
-!-- Transpose the component to be advected: z --> x
-    CALL transpose_zx( v_ad, tend, v_ad )
-
-!
-!-- Advecting component (d) = component to be advected (v_ad) (variable d is
-!-- used for storage, because it is the only one having suitable dimensions).
-!-- NOTE: here x is the first dimension and lies completely on the PE.
-    d = v_ad - u_gtrans
-
-#else
-
-!
-!-- Advection of u in x-direction:
-!-- Store u in temporary array v_ad (component to be advected)
-    ALLOCATE( v_ad(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    v_ad(:,:,:) = u(:,:,:)
-
-!
-!-- Advecting component (d) = component to be advected (u) (variable d is used
-!-- for storage, because it is the only one having suitable dimensions. This is 
-!-- done for for reasons of compatibility with the parallel part.)
-    d(:,:,:) = u(nzb+1:nzt,nys:nyn,nxl:nxr) - u_gtrans
-
-#endif
-
-!
-!-- Upstream-Spline advection of u in x-direction. Array tend comes out
-!-- as v_ad before the advection step including cyclic boundaries.
-!-- It is needed for the long filter.
-    CALL spline_x( v_ad, d, 'u' )
-
-!
-!-- Advection of u in y-direction:
-!-- advecting component (v) must be averaged out on the u grid
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-              d(k,j,i) = 0.25 * ( v(k,j,i-1) + v(k,j+1,i-1) + &
-                                  v(k,j,i)   + v(k,j+1,i) ) - v_gtrans
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-
-!
-!-- Transpose the advecting component: z --> y
-    CALL transpose_zx( d, tend, d )
-    CALL transpose_xy( d, tend, d )
-
-!
-!-- Transpose the component to be advected: x --> y
-    CALL transpose_xy( v_ad, tend, v_ad )
-
-#endif
-
-!
-!-- Upstream-Spline advection of u in y-direction
-    CALL spline_y( v_ad, d, 'u' )
-
-!
-!-- Advection of u in z-direction:
-!-- the advecting component (w) must be averaged out on the u grid
-!-- (weighted for non-equidistant grid)
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             d(k,j,i) =  ( 0.5 * ( w(k,j,i)   + w(k,j,i-1)   ) * &
-                                 ( zu(k) - zw(k-1) )             &
-                         + 0.5 * ( w(k-1,j,i) + w(k-1,j,i-1) ) * &
-                                 ( zw(k) - zu(k)   )             &
-                         ) * ddzw(k)
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-
-!
-!-- Transpose the component to be advected: y --> z (= y --> x + x --> z)
-    CALL transpose_yx( v_ad, tend, v_ad )
-    CALL transpose_xz( v_ad, tend, v_ad )
-
-!
-!-- Resize tend to its normal size
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    ENDIF
-
-#endif
-
-!
-!-- Upstream-Spline advection of u in z-direction
-    CALL spline_z( v_ad, d, dzu, spl_tri_zu, 'u' )
-
-!
-!-- Compute the tendency term
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             tend(k,j,i) = ( v_ad(k,j,i) - u(k,j,i) ) / dt_3d 
-          ENDDO
-       ENDDO
-    ENDDO
-
-    DEALLOCATE( v_ad )
-
-    CALL cpu_log( log_point_s(17), 'advec_u_ups', 'stop' )
-
- END SUBROUTINE advec_u_ups
Index: palm/trunk/SOURCE/advec_v_ups.f90
===================================================================
--- palm/trunk/SOURCE/advec_v_ups.f90	(revision 997)
+++ 	(revision )
@@ -1,186 +1,0 @@
- SUBROUTINE advec_v_ups
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-!
-! 164 2008-05-15 08:46:15Z raasch
-! Arguments removed from transpose routines
-!
-! February 2007
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.7  2004/04/30 08:03:52  raasch
-! Enlarged transposition arrays introduced
-!
-! Revision 1.1  1999/02/05 08:50:32  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Upstream-Spline advection of the v velocity-component. The advection process
-! is divided into three subsequent steps, one for each of the dimensions. The
-! result is stored as a tendency in array tend. The computation of the cubic
-! splines and the possible execution of the Long-filter require that all grid
-! points of the relevant dimension are available. For model runs on more than
-! one PE therefore both the advected and the advecting quantities are
-! transposed accordingly.
-!
-! Internally used arrays:
-! v_ad = scalar quantity to be advected, initialised = v at the beginning,
-!        also being used as temporary storage after each time step
-! d    = advecting component (u, v, or w)
-!------------------------------------------------------------------------------!
-
-    USE advection
-    USE arrays_3d
-    USE cpulog
-    USE grid_variables
-    USE indices
-    USE interfaces
-    USE control_parameters
-
-    IMPLICIT NONE
-
-    INTEGER ::  i, j, k
-    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  v_ad
-
-
-    CALL cpu_log( log_point_s(18), 'advec_v_ups', 'start' )
-
-#if defined( __parallel )
-
-!
-!-- Advection of v in x-direction:
-!-- Store v in temporary array v_ad (component to be advected, boundaries
-!-- are not used because they disturb the transposition)
-    ALLOCATE( v_ad(nzb+1:nzta,nys:nyna,nxl:nxra) )
-    v_ad = 0.0
-    v_ad(nzb+1:nzt,nys:nyn,nxl:nxr) = v(nzb+1:nzt,nys:nyn,nxl:nxr)
-
-!
-!-- Enlarge the size of tend, used as a working array for the transpositions
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(1:nza,nys:nyna,nxl:nxra) )
-    ENDIF
-
-!
-!-- Transpose the component to be advected: z --> x
-    CALL transpose_zx( v_ad, tend, v_ad )
-
-#else
-
-!
-!-- Advection of v in x-direction:
-!-- Store v in temporary array v_ad (component to be advected)
-    ALLOCATE( v_ad(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    v_ad(:,:,:) = v(:,:,:)
-
-#endif
-
-!
-!-- Advecting component (u) must be averaged out on the v grid
-    d = 0.0
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             d(k,j,i) = 0.25 * ( u(k,j-1,i) + u(k,j-1,i+1) + &
-                                 u(k,j,i+1) + u(k,j,i) ) - u_gtrans
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-
-!
-!-- Transpose the advecting component: z --> x
-    CALL transpose_zx( d, tend, d )
-
-#endif
-
-!
-!-- Upstream-Spline advection of v in x-direction. Array tend comes out
-!-- as v_ad before the advection step including cyclic boundaries.
-!-- It is needed for the long filter.
-    CALL spline_x( v_ad, d, 'v' )
-
-!
-!-- Advection of v in y-direction:
-!-- advecting component (d) = component to be advected (v)
-    d(nzb+1:nzt,nys:nyn,nxl:nxr) = v(nzb+1:nzt,nys:nyn,nxl:nxr) - v_gtrans
-
-#if defined( __parallel )
-
-!
-!-- Transpose the advecting component: z --> y
-    CALL transpose_zx( d, tend, d )
-    CALL transpose_xy( d, tend, d )
-
-!
-!-- Transpose the component to be advected: x --> y
-    CALL transpose_xy( v_ad, tend, v_ad )
-
-#endif
-
-!
-!-- Upstream-Spline advection of v in y-direction
-    CALL spline_y( v_ad, d, 'v' )
-
-!
-!-- Advection of v in z-direction:
-!-- the advecting component (w) must be averaged out on the v grid
-!-- (weighted for non-equidistant grid)
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             d(k,j,i) =  ( 0.5 * ( w(k-1,j-1,i) + w(k-1,j,i) ) * &
-                                 ( zw(k) - zu(k) ) + &
-                           0.5 * ( w(k,j,i) + w(k,j-1,i) ) * &
-                                 ( zu(k) - zw(k-1) ) &
-                         ) * ddzw(k)
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-    
-!
-!-- Transpose the component to be advected: y --> z (= y --> x + x --> z)
-    CALL transpose_yx( v_ad, tend, v_ad )
-    CALL transpose_xz( v_ad, tend, v_ad )
-
-!
-!-- Resize tend to its normal size
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    ENDIF
-
-#endif
-
-!
-!-- Upstream-Spline advection of v in z-direction
-    CALL spline_z( v_ad, d, dzu, spl_tri_zu, 'v' )
-
-!
-!-- Compute the tendency term
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             tend(k,j,i) = ( v_ad(k,j,i) - v(k,j,i) ) / dt_3d 
-          ENDDO
-       ENDDO
-    ENDDO
-
-    DEALLOCATE( v_ad )
-
-    CALL cpu_log( log_point_s(18), 'advec_v_ups', 'stop' )
-
- END SUBROUTINE advec_v_ups
Index: palm/trunk/SOURCE/advec_w_ups.f90
===================================================================
--- palm/trunk/SOURCE/advec_w_ups.f90	(revision 997)
+++ 	(revision )
@@ -1,182 +1,0 @@
- SUBROUTINE advec_w_ups
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-!
-! 164 2008-05-15 08:46:15Z raasch
-! Arguments removed from transpose routines
-!
-! February 2007
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.6  2004/04/30 08:05:05  raasch
-! Enlarged transposition arrays introduced
-!
-! Revision 1.1  1999/02/05 08:52:09  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Upstream-Spline advection of the w velocity-component. The advection process
-! is divided into three subsequent steps, one for each of the dimensions. The
-! result is stored as a tendency in array tend. The computation of the cubic
-! splines and the possible execution of the Long-filter require that all grid
-! points of the relevant dimension are available. For model runs on more than
-! one PE therefore both the advected and the advecting quantities are
-! transposed accordingly.
-!
-! Internally used arrays:
-! v_ad = scalar quantity to be advected, initialised = w at the beginning, also
-!        being used as temporary storage after each time step
-! d    = advecting component (u, v, or w)
-!------------------------------------------------------------------------------!
-
-    USE advection
-    USE arrays_3d
-    USE cpulog
-    USE grid_variables
-    USE indices
-    USE interfaces
-    USE control_parameters
-
-    IMPLICIT NONE
-
-    INTEGER ::  i,j,k
-    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  v_ad
-
-
-    CALL cpu_log( log_point_s(19), 'advec_w_ups', 'start' )
-
-#if defined( __parallel )
-
-!
-!-- Advection of w in x-direction:
-!-- Store w in temporary array v_ad (component to be advected, boundaries
-!-- are not used because they disturb the transposition)
-    ALLOCATE( v_ad(nzb+1:nzta,nys:nyna,nxl:nxra) )
-    v_ad = 0.0
-    v_ad(nzb+1:nzt,nys:nyn,nxl:nxr) = w(nzb+1:nzt,nys:nyn,nxl:nxr)
-
-!
-!-- Enlarge the size of tend, used as a working array for the transpositions
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(1:nza,nys:nyna,nxl:nxra) )
-    ENDIF
-
-!
-!-- Transpose the component to be advected: z --> x
-    CALL transpose_zx( v_ad, tend, v_ad )
-
-#else
-
-!
-!-- Advection of w in x-direction:
-!-- Store w in temporary array v_ad (component to be advected)
-    ALLOCATE( v_ad(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    v_ad(:,:,:) = w(:,:,:)
-
-#endif
-
-!
-!-- Advecting component (u) must be averaged out on the w grid
-    d = 0.0
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             d(k,j,i) = 0.25 * ( u(k,j,i) + u(k,j,i+1) +   &
-                                 u(k+1,j,i+1) + u(k+1,j,i) ) - u_gtrans
-          ENDDO
-       ENDDO
-    ENDDO
-    
-#if defined( __parallel )
-
-!
-!-- Transpose the component to be advected: z --> x
-    CALL transpose_zx( d, tend, d )
-
-#endif
-
-!
-!-- Upstream-Spline advection of w in x-direction. Array tend comes out
-!-- as v_ad before the advection step including cyclic boundaries.
-!-- It is needed for the long filter.
-    CALL spline_x( v_ad, d, 'w' )
-
-!
-!-- Advection of w in y-direction:
-!-- advecting component (v) must be averaged out on the w grid
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             d(k,j,i) = 0.25 * ( v(k,j,i) + v(k,j+1,i) +   &
-                                 v(k+1,j+1,i) + v(k+1,j,i) ) - v_gtrans
-          ENDDO
-       ENDDO
-    ENDDO
-
-#if defined( __parallel )
-
-!
-!-- Transpose the advecting component: z --> y
-    CALL transpose_zx( d, tend, d )
-    CALL transpose_xy( d, tend, d )
-
-!
-!-- Transpose the component to be advected: x --> y
-    CALL transpose_xy( v_ad, tend, v_ad )
-
-#endif
-
-!
-!-- Upstream-Spline advection of w in y-direction
-    CALL spline_y( v_ad, d, 'w' )
-
-!
-!-- Advection of w in z-direction:
-!-- advecting component (d) = component to be advected (v_ad)
-    d(nzb+1:nzt,nys:nyn,nxl:nxr) = w(nzb+1:nzt,nys:nyn,nxl:nxr)
-
-#if defined( __parallel )
-
-!
-!-- Transpose the component to be advected: y --> z (= y --> x + x --> z)
-    CALL transpose_yx( v_ad, tend, v_ad )
-    CALL transpose_xz( v_ad, tend, v_ad )
-
-!
-!-- Resize tend to its normal size
-    IF ( nxra > nxr  .OR.  nyna > nyn  .OR.  nza > nz )  THEN
-       DEALLOCATE( tend )
-       ALLOCATE( tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
-    ENDIF
-
-#endif
-
-!
-!-- Upstream-Spline advection of w in z-direction
-    CALL spline_z( v_ad, d, dzw, spl_tri_zw, 'w' )
-
-!
-!-- Compute the tendency term
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-             tend(k,j,i) = ( v_ad(k,j,i) - w(k,j,i) ) / dt_3d
-          ENDDO
-       ENDDO
-    ENDDO
-
-    DEALLOCATE( v_ad )
-
-    CALL cpu_log( log_point_s(19), 'advec_w_ups', 'stop' )
-
- END SUBROUTINE advec_w_ups
Index: palm/trunk/SOURCE/asselin_filter.f90
===================================================================
--- palm/trunk/SOURCE/asselin_filter.f90	(revision 997)
+++ 	(revision )
@@ -1,110 +1,0 @@
- SUBROUTINE asselin_filter
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng
-!
-! Former revisions:
-! ---------------------
-! $Id$
-!
-! 75 2007-03-22 09:54:05Z raasch
-! moisture renamed humidity
-!
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.8  2004/01/30 10:14:02  raasch
-! Scalar lower k index nzb replaced by 2d-array nzb_2d
-!
-! Revision 1.1  2002/05/02  13:43:53  13:43:53  raasch (Siegfried Raasch)
-! Initial revision
-! 
-!
-! Description:
-! -------------
-! Time filter needed for the leap-frog method
-!------------------------------------------------------------------------------!
-
-    USE arrays_3d
-    USE control_parameters
-    USE cpulog 
-    USE indices
-    USE interfaces
-
-    IMPLICIT NONE
-
-    INTEGER ::  i, j, k
-
-
-    CALL cpu_log( log_point(9), 'timefilter', 'start' )
-
-!
-!-- Return to the calling routine, if time filter is not to be applied
-    IF ( asselin_filter_factor == 0.0 )  RETURN
-
-!
-!-- Apply the time filter
-#if defined( __ibm )
-!$OMP PARALLEL PRIVATE (i,j,k)
-!$OMP DO
-    DO  i = nxlg, nxrg
-       DO  j = nysg, nyng
-
-          DO  k = nzb_2d(j,i), nzt+1
-             u(k,j,i) = u(k,j,i) + asselin_filter_factor * &
-                                   ( u_p(k,j,i) - 2.0 * u(k,j,i) + u_m(k,j,i) )
-             v(k,j,i) = v(k,j,i) + asselin_filter_factor * &
-                                   ( v_p(k,j,i) - 2.0 * v(k,j,i) + v_m(k,j,i) )
-             w(k,j,i) = w(k,j,i) + asselin_filter_factor * &
-                                   ( w_p(k,j,i) - 2.0 * w(k,j,i) + w_m(k,j,i) )
-          ENDDO
-
-          IF ( scalar_advec /= 'bc-scheme' )  THEN
-             DO  k = nzb_2d(j,i), nzt+1
-                pt(k,j,i) = pt(k,j,i) + asselin_filter_factor * &
-                            ( pt_p(k,j,i) - 2.0 * pt(k,j,i) + pt_m(k,j,i) )
-             ENDDO
-          ENDIF
-
-          IF ( .NOT. constant_diffusion  .AND.  scalar_advec /= 'bc-scheme' ) &
-          THEN
-             DO  k = nzb_2d(j,i), nzt+1
-                e(k,j,i) = e(k,j,i) + asselin_filter_factor * &
-                           ( e_p(k,j,i) - 2.0 * e(k,j,i) + e_m(k,j,i) )
-             ENDDO
-          ENDIF
-
-          IF ( ( humidity .OR. passive_scalar )  .AND. &
-             scalar_advec /= 'bc-scheme' )  THEN
-             DO  k = nzb_2d(j,i), nzt+1
-                q(k,j,i) = q(k,j,i) + asselin_filter_factor * &
-                           ( q_p(k,j,i) - 2.0 * q(k,j,i) + q_m(k,j,i) )
-             ENDDO
-          ENDIF
-
-       ENDDO
-    ENDDO
-!$OMP END PARALLEL
-#else
-    u = u + asselin_filter_factor * ( u_p - 2.0 * u + u_m )
-    v = v + asselin_filter_factor * ( v_p - 2.0 * v + v_m )
-    w = w + asselin_filter_factor * ( w_p - 2.0 * w + w_m )
-
-    IF ( scalar_advec /= 'bc-scheme' )  THEN
-       pt = pt + asselin_filter_factor * ( pt_p - 2.0 * pt + pt_m )
-    ENDIF
-
-    IF ( .NOT. constant_diffusion  .AND.  scalar_advec /= 'bc-scheme' )  THEN
-       e = e + asselin_filter_factor * ( e_p - 2.0 * e + e_m )
-    ENDIF
-
-    IF ( ( humidity .OR. passive_scalar )  .AND. &
-         scalar_advec /= 'bc-scheme' )  THEN
-       q = q + asselin_filter_factor * ( q_p - 2.0 * q + q_m )
-    ENDIF
-#endif
-
-    CALL cpu_log( log_point(9), 'timefilter', 'stop' )
-
- END SUBROUTINE asselin_filter
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 997)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! all actions concerning leapfrog- and upstream-spline-scheme removed
 !
 ! Former revisions:
@@ -12,5 +12,5 @@
 ! 996 2012-09-07 10:41:47Z raasch
 ! little reformatting
-!
+
 ! 978 2012-08-09 08:28:32Z fricke
 ! setting of bc_lr/ns_dirneu/neudir
@@ -492,7 +492,4 @@
        THEN
           WRITE( action, '(A,A)' )  'momentum_advec = ', momentum_advec
-       ENDIF
-       IF ( timestep_scheme(1:8) == 'leapfrog' )  THEN
-          WRITE( action, '(A,A)' )  'timestep_scheme = ', timestep_scheme
        ENDIF
        IF ( psolver == 'sor' )  THEN
@@ -562,10 +559,4 @@
 
        action = ' '
-       IF ( timestep_scheme(1:8) == 'leapfrog' )  THEN
-          WRITE( action, '(A,A)' )  'timestep_scheme = ', timestep_scheme
-       ENDIF
-       IF ( momentum_advec == 'ups-scheme' )  THEN
-          WRITE( action, '(A,A)' )  'momentum_advec = ', momentum_advec
-       ENDIF
        IF ( action /= ' ' )  THEN
           message_string = 'ocean = .T. does not allow ' // TRIM( action )
@@ -653,15 +644,14 @@
     IF ( scalar_advec   == 'ws-scheme'   )  ws_scheme_sca = .TRUE.
     
-    IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' .AND. &
-         momentum_advec /= 'ups-scheme' ) THEN
+    IF ( momentum_advec /= 'pw-scheme'  .AND.  momentum_advec /= 'ws-scheme' ) &
+    THEN
        message_string = 'unknown advection scheme: momentum_advec = "' // &
                         TRIM( momentum_advec ) // '"'
        CALL message( 'check_parameters', 'PA0022', 1, 2, 0, 6, 0 )
     ENDIF
-    IF ((( momentum_advec == 'ups-scheme'  .OR.  scalar_advec == 'ups-scheme' )&
-           .AND.  timestep_scheme /= 'euler' ) .OR. (( momentum_advec == 'ws-scheme'&
-           .OR.  scalar_advec == 'ws-scheme') .AND. (timestep_scheme == 'euler' .OR. &
-           timestep_scheme == 'leapfrog+euler' .OR. timestep_scheme == 'leapfrog'    &
-           .OR. timestep_scheme == 'runge-kutta-2'))) THEN
+    IF ( ( momentum_advec == 'ws-scheme' .OR.  scalar_advec == 'ws-scheme' )   &
+           .AND. ( timestep_scheme == 'euler' .OR.                             &
+                   timestep_scheme == 'runge-kutta-2' ) )                      &
+    THEN
        message_string = 'momentum_advec or scalar_advec = "' &
          // TRIM( momentum_advec ) // '" is not allowed with timestep_scheme = "' // &
@@ -670,5 +660,6 @@
     ENDIF
     IF ( scalar_advec /= 'pw-scheme'  .AND.  scalar_advec /= 'ws-scheme' .AND. &
-        scalar_advec /= 'bc-scheme'  .AND.  scalar_advec /= 'ups-scheme' )  THEN
+         scalar_advec /= 'bc-scheme' )                                         &
+    THEN
        message_string = 'unknown advection scheme: scalar_advec = "' // &
                         TRIM( scalar_advec ) // '"'
@@ -683,10 +674,4 @@
     ENDIF
 
-    IF ( use_upstream_for_tke  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-       message_string = 'use_upstream_for_tke = .TRUE. not allowed with ' // &
-                        'timestep_scheme = "' // TRIM( timestep_scheme ) // '"'
-       CALL message( 'check_parameters', 'PA0026', 1, 2, 0, 6, 0 )
-    ENDIF
-
     IF ( use_sgs_for_particles  .AND.  curvature_solution_effects )  THEN
        message_string = 'use_sgs_for_particles = .TRUE. not allowed with ' // &
@@ -701,16 +686,10 @@
        CASE ( 'euler' )
           intermediate_timestep_count_max = 1
-          asselin_filter_factor           = 0.0
-
-       CASE ( 'leapfrog', 'leapfrog+euler' )
-          intermediate_timestep_count_max = 1
 
        CASE ( 'runge-kutta-2' )
           intermediate_timestep_count_max = 2
-          asselin_filter_factor           = 0.0
 
        CASE ( 'runge-kutta-3' )
           intermediate_timestep_count_max = 3
-          asselin_filter_factor           = 0.0
 
        CASE DEFAULT
@@ -720,12 +699,4 @@
 
     END SELECT
-
-    IF ( scalar_advec == 'ups-scheme'  .AND.  timestep_scheme(1:5) == 'runge' )&
-    THEN
-       message_string = 'scalar advection scheme "' // TRIM( scalar_advec ) // &
-                        '" & does not work with timestep_scheme "' // &
-                        TRIM( timestep_scheme ) // '"'
-       CALL message( 'check_parameters', 'PA0028', 1, 2, 0, 6, 0 )
-    ENDIF
 
     IF ( (momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme') &
@@ -831,19 +802,8 @@
     ENDIF
 
-    IF ( humidity  .AND.  scalar_advec == 'ups-scheme' )  THEN
-       message_string = 'UPS-scheme is not implemented for humidity = .TRUE.'
-       CALL message( 'check_parameters', 'PA0037', 1, 2, 0, 6, 0 )
-    ENDIF
-
     IF ( passive_scalar  .AND.  humidity )  THEN
        message_string = 'humidity = .TRUE. and passive_scalar = .TRUE. ' // &
                         'is not allowed simultaneously'
        CALL message( 'check_parameters', 'PA0038', 1, 2, 0, 6, 0 )
-    ENDIF
-
-    IF ( passive_scalar  .AND.  scalar_advec == 'ups-scheme' )  THEN
-       message_string = 'UPS-scheme is not implemented for passive_scalar' // &
-                        ' = .TRUE.'
-       CALL message( 'check_parameters', 'PA0039', 1, 2, 0, 6, 0 )
     ENDIF
 
@@ -1319,15 +1279,10 @@
     IF ( cfl_factor <= 0.0  .OR.  cfl_factor > 1.0 )  THEN
        IF ( cfl_factor == -1.0 )  THEN
-          IF ( momentum_advec == 'ups-scheme'  .OR.  &
-               scalar_advec == 'ups-scheme' )  THEN
+          IF ( timestep_scheme == 'runge-kutta-2' )  THEN
              cfl_factor = 0.8
+          ELSEIF ( timestep_scheme == 'runge-kutta-3' )  THEN
+             cfl_factor = 0.9
           ELSE
-             IF ( timestep_scheme == 'runge-kutta-2' )  THEN
-                cfl_factor = 0.8
-             ELSEIF ( timestep_scheme == 'runge-kutta-3' )  THEN
-                cfl_factor = 0.9
-             ELSE
-                cfl_factor = 0.1
-             ENDIF
+             cfl_factor = 0.9
           ENDIF
        ELSE
@@ -1717,9 +1672,5 @@
 !-- Compute and check, respectively, the Rayleigh Damping parameter
     IF ( rayleigh_damping_factor == -1.0 )  THEN
-       IF ( momentum_advec == 'ups-scheme' )  THEN
-          rayleigh_damping_factor = 0.01
-       ELSE
-          rayleigh_damping_factor = 0.0
-       ENDIF
+       rayleigh_damping_factor = 0.0
     ELSE
        IF ( rayleigh_damping_factor < 0.0 .OR. rayleigh_damping_factor > 1.0 ) &
@@ -1753,18 +1704,4 @@
           ENDIF
        ENDIF
-    ENDIF
-
-!
-!-- Check limiters for Upstream-Spline scheme
-    IF ( overshoot_limit_u < 0.0  .OR.  overshoot_limit_v < 0.0  .OR.  &
-         overshoot_limit_w < 0.0  .OR.  overshoot_limit_pt < 0.0  .OR. &
-         overshoot_limit_e < 0.0 )  THEN
-       message_string = 'overshoot_limit_... < 0.0 is not allowed'
-       CALL message( 'check_parameters', 'PA0080', 1, 2, 0, 6, 0 )
-    ENDIF
-    IF ( ups_limit_u < 0.0 .OR. ups_limit_v < 0.0 .OR. ups_limit_w < 0.0 .OR. &
-         ups_limit_pt < 0.0 .OR. ups_limit_e < 0.0 )  THEN
-       message_string = 'ups_limit_... < 0.0 is not allowed'
-       CALL message( 'check_parameters', 'PA0081', 1, 2, 0, 6, 0 )
     ENDIF
 
Index: palm/trunk/SOURCE/diffusion_e.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_e.f90	(revision 997)
+++ palm/trunk/SOURCE/diffusion_e.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! most arrays comunicated by module instead of parameter list
 !
 ! Former revisions:
@@ -64,7 +64,7 @@
 ! Call for all grid points
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_e( ddzu, dd2zu, ddzw, diss, e, km, l_grid, var, &
-                            var_reference, rif, tend, zu, zw )
-
+    SUBROUTINE diffusion_e( var, var_reference )
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -75,10 +75,7 @@
 
        INTEGER ::  i, j, k
-       REAL            ::  dvar_dz, l_stable, phi_m, var_reference
-       REAL            ::  ddzu(1:nzt+1), dd2zu(1:nzt), ddzw(1:nzt+1), &
-                           l_grid(1:nzt), zu(nzb:nzt+1), zw(nzb:nzt+1)
-       REAL, DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: diss, tend
-       REAL, DIMENSION(:,:), POINTER   ::  rif
-       REAL, DIMENSION(:,:,:), POINTER ::  e, km, var
+       REAL    ::  dvar_dz, l_stable, phi_m, var_reference
+
+       REAL, DIMENSION(:,:,:), POINTER ::  var
        REAL, DIMENSION(nzb+1:nzt,nys:nyn) ::  dissipation, l, ll
  
@@ -285,7 +282,7 @@
 ! Call for grid point i,j
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_e_ij( i, j, ddzu, dd2zu, ddzw, diss, e, km, l_grid, &
-                               var, var_reference, rif, tend, zu, zw )
-
+    SUBROUTINE diffusion_e_ij( i, j, var, var_reference )
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -295,12 +292,9 @@
        IMPLICIT NONE
 
-       INTEGER         ::  i, j, k
-       REAL            ::  dvar_dz, l_stable, phi_m, var_reference
-       REAL            ::  ddzu(1:nzt+1), dd2zu(1:nzt), ddzw(1:nzt+1), &
-                           l_grid(1:nzt), zu(nzb:nzt+1), zw(nzb:nzt+1)
-       REAL, DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: diss, tend
-       REAL, DIMENSION(:,:), POINTER   ::  rif
-       REAL, DIMENSION(:,:,:), POINTER ::  e, km, var
-       REAL, DIMENSION(nzb+1:nzt)    ::  dissipation, l, ll
+       INTEGER ::  i, j, k
+       REAL    ::  dvar_dz, l_stable, phi_m, var_reference
+
+       REAL, DIMENSION(:,:,:), POINTER ::  var
+       REAL, DIMENSION(nzb+1:nzt) ::  dissipation, l, ll
 
 
Index: palm/trunk/SOURCE/diffusion_s.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_s.f90	(revision 997)
+++ palm/trunk/SOURCE/diffusion_s.f90	(revision 1001)
@@ -3,5 +3,6 @@
 !------------------------------------------------------------------------------!
 ! Current revisions:
-! -----------------
+! ------------------
+! some arrays comunicated by module instead of parameter list
 !
 ! Former revisions:
@@ -54,7 +55,7 @@
 ! Call for all grid points
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_s( ddzu, ddzw, kh, s, s_flux_b, s_flux_t, &
-                            wall_s_flux, tend )
-
+    SUBROUTINE diffusion_s( s, s_flux_b, s_flux_t, wall_s_flux )
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -65,9 +66,7 @@
        INTEGER ::  i, j, k
        REAL    ::  vertical_gridspace
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
        REAL    ::  wall_s_flux(0:4)
-       REAL, DIMENSION(:,:),   POINTER ::  s_flux_b, s_flux_t
-       REAL, DIMENSION(:,:,:), POINTER ::  kh, s
+       REAL, DIMENSION(nysg:nyng,nxlg:nxrg) ::  s_flux_b, s_flux_t
+       REAL, DIMENSION(:,:,:), POINTER ::  s
 
        DO  i = nxl, nxr
@@ -166,7 +165,7 @@
 ! Call for grid point i,j
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_s_ij( i, j, ddzu, ddzw, kh, s, s_flux_b, s_flux_t, &
-                               wall_s_flux, tend )
-
+    SUBROUTINE diffusion_s_ij( i, j, s, s_flux_b, s_flux_t, wall_s_flux )
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -177,9 +176,7 @@
        INTEGER ::  i, j, k
        REAL    ::  vertical_gridspace
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
        REAL    ::  wall_s_flux(0:4)
-       REAL, DIMENSION(:,:),   POINTER ::  s_flux_b, s_flux_t
-       REAL, DIMENSION(:,:,:), POINTER ::  kh, s
+       REAL, DIMENSION(nysg:nyng,nxlg:nxrg) ::  s_flux_b, s_flux_t
+       REAL, DIMENSION(:,:,:), POINTER ::  s
 
 !
Index: palm/trunk/SOURCE/diffusion_u.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_u.f90	(revision 997)
+++ palm/trunk/SOURCE/diffusion_u.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! arrays comunicated by module instead of parameter list
 !
 ! Former revisions:
@@ -68,6 +68,7 @@
 ! Call for all grid points
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_u( ddzu, ddzw, km, tend, u, usws, uswst, v, w )
-
+    SUBROUTINE diffusion_u
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -78,8 +79,5 @@
        INTEGER ::  i, j, k
        REAL    ::  kmym, kmyp, kmzm, kmzp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
-       REAL, DIMENSION(:,:),   POINTER ::  usws, uswst
-       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
+
        REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs
 
@@ -93,5 +91,5 @@
 
        DO  i = nxlu, nxr
-          DO  j = nys,nyn
+          DO  j = nys, nyn
 !
 !--          Compute horizontal diffusion
@@ -221,7 +219,7 @@
 ! Call for grid point i,j
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_u_ij( i, j, ddzu, ddzw, km, tend, u, usws, &
-                               uswst, v, w )
-
+    SUBROUTINE diffusion_u_ij( i, j )
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -232,9 +230,6 @@
        INTEGER ::  i, j, k
        REAL    ::  kmym, kmyp, kmzm, kmzp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
-       REAL, DIMENSION(nzb:nzt+1)      ::  usvs
-       REAL, DIMENSION(:,:),   POINTER ::  usws, uswst
-       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
+
+       REAL, DIMENSION(nzb:nzt+1) ::  usvs
 
 !
Index: palm/trunk/SOURCE/diffusion_v.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_v.f90	(revision 997)
+++ palm/trunk/SOURCE/diffusion_v.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! arrays comunicated by module instead of parameter list
 !
 ! Former revisions:
@@ -66,6 +66,7 @@
 ! Call for all grid points
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_v( ddzu, ddzw, km, tend, u, v, vsws, vswst, w )
-
+    SUBROUTINE diffusion_v
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -76,8 +77,5 @@
        INTEGER ::  i, j, k
        REAL    ::  kmxm, kmxp, kmzm, kmzp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
-       REAL, DIMENSION(:,:),   POINTER ::  vsws, vswst
-       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
+
        REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  vsus
 
@@ -219,7 +217,7 @@
 ! Call for grid point i,j
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_v_ij( i, j, ddzu, ddzw, km, tend, u, v, &
-                               vsws, vswst, w )
-
+    SUBROUTINE diffusion_v_ij( i, j )
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -230,9 +228,6 @@
        INTEGER ::  i, j, k
        REAL    ::  kmxm, kmxp, kmzm, kmzp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
-       REAL, DIMENSION(nzb:nzt+1)      ::  vsus
-       REAL, DIMENSION(:,:),   POINTER ::  vsws, vswst
-       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
+
+       REAL, DIMENSION(nzb:nzt+1) ::  vsus
 
 !
Index: palm/trunk/SOURCE/diffusion_w.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_w.f90	(revision 997)
+++ palm/trunk/SOURCE/diffusion_w.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! arrays comunicated by module instead of parameter list
 !
 ! Former revisions:
@@ -60,6 +60,7 @@
 ! Call for all grid points
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_w( ddzu, ddzw, km, tend, u, v, w )
-
+    SUBROUTINE diffusion_w
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -70,7 +71,5 @@
        INTEGER ::  i, j, k
        REAL    ::  kmxm, kmxp, kmym, kmyp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
-       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
+
        REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  wsus, wsvs
 
@@ -170,6 +169,7 @@
 ! Call for grid point i,j
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_w_ij( i, j, ddzu, ddzw, km, tend, u, v, w )
-
+    SUBROUTINE diffusion_w_ij( i, j )
+
+       USE arrays_3d
        USE control_parameters
        USE grid_variables
@@ -180,8 +180,6 @@
        INTEGER ::  i, j, k
        REAL    ::  kmxm, kmxp, kmym, kmyp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
-       REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
-       REAL, DIMENSION(nzb:nzt+1)      ::  wsus, wsvs
-       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
+
+       REAL, DIMENSION(nzb:nzt+1) ::  wsus, wsvs
 
 
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 997)
+++ palm/trunk/SOURCE/header.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! all actions concerning leapfrog- and upstream-spline-scheme removed
 !
 ! Former revisions:
@@ -296,18 +296,4 @@
     ELSEIF (momentum_advec == 'ws-scheme' ) THEN
        WRITE ( io, 503 )
-    ELSEIF (momentum_advec == 'ups-scheme' ) THEN
-       WRITE ( io, 114 )
-       IF ( cut_spline_overshoot )  WRITE ( io, 124 )
-       IF ( overshoot_limit_u /= 0.0  .OR.  overshoot_limit_v /= 0.0  .OR. &
-            overshoot_limit_w /= 0.0 )  THEN
-          WRITE ( io, 127 )  overshoot_limit_u, overshoot_limit_v, &
-                             overshoot_limit_w
-       ENDIF
-       IF ( ups_limit_u /= 0.0  .OR.  ups_limit_v /= 0.0  .OR. &
-            ups_limit_w /= 0.0 )                               &
-       THEN
-          WRITE ( io, 125 )  ups_limit_u, ups_limit_v, ups_limit_w
-       ENDIF
-       IF ( long_filter_factor /= 0.0 )  WRITE ( io, 115 )  long_filter_factor
     ENDIF
     IF ( scalar_advec == 'pw-scheme' )  THEN
@@ -315,13 +301,4 @@
     ELSEIF ( scalar_advec == 'ws-scheme' )  THEN
        WRITE ( io, 504 )
-    ELSEIF ( scalar_advec == 'ups-scheme' )  THEN
-       WRITE ( io, 117 )
-       IF ( cut_spline_overshoot )  WRITE ( io, 124 )
-       IF ( overshoot_limit_e /= 0.0  .OR.  overshoot_limit_pt /= 0.0 )  THEN
-          WRITE ( io, 128 )  overshoot_limit_e, overshoot_limit_pt
-       ENDIF
-       IF ( ups_limit_e /= 0.0  .OR.  ups_limit_pt /= 0.0 )  THEN
-          WRITE ( io, 126 )  ups_limit_e, ups_limit_pt
-       ENDIF
     ELSE
        WRITE ( io, 118 )
@@ -344,11 +321,5 @@
                           advected_distance_x/1000.0, advected_distance_y/1000.0
     ENDIF
-    IF ( timestep_scheme == 'leapfrog' )  THEN
-       WRITE ( io, 120 )
-    ELSEIF ( timestep_scheme == 'leapfrog+euler' )  THEN
-       WRITE ( io, 121 )
-    ELSE
-       WRITE ( io, 122 )  timestep_scheme
-    ENDIF
+    WRITE ( io, 122 )  timestep_scheme
     IF ( use_upstream_for_tke )  WRITE ( io, 143 )
     IF ( rayleigh_damping_factor /= 0.0 )  THEN
@@ -1646,31 +1617,13 @@
 113 FORMAT (' --> Momentum advection via Piascek-Williams-Scheme (Form C3)', &
                   ' or Upstream')
-114 FORMAT (' --> Momentum advection via Upstream-Spline-Scheme')
-115 FORMAT ('     Tendencies are smoothed via Long-Filter with factor ',F5.3) 
 116 FORMAT (' --> Scalar advection via Piascek-Williams-Scheme (Form C3)', &
                   ' or Upstream')
-117 FORMAT (' --> Scalar advection via Upstream-Spline-Scheme')
 118 FORMAT (' --> Scalar advection via Bott-Chlond-Scheme')
 119 FORMAT (' --> Galilei-Transform applied to horizontal advection', &
             '     Translation velocity = ',A/ &
             '     distance advected ',A,':  ',F8.3,' km(x)  ',F8.3,' km(y)')
-120 FORMAT (' --> Time differencing scheme: leapfrog only (no euler in case', &
-                  ' of timestep changes)')
-121 FORMAT (' --> Time differencing scheme: leapfrog + euler in case of', &
-                  ' timestep changes')
 122 FORMAT (' --> Time differencing scheme: ',A)
 123 FORMAT (' --> Rayleigh-Damping active, starts ',A,' z = ',F8.2,' m'/ &
             '     maximum damping coefficient: ',F5.3, ' 1/s')
-124 FORMAT ('     Spline-overshoots are being suppressed')
-125 FORMAT ('     Upstream-Scheme is used if Upstream-differences fall short', &
-                  ' of'/                                                       &
-            '     delta_u = ',F6.4,4X,'delta_v = ',F6.4,4X,'delta_w = ',F6.4)
-126 FORMAT ('     Upstream-Scheme is used if Upstream-differences fall short', &
-                  ' of'/                                                       &
-            '     delta_e = ',F6.4,4X,'delta_pt = ',F6.4)
-127 FORMAT ('     The following absolute overshoot differences are tolerated:'/&
-            '     delta_u = ',F6.4,4X,'delta_v = ',F6.4,4X,'delta_w = ',F6.4)
-128 FORMAT ('     The following absolute overshoot differences are tolerated:'/&
-            '     delta_e = ',F6.4,4X,'delta_pt = ',F6.4)
 129 FORMAT (' --> Additional prognostic equation for the specific humidity')
 130 FORMAT (' --> Additional prognostic equation for the total water content')
Index: palm/trunk/SOURCE/init_1d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_1d_model.f90	(revision 997)
+++ palm/trunk/SOURCE/init_1d_model.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -68,23 +68,21 @@
 !
 !-- Allocate required 1D-arrays
-    ALLOCATE( e1d(nzb:nzt+1),    e1d_m(nzb:nzt+1),   e1d_p(nzb:nzt+1), &
-              kh1d(nzb:nzt+1),   kh1d_m(nzb:nzt+1),  km1d(nzb:nzt+1),  &
-              km1d_m(nzb:nzt+1), l_black(nzb:nzt+1), l1d(nzb:nzt+1),   &
-              l1d_m(nzb:nzt+1),  rif1d(nzb:nzt+1),   te_e(nzb:nzt+1),  &
+    ALLOCATE( e1d(nzb:nzt+1),    e1d_p(nzb:nzt+1), &
+              kh1d(nzb:nzt+1),   km1d(nzb:nzt+1),  &
+              l_black(nzb:nzt+1), l1d(nzb:nzt+1),   &
+              rif1d(nzb:nzt+1),   te_e(nzb:nzt+1),  &
               te_em(nzb:nzt+1),  te_u(nzb:nzt+1),    te_um(nzb:nzt+1), &
               te_v(nzb:nzt+1),   te_vm(nzb:nzt+1),    u1d(nzb:nzt+1),   &
-              u1d_m(nzb:nzt+1),  u1d_p(nzb:nzt+1),   v1d(nzb:nzt+1),   &
-              v1d_m(nzb:nzt+1),  v1d_p(nzb:nzt+1) )
+              u1d_p(nzb:nzt+1),  v1d(nzb:nzt+1),   &
+              v1d_p(nzb:nzt+1) )
 
 !
 !-- Initialize arrays
     IF ( constant_diffusion )  THEN
-       km1d   = km_constant
-       km1d_m = km_constant
-       kh1d   = km_constant / prandtl_number
-       kh1d_m = km_constant / prandtl_number
+       km1d = km_constant
+       kh1d = km_constant / prandtl_number
     ELSE
-       e1d = 0.0; e1d_m = 0.0; e1d_p = 0.0
-       kh1d = 0.0; kh1d_m = 0.0; km1d = 0.0; km1d_m = 0.0
+       e1d = 0.0; e1d_p = 0.0
+       kh1d = 0.0; km1d = 0.0
        rif1d = 0.0
 !
@@ -123,10 +121,7 @@
     ENDIF
     l1d   = l_black
-    l1d_m = l_black
     u1d   = u_init
-    u1d_m = u_init
     u1d_p = u_init
     v1d   = v_init
-    v1d_m = v_init
     v1d_p = v_init
 
@@ -136,8 +131,6 @@
 !-- in the initial phase of a run (at k=1, dz/2 occurs in the limiting formula!)
     u1d(0:1)   = 0.1
-    u1d_m(0:1) = 0.1
     u1d_p(0:1) = 0.1
     v1d(0:1)   = 0.1
-    v1d_m(0:1) = 0.1
     v1d_p(0:1) = 0.1
 
@@ -152,6 +145,6 @@
     ENDIF
     ts1d = 0.0
-    usws1d = 0.0; usws1d_m = 0.0
-    vsws1d = 0.0; vsws1d_m = 0.0
+    usws1d = 0.0
+    vsws1d = 0.0
     z01d  = roughness_length
     z0h1d = z0h_factor * z01d 
@@ -226,18 +219,18 @@
           DO  k = nzb_diff, nzt
 
-             kmzm = 0.5 * ( km1d_m(k-1) + km1d_m(k) )
-             kmzp = 0.5 * ( km1d_m(k) + km1d_m(k+1) )
+             kmzm = 0.5 * ( km1d(k-1) + km1d(k) )
+             kmzp = 0.5 * ( km1d(k) + km1d(k+1) )
 !
 !--          u-component
              te_u(k) =  f * ( v1d(k) - vg(k) ) + ( &
-                              kmzp * ( u1d_m(k+1) - u1d_m(k) ) * ddzu(k+1) &
-                            - kmzm * ( u1d_m(k) - u1d_m(k-1) ) * ddzu(k)   &
-                                              ) * ddzw(k)
+                              kmzp * ( u1d(k+1) - u1d(k) ) * ddzu(k+1) &
+                            - kmzm * ( u1d(k) - u1d(k-1) ) * ddzu(k)   &
+                                                 ) * ddzw(k)
 !
 !--          v-component
-             te_v(k) = -f * ( u1d(k) - ug(k) ) + ( &
-                              kmzp * ( v1d_m(k+1) - v1d_m(k) ) * ddzu(k+1) &
-                            - kmzm * ( v1d_m(k) - v1d_m(k-1) ) * ddzu(k)   &
-                                              ) * ddzw(k)
+             te_v(k) = -f * ( u1d(k) - ug(k) ) + (                     &
+                              kmzp * ( v1d(k+1) - v1d(k) ) * ddzu(k+1) &
+                            - kmzm * ( v1d(k) - v1d(k-1) ) * ddzu(k)   &
+                                                 ) * ddzw(k)
           ENDDO
           IF ( .NOT. constant_diffusion )  THEN
@@ -245,6 +238,6 @@
 !
 !--             TKE
-                kmzm = 0.5 * ( km1d_m(k-1) + km1d_m(k) )
-                kmzp = 0.5 * ( km1d_m(k) + km1d_m(k+1) )
+                kmzm = 0.5 * ( km1d(k-1) + km1d(k) )
+                kmzp = 0.5 * ( km1d(k) + km1d(k+1) )
                 IF ( .NOT. humidity )  THEN
                    pt_0 = pt_init(k)
@@ -260,8 +253,8 @@
 !
 !--                According to Detering, c_e=0.064
-                   dissipation = 0.064 * e1d_m(k) * SQRT( e1d_m(k) ) / l1d_m(k)
+                   dissipation = 0.064 * e1d(k) * SQRT( e1d(k) ) / l1d(k)
                 ELSEIF ( dissipation_1d == 'as_in_3d_model' )  THEN
-                   dissipation = ( 0.19 + 0.74 * l1d_m(k) / l_grid(k) ) &
-                                 * e1d_m(k) * SQRT( e1d_m(k) ) / l1d_m(k)
+                   dissipation = ( 0.19 + 0.74 * l1d(k) / l_grid(k) ) &
+                                 * e1d(k) * SQRT( e1d(k) ) / l1d(k)
                 ENDIF
 
@@ -271,8 +264,8 @@
                                     - g / pt_0 * kh1d(k) * flux                &
                                     +            (                             &
-                                 kmzp * ( e1d_m(k+1) - e1d_m(k) ) * ddzu(k+1)  &
-                               - kmzm * ( e1d_m(k) - e1d_m(k-1) ) * ddzu(k)    &
+                                     kmzp * ( e1d(k+1) - e1d(k) ) * ddzu(k+1)  &
+                                   - kmzm * ( e1d(k) - e1d(k-1) ) * ddzu(k)    &
                                                  ) * ddzw(k)                   &
-                               - dissipation
+                                   - dissipation
              ENDDO
           ENDIF
@@ -285,6 +278,6 @@
 
              k = nzb+1
-             kmzm = 0.5 * ( km1d_m(k-1) + km1d_m(k) )
-             kmzp = 0.5 * ( km1d_m(k) + km1d_m(k+1) )
+             kmzm = 0.5 * ( km1d(k-1) + km1d(k) )
+             kmzp = 0.5 * ( km1d(k) + km1d(k+1) )
              IF ( .NOT. humidity )  THEN
                 pt_0 = pt_init(k)
@@ -300,20 +293,20 @@
 !
 !--             According to Detering, c_e=0.064
-                dissipation = 0.064 * e1d_m(k) * SQRT( e1d_m(k) ) / l1d_m(k)
+                dissipation = 0.064 * e1d(k) * SQRT( e1d(k) ) / l1d(k)
              ELSEIF ( dissipation_1d == 'as_in_3d_model' )  THEN
-                dissipation = ( 0.19 + 0.74 * l1d_m(k) / l_grid(k) ) &
-                              * e1d_m(k) * SQRT( e1d_m(k) ) / l1d_m(k)
+                dissipation = ( 0.19 + 0.74 * l1d(k) / l_grid(k) ) &
+                              * e1d(k) * SQRT( e1d(k) ) / l1d(k)
              ENDIF
 
 !
 !--          u-component
-             te_u(k) = f * ( v1d(k) - vg(k) ) + ( &
-                       kmzp * ( u1d_m(k+1) - u1d_m(k) ) * ddzu(k+1) + usws1d_m &
-                                               ) * 2.0 * ddzw(k)
+             te_u(k) = f * ( v1d(k) - vg(k) ) + (                              &
+                       kmzp * ( u1d(k+1) - u1d(k) ) * ddzu(k+1) + usws1d       &
+                                                ) * 2.0 * ddzw(k)
 !
 !--          v-component
-             te_v(k) = -f * ( u1d(k) - ug(k) ) + ( &
-                       kmzp * ( v1d_m(k+1) - v1d_m(k) ) * ddzu(k+1) + vsws1d_m &
-                                           ) * 2.0 * ddzw(k)
+             te_v(k) = -f * ( u1d(k) - ug(k) ) + (                             &
+                       kmzp * ( v1d(k+1) - v1d(k) ) * ddzu(k+1) + vsws1d       &
+                                                 ) * 2.0 * ddzw(k)
 !
 !--          TKE
@@ -323,8 +316,8 @@
                                  - g / pt_0 * kh1d(k) * flux                   &
                                  +           (                                 &
-                              kmzp * ( e1d_m(k+1) - e1d_m(k) ) * ddzu(k+1)     &
-                            - kmzm * ( e1d_m(k) - e1d_m(k-1) ) * ddzu(k)       &
+                                  kmzp * ( e1d(k+1) - e1d(k) ) * ddzu(k+1)     &
+                                - kmzm * ( e1d(k) - e1d(k-1) ) * ddzu(k)       &
                                               ) * ddzw(k)                      &
-                            - dissipation
+                                - dissipation
           ENDIF
 
@@ -333,10 +326,8 @@
           DO  k = nzb+1, nzt
 
-             u1d_p(k) = ( 1. - tsc(1) ) * u1d_m(k) + &
-                        tsc(1) * u1d(k) + dt_1d * ( tsc(2) * te_u(k) + &
-                                                    tsc(3) * te_um(k) ) 
-             v1d_p(k) = ( 1. - tsc(1) ) * v1d_m(k) + &
-                        tsc(1) * v1d(k) + dt_1d * ( tsc(2) * te_v(k) + &
-                                                    tsc(3) * te_vm(k) ) 
+             u1d_p(k) = u1d(k) + dt_1d * ( tsc(2) * te_u(k) + &
+                                           tsc(3) * te_um(k) )
+             v1d_p(k) = v1d(k) + dt_1d * ( tsc(2) * te_v(k) + &
+                                           tsc(3) * te_vm(k) )
 
           ENDDO
@@ -344,7 +335,6 @@
              DO  k = nzb+1, nzt
 
-                e1d_p(k) = ( 1. - tsc(1) ) * e1d_m(k) + &
-                           tsc(1) * e1d(k) + dt_1d * ( tsc(2) * te_e(k) + &
-                                                       tsc(3) * te_em(k) ) 
+                e1d_p(k) = e1d(k) + dt_1d * ( tsc(2) * te_e(k) + &
+                                              tsc(3) * te_em(k) )
 
              ENDDO
@@ -403,34 +393,5 @@
 
 !
-!--       If necessary, apply the time filter
-          IF ( asselin_filter_factor /= 0.0  .AND. &
-               timestep_scheme(1:5) /= 'runge' )  THEN
-
-             u1d = u1d + asselin_filter_factor * ( u1d_p - 2.0 * u1d + u1d_m )
-             v1d = v1d + asselin_filter_factor * ( v1d_p - 2.0 * v1d + v1d_m )
-
-             IF ( .NOT. constant_diffusion )  THEN
-                e1d = e1d + asselin_filter_factor * &
-                            ( e1d_p - 2.0 * e1d + e1d_m )
-             ENDIF
-
-          ENDIF
-
-!
 !--       Swap the time levels in preparation for the next time step.
-          IF ( timestep_scheme(1:4) == 'leap' )  THEN
-             u1d_m  = u1d
-             v1d_m  = v1d
-             IF ( .NOT. constant_diffusion )  THEN
-                e1d_m  = e1d
-                kh1d_m = kh1d  ! The old diffusion quantities are required for
-                km1d_m = km1d  ! explicit diffusion in the leap-frog scheme.
-                l1d_m  = l1d
-                IF ( prandtl_layer )  THEN
-                   usws1d_m = usws1d
-                   vsws1d_m = vsws1d
-                ENDIF
-             ENDIF
-          ENDIF
           u1d  = u1d_p
           v1d  = v1d_p
@@ -696,22 +657,4 @@
           ENDIF   ! .NOT. constant_diffusion
 
-!
-!--       The Runge-Kutta scheme needs the recent diffusion quantities
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             u1d_m  = u1d
-             v1d_m  = v1d
-             IF ( .NOT. constant_diffusion )  THEN
-                e1d_m  = e1d
-                kh1d_m = kh1d
-                km1d_m = km1d
-                l1d_m  = l1d
-                IF ( prandtl_layer )  THEN
-                   usws1d_m = usws1d
-                   vsws1d_m = vsws1d
-                ENDIF
-             ENDIF
-          ENDIF
-
-
        ENDDO   ! intermediate step loop
 
@@ -836,5 +779,5 @@
 
     INTEGER ::  k
-    REAL    ::  div, dt_diff, fac, percent_change, value
+    REAL    ::  div, dt_diff, fac, value
 
 
@@ -842,9 +785,5 @@
 !-- Compute the currently feasible time step according to the diffusion
 !-- criterion. At nzb+1 the half grid length is used.
-    IF ( timestep_scheme(1:4) == 'leap' )  THEN
-       fac = 0.25
-    ELSE
-       fac = 0.35
-    ENDIF
+    fac = 0.35
     dt_diff = dt_max_1d
     DO  k = nzb+2, nzt
@@ -866,71 +805,15 @@
     ENDIF
 
-    IF ( timestep_scheme(1:4) == 'leap' )  THEN
-
-!
-!--    The current time step will only be changed if the new time step exceeds
-!--    its previous value by 5 % or falls 2 % below. After a time step
-!--    reduction at least 30 iterations must be done with this value before a
-!--    new reduction will be allowed again.
-!--    The control parameters for application of Euler- or leap-frog schemes are
-!--    set accordingly.
-       percent_change = dt_1d / old_dt_1d - 1.0
-       IF ( percent_change > 0.05  .OR.  percent_change < -0.02 )  THEN
-
-!
-!--       Each time step increase is by at most 2 %
-          IF ( percent_change > 0.0  .AND.  simulated_time_1d /= 0.0 )  THEN
-             dt_1d = 1.02 * old_dt_1d
-          ENDIF
-
-!
-!--       A more or less simple new time step value is obtained taking only the
-!--       first two significant digits
-          div = 1000.0
-          DO  WHILE ( dt_1d < div )
-             div = div / 10.0
-          ENDDO
-          dt_1d = NINT( dt_1d * 100.0 / div ) * div / 100.0
-
-!
-!--       Now the time step can be changed.
-          IF ( percent_change < 0.0 )  THEN
-!
-!--          Time step reduction
-             old_dt_1d = dt_1d
-             last_dt_change_1d = current_timestep_number_1d
-          ELSE
-!
-!--          Time step will only be increased if at least 30 iterations have
-!--          been done since the previous time step change, and of course at
-!--          simulation start, respectively.
-             IF ( current_timestep_number_1d >= last_dt_change_1d + 30  .OR. &
-                     simulated_time_1d == 0.0 )  THEN
-                old_dt_1d = dt_1d
-                last_dt_change_1d = current_timestep_number_1d
-             ELSE
-                dt_1d = old_dt_1d
-             ENDIF
-          ENDIF
-       ELSE
-!
-!--       No time step change since the difference is too small
-          dt_1d = old_dt_1d
-       ENDIF
-
-    ELSE    ! Runge-Kutta
-
-!--    A more or less simple new time step value is obtained taking only the
-!--    first two significant digits
-       div = 1000.0
-       DO  WHILE ( dt_1d < div )
-          div = div / 10.0
-       ENDDO
-       dt_1d = NINT( dt_1d * 100.0 / div ) * div / 100.0
-
-       old_dt_1d = dt_1d
-       last_dt_change_1d = current_timestep_number_1d
-
-    ENDIF
+!
+!-- A more or less simple new time step value is obtained taking only the
+!-- first two significant digits
+    div = 1000.0
+    DO  WHILE ( dt_1d < div )
+       div = div / 10.0
+    ENDDO
+    dt_1d = NINT( dt_1d * 100.0 / div ) * div / 100.0
+
+    old_dt_1d = dt_1d
+
 
  END SUBROUTINE timestep_1d
Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 997)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 1001)
@@ -7,5 +7,5 @@
 ! Current revisions:
 ! ------------------
-!
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -225,23 +225,10 @@
     ALLOCATE( ptdf_x(nxlg:nxrg), ptdf_y(nysg:nyng) )
 
-    ALLOCATE( rif_1(nysg:nyng,nxlg:nxrg), shf_1(nysg:nyng,nxlg:nxrg), &
-              ts(nysg:nyng,nxlg:nxrg), tswst_1(nysg:nyng,nxlg:nxrg),  &
-              us(nysg:nyng,nxlg:nxrg), usws_1(nysg:nyng,nxlg:nxrg),   &
-              uswst_1(nysg:nyng,nxlg:nxrg),                           &
-              vsws_1(nysg:nyng,nxlg:nxrg),                            &
-              vswst_1(nysg:nyng,nxlg:nxrg), z0(nysg:nyng,nxlg:nxrg),  &
+    ALLOCATE( rif(nysg:nyng,nxlg:nxrg), shf(nysg:nyng,nxlg:nxrg),     &
+              ts(nysg:nyng,nxlg:nxrg), tswst(nysg:nyng,nxlg:nxrg),    &
+              us(nysg:nyng,nxlg:nxrg), usws(nysg:nyng,nxlg:nxrg),     &
+              uswst(nysg:nyng,nxlg:nxrg), vsws(nysg:nyng,nxlg:nxrg),  &
+              vswst(nysg:nyng,nxlg:nxrg), z0(nysg:nyng,nxlg:nxrg),    &
               z0h(nysg:nyng,nxlg:nxrg) )
-
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-!
-!--    Leapfrog scheme needs two timelevels of diffusion quantities
-       ALLOCATE( rif_2(nysg:nyng,nxlg:nxrg),   &
-                 shf_2(nysg:nyng,nxlg:nxrg),   &
-                 tswst_2(nysg:nyng,nxlg:nxrg), &
-                 usws_2(nysg:nyng,nxlg:nxrg),  &
-                 uswst_2(nysg:nyng,nxlg:nxrg), &
-                 vswst_2(nysg:nyng,nxlg:nxrg), &
-                 vsws_2(nysg:nyng,nxlg:nxrg) )
-    ENDIF
 
     ALLOCATE( d(nzb+1:nzta,nys:nyna,nxl:nxra),     &
@@ -249,6 +236,6 @@
               e_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
               e_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
-              kh_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
-              km_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
+              kh(nzb:nzt+1,nysg:nyng,nxlg:nxrg),   &
+              km(nzb:nzt+1,nysg:nyng,nxlg:nxrg),   &
               p(nzb:nzt+1,nysg:nyng,nxlg:nxrg),    &
               pt_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
@@ -278,20 +265,11 @@
     ENDIF
 
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-       ALLOCATE( kh_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
-                 km_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-    ENDIF
-
     IF ( humidity  .OR.  passive_scalar ) THEN
 !
 !--    2D-humidity/scalar arrays
-       ALLOCATE ( qs(nysg:nyng,nxlg:nxrg),     &
-                  qsws_1(nysg:nyng,nxlg:nxrg), &
-                  qswst_1(nysg:nyng,nxlg:nxrg) )
-
-       IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-          ALLOCATE( qsws_2(nysg:nyng,nxlg:nxrg), &
-                    qswst_2(nysg:nyng,nxlg:nxrg) )
-       ENDIF
+       ALLOCATE ( qs(nysg:nyng,nxlg:nxrg),   &
+                  qsws(nysg:nyng,nxlg:nxrg), &
+                  qswst(nysg:nyng,nxlg:nxrg) )
+
 !
 !--    3D-humidity/scalar arrays
@@ -304,8 +282,4 @@
        IF ( humidity )  THEN
           ALLOCATE( vpt_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-
-          IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-             ALLOCATE( vpt_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-          ENDIF
 
           IF ( cloud_physics ) THEN
@@ -334,6 +308,6 @@
 
     IF ( ocean )  THEN
-       ALLOCATE( saswsb_1(nysg:nyng,nxlg:nxrg), &
-                 saswst_1(nysg:nyng,nxlg:nxrg) )
+       ALLOCATE( saswsb(nysg:nyng,nxlg:nxrg), &
+                 saswst(nysg:nyng,nxlg:nxrg) )
        ALLOCATE( prho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &
                  rho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg),  &
@@ -434,70 +408,24 @@
 !
 !-- Initial assignment of the pointers
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-
-       rif_m   => rif_1;    rif   => rif_2
-       shf_m   => shf_1;    shf   => shf_2
-       tswst_m => tswst_1;  tswst => tswst_2
-       usws_m  => usws_1;   usws  => usws_2
-       uswst_m => uswst_1;  uswst => uswst_2
-       vsws_m  => vsws_1;   vsws  => vsws_2
-       vswst_m => vswst_1;  vswst => vswst_2
-       e_m  => e_1;   e  => e_2;   e_p  => e_3;   te_m  => e_3
-       kh_m => kh_1;  kh => kh_2
-       km_m => km_1;  km => km_2
-       pt_m => pt_1;  pt => pt_2;  pt_p => pt_3;  tpt_m => pt_3
-       u_m  => u_1;   u  => u_2;   u_p  => u_3;   tu_m  => u_3
-       v_m  => v_1;   v  => v_2;   v_p  => v_3;   tv_m  => v_3
-       w_m  => w_1;   w  => w_2;   w_p  => w_3;   tw_m  => w_3
-
-       IF ( humidity  .OR.  passive_scalar )  THEN
-          qsws_m  => qsws_1;   qsws  => qsws_2
-          qswst_m => qswst_1;  qswst => qswst_2
-          q_m    => q_1;     q    => q_2;     q_p => q_3;     tq_m => q_3
-          IF ( humidity )        vpt_m  => vpt_1;   vpt  => vpt_2
-          IF ( cloud_physics )   ql   => ql_1
-          IF ( cloud_droplets )  THEN
-             ql   => ql_1
-             ql_c => ql_2
-          ENDIF
-       ENDIF
-
-    ELSE
-
-       rif   => rif_1
-       shf   => shf_1
-       tswst => tswst_1
-       usws  => usws_1
-       uswst => uswst_1
-       vsws  => vsws_1
-       vswst => vswst_1
-       e     => e_1;   e_p  => e_2;   te_m  => e_3;   e_m  => e_3
-       kh    => kh_1
-       km    => km_1
-       pt    => pt_1;  pt_p => pt_2;  tpt_m => pt_3;  pt_m => pt_3
-       u     => u_1;   u_p  => u_2;   tu_m  => u_3;   u_m  => u_3
-       v     => v_1;   v_p  => v_2;   tv_m  => v_3;   v_m  => v_3
-       w     => w_1;   w_p  => w_2;   tw_m  => w_3;   w_m  => w_3
-
-       IF ( humidity  .OR.  passive_scalar )  THEN
-          qsws   => qsws_1
-          qswst  => qswst_1
-          q      => q_1;     q_p  => q_2;     tq_m  => q_3;    q_m => q_3
-          IF ( humidity )        vpt  => vpt_1
-          IF ( cloud_physics )   ql   => ql_1
-          IF ( cloud_droplets )  THEN
-             ql   => ql_1
-             ql_c => ql_2
-          ENDIF
-       ENDIF
-
-       IF ( ocean )  THEN
-          saswsb => saswsb_1
-          saswst => saswst_1
-          sa     => sa_1;    sa_p => sa_2;    tsa_m => sa_3
-       ENDIF
-
-    ENDIF
-    
+    e  => e_1;   e_p  => e_2;   te_m  => e_3
+    pt => pt_1;  pt_p => pt_2;  tpt_m => pt_3
+    u  => u_1;   u_p  => u_2;   tu_m  => u_3
+    v  => v_1;   v_p  => v_2;   tv_m  => v_3
+    w  => w_1;   w_p  => w_2;   tw_m  => w_3
+
+    IF ( humidity  .OR.  passive_scalar )  THEN
+       q => q_1;  q_p => q_2;  tq_m => q_3
+       IF ( humidity )        vpt  => vpt_1
+       IF ( cloud_physics )   ql   => ql_1
+       IF ( cloud_droplets )  THEN
+          ql   => ql_1
+          ql_c => ql_2
+       ENDIF
+    ENDIF
+
+    IF ( ocean )  THEN
+       sa => sa_1;  sa_p => sa_2;  tsa_m => sa_3
+    ENDIF
+
 !
 !-- Allocate arrays containing the RK coefficient for calculation of 
@@ -785,5 +713,4 @@
                 ENDIF
              ENDIF
-             IF ( ASSOCIATED( shf_m ) )  shf_m = shf
           ENDIF
 
@@ -806,5 +733,4 @@
                    ENDDO
                 ENDIF
-                IF ( ASSOCIATED( qsws_m ) )  qsws_m = qsws
              ENDIF
           ENDIF
@@ -822,10 +748,6 @@
 !--          Heat flux is prescribed
              tswst = top_heatflux
-             IF ( ASSOCIATED( tswst_m ) )  tswst_m = tswst
-
-             IF ( humidity  .OR.  passive_scalar )  THEN
-                qswst = 0.0
-                IF ( ASSOCIATED( qswst_m ) )  qswst_m = qswst
-             ENDIF
+
+             IF ( humidity  .OR.  passive_scalar )  qswst = 0.0
 
              IF ( ocean )  THEN
@@ -839,5 +761,4 @@
           IF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
              tswst = 0.0
-             IF ( ASSOCIATED( tswst_m ) )  tswst_m = tswst
           ENDIF
 
@@ -859,12 +780,8 @@
 !--          value in the course of the first few time steps.
              shf   = 0.0
-             IF ( ASSOCIATED( shf_m ) )  shf_m = 0.0
           ENDIF
 
           IF ( humidity  .OR.  passive_scalar )  THEN
-             IF ( .NOT. constant_waterflux )  THEN
-                qsws   = 0.0
-                IF ( ASSOCIATED( qsws_m ) )   qsws_m = 0.0
-             ENDIF
+             IF ( .NOT. constant_waterflux )  qsws   = 0.0
           ENDIF
 
@@ -923,16 +840,10 @@
 !
 !--    Initialize old and new time levels.
-       IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-          e_m = e; pt_m = pt; u_m = u; v_m = v; w_m = w; kh_m = kh; km_m = km
-       ELSE
-          te_m = 0.0; tpt_m = 0.0; tu_m = 0.0; tv_m = 0.0; tw_m = 0.0
-       ENDIF
+       te_m = 0.0; tpt_m = 0.0; tu_m = 0.0; tv_m = 0.0; tw_m = 0.0
        e_p = e; pt_p = pt; u_p = u; v_p = v; w_p = w
 
        IF ( humidity  .OR.  passive_scalar )  THEN
-          IF ( ASSOCIATED( q_m ) )  q_m = q
-          IF ( timestep_scheme(1:5) == 'runge' )  tq_m = 0.0
+          tq_m = 0.0
           q_p = q
-          IF ( humidity  .AND.  ASSOCIATED( vpt_m ) )  vpt_m = vpt
        ENDIF
 
@@ -1080,40 +991,17 @@
 !--       Other scalars (pt, q, s, km, kh, p, sa, ...) are ignored at present,
 !--       maybe revise later.
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             DO  i = nxlg, nxrg
-                DO  j = nysg, nyng
-                   u  (nzb:nzb_u_inner(j,i),j,i)   = 0.0
-                   v  (nzb:nzb_v_inner(j,i),j,i)   = 0.0
-                   w  (nzb:nzb_w_inner(j,i),j,i)   = 0.0
-                   e  (nzb:nzb_w_inner(j,i),j,i)   = 0.0
-                   u_m(nzb:nzb_u_inner(j,i),j,i)   = 0.0
-                   v_m(nzb:nzb_v_inner(j,i),j,i)   = 0.0
-                   w_m(nzb:nzb_w_inner(j,i),j,i)   = 0.0
-                   e_m(nzb:nzb_w_inner(j,i),j,i)   = 0.0
-                   tu_m(nzb:nzb_u_inner(j,i),j,i)  = 0.0
-                   tv_m(nzb:nzb_v_inner(j,i),j,i)  = 0.0
-                   tw_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0
-                   te_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0
-                   tpt_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                ENDDO
-             ENDDO
-          ELSE
-             DO  i = nxlg, nxrg
-                DO  j = nysg, nyng
-                   u  (nzb:nzb_u_inner(j,i),j,i) = 0.0
-                   v  (nzb:nzb_v_inner(j,i),j,i) = 0.0
-                   w  (nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   e  (nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   u_m(nzb:nzb_u_inner(j,i),j,i) = 0.0
-                   v_m(nzb:nzb_v_inner(j,i),j,i) = 0.0
-                   w_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   e_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   u_p(nzb:nzb_u_inner(j,i),j,i) = 0.0
-                   v_p(nzb:nzb_v_inner(j,i),j,i) = 0.0
-                   w_p(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                   e_p(nzb:nzb_w_inner(j,i),j,i) = 0.0
-                ENDDO
-             ENDDO
-          ENDIF
+          DO  i = nxlg, nxrg
+             DO  j = nysg, nyng
+                u  (nzb:nzb_u_inner(j,i),j,i)   = 0.0
+                v  (nzb:nzb_v_inner(j,i),j,i)   = 0.0
+                w  (nzb:nzb_w_inner(j,i),j,i)   = 0.0
+                e  (nzb:nzb_w_inner(j,i),j,i)   = 0.0
+                tu_m(nzb:nzb_u_inner(j,i),j,i)  = 0.0
+                tv_m(nzb:nzb_v_inner(j,i),j,i)  = 0.0
+                tw_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0
+                te_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0
+                tpt_m(nzb:nzb_w_inner(j,i),j,i) = 0.0
+             ENDDO
+          ENDDO
 
        ENDIF
@@ -1135,9 +1023,7 @@
 !--    have to be predefined here because they are used (but multiplied with 0)
 !--    there before they are set. 
-       IF ( timestep_scheme(1:5) == 'runge' )  THEN
-          te_m = 0.0; tpt_m = 0.0; tu_m = 0.0; tv_m = 0.0; tw_m = 0.0
-          IF ( humidity  .OR.  passive_scalar )  tq_m = 0.0
-          IF ( ocean )  tsa_m = 0.0
-       ENDIF
+       te_m = 0.0; tpt_m = 0.0; tu_m = 0.0; tv_m = 0.0; tw_m = 0.0
+       IF ( humidity  .OR.  passive_scalar )  tq_m = 0.0
+       IF ( ocean )  tsa_m = 0.0
 
     ELSE
@@ -1424,6 +1310,4 @@
           shf(:,:) = canopy_heat_flux(0,:,:)
 
-          IF ( ASSOCIATED( shf_m ) )  shf_m = shf
-
        ENDIF
 
@@ -1477,5 +1361,5 @@
        weight_pres(2)    = 1./2.        
 
-    ELSE                                     ! for Euler- and leapfrog-method
+    ELSE                                     ! for Euler-method
 
        weight_substep(1) = 1.0      
Index: palm/trunk/SOURCE/init_advec.f90
===================================================================
--- palm/trunk/SOURCE/init_advec.f90	(revision 997)
+++ palm/trunk/SOURCE/init_advec.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! all actions concerning upstream-spline-method removed
 !
 ! Former revisions:
@@ -80,157 +80,3 @@
     ENDIF
 
-    IF ( momentum_advec == 'ups-scheme' .OR. scalar_advec  == 'ups-scheme' )  &
-    THEN
-
-!
-!--    Provide the constant parameters for the Upstream-Spline advection scheme.
-!--    In x- und y-direction the Sherman-Morrison formula is applied
-!--    (cf. Press et al, 1986 (Numerical Recipes)).
-!
-!--    Allocate nonlocal arrays
-       ALLOCATE( spl_z_x(0:nx), spl_z_y(0:ny), spl_tri_x(5,0:nx), &
-                 spl_tri_y(5,0:ny), spl_tri_zu(5,nzb:nzt+1),      &
-                 spl_tri_zw(5,nzb:nzt+1) )
-
-!
-!--    Provide diagonal elements of the tridiagonal matrices for all 
-!--    directions
-       spl_tri_x(1,:)  = 2.0
-       spl_tri_y(1,:)  = 2.0
-       spl_tri_zu(1,:) = 2.0
-       spl_tri_zw(1,:) = 2.0
-
-!
-!--    Elements of the cyclic tridiagonal matrix
-!--    (same for all horizontal directions)
-       spl_alpha = 0.5
-       spl_beta  = 0.5
-
-!
-!--    Sub- and superdiagonal elements, x-direction
-       spl_tri_x(2,0:nx) = 0.5
-       spl_tri_x(3,0:nx) = 0.5
-
-!
-!--    mMdify the diagonal elements (Sherman-Morrison)
-       spl_gamma_x    = -spl_tri_x(1,0)
-       spl_tri_x(1,0)  = spl_tri_x(1,0) - spl_gamma_x
-       spl_tri_x(1,nx) = spl_tri_x(1,nx) - spl_alpha * spl_beta / spl_gamma_x
-
-!
-!--    Split the tridiagonal matrix for Thomas algorithm
-       spl_tri_x(4,0) = spl_tri_x(1,0)
-       DO  i = 1, nx
-          spl_tri_x(5,i) = spl_tri_x(2,i) / spl_tri_x(4,i-1)
-          spl_tri_x(4,i) = spl_tri_x(1,i) - spl_tri_x(5,i) * spl_tri_x(3,i-1)
-       ENDDO
-
-!
-!--    Allocate arrays required locally
-       ALLOCATE( temp(0:nx), spl_u(0:nx) )
-
-!
-!--    Provide "corrective vector", x-direction
-       spl_u(0)      = spl_gamma_x
-       spl_u(1:nx-1) = 0.0
-       spl_u(nx)     = spl_alpha
-
-!
-!--    Solve the system of equations for the corrective vector
-!--    (Sherman-Morrison)
-       temp(0) = spl_u(0)
-       DO  i = 1, nx
-          temp(i) = spl_u(i) - spl_tri_x(5,i) * temp(i-1)
-       ENDDO
-       spl_z_x(nx) = temp(nx) / spl_tri_x(4,nx)
-       DO  i = nx-1, 0, -1
-          spl_z_x(i) = ( temp(i) - spl_tri_x(3,i) * spl_z_x(i+1) ) / &
-                       spl_tri_x(4,i)
-       ENDDO
-
-!
-!--    Deallocate local arrays, for they are allocated in a different way for
-!--    operations in y-direction
-       DEALLOCATE( temp, spl_u )    
-    
-!
-!--    Provide sub- and superdiagonal elements, y-direction
-       spl_tri_y(2,0:ny) = 0.5
-       spl_tri_y(3,0:ny) = 0.5
-
-!
-!--    Modify the diagonal elements (Sherman-Morrison)
-       spl_gamma_y    = -spl_tri_y(1,0) 
-       spl_tri_y(1,0)  = spl_tri_y(1,0) - spl_gamma_y
-       spl_tri_y(1,ny) = spl_tri_y(1,ny) - spl_alpha * spl_beta / spl_gamma_y
-
-!
-!--    Split the tridiagonal matrix for Thomas algorithm
-       spl_tri_y(4,0) = spl_tri_y(1,0)
-       DO  j = 1, ny
-          spl_tri_y(5,j) = spl_tri_y(2,j) / spl_tri_y(4,j-1)
-          spl_tri_y(4,j) = spl_tri_y(1,j) - spl_tri_y(5,j) * spl_tri_y(3,j-1)
-       ENDDO
-
-!
-!--    Allocate arrays required locally
-       ALLOCATE( temp(0:ny), spl_u(0:ny) )
-
-!
-!--    Provide "corrective vector", y-direction
-       spl_u(0)      = spl_gamma_y
-       spl_u(1:ny-1) = 0.0
-       spl_u(ny)     = spl_alpha
-    
-!
-!--    Solve the system of equations for the corrective vector
-!--    (Sherman-Morrison)
-       temp = 0.0
-       spl_z_y = 0.0
-       temp(0) = spl_u(0)
-       DO  j = 1, ny
-          temp(j) = spl_u(j) - spl_tri_y(5,j) * temp(j-1)
-       ENDDO
-       spl_z_y(ny) = temp(ny) / spl_tri_y(4,ny)
-       DO  j = ny-1, 0, -1
-          spl_z_y(j) = ( temp(j) - spl_tri_y(3,j) * spl_z_y(j+1) ) / &
-                       spl_tri_y(4,j)
-       ENDDO
-
-!
-!--    deallocate local arrays, for they are no longer required
-       DEALLOCATE( temp, spl_u )
-
-!
-!--    provide sub- and superdiagonal elements, z-direction
-       spl_tri_zu(2,nzb)   = 0.0
-       spl_tri_zu(2,nzt+1) = 1.0
-       spl_tri_zw(2,nzb)   = 0.0
-       spl_tri_zw(2,nzt+1) = 1.0
-
-       spl_tri_zu(3,nzb)   = 1.0
-       spl_tri_zu(3,nzt+1) = 0.0
-       spl_tri_zw(3,nzb)   = 1.0
-       spl_tri_zw(3,nzt+1) = 0.0
-
-       DO  k = nzb+1, nzt
-          spl_tri_zu(2,k) = dzu(k) / ( dzu(k) + dzu(k+1) )
-          spl_tri_zw(2,k) = dzw(k) / ( dzw(k) + dzw(k+1) )
-          spl_tri_zu(3,k) = 1.0 - spl_tri_zu(2,k)
-          spl_tri_zw(3,k) = 1.0 - spl_tri_zw(2,k)
-       ENDDO
-    
-       spl_tri_zu(4,nzb) = spl_tri_zu(1,nzb)
-       spl_tri_zw(4,nzb) = spl_tri_zw(1,nzb)
-       DO  k = nzb+1, nzt+1
-          spl_tri_zu(5,k) = spl_tri_zu(2,k) / spl_tri_zu(4,k-1)
-          spl_tri_zw(5,k) = spl_tri_zw(2,k) / spl_tri_zw(4,k-1)
-          spl_tri_zu(4,k) = spl_tri_zu(1,k) - spl_tri_zu(5,k) * &
-                            spl_tri_zu(3,k-1)
-          spl_tri_zw(4,k) = spl_tri_zw(1,k) - spl_tri_zw(5,k) * &
-                            spl_tri_zw(3,k-1)
-       ENDDO
-
-    ENDIF
-
  END SUBROUTINE init_advec
Index: palm/trunk/SOURCE/init_pegrid.f90
===================================================================
--- palm/trunk/SOURCE/init_pegrid.f90	(revision 997)
+++ palm/trunk/SOURCE/init_pegrid.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! all actions concerning upstream-spline-method removed
 !
 ! Former revisions:
@@ -384,16 +384,7 @@
 !
 !-- 1. transposition  z --> x
-!-- This transposition is not neccessary in case of a 1d-decomposition along x,
-!-- except that the uptream-spline method is switched on
-    IF ( pdims(2) /= 1  .OR.  momentum_advec == 'ups-scheme'  .OR. &
-         scalar_advec == 'ups-scheme' )  THEN
-
-       IF ( pdims(2) == 1  .AND. ( momentum_advec == 'ups-scheme'  .OR. &
-            scalar_advec == 'ups-scheme' ) )  THEN
-          message_string = '1d-decomposition along x ' // &
-                           'chosen but nz restrictions may occur' // &
-                           '& since ups-scheme is activated'
-          CALL message( 'init_pegrid', 'PA0229', 0, 1, 0, 6, 0 )
-       ENDIF
+!-- This transposition is not neccessary in case of a 1d-decomposition along x
+    IF ( pdims(2) /= 1 )  THEN
+
        nys_x  = nys
        nyn_xa = nyna
@@ -448,6 +439,5 @@
 !-- 3. transposition  y --> z  (ELSE:  x --> y  in case of 1D-decomposition
 !-- along x)
-    IF ( pdims(2) /= 1  .OR.  momentum_advec == 'ups-scheme'  .OR. &
-         scalar_advec == 'ups-scheme' )  THEN
+    IF ( pdims(2) /= 1 )  THEN
 !
 !--    y --> z
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 997)
+++ palm/trunk/SOURCE/modules.f90	(revision 1001)
@@ -4,5 +4,7 @@
 ! Current revisions:
 ! -----------------
-!
+! -asselin_filter_factor, cut_spline_overshoot, dt_changed, last_dt_change,
+! last_dt_change_1d, long_filter_factor, overshoot_limit_*, ups_limit_*
+! several pointer/target arrays converted to normal ones
 !
 ! Former revisions:
@@ -343,16 +345,7 @@
           diss_s_v, diss_s_w, dzu_mg, dzw_mg, flux_s_e, flux_s_pt, flux_s_q,   &
           flux_s_sa, flux_s_u, flux_s_v, flux_s_w, f1_mg, f2_mg, f3_mg,        &
-          mean_inflow_profiles, pt_slope_ref, qs, qswst_remote, total_2d_a,    &
-          total_2d_o, ts, us, z0, z0h
-
-    REAL, DIMENSION(:,:), ALLOCATABLE, TARGET ::                               &
-          qsws_1, qsws_2, qswst_1, qswst_2, rif_1, rif_2, saswsb_1, saswst_1,  &
-          shf_1, shf_2, tswst_1, tswst_2, usws_1, usws_2, uswst_1, uswst_2,    &
-          vsws_1, vsws_2, vswst_1, vswst_2
-
-    REAL, DIMENSION(:,:), POINTER ::                                           &
-          qsws, qsws_m, qswst, qswst_m, rif, rif_m, saswsb, saswst, shf,       &
-          shf_m, tswst, tswst_m, usws, uswst, usws_m, uswst_m, vsws, vswst,    &
-          vsws_m, vswst_m
+          mean_inflow_profiles, pt_slope_ref, qs, qsws, qswst, qswst_remote,   &
+          rif, saswsb, saswst, shf, total_2d_a, total_2d_o, ts, tswst, us,     &
+          usws, uswst, vsws, vswst, z0, z0h
 
     REAL, DIMENSION(:,:,:), ALLOCATABLE ::                                     &
@@ -360,20 +353,16 @@
           diss_l_pt, diss_l_q, diss_l_sa, diss_l_u, diss_l_v, diss_l_w,        &
           flux_l_e, flux_l_pt, flux_l_q, flux_l_sa, flux_l_u, flux_l_v,        &
-          flux_l_w, lad_s, lad_u, lad_v, lad_w, lai, l_wall, p_loc, sec, sls,  &
-          tend, u_m_l, u_m_n, u_m_r, u_m_s, v_m_l, v_m_n, v_m_r, v_m_s, w_m_l, &
-          w_m_n, w_m_r, w_m_s
+          flux_l_w, kh, km, lad_s, lad_u, lad_v, lad_w, lai, l_wall, p_loc,    &
+          sec, sls, tend, u_m_l, u_m_n, u_m_r, u_m_s, v_m_l, v_m_n, v_m_r,     &
+          v_m_s, w_m_l, w_m_n, w_m_r, w_m_s
 
     REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::                             &
-          ql_v, ql_vp
-
-    REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::                             &
-          e_1, e_2, e_3, kh_1, kh_2, km_1, km_2, p, prho_1, pt_1, pt_2, pt_3,  &
-          q_1, q_2, q_3, ql_1, ql_2, rho_1, sa_1, sa_2, sa_3, u_1, u_2, u_3,   &
-          v_1, v_2, v_3, vpt_1, vpt_2, w_1, w_2, w_3
+          e_1, e_2, e_3, p, prho_1, pt_1, pt_2, pt_3, q_1, q_2, q_3, ql_v,     &
+          ql_vp, ql_1, ql_2, rho_1, sa_1, sa_2, sa_3, u_1, u_2, u_3,           &
+          v_1, v_2, v_3, vpt_1, w_1, w_2, w_3
 
     REAL, DIMENSION(:,:,:), POINTER ::                                         &
-          e, e_m, e_p, kh, kh_m, km, km_m, prho, pt, pt_m, pt_p, q, q_m, q_p,  &
-          ql, ql_c, rho, sa, sa_p, te_m, tpt_m, tq_m, tsa_m, tu_m, tv_m, tw_m, &
-          u, u_m, u_p, v, v_m, v_p, vpt, vpt_m, w, w_m, w_p
+          e, e_p, prho, pt, pt_p, q, q_p, ql, ql_c, rho, sa, sa_p, te_m,       &
+          tpt_m, tq_m, tsa_m, tu_m, tv_m, tw_m, u, u_p, v, v_p, vpt, w, w_p
 
     REAL, DIMENSION(:,:,:,:), ALLOCATABLE ::  rif_wall
@@ -555,5 +544,5 @@
                 intermediate_timestep_count, intermediate_timestep_count_max, &
                 io_group = 0, io_blocks = 1, iran = -1234567, &
-                last_dt_change = 0, masks = 0, maximum_grid_level, &
+                masks = 0, maximum_grid_level, &
                 maximum_parallel_io_streams = -1, max_pr_user = 0, &
                 mgcycles = 0, mg_cycles = -1, mg_switch_to_pe0_level = 0, mid, &
@@ -605,11 +594,9 @@
                 constant_top_salinityflux = .TRUE., &
                 constant_waterflux = .TRUE., create_disturbances = .TRUE., &
-                cut_spline_overshoot = .TRUE., &
                 data_output_2d_on_each_pe = .TRUE., & 
                 dissipation_control = .FALSE., disturbance_created = .FALSE., &
                 do2d_at_begin = .FALSE., do3d_at_begin = .FALSE., &
                 do3d_compress = .FALSE., do_sum = .FALSE., &
-                dp_external = .FALSE., dp_smooth = .FALSE., &
-                dt_changed = .FALSE., dt_fixed = .FALSE., &
+                dp_external = .FALSE., dp_smooth = .FALSE., dt_fixed = .FALSE., &
                 dt_3d_reached, dt_3d_reached_l, exchange_mg = .FALSE., &
                 first_call_lpm = .TRUE., &
@@ -640,6 +627,5 @@
 
     REAL ::  advected_distance_x = 0.0, advected_distance_y = 0.0, &
-             alpha_surface = 0.0, asselin_filter_factor = 0.1, &
-             atmos_ocean_sign = 1.0, &
+             alpha_surface = 0.0, atmos_ocean_sign = 1.0, &
              averaging_interval = 0.0, averaging_interval_pr = 9999999.9, &
              averaging_interval_sp = 9999999.9, bc_pt_t_val, bc_q_t_val, &
@@ -671,13 +657,10 @@
              f = 0.0, fs = 0.0, g = 9.81, inflow_damping_height = 9999999.9, &
              inflow_damping_width = 9999999.9, kappa = 0.4, km_constant = -1.0,&
-             lad_surface = 0.0,  &
-             leaf_surface_concentration = 0.0, long_filter_factor = 0.0, &
+             lad_surface = 0.0, leaf_surface_concentration = 0.0, &
              mask_scale_x = 1.0, mask_scale_y = 1.0, mask_scale_z = 1.0, &
              maximum_cpu_time_allowed = 0.0,  &
              molecular_viscosity = 1.461E-5, &
              old_dt = 1.0E-10, omega = 7.29212E-5, omega_sor = 1.8, &
-             overshoot_limit_e = 0.0, overshoot_limit_pt = 0.0, &
-             overshoot_limit_u = 0.0, overshoot_limit_v = 0.0, &
-             overshoot_limit_w = 0.0, particle_maximum_age = 9999999.9, &
+             particle_maximum_age = 9999999.9, &
              phi = 55.0, prandtl_number = 1.0, &
              precipitation_amount_interval = 9999999.9, prho_reference, &
@@ -710,6 +693,5 @@
              top_momentumflux_v = 9999999.9, top_salinityflux = 9999999.9, &
              ug_surface = 0.0, u_bulk = 0.0, u_gtrans = 0.0, &
-             ups_limit_e = 0.0, ups_limit_pt = 0.0, ups_limit_u = 0.0, &
-             ups_limit_v = 0.0, ups_limit_w = 0.0, vg_surface = 0.0, &
+             vg_surface = 0.0, &
              v_bulk = 0.0, v_gtrans = 0.0, wall_adjustment_factor = 1.8, &
              z_max_do2d = -1.0, z0h_factor = 1.0
@@ -730,5 +712,5 @@
              skip_time_domask(max_masks) = 9999999.9, threshold(20) = 0.0, &
              time_domask(max_masks) = 0.0, &
-             tsc(10) = (/ 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /), &
+             tsc(10) = (/ 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /), &
              u_profile(100) = 9999999.9, uv_heights(100) = 9999999.9, &
              v_profile(100) = 9999999.9, &
@@ -1060,6 +1042,5 @@
 !------------------------------------------------------------------------------!
 
-    INTEGER ::  current_timestep_number_1d = 0, damp_level_ind_1d, &
-                last_dt_change_1d = 0 
+    INTEGER ::  current_timestep_number_1d = 0, damp_level_ind_1d
 
     LOGICAL ::  run_control_header_1d = .FALSE., stop_dt_1d = .FALSE. 
@@ -1069,12 +1050,11 @@
                 end_time_1d = 864000.0, old_dt_1d = 1.0E-10, &
                 qs1d, simulated_time_1d = 0.0, time_pr_1d = 0.0, &
-                time_run_control_1d = 0.0, ts1d, us1d, usws1d, usws1d_m, &
-                vsws1d, vsws1d_m, z01d, z0h1d
-
-
-    REAL, DIMENSION(:), ALLOCATABLE ::  e1d, e1d_m, e1d_p, kh1d, kh1d_m, km1d, &
-                                        km1d_m, l_black, l1d, l1d_m, rif1d,    &
-                                        te_e, te_em, te_u, te_um, te_v, te_vm, &
-                                        u1d, u1d_m, u1d_p, v1d, v1d_m, v1d_p
+                time_run_control_1d = 0.0, ts1d, us1d, usws1d, &
+                vsws1d, z01d, z0h1d
+
+
+    REAL, DIMENSION(:), ALLOCATABLE ::  e1d, e1d_p, kh1d, km1d, l_black, l1d,  &
+                                        rif1d, te_e, te_em, te_u, te_um, te_v, &
+                                        te_vm, u1d, u1d_p, v1d, v1d_p
 
     SAVE
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 997)
+++ palm/trunk/SOURCE/parin.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! -cut_spline_overshoot, long_filter_factor, overshoot_limit_*, ups_limit_*
 !
 ! Former revisions:
@@ -168,5 +168,4 @@
              collective_wait, conserve_volume_flow, conserve_volume_flow_mode, &
              coupling_start_time, cthf, curvature_solution_effects, &
-             cut_spline_overshoot, &
              cycle_mg, damp_level_1d, dissipation_1d, & !dissipation_control, &
              dp_external, dp_level_b, dp_smooth, dpdxy, drag_coefficient, &
@@ -178,11 +177,9 @@
              initializing_actions, km_constant, lad_surface, &
              lad_vertical_gradient, lad_vertical_gradient_level, &
-             leaf_surface_concentration, long_filter_factor, &
+             leaf_surface_concentration, &
              loop_optimization, masking_method, mg_cycles, &
              mg_switch_to_pe0_level, mixing_length_1d, momentum_advec, &
              netcdf_precision, neutral, ngsrb, nsor, &
              nsor_ini, nx, ny, nz, ocean, omega, omega_sor, &
-             overshoot_limit_e, overshoot_limit_pt, &
-             overshoot_limit_u, overshoot_limit_v, overshoot_limit_w, &
              passive_scalar, pch_index, phi, plant_canopy, prandtl_layer, &
              prandtl_number, precipitation, psolver, pt_damping_factor, &
@@ -204,6 +201,5 @@
              top_momentumflux_u, top_momentumflux_v, top_salinityflux, &
              turbulent_inflow, ug_surface, ug_vertical_gradient, &
-             ug_vertical_gradient_level, ups_limit_e, ups_limit_pt, &
-             ups_limit_u, ups_limit_v, ups_limit_w, use_surface_fluxes, &
+             ug_vertical_gradient_level, use_surface_fluxes, &
              use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke, &
              uv_heights, u_bulk, u_profile, vg_surface, vg_vertical_gradient, &
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 997)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! all actions concerning leapfrog- and upstream-spline-scheme removed
 !
 ! Former revisions:
@@ -163,5 +163,5 @@
     CHARACTER (LEN=9) ::  time_to_string
     INTEGER ::  i, i_omp_start, j, k, tn = 0
-    REAL    ::  sat, sbt
+    REAL    ::  sbt
 
 !
@@ -178,13 +178,4 @@
     CALL cpu_log( log_point(5), 'u-equation', 'start' )
 
-!
-!-- u-tendency terms with communication
-    IF ( momentum_advec == 'ups-scheme' )  THEN
-       tend = 0.0
-       CALL advec_u_ups
-    ENDIF
-
-!
-!-- u-tendency terms with no communication
     i_omp_start = nxlu
     DO  i = nxlu, nxr
@@ -192,6 +183,6 @@
 !
 !--       Tendency terms
-          IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-             tend(:,j,i) = 0.0
+          tend(:,j,i) = 0.0
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_mom )  THEN
                  CALL advec_u_ws( i, j, i_omp_start, tn )
@@ -199,18 +190,8 @@
                  CALL advec_u_pw( i, j )
              ENDIF
-
           ELSE
-             IF ( momentum_advec /= 'ups-scheme' )  THEN
-                tend(:,j,i) = 0.0
-                CALL advec_u_up( i, j )
-             ENDIF
-          ENDIF
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             CALL diffusion_u( i, j, ddzu, ddzw, km_m, tend, u_m, usws_m, &
-                               uswst_m, v_m, w_m )
-          ELSE
-             CALL diffusion_u( i, j, ddzu, ddzw, km, tend, u, usws, uswst, &
-                               v, w )
-          ENDIF
+             CALL advec_u_up( i, j )
+          ENDIF
+          CALL diffusion_u( i, j )
           CALL coriolis( i, j, 1 )
           IF ( sloping_surface  .AND.  .NOT. neutral )  THEN
@@ -235,9 +216,7 @@
 !--       Prognostic equation for u-velocity component
           DO  k = nzb_u_inner(j,i)+1, nzt
-             u_p(k,j,i) = ( 1.0-tsc(1) ) * u_m(k,j,i) + tsc(1) * u(k,j,i) +    &
-                          dt_3d * (                                            &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tu_m(k,j,i) &
-                                  ) -                                          &
-                           tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
+             u_p(k,j,i) = u(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
+                                               tsc(3) * tu_m(k,j,i) )          &
+                                   - tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
           ENDDO
 
@@ -266,13 +245,4 @@
     CALL cpu_log( log_point(6), 'v-equation', 'start' )
 
-!
-!-- v-tendency terms with communication
-    IF ( momentum_advec == 'ups-scheme' )  THEN
-       tend = 0.0
-       CALL advec_v_ups
-    ENDIF
-
-!
-!-- v-tendency terms with no communication
     i_omp_start = nxl
     DO  i = nxl, nxr
@@ -280,6 +250,6 @@
 !
 !--       Tendency terms
-          IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-             tend(:,j,i) = 0.0
+          tend(:,j,i) = 0.0
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_mom )  THEN
                  CALL advec_v_ws( i, j, i_omp_start, tn )
@@ -289,16 +259,7 @@
 
           ELSE
-             IF ( momentum_advec /= 'ups-scheme' )  THEN
-                tend(:,j,i) = 0.0
-                CALL advec_v_up( i, j )
-             ENDIF
-          ENDIF
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             CALL diffusion_v( i, j, ddzu, ddzw, km_m, tend, u_m, v_m, &
-                               vsws_m, vswst_m, w_m )
-          ELSE
-             CALL diffusion_v( i, j, ddzu, ddzw, km, tend, u, v, vsws, &
-                               vswst, w )
-          ENDIF
+             CALL advec_v_up( i, j )
+          ENDIF
+          CALL diffusion_v( i, j )
           CALL coriolis( i, j, 2 )
 
@@ -320,9 +281,7 @@
 !--       Prognostic equation for v-velocity component
           DO  k = nzb_v_inner(j,i)+1, nzt
-             v_p(k,j,i) = ( 1.0-tsc(1) ) * v_m(k,j,i) + tsc(1) * v(k,j,i) +    &
-                          dt_3d * (                                            &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tv_m(k,j,i) &
-                                  ) -                                          &
-                          tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
+             v_p(k,j,i) = v(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
+                                               tsc(3) * tv_m(k,j,i) )          &
+                                   - tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
           ENDDO
 
@@ -351,19 +310,10 @@
     CALL cpu_log( log_point(7), 'w-equation', 'start' )
 
-!
-!-- w-tendency terms with communication
-    IF ( momentum_advec == 'ups-scheme' )  THEN
-       tend = 0.0
-       CALL advec_w_ups
-    ENDIF
-
-!
-!-- w-tendency terms with no communication
     DO  i = nxl, nxr
        DO  j = nys, nyn
 !
 !--       Tendency terms
-          IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-             tend(:,j,i) = 0.0
+          tend(:,j,i) = 0.0
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_mom )  THEN
                  CALL advec_w_ws( i, j, i_omp_start, tn )
@@ -373,14 +323,7 @@
 
           ELSE
-             IF ( momentum_advec /= 'ups-scheme' )  THEN
-                tend(:,j,i) = 0.0
-                CALL advec_w_up( i, j )
-             ENDIF
-          ENDIF
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             CALL diffusion_w( i, j, ddzu, ddzw, km_m, tend, u_m, v_m, w_m )
-          ELSE
-             CALL diffusion_w( i, j, ddzu, ddzw, km, tend, u, v, w )
-          ENDIF
+             CALL advec_w_up( i, j )
+          ENDIF
+          CALL diffusion_w( i, j )
           CALL coriolis( i, j, 3 )
 
@@ -406,9 +349,7 @@
 !--       Prognostic equation for w-velocity component
           DO  k = nzb_w_inner(j,i)+1, nzt-1
-             w_p(k,j,i) = ( 1.0-tsc(1) ) * w_m(k,j,i) + tsc(1) * w(k,j,i) +    &
-                          dt_3d * (                                            &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tw_m(k,j,i) &
-                                  ) -                                          &
-                          tsc(5) * rdf(k) * w(k,j,i)
+             w_p(k,j,i) = w(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
+                                               tsc(3) * tw_m(k,j,i) )          &
+                                   - tsc(5) * rdf(k) * w(k,j,i)
           ENDDO
 
@@ -439,39 +380,28 @@
        CALL cpu_log( log_point(13), 'pt-equation', 'start' )
 
-   !
-   !-- pt-tendency terms with communication
-       sat = tsc(1)
+!
+!--    pt-tendency terms with communication
        sbt = tsc(2)
        IF ( scalar_advec == 'bc-scheme' )  THEN
 
           IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-   !
-   !--       Bott-Chlond scheme always uses Euler time step when leapfrog is
-   !--       switched on. Thus:
-             sat = 1.0
+!
+!--          Bott-Chlond scheme always uses Euler time step. Thus:
              sbt = 1.0
           ENDIF
           tend = 0.0
           CALL advec_s_bc( pt, 'pt' )
-       ELSE
-          IF ( tsc(2) /= 2.0  .AND.  scalar_advec == 'ups-scheme' )  THEN
-             tend = 0.0
-             CALL advec_s_ups( pt, 'pt' )
-          ENDIF
-       ENDIF
-
-   !
-   !-- pt-tendency terms with no communication
+
+       ENDIF
+
+!
+!--    pt-tendency terms with no communication
        DO  i = nxl, nxr
           DO  j = nys, nyn
-   !
-   !--       Tendency terms
-             IF ( scalar_advec == 'bc-scheme' )  THEN
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, &
-                                  wall_heatflux, tend )
-             ELSE
-                IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) &
-                THEN
-                   tend(:,j,i) = 0.0
+!
+!--          Tendency terms
+             IF ( scalar_advec /= 'bc-scheme' )  THEN
+                tend(:,j,i) = 0.0
+                IF ( timestep_scheme(1:5) == 'runge' )  THEN
                    IF ( ws_scheme_sca )  THEN
                       CALL advec_s_ws( i, j, pt, 'pt', flux_s_pt,       &
@@ -482,40 +412,31 @@
                    ENDIF
                 ELSE
-                   IF ( scalar_advec /= 'ups-scheme' )  THEN
-                      tend(:,j,i) = 0.0
-                      CALL advec_s_up( i, j, pt )
-                   ENDIF
-                ENDIF
-                IF ( tsc(2) == 2.0 .AND. timestep_scheme(1:8) == 'leapfrog' ) &
-                THEN
-                   CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, &
-                                     tswst_m, wall_heatflux, tend )
-                ELSE
-                   CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, &
-                                     wall_heatflux, tend )
-                ENDIF
-             ENDIF
-
-   !
-   !--       If required compute heating/cooling due to long wave radiation
-   !--       processes
+                   CALL advec_s_up( i, j, pt )
+                ENDIF
+             ENDIF
+
+             CALL diffusion_s( i, j, pt, shf, tswst, wall_heatflux )
+
+!
+!--          If required compute heating/cooling due to long wave radiation
+!--          processes
              IF ( radiation )  THEN
                 CALL calc_radiation( i, j )
              ENDIF
 
-   !
-   !--       If required compute impact of latent heat due to precipitation
+!
+!--          If required compute impact of latent heat due to precipitation
              IF ( precipitation )  THEN
                 CALL impact_of_latent_heat( i, j )
              ENDIF
 
-   !
-   !--       Consideration of heat sources within the plant canopy
+!
+!--          Consideration of heat sources within the plant canopy
              IF ( plant_canopy .AND. ( cthf /= 0.0 ) ) THEN
                 CALL plant_canopy_model( i, j, 4 )
              ENDIF
 
-   !
-   !--       If required compute influence of large-scale subsidence/ascent
+!
+!--          If required compute influence of large-scale subsidence/ascent
              IF ( large_scale_subsidence )  THEN
                 CALL subsidence( i, j, tend, pt, pt_init )
@@ -524,17 +445,15 @@
              CALL user_actions( i, j, 'pt-tendency' )
 
-   !
-   !--       Prognostic equation for potential temperature
+!
+!--          Prognostic equation for potential temperature
              DO  k = nzb_s_inner(j,i)+1, nzt
-                pt_p(k,j,i) = ( 1 - sat ) * pt_m(k,j,i) + sat * pt(k,j,i) + &
-                              dt_3d * (                                        &
-                                       sbt * tend(k,j,i) + tsc(3) * tpt_m(k,j,i) &
-                                      ) - &
-                              tsc(5) * ( pt(k,j,i) - pt_init(k) ) * &
-                              ( rdf_sc(k) + ptdf_x(i) + ptdf_y(j) )  
-             ENDDO
-
-   !
-   !--       Calculate tendencies for the next Runge-Kutta step
+                pt_p(k,j,i) = pt(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +        &
+                                                    tsc(3) * tpt_m(k,j,i) )    &
+                                        - tsc(5) * ( pt(k,j,i) - pt_init(k) ) *&
+                                          ( rdf_sc(k) + ptdf_x(i) + ptdf_y(j) )
+             ENDDO
+
+!
+!--          Calculate tendencies for the next Runge-Kutta step
              IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( intermediate_timestep_count == 1 )  THEN
@@ -566,5 +485,4 @@
 !
 !--    sa-tendency terms with communication
-       sat = tsc(1)
        sbt = tsc(2)
        IF ( scalar_advec == 'bc-scheme' )  THEN
@@ -572,18 +490,10 @@
           IF ( timestep_scheme(1:5) /= 'runge' )  THEN
 !
-!--          Bott-Chlond scheme always uses Euler time step when leapfrog is
-!--          switched on. Thus:
-             sat = 1.0
+!--          Bott-Chlond scheme always uses Euler time step. Thus:
              sbt = 1.0
           ENDIF
           tend = 0.0
           CALL advec_s_bc( sa, 'sa' )
-       ELSE
-          IF ( tsc(2) /= 2.0 )  THEN
-             IF ( scalar_advec == 'ups-scheme' )  THEN
-                tend = 0.0
-                CALL advec_s_ups( sa, 'sa' )
-             ENDIF
-          ENDIF
+
        ENDIF
 
@@ -594,10 +504,7 @@
 !
 !--          Tendency-terms
-             IF ( scalar_advec == 'bc-scheme' )  THEN
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, &
-                                  wall_salinityflux, tend )
-             ELSE
-                IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) THEN
-                   tend(:,j,i) = 0.0
+             IF ( scalar_advec /= 'bc-scheme' )  THEN
+                tend(:,j,i) = 0.0
+                IF ( timestep_scheme(1:5) == 'runge' ) THEN
                    IF ( ws_scheme_sca )  THEN
                        CALL advec_s_ws( i, j, sa, 'sa', flux_s_sa,  &
@@ -608,12 +515,9 @@
 
                 ELSE
-                   IF ( scalar_advec /= 'ups-scheme' )  THEN
-                      tend(:,j,i) = 0.0
-                      CALL advec_s_up( i, j, sa )
-                   ENDIF
-                ENDIF
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, &
-                                  wall_salinityflux, tend )
-             ENDIF
+                   CALL advec_s_up( i, j, sa )
+                ENDIF
+             ENDIF
+
+             CALL diffusion_s( i, j, sa, saswsb, saswst, wall_salinityflux )
        
              CALL user_actions( i, j, 'sa-tendency' )
@@ -622,9 +526,8 @@
 !--          Prognostic equation for salinity
              DO  k = nzb_s_inner(j,i)+1, nzt
-                sa_p(k,j,i) = sat * sa(k,j,i) +                                &
-                              dt_3d * (                                        &
-                                     sbt * tend(k,j,i) + tsc(3) * tsa_m(k,j,i) &
-                                      ) -                                      &
-                              tsc(5) * rdf_sc(k) * ( sa(k,j,i) - sa_init(k) )
+                sa_p(k,j,i) = sa(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +        &
+                                                    tsc(3) * tsa_m(k,j,i) )    &
+                                        - tsc(5) * rdf_sc(k) *                 &
+                                          ( sa(k,j,i) - sa_init(k) )
                 IF ( sa_p(k,j,i) < 0.0 )  sa_p(k,j,i) = 0.1 * sa(k,j,i)
              ENDDO
@@ -665,5 +568,4 @@
 !
 !--    Scalar/q-tendency terms with communication
-       sat = tsc(1)
        sbt = tsc(2)
        IF ( scalar_advec == 'bc-scheme' )  THEN
@@ -671,18 +573,10 @@
           IF ( timestep_scheme(1:5) /= 'runge' )  THEN
 !
-!--          Bott-Chlond scheme always uses Euler time step when leapfrog is
-!--          switched on. Thus:
-             sat = 1.0
+!--          Bott-Chlond scheme always uses Euler time step. Thus:
              sbt = 1.0
           ENDIF
           tend = 0.0
           CALL advec_s_bc( q, 'q' )
-       ELSE
-          IF ( tsc(2) /= 2.0 )  THEN
-             IF ( scalar_advec == 'ups-scheme' )  THEN
-                tend = 0.0
-                CALL advec_s_ups( q, 'q' )
-             ENDIF
-          ENDIF
+
        ENDIF
 
@@ -693,10 +587,7 @@
 !
 !--          Tendency-terms
-             IF ( scalar_advec == 'bc-scheme' )  THEN
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, &
-                                  wall_qflux, tend )
-             ELSE
-                IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) THEN
-                   tend(:,j,i) = 0.0
+             IF ( scalar_advec /= 'bc-scheme' )  THEN
+                tend(:,j,i) = 0.0
+                IF ( timestep_scheme(1:5) == 'runge' ) THEN
                    IF ( ws_scheme_sca )  THEN
                        CALL advec_s_ws( i, j, q, 'q', flux_s_q, &
@@ -706,18 +597,9 @@
                    ENDIF
                 ELSE
-                   IF ( scalar_advec /= 'ups-scheme' )  THEN
-                      tend(:,j,i) = 0.0
-                      CALL advec_s_up( i, j, q )
-                   ENDIF
-                ENDIF
-                IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )&
-                THEN
-                   CALL diffusion_s( i, j, ddzu, ddzw, kh_m, q_m, qsws_m, &
-                                     qswst_m, wall_qflux, tend )
-                ELSE
-                   CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, &
-                                     wall_qflux, tend )
-                ENDIF
-             ENDIF
+                   CALL advec_s_up( i, j, q )
+                ENDIF
+             ENDIF
+
+             CALL diffusion_s( i, j, q, qsws, qswst, wall_qflux )
        
 !
@@ -743,9 +625,8 @@
 !--          Prognostic equation for total water content / scalar
              DO  k = nzb_s_inner(j,i)+1, nzt
-                q_p(k,j,i) = ( 1 - sat ) * q_m(k,j,i) + sat * q(k,j,i) +       &
-                             dt_3d * (                                         &
-                                      sbt * tend(k,j,i) + tsc(3) * tq_m(k,j,i) &
-                                     ) -                                       &
-                             tsc(5) * rdf_sc(k) * ( q(k,j,i) - q_init(k) )
+                q_p(k,j,i) = q(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +          &
+                                                  tsc(3) * tq_m(k,j,i) )       &
+                                      - tsc(5) * rdf_sc(k) *                   &
+                                        ( q(k,j,i) - q_init(k) )
                 IF ( q_p(k,j,i) < 0.0 )  q_p(k,j,i) = 0.1 * q(k,j,i)
              ENDDO
@@ -784,5 +665,4 @@
        CALL production_e_init
 
-       sat = tsc(1)
        sbt = tsc(2)
        IF ( .NOT. use_upstream_for_tke )  THEN
@@ -791,18 +671,9 @@
              IF ( timestep_scheme(1:5) /= 'runge' )  THEN
 !
-!--             Bott-Chlond scheme always uses Euler time step when leapfrog is
-!--             switched on. Thus:
-                sat = 1.0
+!--             Bott-Chlond scheme always uses Euler time step. Thus:
                 sbt = 1.0
              ENDIF
              tend = 0.0
              CALL advec_s_bc( e, 'e' )
-          ELSE
-             IF ( tsc(2) /= 2.0 )  THEN
-                IF ( scalar_advec == 'ups-scheme' )  THEN
-                   tend = 0.0
-                   CALL advec_s_ups( e, 'e' )
-                ENDIF
-             ENDIF
           ENDIF
        ENDIF
@@ -814,29 +685,11 @@
 !
 !--          Tendency-terms
-             IF ( scalar_advec == 'bc-scheme'  .AND.  &
-                  .NOT. use_upstream_for_tke )  THEN
-                IF ( .NOT. humidity )  THEN
-                   IF ( ocean )  THEN
-                      CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e, km,  &
-                                        l_grid, prho, prho_reference, rif,     &
-                                        tend, zu, zw )
-                   ELSE
-                      CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e, km,  &
-                                        l_grid, pt, pt_reference, rif, tend,   &
-                                        zu, zw )
-                   ENDIF
-                ELSE
-                   CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e, km,     &
-                                     l_grid, vpt, pt_reference, rif, tend, zu, &
-                                     zw )
-                ENDIF
-             ELSE
+             IF ( scalar_advec /= 'bc-scheme' .OR. use_upstream_for_tke )  THEN
                 IF ( use_upstream_for_tke )  THEN
                    tend(:,j,i) = 0.0
                    CALL advec_s_up( i, j, e )
                 ELSE
-                   IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) &
-                   THEN
-                      tend(:,j,i) = 0.0
+                   tend(:,j,i) = 0.0
+                   IF ( timestep_scheme(1:5) == 'runge' )  THEN
                       IF ( ws_scheme_sca )  THEN
                           CALL advec_s_ws( i, j, e, 'e', flux_s_e, & 
@@ -846,39 +699,19 @@
                       ENDIF
                    ELSE
-                      IF ( scalar_advec /= 'ups-scheme' )  THEN
-                         tend(:,j,i) = 0.0
-                         CALL advec_s_up( i, j, e )
-                      ENDIF
+                      CALL advec_s_up( i, j, e )
                    ENDIF
                 ENDIF
-                IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )&
-                THEN
-                   IF ( .NOT. humidity )  THEN
-                      CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e_m, &
-                                        km_m, l_grid, pt_m, pt_reference,   &
-                                        rif_m, tend, zu, zw )
-                   ELSE
-                      CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e_m, &
-                                        km_m, l_grid, vpt_m, pt_reference,  &
-                                        rif_m, tend, zu, zw )
-                   ENDIF
+             ENDIF
+
+             IF ( .NOT. humidity )  THEN
+                IF ( ocean )  THEN
+                   CALL diffusion_e( i, j, prho, prho_reference )
                 ELSE
-                   IF ( .NOT. humidity )  THEN
-                      IF ( ocean )  THEN
-                         CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e,  &
-                                           km, l_grid, prho, prho_reference,  &
-                                           rif, tend, zu, zw )
-                      ELSE
-                         CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e,  &
-                                           km, l_grid, pt, pt_reference, rif, &
-                                           tend, zu, zw )
-                      ENDIF
-                   ELSE
-                      CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e, km, &
-                                        l_grid, vpt, pt_reference, rif, tend, &
-                                        zu, zw )
-                   ENDIF
-                ENDIF
-             ENDIF
+                   CALL diffusion_e( i, j, pt, pt_reference )
+                ENDIF
+             ELSE
+                CALL diffusion_e( i, j, vpt, pt_reference )
+             ENDIF
+
              CALL production_e( i, j )
 
@@ -895,8 +728,6 @@
 !--          value is reduced by 90%.
              DO  k = nzb_s_inner(j,i)+1, nzt
-                e_p(k,j,i) = ( 1 - sat ) * e_m(k,j,i) + sat * e(k,j,i) +       &
-                             dt_3d * (                                         &
-                                      sbt * tend(k,j,i) + tsc(3) * te_m(k,j,i) &
-                                     )
+                e_p(k,j,i) = e(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +          &
+                                                  tsc(3) * te_m(k,j,i) )
                 IF ( e_p(k,j,i) < 0.0 )  e_p(k,j,i) = 0.1 * e(k,j,i)
              ENDDO
@@ -986,8 +817,7 @@
 
              tend(:,j,i) = 0.0
-             IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
+             IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_mom )  THEN
                    IF ( ( inflow_l .OR. outflow_l ) .AND. i_omp_start == nxl )  THEN 
-!                     CALL local_diss( i, j, u)    ! dissipation control
                       CALL advec_u_ws( i, j, i_omp_start + 1, tn )
                    ELSE
@@ -1000,12 +830,5 @@
                 CALL advec_u_up( i, j )
              ENDIF
-             IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' ) &
-             THEN
-                CALL diffusion_u( i, j, ddzu, ddzw, km_m, tend,  u_m, &
-                                  usws_m, uswst_m, v_m, w_m )
-             ELSE
-                CALL diffusion_u( i, j, ddzu, ddzw, km, tend, u, usws, &
-                                  uswst, v, w )
-             ENDIF
+             CALL diffusion_u( i, j )
              CALL coriolis( i, j, 1 )
              IF ( sloping_surface  .AND.  .NOT. neutral )  THEN
@@ -1030,9 +853,7 @@
 !--          Prognostic equation for u-velocity component
              DO  k = nzb_u_inner(j,i)+1, nzt
-                u_p(k,j,i) = ( 1.0-tsc(1) ) * u_m(k,j,i) + tsc(1) * u(k,j,i) + &
-                             dt_3d * (                                         &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tu_m(k,j,i) &
-                                     ) -                                       &
-                             tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
+                u_p(k,j,i) = u(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
+                                                  tsc(3) * tu_m(k,j,i) )       &
+                                      - tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
              ENDDO
 
@@ -1059,7 +880,6 @@
 
              tend(:,j,i) = 0.0
-             IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
+             IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_mom )  THEN
-                 !   CALL local_diss( i, j, v)
                     CALL advec_v_ws( i, j, i_omp_start, tn )
                 ELSE 
@@ -1069,12 +889,5 @@
                 CALL advec_v_up( i, j )
              ENDIF
-             IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' ) &
-             THEN
-                CALL diffusion_v( i, j, ddzu, ddzw, km_m, tend, u_m, v_m, &
-                                  vsws_m, vswst_m, w_m )
-             ELSE
-                CALL diffusion_v( i, j, ddzu, ddzw, km, tend, u, v, vsws, &
-                                  vswst, w )
-             ENDIF
+             CALL diffusion_v( i, j )
              CALL coriolis( i, j, 2 )
 
@@ -1096,9 +909,7 @@
 !--          Prognostic equation for v-velocity component
              DO  k = nzb_v_inner(j,i)+1, nzt
-                v_p(k,j,i) = ( 1.0-tsc(1) ) * v_m(k,j,i) + tsc(1) * v(k,j,i) + &
-                             dt_3d * (                                         &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tv_m(k,j,i) &
-                                     ) -                                       &
-                             tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
+                v_p(k,j,i) = v(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
+                                                  tsc(3) * tv_m(k,j,i) )       &
+                                      - tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
              ENDDO
 
@@ -1123,7 +934,6 @@
 !--       Tendency terms for w-velocity component
           tend(:,j,i) = 0.0
-          IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_mom )  THEN
-             !   CALL local_diss( i, j, w)
                 CALL advec_w_ws( i, j, i_omp_start, tn )
              ELSE 
@@ -1133,11 +943,5 @@
              CALL advec_w_up( i, j )
           ENDIF
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' ) &
-          THEN
-             CALL diffusion_w( i, j, ddzu, ddzw, km_m, tend, u_m, v_m, &
-                               w_m )
-          ELSE
-             CALL diffusion_w( i, j, ddzu, ddzw, km, tend, u, v, w )
-          ENDIF
+          CALL diffusion_w( i, j )
           CALL coriolis( i, j, 3 )
 
@@ -1163,9 +967,7 @@
 !--       Prognostic equation for w-velocity component
           DO  k = nzb_w_inner(j,i)+1, nzt-1
-             w_p(k,j,i) = ( 1.0-tsc(1) ) * w_m(k,j,i) + tsc(1) * w(k,j,i) + &
-                          dt_3d * (                                         &
-                                tsc(2) * tend(k,j,i) + tsc(3) * tw_m(k,j,i) &
-                                  ) -                                       &
-                          tsc(5) * rdf(k) * w(k,j,i)
+             w_p(k,j,i) = w(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
+                                               tsc(3) * tw_m(k,j,i) )          &
+                                   - tsc(5) * rdf(k) * w(k,j,i)
           ENDDO
 
@@ -1191,5 +993,5 @@
 !--          Tendency terms for potential temperature
              tend(:,j,i) = 0.0
-             IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
+             IF ( timestep_scheme(1:5) == 'runge' )  THEN
                    IF ( ws_scheme_sca )  THEN
                       CALL advec_s_ws( i, j, pt, 'pt', flux_s_pt, diss_s_pt, &
@@ -1201,12 +1003,5 @@
                 CALL advec_s_up( i, j, pt )
              ENDIF
-             IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' ) &
-             THEN
-                CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, &
-                                  tswst_m, wall_heatflux, tend )
-             ELSE
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, &
-                                  wall_heatflux, tend )
-             ENDIF
+             CALL diffusion_s( i, j, pt, shf, tswst, wall_heatflux )
 
 !
@@ -1241,10 +1036,8 @@
 !--          Prognostic equation for potential temperature
              DO  k = nzb_s_inner(j,i)+1, nzt
-                pt_p(k,j,i) = ( 1.0-tsc(1) ) * pt_m(k,j,i) + tsc(1)*pt(k,j,i) +&
-                              dt_3d * (                                        &
-                                  tsc(2) * tend(k,j,i) + tsc(3) * tpt_m(k,j,i) &
-                                      ) - &
-                              tsc(5) * ( pt(k,j,i) - pt_init(k) ) * &
-                              ( rdf_sc(k) + ptdf_x(i) + ptdf_y(j) )  
+                pt_p(k,j,i) = pt(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +     &
+                                                    tsc(3) * tpt_m(k,j,i) )    &
+                                        - tsc(5) * ( pt(k,j,i) - pt_init(k) ) *&
+                                          ( rdf_sc(k) + ptdf_x(i) + ptdf_y(j) )
              ENDDO
 
@@ -1274,8 +1067,7 @@
 !--          Tendency-terms for salinity
              tend(:,j,i) = 0.0
-             IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) &
+             IF ( timestep_scheme(1:5) == 'runge' ) &
              THEN
                 IF ( ws_scheme_sca )  THEN
-            !        CALL local_diss( i, j, sa )
                     CALL advec_s_ws( i, j, sa, 'sa', flux_s_sa,  &
                                 diss_s_sa, flux_l_sa, diss_l_sa, i_omp_start, tn  )
@@ -1286,6 +1078,5 @@
                 CALL advec_s_up( i, j, sa )
              ENDIF
-             CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, &
-                               wall_salinityflux, tend )
+             CALL diffusion_s( i, j, sa, saswsb, saswst, wall_salinityflux )
 
              CALL user_actions( i, j, 'sa-tendency' )
@@ -1294,9 +1085,8 @@
 !--          Prognostic equation for salinity
              DO  k = nzb_s_inner(j,i)+1, nzt
-                sa_p(k,j,i) = tsc(1) * sa(k,j,i) +                          &
-                              dt_3d * (                                     &
-                               tsc(2) * tend(k,j,i) + tsc(3) * tsa_m(k,j,i) &
-                                      ) -                                   &
-                             tsc(5) * rdf_sc(k) * ( sa(k,j,i) - sa_init(k) )
+                sa_p(k,j,i) = sa(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +     &
+                                                    tsc(3) * tsa_m(k,j,i) )    &
+                                        - tsc(5) * rdf_sc(k) *                 &
+                                          ( sa(k,j,i) - sa_init(k) )
                 IF ( sa_p(k,j,i) < 0.0 )  sa_p(k,j,i) = 0.1 * sa(k,j,i)
              ENDDO
@@ -1332,8 +1122,7 @@
 !--          Tendency-terms for total water content / scalar
              tend(:,j,i) = 0.0
-             IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) &
+             IF ( timestep_scheme(1:5) == 'runge' ) &
              THEN
                 IF ( ws_scheme_sca )  THEN
-          !         CALL local_diss( i, j, q )
                    CALL advec_s_ws( i, j, q, 'q', flux_s_q, & 
                                 diss_s_q, flux_l_q, diss_l_q, i_omp_start, tn )
@@ -1344,12 +1133,5 @@
                 CALL advec_s_up( i, j, q )
              ENDIF
-             IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )&
-             THEN
-                CALL diffusion_s( i, j, ddzu, ddzw, kh_m, q_m, qsws_m, &
-                                  qswst_m, wall_qflux, tend )
-             ELSE
-                CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, &
-                                  wall_qflux, tend )
-             ENDIF
+             CALL diffusion_s( i, j, q, qsws, qswst, wall_qflux )
        
 !
@@ -1374,9 +1156,8 @@
 !--          Prognostic equation for total water content / scalar
              DO  k = nzb_s_inner(j,i)+1, nzt
-                q_p(k,j,i) = ( 1.0-tsc(1) ) * q_m(k,j,i) + tsc(1)*q(k,j,i) +&
-                             dt_3d * (                                      &
-                                tsc(2) * tend(k,j,i) + tsc(3) * tq_m(k,j,i) &
-                                     ) -                                    &
-                             tsc(5) * rdf_sc(k) * ( q(k,j,i) - q_init(k) )
+                q_p(k,j,i) = q(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
+                                                  tsc(3) * tq_m(k,j,i) )       &
+                                      - tsc(5) * rdf_sc(k) *                   &
+                                        ( q(k,j,i) - q_init(k) )
                 IF ( q_p(k,j,i) < 0.0 )  q_p(k,j,i) = 0.1 * q(k,j,i)
              ENDDO
@@ -1408,10 +1189,9 @@
 !--          Tendency-terms for TKE
              tend(:,j,i) = 0.0
-             IF ( ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  &
+             IF ( timestep_scheme(1:5) == 'runge'  &
                  .AND.  .NOT. use_upstream_for_tke )  THEN
                  IF ( ws_scheme_sca )  THEN
-                 !    CALL local_diss( i, j, e )
-                     CALL advec_s_ws( i, j, e, 'e', flux_s_e, &
-                                diss_s_e, flux_l_e, diss_l_e , i_omp_start, tn )
+                     CALL advec_s_ws( i, j, e, 'e', flux_s_e, diss_s_e, &
+                                      flux_l_e, diss_l_e , i_omp_start, tn )
                  ELSE
                      CALL advec_s_pw( i, j, e )
@@ -1420,31 +1200,12 @@
                 CALL advec_s_up( i, j, e )
              ENDIF
-             IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )&
-             THEN
-                IF ( .NOT. humidity )  THEN
-                   CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e_m, &
-                                     km_m, l_grid, pt_m, pt_reference,   &
-                                     rif_m, tend, zu, zw )
+             IF ( .NOT. humidity )  THEN
+                IF ( ocean )  THEN
+                   CALL diffusion_e( i, j, prho, prho_reference )
                 ELSE
-                   CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e_m, &
-                                     km_m, l_grid, vpt_m, pt_reference,  &
-                                     rif_m, tend, zu, zw )
+                   CALL diffusion_e( i, j, pt, pt_reference )
                 ENDIF
              ELSE
-                IF ( .NOT. humidity )  THEN
-                   IF ( ocean )  THEN
-                      CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e,  &
-                                        km, l_grid, prho, prho_reference,  &
-                                        rif, tend, zu, zw )
-                   ELSE
-                      CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e,  &
-                                        km, l_grid, pt, pt_reference, rif, &
-                                        tend, zu, zw )
-                   ENDIF
-                ELSE
-                   CALL diffusion_e( i, j, ddzu, dd2zu, ddzw, diss, e, km, &
-                                     l_grid, vpt, pt_reference, rif, tend, &
-                                     zu, zw )
-                ENDIF
+                CALL diffusion_e( i, j, vpt, pt_reference )
              ENDIF
              CALL production_e( i, j )
@@ -1462,8 +1223,6 @@
 !--          TKE value is reduced by 90%.
              DO  k = nzb_s_inner(j,i)+1, nzt
-                e_p(k,j,i) = ( 1.0-tsc(1) ) * e_m(k,j,i) + tsc(1)*e(k,j,i) +&
-                             dt_3d * (                                      &
-                                tsc(2) * tend(k,j,i) + tsc(3) * te_m(k,j,i) &
-                                     )
+                e_p(k,j,i) = e(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
+                                                  tsc(3) * te_m(k,j,i) )
                 IF ( e_p(k,j,i) < 0.0 )  e_p(k,j,i) = 0.1 * e(k,j,i)
              ENDDO
@@ -1507,5 +1266,5 @@
     CHARACTER (LEN=9) ::  time_to_string
     INTEGER ::  i, j, k
-    REAL    ::  sat, sbt
+    REAL    ::  sbt
 
 !
@@ -1522,15 +1281,6 @@
     CALL cpu_log( log_point(5), 'u-equation', 'start' )
 
-!
-!-- u-tendency terms with communication
-    IF ( momentum_advec == 'ups-scheme' )  THEN
-       tend = 0.0
-       CALL advec_u_ups
-    ENDIF
-
-!
-!-- u-tendency terms with no communication
-    IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-       tend = 0.0
+    tend = 0.0
+    IF ( timestep_scheme(1:5) == 'runge' )  THEN
        IF ( ws_scheme_mom )  THEN
           CALL advec_u_ws
@@ -1539,15 +1289,7 @@
        ENDIF
     ELSE
-       IF ( momentum_advec /= 'ups-scheme' )  THEN
-          tend = 0.0
-          CALL advec_u_up
-       ENDIF
+       CALL advec_u_up
     ENDIF
-    IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-       CALL diffusion_u( ddzu, ddzw, km_m, tend, u_m, usws_m, uswst_m, &
-                         v_m, w_m )
-    ELSE
-       CALL diffusion_u( ddzu, ddzw, km, tend, u, usws, uswst, v, w )
-    ENDIF
+    CALL diffusion_u
     CALL coriolis( 1 )
     IF ( sloping_surface  .AND.  .NOT. neutral )  THEN
@@ -1578,9 +1320,7 @@
        DO  j = nys, nyn
           DO  k = nzb_u_inner(j,i)+1, nzt
-             u_p(k,j,i) = ( 1.0-tsc(1) ) * u_m(k,j,i) + tsc(1) * u(k,j,i) +    &
-                          dt_3d * (                                            &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tu_m(k,j,i) &
-                                  ) -                                          &
-                          tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
+             u_p(k,j,i) = u(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
+                                               tsc(3) * tu_m(k,j,i) )          &
+                                   - tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
           ENDDO
        ENDDO
@@ -1616,15 +1356,6 @@
     CALL cpu_log( log_point(6), 'v-equation', 'start' )
 
-!
-!-- v-tendency terms with communication
-    IF ( momentum_advec == 'ups-scheme' )  THEN
-       tend = 0.0
-       CALL advec_v_ups
-    ENDIF
-
-!
-!-- v-tendency terms with no communication
-    IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-       tend = 0.0
+    tend = 0.0
+    IF ( timestep_scheme(1:5) == 'runge' )  THEN
        IF ( ws_scheme_mom )  THEN
           CALL advec_v_ws
@@ -1633,15 +1364,7 @@
        END IF
     ELSE
-       IF ( momentum_advec /= 'ups-scheme' )  THEN
-          tend = 0.0
-          CALL advec_v_up
-       ENDIF
+       CALL advec_v_up
     ENDIF
-    IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-       CALL diffusion_v( ddzu, ddzw, km_m, tend, u_m, v_m, vsws_m, vswst_m, &
-                         w_m )
-    ELSE
-       CALL diffusion_v( ddzu, ddzw, km, tend, u, v, vsws, vswst, w )
-    ENDIF
+    CALL diffusion_v
     CALL coriolis( 2 )
 
@@ -1669,9 +1392,7 @@
        DO  j = nysv, nyn
           DO  k = nzb_v_inner(j,i)+1, nzt
-             v_p(k,j,i) = ( 1.0-tsc(1) ) * v_m(k,j,i) + tsc(1) * v(k,j,i) +    &
-                          dt_3d * (                                            &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tv_m(k,j,i) &
-                                  ) -                                          &
-                          tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
+             v_p(k,j,i) = v(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
+                                               tsc(3) * tv_m(k,j,i) )          &
+                                   - tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
           ENDDO
        ENDDO
@@ -1707,15 +1428,6 @@
     CALL cpu_log( log_point(7), 'w-equation', 'start' )
 
-!
-!-- w-tendency terms with communication
-    IF ( momentum_advec == 'ups-scheme' )  THEN
-       tend = 0.0
-       CALL advec_w_ups
-    ENDIF
-
-!
-!-- w-tendency terms with no communication
-    IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-       tend = 0.0
+    tend = 0.0
+    IF ( timestep_scheme(1:5) == 'runge' )  THEN
        IF ( ws_scheme_mom )  THEN
           CALL advec_w_ws
@@ -1724,14 +1436,7 @@
        ENDIF
     ELSE
-       IF ( momentum_advec /= 'ups-scheme' )  THEN
-          tend = 0.0
-          CALL advec_w_up
-       ENDIF
+       CALL advec_w_up
     ENDIF
-    IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-       CALL diffusion_w( ddzu, ddzw, km_m, tend, u_m, v_m, w_m )
-    ELSE
-       CALL diffusion_w( ddzu, ddzw, km, tend, u, v, w )
-    ENDIF
+    CALL diffusion_w
     CALL coriolis( 3 )
 
@@ -1759,9 +1464,7 @@
        DO  j = nys, nyn
           DO  k = nzb_w_inner(j,i)+1, nzt-1
-             w_p(k,j,i) = ( 1-tsc(1) ) * w_m(k,j,i) + tsc(1) * w(k,j,i) +      &
-                          dt_3d * (                                            &
-                                   tsc(2) * tend(k,j,i) + tsc(3) * tw_m(k,j,i) &
-                                  ) -                                          &
-                          tsc(5) * rdf(k) * w(k,j,i)
+             w_p(k,j,i) = w(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
+                                               tsc(3) * tw_m(k,j,i) )          &
+                                   - tsc(5) * rdf(k) * w(k,j,i)
           ENDDO
        ENDDO
@@ -1802,5 +1505,4 @@
 !
 !--    pt-tendency terms with communication
-       sat = tsc(1)
        sbt = tsc(2)
        IF ( scalar_advec == 'bc-scheme' )  THEN
@@ -1808,26 +1510,17 @@
           IF ( timestep_scheme(1:5) /= 'runge' )  THEN
 !
-!--          Bott-Chlond scheme always uses Euler time step when leapfrog is
-!--          switched on. Thus:
-             sat = 1.0
+!--          Bott-Chlond scheme always uses Euler time step. Thus:
              sbt = 1.0
           ENDIF
           tend = 0.0
           CALL advec_s_bc( pt, 'pt' )
-       ELSE
-          IF ( tsc(2) /= 2.0  .AND.  scalar_advec == 'ups-scheme' )  THEN
-             tend = 0.0
-             CALL advec_s_ups( pt, 'pt' )
-          ENDIF
+
        ENDIF
 
 !
 !--    pt-tendency terms with no communication
-       IF ( scalar_advec == 'bc-scheme' )  THEN
-          CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, wall_heatflux, &
-                            tend )
-       ELSE
-          IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-             tend = 0.0
+       IF ( scalar_advec /= 'bc-scheme' )  THEN
+          tend = 0.0
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_sca )  THEN
                 CALL advec_s_ws( pt, 'pt' )
@@ -1836,17 +1529,9 @@
              ENDIF
           ELSE
-             IF ( scalar_advec /= 'ups-scheme' )  THEN
-                tend = 0.0
-                CALL advec_s_up( pt )
-             ENDIF
-          ENDIF
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             CALL diffusion_s( ddzu, ddzw, kh_m, pt_m, shf_m, tswst_m, &
-                               wall_heatflux, tend )
-          ELSE
-             CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, wall_heatflux, &
-                               tend )
-          ENDIF
-       ENDIF
+             CALL advec_s_up( pt )
+          ENDIF
+       ENDIF
+
+       CALL diffusion_s( pt, shf, tswst, wall_heatflux )
 
 !
@@ -1881,10 +1566,8 @@
           DO  j = nys, nyn
              DO  k = nzb_s_inner(j,i)+1, nzt
-                pt_p(k,j,i) = ( 1 - sat ) * pt_m(k,j,i) + sat * pt(k,j,i) +    &
-                              dt_3d * (                                        &
-                                       sbt * tend(k,j,i) + tsc(3) * tpt_m(k,j,i)&
-                                      ) - &
-                              tsc(5) * ( pt(k,j,i) - pt_init(k) ) * &
-                              ( rdf_sc(k) + ptdf_x(i) + ptdf_y(j) )  
+                pt_p(k,j,i) = pt(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +        &
+                                                    tsc(3) * tpt_m(k,j,i) )    &
+                                        - tsc(5) * ( pt(k,j,i) - pt_init(k) ) *&
+                                          ( rdf_sc(k) + ptdf_x(i) + ptdf_y(j) )
              ENDDO
           ENDDO
@@ -1927,5 +1610,4 @@
 !
 !--    sa-tendency terms with communication
-       sat = tsc(1)
        sbt = tsc(2)
        IF ( scalar_advec == 'bc-scheme' )  THEN
@@ -1933,28 +1615,17 @@
           IF ( timestep_scheme(1:5) /= 'runge' )  THEN
 !
-!--          Bott-Chlond scheme always uses Euler time step when leapfrog is
-!--          switched on. Thus:
-             sat = 1.0
+!--          Bott-Chlond scheme always uses Euler time step. Thus:
              sbt = 1.0
           ENDIF
           tend = 0.0
           CALL advec_s_bc( sa, 'sa' )
-       ELSE
-          IF ( tsc(2) /= 2.0 )  THEN
-             IF ( scalar_advec == 'ups-scheme' )  THEN
-                tend = 0.0
-                CALL advec_s_ups( sa, 'sa' )
-             ENDIF
-          ENDIF
+
        ENDIF
 
 !
 !--    sa-tendency terms with no communication
-       IF ( scalar_advec == 'bc-scheme' )  THEN
-          CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, &
-                            wall_salinityflux, tend )
-       ELSE
-          IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-             tend = 0.0
+       IF ( scalar_advec /= 'bc-scheme' )  THEN
+          tend = 0.0
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_sca )  THEN
                  CALL advec_s_ws( sa, 'sa' )
@@ -1963,12 +1634,9 @@
              ENDIF
           ELSE
-             IF ( scalar_advec /= 'ups-scheme' )  THEN
-                tend = 0.0
-                CALL advec_s_up( sa )
-             ENDIF
-          ENDIF
-          CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, &
-                            wall_salinityflux, tend )
-       ENDIF
+             CALL advec_s_up( sa )
+          ENDIF
+       ENDIF
+
+       CALL diffusion_s( sa, saswsb, saswst, wall_salinityflux )
        
        CALL user_actions( 'sa-tendency' )
@@ -1979,9 +1647,8 @@
           DO  j = nys, nyn
              DO  k = nzb_s_inner(j,i)+1, nzt
-                sa_p(k,j,i) = sat * sa(k,j,i) +                                &
-                              dt_3d * (                                        &
-                                     sbt * tend(k,j,i) + tsc(3) * tsa_m(k,j,i) &
-                                      ) -                                      &
-                              tsc(5) * rdf_sc(k) * ( sa(k,j,i) - sa_init(k) )
+                sa_p(k,j,i) = sa(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +        &
+                                                    tsc(3) * tsa_m(k,j,i) )    &
+                                        - tsc(5) * rdf_sc(k) *                 &
+                                          ( sa(k,j,i) - sa_init(k) )
                 IF ( sa_p(k,j,i) < 0.0 )  sa_p(k,j,i) = 0.1 * sa(k,j,i)
              ENDDO
@@ -2031,5 +1698,4 @@
 !
 !--    Scalar/q-tendency terms with communication
-       sat = tsc(1)
        sbt = tsc(2)
        IF ( scalar_advec == 'bc-scheme' )  THEN
@@ -2037,27 +1703,17 @@
           IF ( timestep_scheme(1:5) /= 'runge' )  THEN
 !
-!--          Bott-Chlond scheme always uses Euler time step when leapfrog is
-!--          switched on. Thus:
-             sat = 1.0
+!--          Bott-Chlond scheme always uses Euler time step. Thus:
              sbt = 1.0
           ENDIF
           tend = 0.0
           CALL advec_s_bc( q, 'q' )
-       ELSE
-          IF ( tsc(2) /= 2.0 )  THEN
-             IF ( scalar_advec == 'ups-scheme' )  THEN
-                tend = 0.0
-                CALL advec_s_ups( q, 'q' )
-             ENDIF
-          ENDIF
+
        ENDIF
 
 !
 !--    Scalar/q-tendency terms with no communication
-       IF ( scalar_advec == 'bc-scheme' )  THEN
-          CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, wall_qflux, tend )
-       ELSE
-          IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-             tend = 0.0
+       IF ( scalar_advec /= 'bc-scheme' )  THEN
+          tend = 0.0
+          IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_sca )  THEN
                 CALL advec_s_ws( q, 'q' )
@@ -2066,17 +1722,9 @@
              ENDIF
           ELSE
-             IF ( scalar_advec /= 'ups-scheme' )  THEN
-                tend = 0.0
-                CALL advec_s_up( q )
-             ENDIF
-          ENDIF
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             CALL diffusion_s( ddzu, ddzw, kh_m, q_m, qsws_m, qswst_m, &
-                               wall_qflux, tend )
-          ELSE
-             CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, &
-                               wall_qflux, tend )
-          ENDIF
-       ENDIF
+             CALL advec_s_up( q )
+          ENDIF
+       ENDIF
+
+       CALL diffusion_s( q, qsws, qswst, wall_qflux )
        
 !
@@ -2104,9 +1752,8 @@
           DO  j = nys, nyn
              DO  k = nzb_s_inner(j,i)+1, nzt
-                q_p(k,j,i) = ( 1 - sat ) * q_m(k,j,i) + sat * q(k,j,i) +       &
-                             dt_3d * (                                         &
-                                      sbt * tend(k,j,i) + tsc(3) * tq_m(k,j,i) &
-                                     ) -                                       &
-                             tsc(5) * rdf_sc(k) * ( q(k,j,i) - q_init(k) )
+                q_p(k,j,i) = q(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +          &
+                                                  tsc(3) * tq_m(k,j,i) )       &
+                                      - tsc(5) * rdf_sc(k) *                   &
+                                        ( q(k,j,i) - q_init(k) )
                 IF ( q_p(k,j,i) < 0.0 )  q_p(k,j,i) = 0.1 * q(k,j,i)
              ENDDO
@@ -2152,5 +1799,4 @@
        CALL production_e_init
 
-       sat = tsc(1)
        sbt = tsc(2)
        IF ( .NOT. use_upstream_for_tke )  THEN
@@ -2159,18 +1805,10 @@
              IF ( timestep_scheme(1:5) /= 'runge' )  THEN
 !
-!--             Bott-Chlond scheme always uses Euler time step when leapfrog is
-!--             switched on. Thus:
-                sat = 1.0
+!--             Bott-Chlond scheme always uses Euler time step. Thus:
                 sbt = 1.0
              ENDIF
              tend = 0.0
              CALL advec_s_bc( e, 'e' )
-          ELSE
-             IF ( tsc(2) /= 2.0 )  THEN
-                IF ( scalar_advec == 'ups-scheme' )  THEN
-                   tend = 0.0
-                   CALL advec_s_ups( e, 'e' )
-                ENDIF
-             ENDIF
+
           ENDIF
        ENDIF
@@ -2178,25 +1816,11 @@
 !
 !--    TKE-tendency terms with no communication
-       IF ( scalar_advec == 'bc-scheme'  .AND.  .NOT. use_upstream_for_tke )  &
-       THEN
-          IF ( .NOT. humidity )  THEN
-             IF ( ocean )  THEN
-                CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e, km, l_grid, &
-                                  prho, prho_reference, rif, tend, zu, zw )
-             ELSE
-                CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e, km, l_grid, pt, &
-                                  pt_reference, rif, tend, zu, zw )
-             ENDIF
-          ELSE
-             CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e, km, l_grid, vpt, &
-                               pt_reference, rif, tend, zu, zw )
-          ENDIF
-       ELSE
+       IF ( scalar_advec /= 'bc-scheme'  .OR.  use_upstream_for_tke )  THEN
           IF ( use_upstream_for_tke )  THEN
              tend = 0.0
              CALL advec_s_up( e )
           ELSE
-             IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN
-                tend = 0.0
+             tend = 0.0
+             IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_sca )  THEN
                    CALL advec_s_ws( e, 'e' )
@@ -2205,33 +1829,19 @@
                 ENDIF
              ELSE
-                IF ( scalar_advec /= 'ups-scheme' )  THEN
-                   tend = 0.0
-                   CALL advec_s_up( e )
-                ENDIF
-             ENDIF
-          ENDIF
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             IF ( .NOT. humidity )  THEN
-                CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e_m, km_m, l_grid, &
-                                  pt_m, pt_reference, rif_m, tend, zu, zw )
-             ELSE
-                CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e_m, km_m, l_grid, &
-                                  vpt_m, pt_reference, rif_m, tend, zu, zw )
-             ENDIF
+                CALL advec_s_up( e )
+             ENDIF
+          ENDIF
+       ENDIF
+
+       IF ( .NOT. humidity )  THEN
+          IF ( ocean )  THEN
+             CALL diffusion_e( prho, prho_reference )
           ELSE
-             IF ( .NOT. humidity )  THEN
-                IF ( ocean )  THEN
-                   CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e, km, l_grid, &
-                                     prho, prho_reference, rif, tend, zu, zw )
-                ELSE
-                   CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e, km, l_grid, &
-                                     pt, pt_reference, rif, tend, zu, zw )
-                ENDIF
-             ELSE
-                CALL diffusion_e( ddzu, dd2zu, ddzw, diss, e, km, l_grid, vpt, &
-                                  pt_reference, rif, tend, zu, zw )
-             ENDIF
-          ENDIF
-       ENDIF
+             CALL diffusion_e( pt, pt_reference )
+          ENDIF
+       ELSE
+          CALL diffusion_e( vpt, pt_reference )
+       ENDIF
+
        CALL production_e
 
@@ -2249,8 +1859,6 @@
           DO  j = nys, nyn
              DO  k = nzb_s_inner(j,i)+1, nzt
-                e_p(k,j,i) = ( 1 - sat ) * e_m(k,j,i) + sat * e(k,j,i) +       &
-                             dt_3d * (                                         &
-                                      sbt * tend(k,j,i) + tsc(3) * te_m(k,j,i) &
-                                     )
+                e_p(k,j,i) = e(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +          &
+                                                  tsc(3) * te_m(k,j,i) )
                 IF ( e_p(k,j,i) < 0.0 )  e_p(k,j,i) = 0.1 * e(k,j,i)
              ENDDO
Index: palm/trunk/SOURCE/read_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/read_3d_binary.f90	(revision 997)
+++ palm/trunk/SOURCE/read_3d_binary.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -376,9 +376,4 @@
                             tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'e_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   e_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                             tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'iran' ) ! matching random numbers is still unresolved
                                 ! issue
@@ -390,18 +385,8 @@
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'kh_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   kh_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'km' )
                    IF ( k == 1 )  READ ( 13 )  tmp_3d
                    km(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
-                CASE ( 'km_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   km_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
                 CASE ( 'lpt_av' )
@@ -476,9 +461,4 @@
                                     tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'pt_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   pt_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                                    tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'q' )
                    IF ( k == 1 )  READ ( 13 )  tmp_3d
@@ -494,9 +474,4 @@
                                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'q_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   q_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'ql' )
                    IF ( k == 1 )  READ ( 13 )  tmp_3d
@@ -544,9 +519,4 @@
                    IF ( k == 1 )  READ ( 13 )  tmp_2d
                    qsws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
-                CASE ( 'qsws_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   qsws_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
                                           tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
@@ -564,9 +534,4 @@
                                           tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'qswst_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   qswst_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'qv_av' )
                    IF ( .NOT. ALLOCATED( qv_av ) )  THEN
@@ -594,9 +559,4 @@
                                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'rif_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   rif_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                        tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'rif_wall' )
                    IF ( k == 1 )  THEN
@@ -644,8 +604,4 @@
                       tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'shf_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   shf_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                        tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
                 CASE ( 'shf_av' )
                    IF ( .NOT. ALLOCATED( shf_av ) )  THEN
@@ -655,4 +611,5 @@
                    shf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
                 CASE ( 'spectrum_x' )
                    IF ( k == 1 )  THEN
@@ -703,9 +660,4 @@
                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'tswst_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   tswst_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'u' )
                    IF ( k == 1 )  READ ( 13 )  tmp_3d
@@ -721,9 +673,4 @@
                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'u_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   u_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                                 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'u_m_l' )
                    IF ( k == 1 )  THEN
@@ -781,14 +728,4 @@
                         tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'usws_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   usws_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                         tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
-                CASE ( 'uswst_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   uswst_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'us_av' )
                    IF ( .NOT. ALLOCATED( us_av ) )  THEN
@@ -812,9 +749,4 @@
                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'v_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   v_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'v_m_l' )
                    IF ( k == 1 )  THEN
@@ -870,9 +802,4 @@
                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'vpt_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   vpt_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'vsws' )
                    IF ( k == 1 )  READ ( 13 )  tmp_2d
@@ -884,14 +811,4 @@
                    vswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
                         tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
-                CASE ( 'vsws_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   vsws_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                         tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
-                CASE ( 'vswst_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   vswst_m(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  = &
-                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
                 CASE ( 'w' )
@@ -907,9 +824,4 @@
                    w_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
-                CASE ( 'w_m' )
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   w_m(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
-                                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
                 CASE ( 'w_m_l' )
Index: palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- palm/trunk/SOURCE/read_var_list.f90	(revision 997)
+++ palm/trunk/SOURCE/read_var_list.f90	(revision 1001)
@@ -4,5 +4,6 @@
 ! Current revisions:
 ! ------------------
-!
+! -cut_spline_overshoot, dt_fixed, last_dt_change, long_filter_factor,
+! overshoot_limit_*, ups_limit_*
 !
 ! Former revisions:
@@ -313,6 +314,4 @@
           CASE ( 'curvature_solution_effects' )
              READ ( 13 )  curvature_solution_effects
-          CASE ( 'cut_spline_overshoot' )
-             READ ( 13 )  cut_spline_overshoot
           CASE ( 'cycle_mg' )
              READ ( 13 )  cycle_mg
@@ -331,10 +330,4 @@
           CASE ( 'drag_coefficient' )
              READ ( 13 )  drag_coefficient
-          CASE ( '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
@@ -400,12 +393,8 @@
           CASE ( 'lad_vertical_gradient_level_in' )
              READ ( 13 )  lad_vertical_gradient_level_ind
-          CASE ( 'last_dt_change' )
-             READ ( 13 )  last_dt_change
            CASE ( 'large_scale_subsidence' )
              READ ( 13 )  large_scale_subsidence
           CASE ( 'leaf_surface_concentration' )
              READ ( 13 )  leaf_surface_concentration
-          CASE ( 'long_filter_factor' )
-             READ ( 13 )  long_filter_factor
           CASE ( 'loop_optimization' )
              READ ( 13 )  loop_optimization
@@ -451,14 +440,4 @@
           CASE ( 'output_for_t0' )
              READ (13)    output_for_t0
-          CASE ( 'overshoot_limit_e' )
-             READ ( 13 )  overshoot_limit_e
-          CASE ( 'overshoot_limit_pt' )
-             READ ( 13 )  overshoot_limit_pt
-          CASE ( 'overshoot_limit_u' )
-             READ ( 13 )  overshoot_limit_u
-          CASE ( 'overshoot_limit_v' )
-             READ ( 13 )  overshoot_limit_v
-          CASE ( 'overshoot_limit_w' )
-             READ ( 13 )  overshoot_limit_w
           CASE ( 'passive_scalar' )
              READ ( 13 )  passive_scalar
@@ -637,14 +616,4 @@
           CASE ( 'ug_vertical_gradient_level_ind' )
              READ ( 13 )  ug_vertical_gradient_level_ind
-          CASE ( 'ups_limit_e' )
-             READ ( 13 )  ups_limit_e
-          CASE ( 'ups_limit_pt' )
-             READ ( 13 )  ups_limit_pt
-          CASE ( 'ups_limit_u' )
-             READ ( 13 )  ups_limit_u
-          CASE ( 'ups_limit_v' )
-             READ ( 13 )  ups_limit_v
-          CASE ( 'ups_limit_w' )
-             READ ( 13 )  ups_limit_w
           CASE ( 'use_surface_fluxes' )
              READ ( 13 )  use_surface_fluxes
Index: palm/trunk/SOURCE/run_control.f90
===================================================================
--- palm/trunk/SOURCE/run_control.f90	(revision 997)
+++ palm/trunk/SOURCE/run_control.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -43,5 +43,5 @@
     IMPLICIT NONE
 
-    CHARACTER (LEN=1) ::  change_chr, disturb_chr
+    CHARACTER (LEN=1) ::  disturb_chr
 
 !
@@ -70,17 +70,4 @@
 
 !
-!--    Output the the beginning of the run receives no information about an
-!--    Euler-timestep
-       IF ( dt_changed  .AND.  simulated_time /= 0.0  .AND. &
-            timestep_scheme(1:5) /= 'runge' )  THEN
-          IF ( timestep_scheme == 'leapfrog' )  THEN
-             change_chr = 'L'
-          ELSE
-             change_chr = 'E'
-          ENDIF
-       ELSE
-          change_chr = ' '
-       ENDIF
-!
 !--    If required, set disturbance flag
        IF ( disturbance_created )  THEN
@@ -91,5 +78,5 @@
        WRITE ( 15, 101 )  runnr, current_timestep_number, simulated_time_chr,  &
                           simulated_time-INT( simulated_time ), dt_3d,         &
-                          timestep_reason, change_chr, u_max, disturb_chr,     &
+                          timestep_reason, u_max, disturb_chr,                 &
                           v_max, disturb_chr, w_max, hom(nzb,1,pr_palm,0),     &
                           hom(nzb+8,1,pr_palm,0), hom(nzb+3,1,pr_palm,0),      &
@@ -124,5 +111,5 @@
           &'----------------------------------------------------------------', &
           &'-----')
-101 FORMAT (I3,1X,I6,1X,A8,F3.2,1X,F8.4,A1,A1,F8.4,A1,F8.4,A1,F8.4,2X,F5.3,2X, &
+101 FORMAT (I3,1X,I6,1X,A8,F3.2,1X,F8.4,A1,1X,F8.4,A1,F8.4,A1,F8.4,2X,F5.3,2X, &
             F4.2, &
             2X,F6.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
Index: palm/trunk/SOURCE/spline_x.f90
===================================================================
--- palm/trunk/SOURCE/spline_x.f90	(revision 997)
+++ 	(revision )
@@ -1,525 +1,0 @@
- SUBROUTINE spline_x( vad_in_out, ad_v, var_char )
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.8  2004/04/30 12:54:20  raasch
-! Names of transpose indices changed, enlarged transposition arrays introduced
-!
-! Revision 1.1  1999/02/05 09:15:59  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Upstream-spline advection along x
-!
-! Input/output parameters:
-! ad_v       = advecting wind speed component
-! vad_in_out = quantity to be advected, excluding ghost- or cyclic boundaries
-!              result is given to the calling routine in this array
-! var_char   = string which defines the quantity to be advected
-!
-! Internal arrays:
-! r          = 2D-working array (right hand side of linear equation, buffer for
-!              Long filter)
-! tf         = tendency field (2D), used for long filter
-! vad        = quantity to be advected (2D), including ghost- or cyclic
-!              boundarys along the direction of advection
-! wrk_long   = working array (long coefficients)
-! wrk_spline = working array (spline coefficients)
-!------------------------------------------------------------------------------!
-
-    USE advection
-    USE grid_variables
-    USE indices
-    USE statistics
-    USE control_parameters
-    USE transpose_indices
-
-    IMPLICIT NONE
-
-    CHARACTER (LEN=*) ::  var_char
-
-    INTEGER ::  component, i, j, k, sr
-    REAL    ::  overshoot_limit, sm_faktor, t1, t2, t3, ups_limit
-    REAL, DIMENSION(:,:),   ALLOCATABLE ::  r, tf, vad, wrk_spline
-    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  wrk_long
-
-#if defined( __parallel )
-    REAL ::  ad_v(0:nxa,nys_x:nyn_xa,nzb_x:nzt_xa),       &
-             vad_in_out(0:nxa,nys_x:nyn_xa,nzb_x:nzt_xa)
-#else
-    REAL ::  ad_v(nzb+1:nzt,nys:nyn,nxl:nxr),               &
-             vad_in_out(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
-#endif
-
-!
-!-- Set criteria for switching between upstream- and upstream-spline-method
-    IF ( var_char == 'u' )  THEN
-       overshoot_limit = overshoot_limit_u
-       ups_limit       = ups_limit_u
-       component       = 1
-    ELSEIF (  var_char == 'v' )  THEN
-       overshoot_limit = overshoot_limit_v
-       ups_limit       = ups_limit_v
-       component       = 2
-    ELSEIF (  var_char == 'w' )  THEN
-       overshoot_limit = overshoot_limit_w
-       ups_limit       = ups_limit_w
-       component       = 3
-    ELSEIF (  var_char == 'pt' )  THEN
-       overshoot_limit = overshoot_limit_pt
-       ups_limit       = ups_limit_pt
-       component       = 4
-    ELSEIF (  var_char == 'e' )  THEN
-       overshoot_limit = overshoot_limit_e
-       ups_limit       = ups_limit_e
-       component       = 5
-    ENDIF
-
-!
-!-- Initialize calculation of relative upstream fraction
-    sums_up_fraction_l(component,1,:) = 0.0
-
-#if defined( __parallel )
-
-!
-!-- Allocate working arrays
-    ALLOCATE( r(-1:nx+1,nys_x:nyn_x), vad(-1:nx+1,nys_x:nyn_x), &
-              wrk_spline(0:nx,nys_x:nyn_x) )
-    IF ( long_filter_factor /= 0.0 )  THEN
-       ALLOCATE( tf(0:nx,nys_x:nyn_x), wrk_long(0:nx,nys_x:nyn_x,1:3) )
-    ENDIF
-
-!
-!-- Loop over all gridpoints along z
-    DO  k = nzb_x, nzt_x
-
-!
-!--    Store array to be advected on work array and add cyclic boundary along x
-       vad(0:nx,nys_x:nyn_x) = vad_in_out(0:nx,nys_x:nyn_x,k)
-       vad(-1,:)   = vad(nx,:)
-       vad(nx+1,:) = vad(0,:)
-
-!
-!--    Calculate right hand side
-       DO  j = nys_x, nyn_x
-          DO  i = 0, nx
-             r(i,j) = 3.0 * (                                                  &
-                            spl_tri_x(2,i) * ( vad(i,j) - vad(i-1,j) ) * ddx + &
-                            spl_tri_x(3,i) * ( vad(i+1,j) - vad(i,j) ) * ddx   &
-                            )
-          ENDDO
-       ENDDO
-
-!
-!--    Forward substitution
-       DO  j = nys_x, nyn_x
-          wrk_spline(0,j) = r(0,j)
-          DO  i = 1, nx
-             wrk_spline(i,j) = r(i,j) - spl_tri_x(5,i) * wrk_spline(i-1,j)
-          ENDDO
-       ENDDO
-
-!
-!--    Backward substitution (Sherman-Morrison-formula)
-       DO  j = nys_x, nyn_x
-          r(nx,j) = wrk_spline(nx,j) / spl_tri_x(4,nx)
-          DO  i = nx-1, 0, -1
-             r(i,j) = ( wrk_spline(i,j) - spl_tri_x(3,i) * r(i+1,j) ) / &
-                      spl_tri_x(4,i)
-          ENDDO
-          sm_faktor = ( r(0,j) + 0.5 * r(nx,j) / spl_gamma_x ) / &
-                      ( 1.0 + spl_z_x(0) + 0.5 * spl_z_x(nx) / spl_gamma_x )
-          DO  i = 0, nx
-             r(i,j) = r(i,j) - sm_faktor * spl_z_x(i)
-          ENDDO
-       ENDDO
-
-!
-!--    Add cyclic boundary to right hand side
-       r(-1,:)   = r(nx,:)
-       r(nx+1,:) = r(0,:)
-
-!
-!--    Calculate advection along x
-       DO  j = nys_x, nyn_x
-          DO  i = 0, nx
-
-             IF ( ad_v(i,j,k) == 0.0 )  THEN
-
-                vad_in_out(i,j,k) = vad(i,j)
-
-             ELSEIF ( ad_v(i,j,k) > 0.0 )  THEN
-
-                IF ( ABS( vad(i,j) - vad(i-1,j) ) <= ups_limit )  THEN
-                   vad_in_out(i,j,k) = vad(i,j) - dt_3d * ad_v(i,j,k) * &
-                                       ( vad(i,j) - vad(i-1,j) ) * ddx 
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,1,sr) = &
-                               sums_up_fraction_l(component,1,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = ad_v(i,j,k) * dt_3d * ddx
-                   t2 = 3.0 * ( vad(i-1,j) - vad(i,j) ) + &
-                        ( 2.0 * r(i,j) + r(i-1,j) ) * dx
-                   t3 = 2.0 * ( vad(i-1,j) - vad(i,j) ) + &
-                        ( r(i,j) + r(i-1,j) ) * dx
-                   vad_in_out(i,j,k) = vad(i,j) - r(i,j) * t1 * dx + &
-                                       t2 * t1**2 - t3 * t1**3
-                   IF ( vad(i-1,j) == vad(i,j) )  THEN
-                      vad_in_out(i,j,k) = vad(i,j)
-                   ENDIF
-                ENDIF
-
-             ELSE
-
-                IF ( ABS( vad(i,j) - vad(i+1,j) ) <= ups_limit )  THEN
-                   vad_in_out(i,j,k) = vad(i,j) - dt_3d * ad_v(i,j,k) * &
-                                       ( vad(i+1,j) - vad(i,j) ) * ddx
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,1,sr) = &
-                               sums_up_fraction_l(component,1,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = -ad_v(i,j,k) * dt_3d * ddx
-                   t2 = 3.0 * ( vad(i,j) - vad(i+1,j) ) + &
-                        ( 2.0 * r(i,j) + r(i+1,j) ) * dx
-                   t3 = 2.0 * ( vad(i,j) - vad(i+1,j) ) + &
-                        ( r(i,j) + r(i+1,j) ) * dx
-                   vad_in_out(i,j,k) = vad(i,j) + r(i,j) * t1 * dx - &
-                                       t2 * t1**2 + t3 * t1**3
-                   IF ( vad(i+1,j) == vad(i,j) )  THEN
-                      vad_in_out(i,j,k) = vad(i,j)
-                   ENDIF
-                ENDIF
-
-             ENDIF
-          ENDDO
-       ENDDO
-
-!
-!--    Limit values in order to prevent overshooting
-       IF ( cut_spline_overshoot )  THEN
-
-          DO  j = nys_x, nyn_x
-             DO  i = 0, nx
-                IF ( ad_v(i,j,k) > 0.0 ) THEN
-                   IF ( vad(i,j) > vad(i-1,j) )  THEN
-                      vad_in_out(i,j,k) = MIN( vad_in_out(i,j,k), &
-                                               vad(i,j)   + overshoot_limit )
-                      vad_in_out(i,j,k) = MAX( vad_in_out(i,j,k), &
-                                               vad(i-1,j) - overshoot_limit )
-                   ELSE
-                      vad_in_out(i,j,k) = MAX( vad_in_out(i,j,k), &
-                                               vad(i,j)   - overshoot_limit )
-                      vad_in_out(i,j,k) = MIN( vad_in_out(i,j,k), &
-                                               vad(i-1,j) + overshoot_limit )
-                   ENDIF
-                ELSE
-                   IF ( vad(i,j) > vad(i+1,j) )  THEN
-                      vad_in_out(i,j,k) = MIN( vad_in_out(i,j,k), &
-                                               vad(i,j)   + overshoot_limit )
-                      vad_in_out(i,j,k) = MAX( vad_in_out(i,j,k), &
-                                               vad(i+1,j) - overshoot_limit )
-                   ELSE
-                      vad_in_out(i,j,k) = MAX( vad_in_out(i,j,k), &
-                                               vad(i,j)   - overshoot_limit )
-                      vad_in_out(i,j,k) = MIN( vad_in_out(i,j,k), &
-                                               vad(i+1,j) + overshoot_limit )
-                   ENDIF
-                ENDIF
-             ENDDO
-          ENDDO
-
-       ENDIF
-
-!
-!--    Long-filter (acting on tendency only)
-       IF ( long_filter_factor /= 0.0 )  THEN
-
-!
-!--       Compute tendency
-          DO  j = nys_x, nyn_x
-             DO  i = 0, nx
-                tf(i,j) = vad_in_out(i,j,k) - vad(i,j)
-             ENDDO
-          ENDDO
-
-!
-!--       Apply the filter.
-          DO  j = nys_x, nyn_x
-             wrk_long(0,j,1) = 2.0 * ( 1.0 + long_filter_factor )
-             wrk_long(0,j,2) = ( 1.0 - long_filter_factor ) / wrk_long(0,j,1)
-             wrk_long(0,j,3) = ( long_filter_factor * tf(nx,j) + &
-                                 2.0 * tf(0,j) + tf(1,j)         &
-                               ) / wrk_long(0,j,1)
-             DO  i = 1, nx-1
-                wrk_long(i,j,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                  ( 1.0 - long_filter_factor ) * wrk_long(i-1,j,2)
-                wrk_long(i,j,2) = ( 1.0 - long_filter_factor ) / wrk_long(i,j,1)
-                wrk_long(i,j,3) = ( tf(i-1,j) + 2.0 * tf(i,j)  +               &
-                                    tf(i+1,j) - ( 1.0 - long_filter_factor ) * &
-                                    wrk_long(i-1,j,3) ) / wrk_long(i,j,1)
-             ENDDO
-             wrk_long(nx,j,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                ( 1.0 - long_filter_factor ) * wrk_long(nx-1,j,2)
-             wrk_long(nx,j,2) = ( 1.0 - long_filter_factor ) / wrk_long(nx,j,1)
-             wrk_long(nx,j,3) = ( tf(nx-1,j) + 2.0 * tf(nx,j) +  &
-                                  long_filter_factor * tf(0,j) - &
-                                  ( 1.0 - long_filter_factor ) * &
-                                  wrk_long(nx-1,j,3)             &
-                                ) / wrk_long(nx,j,1)
-             r(nx,j) = wrk_long(nx,j,3)
-          ENDDO
-
-          DO  i = nx-1, 0, -1
-             DO  j = nys_x, nyn_x
-                r(i,j) = wrk_long(i,j,3) - wrk_long(i,j,2) * r(i+1,j)
-             ENDDO
-          ENDDO
-
-          DO  j = nys_x, nyn_x 
-             DO  i = 0, nx
-                vad_in_out(i,j,k) = vad(i,j) + r(i,j)
-             ENDDO
-          ENDDO
-
-       ENDIF  ! Long filter
-
-    ENDDO
-
-#else
-
-!
-!-- Allocate working arrays
-    ALLOCATE( r(nzb+1:nzt,nxl-1:nxr+1), vad(nzb:nzt+1,nxl-1:nxr+1), &
-              wrk_spline(nzb+1:nzt,nxl-1:nxr+1) )
-    IF ( long_filter_factor /= 0.0 )  THEN
-       ALLOCATE( tf(nzb+1:nzt,nxl-1:nxr+1), wrk_long(nzb+1:nzt,0:nx,1:3) )
-    ENDIF
-
-!
-!-- Loop over all gridpoints along y
-    DO  j = nys, nyn
-    
-!
-!--    Store array to be advected on work array and add cyclic boundary along x
-       vad(:,:) = vad_in_out(:,j,:)
-       vad(:,-1)   = vad(:,nx)
-       vad(:,nx+1) = vad(:,0)
-
-!
-!--    Calculate right hand side
-       DO  i = 0, nx
-          DO  k = nzb+1, nzt
-             r(k,i) = 3.0 * (                                                  &
-                            spl_tri_x(2,i) * ( vad(k,i) - vad(k,i-1) ) * ddx + &
-                            spl_tri_x(3,i) * ( vad(k,i+1) - vad(k,i) ) * ddx   &
-                            )
-          ENDDO
-       ENDDO
-    
-!
-!--    Forward substitution
-       DO  k = nzb+1, nzt
-          wrk_spline(k,0) = r(k,0)
-       ENDDO
-
-       DO  i = 1, nx
-          DO  k = nzb+1, nzt
-             wrk_spline(k,i) = r(k,i) - spl_tri_x(5,i) * wrk_spline(k,i-1)
-          ENDDO
-       ENDDO
-
-!
-!--    Backward substitution (Sherman-Morrison-formula)
-       DO  k = nzb+1, nzt
-          r(k,nx) = wrk_spline(k,nx) / spl_tri_x(4,nx)
-       ENDDO
-
-       DO  k = nzb+1, nzt
-          DO  i = nx-1, 0, -1
-             r(k,i) = ( wrk_spline(k,i) - spl_tri_x(3,i) * r(k,i+1) ) / &
-                        spl_tri_x(4,i)
-          ENDDO
-          sm_faktor = ( r(k,0) + 0.5 * r(k,nx) / spl_gamma_x ) / &
-                      ( 1.0 + spl_z_x(0) + 0.5 * spl_z_x(nx) / spl_gamma_x )
-          DO  i = 0, nx
-             r(k,i) = r(k,i) - sm_faktor * spl_z_x(i)
-          ENDDO
-       ENDDO
-
-!
-!--    Add cyclic boundary to the right hand side
-       r(:,-1)   = r(:,nx)
-       r(:,nx+1) = r(:,0)
-
-!
-!--    Calculate advection along x
-       DO  i = 0, nx
-          DO  k = nzb+1, nzt
-
-             IF (ad_v(k,j,i) == 0.0)  THEN
-
-                vad_in_out(k,j,i) = vad(k,i)
-
-             ELSEIF ( ad_v(k,j,i) > 0.0)  THEN
-                
-                IF ( ABS( vad(k,i) - vad(k,i-1) ) <= ups_limit ) THEN
-                   vad_in_out(k,j,i) = vad(k,i) - dt_3d * ad_v(k,j,i) * &
-                                       ( vad(k,i) - vad(k,i-1) ) * ddx
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,1,sr) = &
-                               sums_up_fraction_l(component,1,sr) + 1.0
-                   ENDDO
-                ELSE 
-                   t1 = ad_v(k,j,i) * dt_3d * ddx
-                   t2 = 3.0 * ( vad(k,i-1) - vad(k,i) ) + &
-                        ( 2.0 * r(k,i) + r(k,i-1) ) * dx
-                   t3 = 2.0 * ( vad(k,i-1) - vad(k,i) ) + &
-                        ( r(k,i) + r(k,i-1) ) * dx
-                   vad_in_out(k,j,i) = vad(k,i) - r(k,i) * t1 * dx + &
-                                       t2 * t1**2 - t3 * t1**3
-                   IF ( vad(k,i-1) == vad(k,i) )  THEN
-                      vad_in_out(k,j,i) = vad(k,i)
-                   ENDIF
-                ENDIF
-
-             ELSE
-
-                IF ( ABS( vad(k,i) - vad(k,i+1) ) <= ups_limit ) THEN
-                   vad_in_out(k,j,i) = vad(k,i) - dt_3d * ad_v(k,j,i) * &
-                                       ( vad(k,i+1) - vad(k,i) ) * ddx
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,1,sr) = &
-                               sums_up_fraction_l(component,1,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = -ad_v(k,j,i) * dt_3d * ddx
-                   t2 = 3.0 * ( vad(k,i) - vad(k,i+1) ) + &
-                        ( 2.0 * r(k,i) + r(k,i+1)) * dx
-                   t3 = 2.0 * ( vad(k,i) - vad(k,i+1) ) + &
-                        ( r(k,i) + r(k,i+1) ) * dx
-                   vad_in_out(k,j,i) = vad(k,i) + r(k,i) * t1 * dx - &
-                                       t2 * t1**2 + t3 * t1**3
-                   IF ( vad(k,i+1) == vad(k,i) )  THEN
-                      vad_in_out(k,j,i) = vad(k,i)
-                   ENDIF
-                ENDIF
-
-             ENDIF
-          ENDDO
-       ENDDO
-
-!
-!--    Limit values in order to prevent overshooting
-       IF ( cut_spline_overshoot )  THEN
-
-          DO  i = 0, nx
-             DO  k =  nzb+1, nzt
-                IF ( ad_v(k,j,i) > 0.0 ) THEN
-                   IF ( vad(k,i) > vad(k,i-1) )  THEN
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,i)   + overshoot_limit )
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,i-1) - overshoot_limit )
-                   ELSE
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,i)   - overshoot_limit )
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,i-1) + overshoot_limit )
-                   ENDIF
-                ELSE
-                   IF ( vad(k,i) > vad(k,i+1) )  THEN
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,i)   + overshoot_limit )
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,i+1) - overshoot_limit )
-                   ELSE
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,i)   - overshoot_limit )
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,i+1) + overshoot_limit )
-                   ENDIF
-                ENDIF
-             ENDDO
-          ENDDO
-
-       ENDIF
-
-!
-!--    Long filter (acting on tendency only)
-       IF ( long_filter_factor /= 0.0 )  THEN
-
-!
-!--       Compute tendency
-          DO  i = nxl, nxr
-             DO  k = nzb+1, nzt
-                tf(k,i) = vad_in_out(k,j,i) - vad(k,i)
-             ENDDO
-          ENDDO
-
-!
-!--       Apply the filter
-          wrk_long(:,0,1) = 2.0 * ( 1.0 + long_filter_factor )
-          wrk_long(:,0,2) = ( 1.0 - long_filter_factor ) / wrk_long(:,0,1)
-          wrk_long(:,0,3) = ( long_filter_factor * tf(:,nx) + &
-                                   2.0 * tf(:,0) + tf(:,1) ) / wrk_long(:,0,1)
-
-          DO  i = 1, nx-1
-             DO  k = nzb+1, nzt
-                wrk_long(k,i,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                  ( 1.0 - long_filter_factor ) *       &
-                                  wrk_long(k,i-1,2)
-                wrk_long(k,i,2) = ( 1.0 - long_filter_factor ) / wrk_long(k,i,1)
-                wrk_long(k,i,3) = ( tf(k,i-1) + 2.0 * tf(k,i) +                &
-                                    tf(k,i+1) - ( 1.0 - long_filter_factor ) * &
-                                    wrk_long(k,i-1,3) ) / wrk_long(k,i,1)
-             ENDDO
-             wrk_long(:,nx,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                      ( 1.0 - long_filter_factor ) * &
-                                        wrk_long(:,nx-1,2)
-             wrk_long(:,nx,2) = ( 1.0 - long_filter_factor ) / wrk_long(:,nx,1)
-             wrk_long(:,nx,3) = ( tf(:,nx-1) + 2.0 * tf(:,nx) +    &
-                                    long_filter_factor * tf(:,0) - &
-                                    ( 1.0 - long_filter_factor ) * &
-                                    wrk_long(:,nx-1,3) ) / wrk_long(:,nx,1)
-             r(:,nx) = wrk_long(:,nx,3)
-          ENDDO
-          DO  i = nx-1, 0, -1
-             DO  k = nzb+1, nzt
-                r(k,i) = wrk_long(k,i,3) - wrk_long(k,i,2) * r(k,i+1)
-             ENDDO
-          ENDDO
-          DO  i = 0, nx
-             DO  k = nzb+1, nzt
-                vad_in_out(k,j,i) = vad(k,i) + r(k,i)
-             ENDDO
-          ENDDO
-
-       ENDIF  ! Long filter
-
-    ENDDO
-#endif
-
-    IF ( long_filter_factor /= 0.0 )  DEALLOCATE( tf, wrk_long )
-    DEALLOCATE( r, vad, wrk_spline )
-
- END SUBROUTINE spline_x
Index: palm/trunk/SOURCE/spline_y.f90
===================================================================
--- palm/trunk/SOURCE/spline_y.f90	(revision 997)
+++ 	(revision )
@@ -1,527 +1,0 @@
- SUBROUTINE spline_y( vad_in_out, ad_v, var_char )
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.9  2004/04/30 12:54:37  raasch
-! Names of transpose indices changed, enlarged transposition arrays introduced
-!
-! Revision 1.1  1999/02/05 09:16:31  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Upstream-spline advection along x
-!
-! Input/output parameters:
-! ad_v       = advecting wind speed component
-! vad_in_out = quantity to be advected, excluding ghost- or cyclic boundaries
-!              result is given to the calling routine in this array
-! var_char   = string which defines the quantity to be advected
-!
-! Internal arrays:
-! r          = 2D-working array (right hand side of linear equation, buffer for
-!              Long filter)
-! tf         = tendency field (2D), used for long filter
-! vad        = quantity to be advected (2D), including ghost- or cyclic
-!              boundarys along the direction of advection
-! wrk_long   = working array (long coefficients)
-! wrk_spline = working array (spline coefficients)
-!------------------------------------------------------------------------------!
-
-    USE advection
-    USE grid_variables
-    USE indices
-    USE statistics
-    USE control_parameters
-    USE transpose_indices
-
-    IMPLICIT NONE
-
-    CHARACTER (LEN=*) ::  var_char
-
-    INTEGER ::  component, i, j, k, sr
-    REAL    ::  overshoot_limit, sm_faktor, t1, t2, t3, ups_limit
-    REAL, DIMENSION(:,:), ALLOCATABLE   ::  r, tf, vad, wrk_spline
-    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  wrk_long
-
-#if defined( __parallel )
-    REAL ::  ad_v(0:nya,nxl_y:nxr_ya,nzb_y:nzt_ya), &
-             vad_in_out(0:nya,nxl_y:nxr_ya,nzb_y:nzt_ya)
-#else
-    REAL ::  ad_v(nzb+1:nzt,nys:nyn,nxl:nxr), &
-             vad_in_out(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
-#endif
-
-!
-!-- Set criteria for switching between upstream- and upstream-spline-method
-    IF ( var_char == 'u' )  THEN
-       overshoot_limit = overshoot_limit_u
-       ups_limit       = ups_limit_u
-       component       = 1
-    ELSEIF (  var_char == 'v' )  THEN
-       overshoot_limit = overshoot_limit_v
-       ups_limit       = ups_limit_v
-       component       = 2
-    ELSEIF (  var_char == 'w' )  THEN
-       overshoot_limit = overshoot_limit_w
-       ups_limit       = ups_limit_w
-       component       = 3
-    ELSEIF (  var_char == 'pt' )  THEN
-       overshoot_limit = overshoot_limit_pt
-       ups_limit       = ups_limit_pt
-       component       = 4
-    ELSEIF (  var_char == 'e' )  THEN
-       overshoot_limit = overshoot_limit_e
-       ups_limit       = ups_limit_e
-       component       = 5
-    ENDIF
-
-!
-!-- Initialize calculation of relative upstream fraction
-    sums_up_fraction_l(component,2,:) = 0.0
-
-#if defined( __parallel )
-
-!
-!-- Allocate working arrays
-    ALLOCATE( r(-1:ny+1,nxl_y:nxr_y),   &
-              vad(-1:ny+1,nxl_y:nxr_y), &
-              wrk_spline(0:ny,nxl_y:nxr_y) )
-    IF ( long_filter_factor /= 0.0 )  THEN
-       ALLOCATE( tf(0:ny,nxl_y:nxr_y), &
-                 wrk_long(0:ny,nxl_y:nxr_y,1:3) )
-    ENDIF
-
-!
-!-- Loop over all gridpoints along z
-    DO  k = nzb_y, nzt_y
-
-!
-!--    Store array to be advected on work array and add cyclic boundary along y
-       vad(0:ny,nxl_y:nxr_y) = vad_in_out(0:ny,nxl_y:nxr_y,k)
-       vad(-1,:)   = vad(ny,:)
-       vad(ny+1,:) = vad(0,:)
-
-!
-!--    Calculate right hand side
-       DO  i = nxl_y, nxr_y
-          DO  j = 0, ny
-             r(j,i) = 3.0 * (                                                  &
-                            spl_tri_y(2,j) * ( vad(j,i) - vad(j-1,i) ) * ddy + &
-                            spl_tri_y(3,j) * ( vad(j+1,i) - vad(j,i) ) * ddy   &
-                            )
-          ENDDO
-       ENDDO
-    
-!
-!--    Forward substitution
-       DO  i = nxl_y, nxr_y
-          wrk_spline(0,i) = r(0,i)
-          DO  j = 1, ny
-             wrk_spline(j,i) = r(j,i) - spl_tri_y(5,j) * wrk_spline(j-1,i)
-          ENDDO
-       ENDDO
-    
-!
-!--    Backward substitution (sherman-Morrison-formula)
-       DO  i = nxl_y, nxr_y
-          r(ny,i) = wrk_spline(ny,i) / spl_tri_y(4,ny)
-          DO  j = ny-1, 0, -1
-             r(j,i) = ( wrk_spline(j,i) - spl_tri_y(3,j) * r(j+1,i) ) / &
-                        spl_tri_y(4,j)
-          ENDDO
-          sm_faktor = ( r(0,i) + 0.5 * r(ny,i) / spl_gamma_y ) / &
-                      ( 1.0 + spl_z_y(0) + 0.5 * spl_z_y(ny) / spl_gamma_y )
-          DO  j = 0, ny
-             r(j,i) = r(j,i) - sm_faktor * spl_z_y(j)
-          ENDDO
-       ENDDO
-
-! 
-!--    Add cyclic boundary conditions to right hand side
-       r(-1,:)   = r(ny,:)
-       r(ny+1,:) = r(0,:)
-
-!
-!--    Calculate advection along y
-       DO  i = nxl_y, nxr_y
-          DO  j = 0, ny
-
-             IF ( ad_v(j,i,k) == 0.0 )  THEN
-
-                vad_in_out(j,i,k) = vad(j,i)
-
-             ELSEIF ( ad_v(j,i,k) > 0.0 )  THEN
-
-                IF ( ABS( vad(j,i) - vad(j-1,i) ) <= ups_limit )  THEN
-                   vad_in_out(j,i,k) = vad(j,i) - dt_3d * ad_v(j,i,k) * &
-                                       ( vad(j,i) - vad(j-1,i) ) * ddy
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,2,sr) = &
-                               sums_up_fraction_l(component,2,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = ad_v(j,i,k) * dt_3d * ddy
-                   t2 = 3.0 * ( vad(j-1,i) - vad(j,i) ) + &
-                        ( 2.0 * r(j,i) + r(j-1,i) ) * dy
-                   t3 = 2.0 * ( vad(j-1,i) - vad(j,i) ) + &
-                              ( r(j,i) + r(j-1,i) ) * dy
-                   vad_in_out(j,i,k) = vad(j,i) - r(j,i) * t1 * dy + &
-                                       t2 * t1**2 - t3 * t1**3
-                   IF ( vad(j-1,i) == vad(j,i) )  THEN
-                      vad_in_out(j,i,k) = vad(j,i)
-                   ENDIF
-                ENDIF
-
-             ELSE
-
-                IF ( ABS( vad(j,i) - vad(j+1,i) ) <= ups_limit )  THEN
-                   vad_in_out(j,i,k) = vad(j,i) - dt_3d * ad_v(j,i,k) * &
-                                       ( vad(j+1,i) - vad(j,i) ) * ddy
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,2,sr) = &
-                               sums_up_fraction_l(component,2,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = -ad_v(j,i,k) * dt_3d * ddy
-                   t2 = 3.0 * ( vad(j,i) - vad(j+1,i) ) + &
-                        ( 2.0 * r(j,i) + r(j+1,i) ) * dy
-                   t3 = 2.0 * ( vad(j,i) - vad(j+1,i) ) + &
-                        ( r(j,i) + r(j+1,i) ) * dy
-                   vad_in_out(j,i,k) = vad(j,i) + r(j,i) * t1 * dy - &
-                                       t2 * t1**2 + t3 * t1**3
-                   IF ( vad(j+1,i) == vad(j,i) )  THEN
-                      vad_in_out(j,i,k) = vad(j,i)
-                   ENDIF
-                ENDIF
-
-             ENDIF
-          ENDDO
-       ENDDO
-
-!
-!--    Limit values in order to prevent overshooting
-       IF ( cut_spline_overshoot )  THEN
-
-          DO  i = nxl_y, nxr_y
-             DO  j = 0, ny
-                IF ( ad_v(j,i,k) > 0.0 ) THEN
-                   IF ( vad(j,i) > vad(j-1,i) )  THEN
-                      vad_in_out(j,i,k) = MIN( vad_in_out(j,i,k), &
-                                               vad(j,i)   + overshoot_limit )
-                      vad_in_out(j,i,k) = MAX( vad_in_out(j,i,k), &
-                                               vad(j-1,i) - overshoot_limit )
-                   ELSE
-                      vad_in_out(j,i,k) = MAX( vad_in_out(j,i,k), &
-                                               vad(j,i)   - overshoot_limit )
-                      vad_in_out(j,i,k) = MIN( vad_in_out(j,i,k), &
-                                               vad(j-1,i) + overshoot_limit )
-                   ENDIF
-                ELSE
-                   IF ( vad(j,i) > vad(j+1,i) )  THEN
-                      vad_in_out(j,i,k) = MIN( vad_in_out(j,i,k), &
-                                               vad(j,i)   + overshoot_limit )
-                      vad_in_out(j,i,k) = MAX( vad_in_out(j,i,k), &
-                                               vad(j+1,i) - overshoot_limit )
-                   ELSE
-                      vad_in_out(j,i,k) = MAX( vad_in_out(j,i,k), &
-                                               vad(j,i)   - overshoot_limit )
-                      vad_in_out(j,i,k) = MIN( vad_in_out(j,i,k), &
-                                               vad(j+1,i) + overshoot_limit )
-                   ENDIF
-                ENDIF
-             ENDDO
-          ENDDO
-
-       ENDIF
-
-!
-!--    Long-filter (acting on tendency only)
-       IF ( long_filter_factor /= 0.0 )  THEN
-
-!
-!--       Compute tendency. Filter only acts on this quantity.
-          DO  i = nxl_y, nxr_y
-             DO  j = 0, ny
-                tf(j,i) = vad_in_out(j,i,k) - vad(j,i)
-             ENDDO
-          ENDDO
-
-!
-!--       Apply the filter.
-          DO  i = nxl_y, nxr_y
-             wrk_long(0,i,1) = 2.0 * ( 1.0 + long_filter_factor )
-             wrk_long(0,i,2) = ( 1.0 - long_filter_factor ) / wrk_long(0,i,1)
-             wrk_long(0,i,3) = ( long_filter_factor * tf(ny,i) + &
-                                2.0 * tf(0,i) + tf(1,i)          &
-                               ) / wrk_long(0,i,1)
-             DO  j = 1, ny-1
-                wrk_long(j,i,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                  ( 1.0 - long_filter_factor ) * wrk_long(j-1,i,2)
-                wrk_long(j,i,2) = ( 1.0 - long_filter_factor ) / wrk_long(j,i,1)
-                wrk_long(j,i,3) = ( tf(j-1,i) + 2.0 * tf(j,i) +                &
-                                    tf(j+1,i) - ( 1.0 - long_filter_factor ) * &
-                                    wrk_long(j-1,i,3) ) / wrk_long(j,i,1)
-             ENDDO
-             wrk_long(ny,i,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                ( 1.0 - long_filter_factor ) * wrk_long(ny-1,i,2)
-             wrk_long(ny,i,2) = ( 1.0 - long_filter_factor ) / wrk_long(ny,i,1)
-             wrk_long(ny,i,3) = ( tf(ny-1,i) + 2.0 * tf(ny,i) +  &
-                                  long_filter_factor * tf(0,i) - &
-                                  ( 1.0 - long_filter_factor ) * &
-                                  wrk_long(ny-1,i,3)             &
-                                ) / wrk_long(ny,i,1)
-             r(ny,i) = wrk_long(ny,i,3)
-          ENDDO
-
-          DO  j = ny-1, 0, -1
-             DO  i = nxl_y, nxr_y
-                r(j,i) = wrk_long(j,i,3) - wrk_long(j,i,2) * r(j+1,i)
-             ENDDO
-          ENDDO
-
-          DO  i = nxl_y, nxr_y
-             DO  j = 0, ny
-                vad_in_out(j,i,k) = vad(j,i) + r(j,i)
-             ENDDO
-          ENDDO
-
-       ENDIF  ! Long filter
-
-    ENDDO
-
-#else
-
-!
-!-- Allocate working arrays
-    ALLOCATE( r(nzb+1:nzt,nys-1:nyn+1), vad(nzb:nzt+1,nys-1:nyn+1), &
-              wrk_spline(nzb+1:nzt,nys-1:nyn+1) )
-    IF ( long_filter_factor /= 0.0 )  THEN
-       ALLOCATE( tf(nzb+1:nzt,nys-1:nyn+1), wrk_long(nzb+1:nzt,0:ny,1:3) )
-    ENDIF
-
-!
-!-- Loop over all gridpoints along x
-    DO  i = nxl, nxr
-
-!
-!--    Store array to be advected on work array and add cyclic boundary along x
-       vad(:,:)    = vad_in_out(:,:,i)
-       vad(:,-1)   = vad(:,ny)
-       vad(:,ny+1) = vad(:,0)
-
-!
-!--    Calculate right hand side
-       DO  j = 0, ny
-          DO  k = nzb+1, nzt
-             r(k,j) = 3.0 *  (                                                  &
-                             spl_tri_y(2,j) * ( vad(k,j) - vad(k,j-1) ) * ddy + &
-                             spl_tri_y(3,j) * ( vad(k,j+1) - vad(k,j) ) * ddy   &
-                             )
-          ENDDO
-       ENDDO
-    
-!
-!--    Forward substitution
-       DO  k = nzb+1, nzt
-          wrk_spline(k,0) = r(k,0)
-       ENDDO
-
-       DO  j = 1, ny
-          DO  k = nzb+1, nzt
-             wrk_spline(k,j) = r(k,j) - spl_tri_y(5,j) * wrk_spline(k,j-1)
-          ENDDO
-       ENDDO
-
-!
-!--    Backward substitution (Sherman-Morrison-formula)
-       DO  k = nzb+1, nzt
-          r(k,ny) = wrk_spline(k,ny) / spl_tri_y(4,ny)
-       ENDDO
-
-       DO  k = nzb+1, nzt
-          DO  j = ny-1, 0, -1
-             r(k,j) = ( wrk_spline(k,j) - spl_tri_y(3,j) * r(k,j+1) ) / &
-                        spl_tri_y(4,j)
-          ENDDO
-          sm_faktor = ( r(k,0) + 0.5 * r(k,ny) / spl_gamma_y ) / &
-                      ( 1.0 + spl_z_y(0) + 0.5 * spl_z_y(ny) / spl_gamma_y )
-          DO  j = 0, ny
-             r(k,j) = r(k,j) - sm_faktor * spl_z_y(j)
-          ENDDO
-       ENDDO
-
-!
-!--    Add cyclic boundary to the right hand side
-       r(:,-1)   = r(:,ny)
-       r(:,ny+1) = r(:,0)
-   
-!
-!--    Calculate advection along y
-       DO  j = 0, ny
-          DO  k = nzb+1, nzt
-
-             IF ( ad_v(k,j,i) == 0.0 )  THEN
-
-                vad_in_out(k,j,i) = vad(k,j)
-
-             ELSEIF ( ad_v(k,j,i) > 0.0 )  THEN
-
-                IF ( ABS( vad(k,j) - vad(k,j-1) ) <= ups_limit ) THEN
-                   vad_in_out(k,j,i) = vad(k,j) - dt_3d * ad_v(k,j,i) * &
-                                       ( vad(k,j) - vad(k,j-1) ) * ddy
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,2,sr) = &
-                               sums_up_fraction_l(component,2,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = ad_v(k,j,i) * dt_3d * ddy
-                   t2 = 3.0 * ( vad(k,j-1) - vad(k,j) ) + &
-                        ( 2.0 * r(k,j) + r(k,j-1) ) * dy
-                   t3 = 2.0 * ( vad(k,j-1) - vad(k,j) ) + &
-                        ( r(k,j) + r(k,j-1) ) * dy
-                   vad_in_out(k,j,i) = vad(k,j) - r(k,j) * t1 * dy + &
-                                       t2 * t1**2 - t3 * t1**3
-                   IF ( vad(k,j-1) == vad(k,j) )  THEN
-                      vad_in_out(k,j,i) = vad(k,j)
-                   ENDIF
-                ENDIF
-
-             ELSE
-                
-                IF ( ABS( vad(k,j) - vad(k,j+1) ) <= ups_limit ) THEN
-                   vad_in_out(k,j,i) = vad(k,j) - dt_3d * ad_v(k,j,i) * &
-                                       ( vad(k,j+1) - vad(k,j) ) * ddy
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,2,sr) = &
-                               sums_up_fraction_l(component,2,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = -ad_v(k,j,i) * dt_3d * ddy
-                   t2 = 3.0 * ( vad(k,j) - vad(k,j+1) ) + &
-                        ( 2.0 * r(k,j) + r(k,j+1) ) * dy
-                   t3 = 2.0 * ( vad(k,j) - vad(k,j+1) ) + &
-                        ( r(k,j) + r(k,j+1) ) * dy
-                   vad_in_out(k,j,i) = vad(k,j) + r(k,j) * t1 * dy - &
-                                       t2 * t1**2 + t3 * t1**3
-                   IF ( vad(k,j+1) == vad(k,j) )  THEN
-                      vad_in_out(k,j,i) = vad(k,j)
-                   ENDIF
-                ENDIF
-
-             ENDIF
-          ENDDO
-       ENDDO
-
-!
-!--    Limit values in order to prevent overshooting
-       IF ( cut_spline_overshoot )  THEN
-
-          DO  j = 0, ny
-             DO  k = nzb+1, nzt
-                IF ( ad_v(k,j,i) > 0.0 ) THEN
-                   IF ( vad(k,j) > vad(k,j-1) )  THEN
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,j)   + overshoot_limit )
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,j-1) - overshoot_limit )
-                   ELSE
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,j)   - overshoot_limit )
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,j-1) + overshoot_limit )
-                   ENDIF
-                ELSE
-                   IF ( vad(k,j) > vad(k,j+1) )  THEN
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,j)   + overshoot_limit )
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,j+1) - overshoot_limit )
-                   ELSE
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,j)   - overshoot_limit )
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,j+1) + overshoot_limit )
-                   ENDIF
-                ENDIF
-             ENDDO
-          ENDDO
-
-       ENDIF
-
-!
-!--    Long filter (acting on tendency only)
-       IF ( long_filter_factor /= 0.0 )  THEN
-
-!
-!--       Compute tendency
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt
-                tf(k,j) = vad_in_out(k,j,i) - vad(k,j)
-             ENDDO
-          ENDDO
-
-!
-!--       Apply the filter
-          wrk_long(:,0,1) = 2.0 * ( 1.0 + long_filter_factor )
-          wrk_long(:,0,2) = ( 1.0 - long_filter_factor ) / wrk_long(:,0,1)
-          wrk_long(:,0,3) = ( long_filter_factor * tf(:,ny) + &
-                                   2.0 * tf(:,0) + tf(:,1) ) / wrk_long(:,0,1)
-
-          DO  j = 1, ny-1
-             DO  k = nzb+1, nzt
-                wrk_long(k,j,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                  ( 1.0 - long_filter_factor ) *       &
-                                  wrk_long(k,j-1,2)
-                wrk_long(k,j,2) = ( 1.0 - long_filter_factor ) / wrk_long(k,j,1)
-                wrk_long(k,j,3) = ( tf(k,j-1) + 2.0 * tf(k,j) +                &
-                                    tf(k,j+1) - ( 1.0 - long_filter_factor ) * &
-                                    wrk_long(k,j-1,3) ) / wrk_long(k,j,1)
-             ENDDO
-             wrk_long(:,ny,1) = 2.0 * ( 1.0 + long_filter_factor ) - &
-                                      ( 1.0 - long_filter_factor ) * &
-                                        wrk_long(:,ny-1,2)
-             wrk_long(:,ny,2) = ( 1.0 - long_filter_factor ) / wrk_long(:,ny,1)
-             wrk_long(:,ny,3) = ( tf(:,ny-1) + 2.0 * tf(:,ny) +    &
-                                    long_filter_factor * tf(:,0) - &
-                                    ( 1.0 - long_filter_factor ) * &
-                                    wrk_long(:,ny-1,3) ) / wrk_long(:,ny,1)
-             r(:,ny) = wrk_long(:,ny,3)
-          ENDDO
-          DO  j = ny-1, 0, -1
-             DO  k = nzb+1, nzt
-                r(k,j) = wrk_long(k,j,3) - wrk_long(k,j,2) * r(k,j+1)
-             ENDDO
-          ENDDO
-          DO  j = 0, ny
-             DO  k = nzb+1, nzt
-                vad_in_out(k,j,i) = vad(k,j) + r(k,j)
-             ENDDO
-          ENDDO
-
-       ENDIF  ! Long filter
-
-    ENDDO
-#endif
-
-    IF ( long_filter_factor /= 0.0 )  DEALLOCATE( tf, wrk_long )
-    DEALLOCATE( r, vad, wrk_spline )
-
- END SUBROUTINE spline_y
Index: palm/trunk/SOURCE/spline_z.f90
===================================================================
--- palm/trunk/SOURCE/spline_z.f90	(revision 997)
+++ 	(revision )
@@ -1,431 +1,0 @@
- SUBROUTINE spline_z( vad_in_out, ad_v, dz_spline, spline_tri, var_char )
-
-!------------------------------------------------------------------------------!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-!
-! 19 2007-02-23 04:53:48Z raasch
-! Boundary condition for pt at top adjusted
-!
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.9  2005/06/29 08:22:56  steinfeld
-! Dependency of ug and vg on height considered in the determination of the
-! upper boundary condition for vad
-!
-! Revision 1.1  1999/02/05 09:17:16  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Upstream-spline advection along x
-!
-! Input/output parameters:
-! ad_v       = advecting wind speed component
-! dz_spline  = vertical grid spacing (dzu or dzw, depending on quantity to be
-!              advected)
-! spline_tri = grid spacing factors (spl_tri_zu or spl_tri_zw, depending on
-!              quantity to be advected)
-! vad_in_out = quantity to be advected, excluding ghost- or cyclic boundaries
-!              result is given to the calling routine in this array
-! var_char   = string which defines the quantity to be advected
-!
-! Internal arrays:
-! r          = 2D-working array (right hand side of linear equation, buffer for
-!              Long filter)
-! tf         = tendency field (2D), used for long filter
-! vad        = quantity to be advected (2D), including ghost- or cyclic
-!              boundarys along the direction of advection
-! wrk_long   = working array (long coefficients)
-! wrk_spline = working array (spline coefficients)
-!------------------------------------------------------------------------------!
-
-    USE arrays_3d
-    USE grid_variables
-    USE indices
-    USE statistics
-    USE control_parameters
-    USE transpose_indices
-
-    IMPLICIT NONE
-
-    CHARACTER (LEN=*) ::  var_char
-
-    INTEGER ::  component, i, j, k, sr
-    REAL ::     dzwd, dzwu, overshoot_limit, t1, t2, t3, ups_limit
-    REAL ::     dz_spline(1:nzt+1)
-    REAL ::     spline_tri(5,nzb:nzt+1)
-    REAL ::     ad_v(nzb+1:nzta,nys:nyna,nxl:nxra)
-
-    REAL, DIMENSION(:,:), ALLOCATABLE   ::  r, tf, vad, wrk_spline
-    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  wrk_long
-
-#if defined( __parallel )
-    REAL ::     vad_in_out(nzb+1:nzta,nys:nyna,nxl:nxra)
-#else
-    REAL ::     vad_in_out(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
-#endif
-
-!
-!-- Set criteria for switching between upstream- and upstream-spline-method
-    IF ( var_char == 'u' )  THEN
-       overshoot_limit = overshoot_limit_u
-       ups_limit       = ups_limit_u
-       component       = 1
-    ELSEIF (  var_char == 'v' )  THEN
-       overshoot_limit = overshoot_limit_v
-       ups_limit       = ups_limit_v
-       component       = 2
-    ELSEIF (  var_char == 'w' )  THEN
-       overshoot_limit = overshoot_limit_w
-       ups_limit       = ups_limit_w
-       component       = 3
-    ELSEIF (  var_char == 'pt' )  THEN
-       overshoot_limit = overshoot_limit_pt
-       ups_limit       = ups_limit_pt
-       component       = 4
-    ELSEIF (  var_char == 'e' )  THEN
-       overshoot_limit = overshoot_limit_e
-       ups_limit       = ups_limit_e
-       component       = 5
-    ENDIF
-
-!
-!-- Allocate working arrays
-    ALLOCATE( r(nzb:nzt+1,nys:nyn), vad(nzb:nzt+1,nys:nyn), &
-              wrk_spline(nzb:nzt+1,nys:nyn) )
-    IF ( long_filter_factor /= 0.0 )  THEN
-       ALLOCATE( tf(nzb:nzt+1,nys:nyn), wrk_long(nzb+1:nzt,nys:nyn,1:3) )
-    ENDIF    
-
-!
-!-- Initialize calculation of relative upstream fraction
-    sums_up_fraction_l(component,3,:) = 0.0
-
-!
-!-- Loop over all gridpoints along x
-    DO  i = nxl, nxr
-
-!
-!--    Store array to be advected on work array
-       vad(nzb+1:nzt,:) = vad_in_out(nzb+1:nzt,nys:nyn,i)
-!
-!--    Add boundary conditions along z
-       IF ( var_char == 'u'  .OR.  var_char == 'v' )  THEN
-!
-!--       Bottom boundary
-!--       u- and v-component
-          IF ( ibc_uv_b == 0 )  THEN
-             vad(nzb,:) = -vad(nzb+1,:)
-          ELSE
-             vad(nzb,:) = vad(nzb+1,:)
-          ENDIF
-!
-!--       Top boundary
-!--       Dirichlet condition
-          IF ( ibc_uv_t == 0  .AND.  var_char == 'u' )  THEN
-!
-!--          u-component
-             vad(nzt+1,:) = ug(nzt+1)
-          ELSEIF ( ibc_uv_t == 0  .AND.  var_char == 'v' )  THEN
-!
-!--          v-component
-             vad(nzt+1,:) = vg(nzt+1)
-          ELSE
-!
-!--          Neumann condition
-             vad(nzt+1,:) = vad(nzt,:)
-          ENDIF
-
-       ELSEIF ( var_char == 'w' )  THEN
-!
-!--       Bottom and top boundary for w-component
-          vad(nzb,:)   = 0.0
-          vad(nzt+1,:) = 0.0
-
-       ELSEIF ( var_char == 'pt' )  THEN
-!
-!--       Bottom boundary for temperature
-          IF ( ibc_pt_b == 1 )  THEN
-             vad(nzb,:) = vad(nzb+1,:)
-          ELSE
-             vad(nzb,:) = pt(nzb,:,i)
-          ENDIF
-!
-!--       Top boundary for temperature
-          IF ( ibc_pt_t == 0 )  THEN
-             vad(nzt+1,:) = pt(nzt+1,nys:nyn,i)
-          ELSEIF ( ibc_pt_t == 1 )  THEN
-             vad(nzt+1,:) = vad(nzt,:)
-          ELSEIF ( ibc_pt_t == 2 )  THEN
-             vad(nzt+1,:) = vad(nzt,:)   + bc_pt_t_val * dz_spline(nzt+1)
-          ENDIF
-
-       ELSEIF ( var_char == 'e' )  THEN
-!
-!--       Boundary conditions for TKE (Neumann in any case)
-          vad(nzb,:)   = vad(nzb+1,:)
-          vad(nzt,:)   = vad(nzt-1,:)
-          vad(nzt+1,:) = vad(nzt,:)
-
-       ENDIF
-
-!
-!--    Calculate right hand side
-       DO  j = nys, nyn
-          r(nzb,j)   = 3.0 * ( vad(nzb+1,j)-vad(nzb,j) ) / dz_spline(1)
-          r(nzt+1,j) = 3.0 * ( vad(nzt+1,j)-vad(nzt,j) ) / dz_spline(nzt+1)
-          DO  k = nzb+1, nzt
-             r(k,j) = 3.0 * (                                                   &
-                     spline_tri(2,k) * ( vad(k,j)-vad(k-1,j) ) / dz_spline(k)   &
-                   + spline_tri(3,k) * ( vad(k+1,j)-vad(k,j) ) / dz_spline(k+1) &
-                            )
-          ENDDO
-       ENDDO
-    
-!
-!--    Forward substitution
-       DO  j = nys, nyn
-          wrk_spline(nzb,j) = r(nzb,j)
-          DO  k = nzb+1, nzt+1
-             wrk_spline(k,j) = r(k,j) - spline_tri(5,k) * r(k-1,j)
-          ENDDO
-       ENDDO
-
-!
-!--    Backward substitution
-       DO  j = nys, nyn
-          r(nzt+1,j) = wrk_spline(nzt+1,j) / spline_tri(4,nzt+1)
-          DO  k = nzt, nzb, -1
-             r(k,j) = ( wrk_spline(k,j) - spline_tri(3,k) * r(k+1,j) ) / &
-                      spline_tri(4,k)
-          ENDDO
-       ENDDO
-    
-!
-!--    Calculate advection along z
-       DO  j = nys, nyn
-          DO  k = nzb+1, nzt
-
-             IF ( ad_v(k,j,i) == 0.0 ) THEN
-
-                vad_in_out(k,j,i) = vad(k,j)
-
-             ELSEIF ( ad_v(k,j,i) > 0.0 ) THEN
-
-                IF ( ABS( vad(k,j) - vad(k-1,j) ) <= ups_limit )  THEN
-                   vad_in_out(k,j,i) = vad(k,j) - dt_3d * ad_v(k,j,i) * &
-                                       ( vad(k,j) - vad(k-1,j) ) * ddzu(k)
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,3,sr) = &
-                               sums_up_fraction_l(component,3,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = ad_v(k,j,i) * dt_3d / dz_spline(k)
-                   t2 = 3.0 * ( vad(k-1,j) - vad(k,j) ) + &
-                        ( 2.0 * r(k,j) + r(k-1,j) ) * dz_spline(k)
-                   t3 = 2.0 * ( vad(k-1,j) - vad(k,j) ) + &
-                        ( r(k,j) + r(k-1,j) ) * dz_spline(k)
-                   vad_in_out(k,j,i) = vad(k,j) - r(k,j) * t1* dz_spline(k) + &
-                                       t2 * t1**2 - t3 * t1**3
-                   IF ( vad(k-1,j) == vad(k,j) )  THEN
-                      vad_in_out(k,j,i) = vad(k,j)
-                   ENDIF
-                ENDIF
-
-             ELSE
-
-                IF( ABS( vad(k,j) - vad(k+1,j) ) <= ups_limit )  THEN
-                   vad_in_out(k,j,i) = vad(k,j) - dt_3d * ad_v(k,j,i) * &
-                                       ( vad(k+1,j) - vad(k,j) ) * ddzu(k+1)
-!
-!--                Calculate upstream fraction in % (s. flow_statistics)
-                   DO  sr = 0, statistic_regions
-                      sums_up_fraction_l(component,3,sr) = &
-                               sums_up_fraction_l(component,3,sr) + 1.0
-                   ENDDO
-                ELSE
-                   t1 = -ad_v(k,j,i) * dt_3d / dz_spline(k+1)
-                   t2 = 3.0 * ( vad(k,j) - vad(k+1,j) ) + &
-                        ( 2.0 * r(k,j) + r(k+1,j) ) * dz_spline(k+1)
-                   t3 = 2.0 * ( vad(k,j) - vad(k+1,j) ) + &
-                        ( r(k,j) + r(k+1,j) ) * dz_spline(k+1)
-                   vad_in_out(k,j,i) = vad(k,j) + r(k,j)*t1*dz_spline(k+1) - &
-                                       t2 * t1**2 + t3 * t1**3
-                   IF ( vad(k+1,j) == vad(k,j) )  THEN
-                      vad_in_out(k,j,i) = vad(k,j)
-                   ENDIF
-                ENDIF
-
-             ENDIF
-          ENDDO
-       ENDDO
-
-!
-!--    Limit values in order to prevent overshooting
-       IF ( cut_spline_overshoot )  THEN
-
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt
-                IF ( ad_v(k,j,i) > 0.0 ) THEN
-                   IF ( vad(k,j) > vad(k-1,j) )  THEN
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,j)   + overshoot_limit )
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k-1,j) - overshoot_limit )
-                   ELSE
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,j)   - overshoot_limit )
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k-1,j) + overshoot_limit )
-                   ENDIF
-                ELSE
-                   IF ( vad(k,j) > vad(k+1,j) )  THEN
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k,j)   + overshoot_limit )
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k+1,j) - overshoot_limit )
-                   ELSE
-                      vad_in_out(k,j,i) = MAX( vad_in_out(k,j,i), &
-                                               vad(k,j)   - overshoot_limit )
-                      vad_in_out(k,j,i) = MIN( vad_in_out(k,j,i), &
-                                               vad(k+1,j) + overshoot_limit )
-                   ENDIF
-                ENDIF
-             ENDDO
-          ENDDO
-
-       ENDIF
-
-!
-!--    Long-filter (acting on tendency only)
-       IF ( long_filter_factor /= 0.0 )  THEN
-
-!
-!--       Compute tendency
-          DO  j = nys, nyn
-
-!
-!--          Depending on the quantity to be advected, the respective vertical 
-!--          boundary conditions must be applied.
-             IF ( var_char == 'u'  .OR.  var_char == 'v' ) THEN
-
-                IF ( ibc_uv_b == 0 )  THEN
-                   tf(nzb,j) = - ( vad_in_out(nzb+1,j,i) - vad(nzb+1,j) )
-                ELSE
-                   tf(nzb,j) = vad_in_out(nzb+1,j,i) - vad(nzb+1,j)
-                ENDIF
-
-                IF ( ibc_uv_t == 0 )  THEN
-                   tf(nzt+1,j) = 0.0
-                ELSE
-                   tf(nzt+1,j) = vad_in_out(nzt,j,i) - vad(nzt,j)
-                ENDIF
-
-             ELSEIF ( var_char == 'w' )  THEN
-
-                tf(nzb,j)   = 0.0
-                tf(nzt+1,j) = 0.0
-
-             ELSEIF ( var_char == 'pt' )  THEN
-
-                IF ( ibc_pt_b == 1 )  THEN
-                   tf(nzb,j) = vad_in_out(nzb+1,j,i) - vad(nzb+1,j)
-                ELSE
-                   tf(nzb,j) = 0.0
-                ENDIF
-
-                IF ( ibc_pt_t == 1 )  THEN
-                   vad_in_out(nzt,j,i) = vad_in_out(nzt-1,j,i) + bc_pt_t_val * &
-                                         dz_spline(nzt)
-                   tf(nzt+1,j) = vad_in_out(nzt,j,i) + bc_pt_t_val * &
-                                         dz_spline(nzt+1) - vad(nzt+1,j)
-                ELSE
-                   vad_in_out(nzt,j,i) = pt(nzt,j,i)
-                   tf(nzt+1,j) = 0.0
-                ENDIF
-
-             ENDIF
-
-             DO  k = nzb+1, nzt
-                tf(k,j) = vad_in_out(k,j,i) - vad(k,j)
-             ENDDO
-
-          ENDDO
-
-!
-!--       Apply the filter.
-          DO  j = nys, nyn
-
-             dzwd = dz_spline(1) / ( dz_spline(1) + dz_spline(2) )
-             dzwu = dz_spline(2) / ( dz_spline(1) + dz_spline(2) )
-
-             wrk_long(nzb+1,j,1) = 2.0 * ( 1.0 + long_filter_factor )
-             wrk_long(nzb+1,j,2) = ( 1.0 - long_filter_factor ) * dzwd / &
-                                     wrk_long(nzb+1,j,1)
-             wrk_long(nzb+1,j,3) = ( long_filter_factor * dzwu * tf(nzb,j) +  &
-                                     2.0 * tf(nzb+1,j) + dzwd * tf(nzb+2,j) &
-                                   ) / wrk_long(nzb+1,j,1)
-
-             DO  k = nzb+2, nzt-1
-
-                dzwd = dz_spline(k)   / ( dz_spline(k) + dz_spline(k+1) )
-                dzwu = dz_spline(k+1) / ( dz_spline(k) + dz_spline(k+1) )
-
-                wrk_long(k,j,1) = 2.0 * ( 1.0 + long_filter_factor ) -  &
-                                  ( 1.0 - long_filter_factor ) * dzwu * &
-                                  wrk_long(k-1,j,2)
-                wrk_long(k,j,2) = ( 1.0 - long_filter_factor ) * dzwd / &
-                                  wrk_long(k,j,1) 
-                wrk_long(k,j,3) = ( dzwu * tf(k-1,j) + 2.0 * tf(k,j) +   &
-                                    dzwd * tf(k+1,j) -                   &
-                                   ( 1.0 - long_filter_factor ) * dzwu * &
-                                  wrk_long(k-1,j,3)                      &
-                                  ) / wrk_long(k,j,1)
-             ENDDO
-
-             dzwd = dz_spline(nzt)   / ( dz_spline(nzt) + dz_spline(nzt+1) )
-             dzwu = dz_spline(nzt+1) / ( dz_spline(nzt) + dz_spline(nzt+1) )
-
-             wrk_long(nzt,j,1) = 2.0 * ( 1.0 + long_filter_factor ) -  &
-                                 ( 1.0 - long_filter_factor ) * dzwu * &
-                                 wrk_long(nzt-1,j,2)
-             wrk_long(nzt,j,2) = ( 1.0 - long_filter_factor ) * dzwd / &
-                                 wrk_long(nzt,j,1)
-             wrk_long(nzt,j,3) = ( dzwu * tf(nzt-1,j) + 2.0 * tf(nzt,j) +    & 
-                                   dzwd * long_filter_factor * tf(nzt+1,j) - &
-                                   ( 1.0 - long_filter_factor ) * dzwu *     &
-                                   wrk_long(nzt-1,j,3)                       &
-                                 ) / wrk_long(nzt,j,1)
-             r(nzt,j)     = wrk_long(nzt,j,3)
-
-          ENDDO
-
-          DO  j = nys, nyn
-             DO  k = nzt-1, nzb+1, -1
-                r(k,j) = wrk_long(k,j,3) - wrk_long(k,j,2) * r(k+1,j)
-             ENDDO
-          ENDDO
-
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt
-                vad_in_out(k,j,i) = vad(k,j) + r(k,j)
-             ENDDO
-          ENDDO
-
-       ENDIF  ! Long filter
-
-    ENDDO
-
-    DEALLOCATE( r, vad, wrk_spline )
-    IF ( long_filter_factor /= 0.0 )  DEALLOCATE( tf, wrk_long )    
-
- END SUBROUTINE spline_z
Index: palm/trunk/SOURCE/swap_timelevel.f90
===================================================================
--- palm/trunk/SOURCE/swap_timelevel.f90	(revision 997)
+++ palm/trunk/SOURCE/swap_timelevel.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -51,156 +51,40 @@
 
 !
-!-- Swap of 3-level variables
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-
-       SELECT CASE ( MOD( timestep_count, 3 ) )
-
-          CASE ( 0 )
-
-             u_m  => u_1;   u  => u_2;  u_p  => u_3
-             v_m  => v_1;   v  => v_2;  v_p  => v_3
-             w_m  => w_1;   w  => w_2;  w_p  => w_3
-             pt_m => pt_1;  pt => pt_2; pt_p => pt_3
-             IF ( .NOT. constant_diffusion )  THEN
-                e_m => e_1;  e => e_2;  e_p => e_3
-             ENDIF
-             IF ( humidity  .OR.  passive_scalar )  THEN
-                q_m => q_1;  q => q_2;  q_p => q_3
-             ENDIF
-
-          CASE ( 1 )
-
-             u_m  => u_2;   u  => u_3;  u_p  => u_1
-             v_m  => v_2;   v  => v_3;  v_p  => v_1
-             w_m  => w_2;   w  => w_3;  w_p  => w_1
-             pt_m => pt_2;  pt => pt_3; pt_p => pt_1
-             IF ( .NOT. constant_diffusion )  THEN
-                e_m => e_2;  e => e_3;  e_p => e_1
-             ENDIF
-             IF ( humidity  .OR.  passive_scalar )  THEN
-                q_m => q_2;  q => q_3;  q_p => q_1
-             ENDIF
-
-          CASE ( 2 )
-
-             u_m  => u_3;   u  => u_1;  u_p  => u_2
-             v_m  => v_3;   v  => v_1;  v_p  => v_2
-             w_m  => w_3;   w  => w_1;  w_p  => w_2
-             pt_m => pt_3;  pt => pt_1; pt_p => pt_2
-             IF ( .NOT. constant_diffusion )  THEN
-                e_m => e_3;  e => e_1;  e_p => e_2
-             ENDIF
-             IF ( humidity  .OR.  passive_scalar )  THEN
-                q_m => q_3;  q => q_1;  q_p => q_2
-             ENDIF
-
-       END SELECT
-
-    ENDIF
-
-!
-!-- Swap of 2-level variables
+!-- Swap of variables
     SELECT CASE ( MOD( timestep_count, 2 ) )
 
        CASE ( 0 )
 
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
+          u  => u_1;   u_p  => u_2
+          v  => v_1;   v_p  => v_2
+          w  => w_1;   w_p  => w_2
+          pt => pt_1;  pt_p => pt_2
+          IF ( .NOT. constant_diffusion )  THEN
+             e => e_1;    e_p => e_2
+          ENDIF
+          IF ( ocean )  THEN
+             sa => sa_1;  sa_p => sa_2
+          ENDIF
+          IF ( humidity  .OR.  passive_scalar )  THEN
+             q => q_1;    q_p => q_2
+          ENDIF
 
-             u  => u_1;   u_p  => u_2
-             v  => v_1;   v_p  => v_2
-             w  => w_1;   w_p  => w_2
-             pt => pt_1;  pt_p => pt_2
-             IF ( .NOT. constant_diffusion )  THEN
-                e => e_1;    e_p => e_2
-             ENDIF
-             IF ( ocean )  THEN
-                sa => sa_1;  sa_p => sa_2
-             ENDIF
-             IF ( humidity  .OR.  passive_scalar )  THEN
-                q => q_1;    q_p => q_2
-             ENDIF
-
-          ELSE
-!
-!--          Old timelevels are needed for explicit diffusion within leapfrog
-             IF ( .NOT. constant_diffusion )  THEN
-                kh_m => kh_1;  kh => kh_2
-                km_m => km_1;  km => km_2
-                IF ( use_surface_fluxes )  THEN
-                   usws_m => usws_1;  usws => usws_2
-                   vsws_m => vsws_1;  vsws => vsws_2
-                   shf_m  => shf_1;   shf  => shf_2
-                   IF ( humidity  .OR.  passive_scalar )  THEN
-                      qsws_m => qsws_1;  qsws => qsws_2
-                   ENDIF
-                ENDIF
-                IF ( prandtl_layer )  THEN
-                   rif_m  => rif_1;   rif  => rif_2
-                ENDIF
-                IF ( use_top_fluxes )  THEN
-                   uswst_m => uswst_1;  uswst => uswst_2
-                   vswst_m => vswst_1;  vswst => vswst_2
-                   tswst_m => tswst_1;  tswst => tswst_2
-                   IF ( humidity  .OR.  passive_scalar )  THEN
-                      qswst_m => qswst_1;  qswst => qswst_2
-                   ENDIF
-                ENDIF
-             ENDIF
-
-             IF ( humidity )  THEN
-                vpt_m => vpt_1;  vpt => vpt_2
-             ENDIF
-
-          ENDIF
 
        CASE ( 1 )
 
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
+          u  => u_2;   u_p  => u_1
+          v  => v_2;   v_p  => v_1
+          w  => w_2;   w_p  => w_1
+          pt => pt_2;  pt_p => pt_1
+          IF ( .NOT. constant_diffusion )  THEN
+             e => e_2;    e_p => e_1
+          ENDIF
+          IF ( ocean )  THEN
+             sa => sa_2;  sa_p => sa_1
+          ENDIF
+          IF ( humidity  .OR.  passive_scalar )  THEN
+             q => q_2;    q_p => q_1
+          ENDIF
 
-             u  => u_2;   u_p  => u_1
-             v  => v_2;   v_p  => v_1
-             w  => w_2;   w_p  => w_1
-             pt => pt_2;  pt_p => pt_1
-             IF ( .NOT. constant_diffusion )  THEN
-                e => e_2;    e_p => e_1
-             ENDIF
-             IF ( ocean )  THEN
-                sa => sa_2;  sa_p => sa_1
-             ENDIF
-             IF ( humidity  .OR.  passive_scalar )  THEN
-                q => q_2;    q_p => q_1
-             ENDIF
-
-          ELSE
-
-             IF ( .NOT. constant_diffusion )  THEN
-                kh_m => kh_2;  kh => kh_1
-                km_m => km_2;  km => km_1
-                IF ( use_surface_fluxes )  THEN
-                   usws_m => usws_2;  usws => usws_1
-                   vsws_m => vsws_2;  vsws => vsws_1
-                   shf_m  => shf_2;   shf  => shf_1
-                   IF ( humidity  .OR.  passive_scalar )  THEN
-                      qsws_m => qsws_2;  qsws => qsws_1
-                   ENDIF
-                ENDIF
-                IF ( prandtl_layer )  THEN
-                   rif_m  => rif_2;   rif  => rif_1
-                ENDIF
-                IF ( use_top_fluxes )  THEN
-                   uswst_m => uswst_2;  uswst => uswst_1
-                   vswst_m => vswst_2;  vswst => vswst_1
-                   tswst_m => tswst_2;  tswst => tswst_1
-                   IF ( humidity  .OR.  passive_scalar )  THEN
-                      qswst_m => qswst_2;  qswst => qswst_1
-                   ENDIF
-                ENDIF
-             ENDIF
-
-             IF ( humidity )  THEN
-                vpt_m => vpt_2;  vpt => vpt_1
-             ENDIF
-
-          ENDIF
 
     END SELECT
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 997)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! all actions concerning leapfrog- and upstream-spline-scheme removed
 !
 ! Former revisions:
@@ -174,8 +174,5 @@
              CALL prognostic_equations_vector
           ELSE
-             IF ( momentum_advec == 'ups-scheme'  .OR.  &
-                  scalar_advec == 'ups-scheme'   .OR.  &
-                  scalar_advec == 'bc-scheme' )        &
-             THEN
+             IF ( scalar_advec == 'bc-scheme' )  THEN
                 CALL prognostic_equations_noopt
              ELSE
@@ -227,10 +224,4 @@
 
           CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' )
-
-!
-!--       Apply time filter in case of leap-frog timestep
-          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
-             CALL asselin_filter
-          ENDIF
 
 !
@@ -459,9 +450,7 @@
 !
 !--    Computation and output of run control parameters.
-!--    This is also done whenever the time step has changed or perturbations
-!--    have been imposed
+!--    This is also done whenever perturbations have been imposed
        IF ( time_run_control >= dt_run_control  .OR.                     &
-            ( dt_changed  .AND.  timestep_scheme(1:5) /= 'runge' )  .OR. &
-            disturbance_created )                                        &
+            timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created ) &
        THEN
           CALL run_control
Index: palm/trunk/SOURCE/timestep.f90
===================================================================
--- palm/trunk/SOURCE/timestep.f90	(revision 997)
+++ palm/trunk/SOURCE/timestep.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! ------------------
-!
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -68,5 +68,5 @@
              dt_plant_canopy_l,                                        &
              dt_plant_canopy_u, dt_plant_canopy_v, dt_plant_canopy_w,  & 
-             dt_u, dt_v, dt_w, lad_max, percent_change,                &
+             dt_u, dt_v, dt_w, lad_max,                                &
              u_gtrans_l, u_max_cfl, vabs_max, value, v_gtrans_l, v_max_cfl
 
@@ -277,15 +277,7 @@
 !
 !--    The time step is the minimum of the 3-4 components and the diffusion time
-!--    step minus a reduction to be on the safe side. Factor 0.5 is necessary 
-!--    since the leap-frog scheme always progresses by 2 * delta t.
-!--    The user has to set the cfl_factor small enough to ensure that the 
-!--    divergences do not become too large.
+!--    step minus a reduction (cfl_factor) to be on the safe side.
 !--    The time step must not exceed the maximum allowed value.
-       IF ( timestep_scheme(1:5) == 'runge' )  THEN
-          dt_3d = cfl_factor * MIN( dt_diff, dt_plant_canopy, dt_u, dt_v, dt_w )
-       ELSE
-          dt_3d = cfl_factor * 0.5 *  &
-                  MIN( dt_diff, dt_plant_canopy, dt_u, dt_v, dt_w )
-       ENDIF
+       dt_3d = cfl_factor * MIN( dt_diff, dt_plant_canopy, dt_u, dt_v, dt_w )
        dt_3d = MIN( dt_3d, dt_max )
 
@@ -339,63 +331,17 @@
 
 !
-!--    Ensure a smooth value (two significant digits) of the timestep. For
-!--    other schemes than Runge-Kutta, the following restrictions appear:
-!--    The current timestep is only then changed, if the change relative to
-!--    its previous value exceeds +5 % or -2 %. In case of a timestep
-!--    reduction, at least 30 iterations have to be performed before a timestep
-!--    enlargement is permitted again.
-       percent_change = dt_3d / old_dt - 1.0
-       IF ( percent_change > 0.05  .OR.  percent_change < -0.02  .OR. &
-            timestep_scheme(1:5) == 'runge' )  THEN
-
-!
-!--       Time step enlargement by no more than 2 %.
-          IF ( percent_change > 0.0  .AND.  simulated_time /= 0.0  .AND. &
-               timestep_scheme(1:5) /= 'runge' )  THEN
-             dt_3d = 1.02 * old_dt
-          ENDIF
-
-!
-!--       A relatively smooth value of the time step is ensured by taking
-!--       only the first two significant digits.
-          div = 1000.0
-          DO  WHILE ( dt_3d < div )
-             div = div / 10.0
-          ENDDO
-          dt_3d = NINT( dt_3d * 100.0 / div ) * div / 100.0
-
-!
-!--       Now the time step can be adjusted.
-          IF ( percent_change < 0.0  .OR.  timestep_scheme(1:5) == 'runge' ) &
-          THEN
-!
-!--          Time step reduction.
-             old_dt = dt_3d
-             dt_changed = .TRUE.
-          ELSE
-!
-!--          For other timestep schemes , the time step is only enlarged
-!--          after at least 30 iterations since the previous time step
-!--          change or, of course, after model initialization.
-             IF ( current_timestep_number >= last_dt_change + 30  .OR. &
-                  simulated_time == 0.0 )  THEN
-                old_dt = dt_3d
-                dt_changed = .TRUE.
-             ELSE
-                dt_3d = old_dt
-                dt_changed = .FALSE.
-             ENDIF
-
-          ENDIF
-       ELSE
-!
-!--       No time step change since the difference is too small.
-          dt_3d = old_dt
-          dt_changed = .FALSE.
-       ENDIF
-
-       IF ( dt_changed )  last_dt_change = current_timestep_number
+!--    Ensure a smooth value (two significant digits) of the timestep.
+       div = 1000.0
+       DO  WHILE ( dt_3d < div )
+          div = div / 10.0
+       ENDDO
+       dt_3d = NINT( dt_3d * 100.0 / div ) * div / 100.0
+
+!
+!--    Adjust the time step
+       old_dt = dt_3d
 
     ENDIF
+
     CALL cpu_log( log_point(12), 'calculate_timestep', 'stop' )
 
Index: palm/trunk/SOURCE/timestep_scheme_steering.f90
===================================================================
--- palm/trunk/SOURCE/timestep_scheme_steering.f90	(revision 997)
+++ palm/trunk/SOURCE/timestep_scheme_steering.f90	(revision 1001)
@@ -3,5 +3,6 @@
 !------------------------------------------------------------------------------!
 ! Current revisions:
-! -----------------
+! ------------------
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -52,50 +53,8 @@
        ENDIF
 
-    ELSE
-
-       IF ( .NOT. dt_fixed )  THEN
+    ELSEIF ( timestep_scheme == 'euler' )  THEN
 !
-!--       Leapfrog and Euler schemes
-!--       Determine whether after the time step adjustment the Euler- or the
-!--       leapfrog scheme will be applied. The very first time step must always
-!--       be an Euler step.
-          IF ( dt_changed )  THEN
-             IF ( timestep_scheme == 'leapfrog+euler'  .OR. &
-                  timestep_scheme == 'euler' .OR. simulated_time == 0.0 )  THEN
-                tsc(1:5) = (/ 1.0, 1.0, 0.0, 0.0, 1.0 /)
-             ELSE
-                tsc(1:5) = (/ 0.0, 2.0, 0.0, 0.0, 2.0 /)
-             ENDIF
-          ELSE
-!
-!--          No time step change, hence continue with the scheme set by the
-!--          user.
-             IF ( timestep_scheme == 'euler' )  THEN
-                tsc(1:5) = (/ 1.0, 1.0, 0.0, 0.0, 1.0 /)
-             ELSE
-                tsc(1:5) = (/ 0.0, 2.0, 0.0, 0.0, 2.0 /)
-             ENDIF
-          ENDIF
-
-       ELSE
-
-!
-!--       Fixed time step:
-!
-!--       In any case, the very first time step must always be an Euler step.
-          timestep_reason = 'F'
-          IF ( simulated_time == 0.0 )  THEN
-             dt_changed = .TRUE.
-             tsc(1:5) = (/ 1.0, 1.0, 0.0, 0.0, 1.0 /)
-          ELSE
-             dt_changed = .FALSE.
-             IF ( timestep_scheme == 'euler' )  THEN
-                tsc(1:5) = (/ 1.0, 1.0, 0.0, 0.0, 1.0 /)
-             ELSE
-                tsc(1:5) = (/ 0.0, 2.0, 0.0, 0.0, 2.0 /)
-             ENDIF
-          ENDIF
-
-       ENDIF
+!--    Euler scheme
+       tsc(1:5) = (/ 1.0, 1.0, 0.0, 0.0, 1.0 /)
 
     ENDIF
Index: palm/trunk/SOURCE/write_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/write_3d_binary.f90	(revision 997)
+++ palm/trunk/SOURCE/write_3d_binary.f90	(revision 1001)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! all actions concerning leapfrog scheme removed
 !
 ! Former revisions:
@@ -104,14 +104,7 @@
        WRITE ( 14 )  'e_av                ';  WRITE ( 14 )  e_av
     ENDIF
-    WRITE ( 14 )  'e_m                 ';  WRITE ( 14 )  e_m
     WRITE ( 14 )  'iran                ';  WRITE ( 14 )  iran, iran_part
     WRITE ( 14 )  'kh                  ';  WRITE ( 14 )  kh
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-       WRITE ( 14 )  'kh_m                ';  WRITE ( 14 )  kh_m
-    ENDIF
     WRITE ( 14 )  'km                  ';  WRITE ( 14 )  km
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-       WRITE ( 14 )  'km_m                ';  WRITE ( 14 )  km_m
-    ENDIF
     IF ( ALLOCATED( lpt_av ) )  THEN
        WRITE ( 14 )  'lpt_av              ';  WRITE ( 14 )  lpt_av
@@ -141,5 +134,4 @@
        WRITE ( 14 )  'pt_av               ';  WRITE ( 14 )  pt_av
     ENDIF
-    WRITE ( 14 )  'pt_m                ';  WRITE ( 14 )  pt_m
     IF ( humidity  .OR. passive_scalar )  THEN
        WRITE ( 14 )  'q                   ';  WRITE ( 14 )  q 
@@ -147,5 +139,4 @@
           WRITE ( 14 )  'q_av                ';  WRITE ( 14 )  q_av
        ENDIF
-       WRITE ( 14 )  'q_m                 ';  WRITE ( 14 ) q_m
        IF ( cloud_physics  .OR.  cloud_droplets )  THEN
           WRITE ( 14 )  'ql                  ';  WRITE ( 14 ) ql
@@ -156,14 +147,8 @@
        WRITE ( 14 )  'qs                  ';  WRITE ( 14 ) qs
        WRITE ( 14 )  'qsws                ';  WRITE ( 14 ) qsws
-       IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-          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
-          WRITE ( 14 )  'qswst_m             ';  WRITE ( 14 ) qswst_m
-       ENDIF
     ENDIF
     IF ( ocean )  THEN
@@ -193,7 +178,4 @@
                                            WRITE ( 14 )  random_iy
     WRITE ( 14 )  'rif                 ';  WRITE ( 14 )  rif
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-       WRITE ( 14 )  'rif_m               ';  WRITE ( 14 )  rif_m
-    ENDIF
     IF ( topography /= 'flat' )  THEN
        WRITE ( 14 )  'rif_wall            ';  WRITE ( 14 )  rif_wall
@@ -203,7 +185,4 @@
     ENDIF
     WRITE ( 14 )  'shf                 ';  WRITE ( 14 )  shf
-    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
@@ -218,12 +197,8 @@
     ENDIF
     WRITE ( 14 )  'tswst               ';  WRITE ( 14 )  tswst
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-       WRITE ( 14 )  'tswst_m             ';  WRITE ( 14 )  tswst_m
-    ENDIF
     WRITE ( 14 )  'u                   ';  WRITE ( 14 )  u
     IF ( ALLOCATED( u_av ) )  THEN
        WRITE ( 14 )  'u_av                ';  WRITE ( 14 )  u_av
     ENDIF
-    WRITE ( 14 )  'u_m                 ';  WRITE ( 14 )  u_m
     IF ( ALLOCATED( u_m_l ) )  THEN
        WRITE ( 14 )  'u_m_l               ';  WRITE ( 14 )  u_m_l
@@ -241,8 +216,4 @@
     WRITE ( 14 )  'usws                ';  WRITE ( 14 )  usws
     WRITE ( 14 )  'uswst               ';  WRITE ( 14 )  uswst
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-       WRITE ( 14 )  'usws_m              ';  WRITE ( 14 )  usws_m
-       WRITE ( 14 )  'uswst_m             ';  WRITE ( 14 )  uswst_m
-    ENDIF
     IF ( ALLOCATED( us_av ) )  THEN
        WRITE ( 14 )  'us_av               ';  WRITE ( 14 )  us_av
@@ -252,5 +223,4 @@
        WRITE ( 14 )  'v_av                ';  WRITE ( 14 )  v_av
     ENDIF
-    WRITE ( 14 )  'v_m                 ';  WRITE ( 14 )  v_m
     IF ( ALLOCATED( v_m_l ) )  THEN
        WRITE ( 14 )  'v_m_l               ';  WRITE ( 14 )  v_m_l
@@ -270,19 +240,11 @@
           WRITE ( 14 )  'vpt_av              ';  WRITE ( 14 )  vpt_av
        ENDIF
-       IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-          WRITE ( 14 )  'vpt_m               ';  WRITE ( 14 )  vpt_m
-       ENDIF
     ENDIF
     WRITE ( 14 )  'vsws                ';  WRITE ( 14 )  vsws
     WRITE ( 14 )  'vswst               ';  WRITE ( 14 )  vswst
-    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-       WRITE ( 14 )  'vsws_m              ';  WRITE ( 14 )  vsws_m
-       WRITE ( 14 )  'vswst_m             ';  WRITE ( 14 )  vswst_m
-    ENDIF
     WRITE ( 14 )  'w                   ';  WRITE ( 14 )  w
     IF ( ALLOCATED( w_av ) )  THEN
        WRITE ( 14 )  'w_av                ';  WRITE ( 14 )  w_av
     ENDIF
-    WRITE ( 14 )  'w_m                 ';  WRITE ( 14 )  w_m
     IF ( ALLOCATED( w_m_l ) )  THEN
        WRITE ( 14 )  'w_m_l               ';  WRITE ( 14 )  w_m_l
Index: palm/trunk/SOURCE/write_var_list.f90
===================================================================
--- palm/trunk/SOURCE/write_var_list.f90	(revision 997)
+++ palm/trunk/SOURCE/write_var_list.f90	(revision 1001)
@@ -4,5 +4,6 @@
 ! Current revisions:
 ! -----------------
-!
+! -cut_spline_overshoot, last_dt_change, long_filter_factor, overshoot_limit_*,
+! ups_limit_*
 !
 ! Former revisions:
@@ -235,6 +236,4 @@
     WRITE ( 14 )  'cthf                          '
     WRITE ( 14 )  cthf
-    WRITE ( 14 )  'cut_spline_overshoot          '
-    WRITE ( 14 )  cut_spline_overshoot
     WRITE ( 14 )  'cycle_mg                      '
     WRITE ( 14 )  cycle_mg
@@ -315,12 +314,8 @@
     WRITE ( 14 )  'lad_vertical_gradient_level_in'
     WRITE ( 14 )  lad_vertical_gradient_level_ind
-    WRITE ( 14 )  'last_dt_change                '
-    WRITE ( 14 )  last_dt_change
     WRITE ( 14 )  'large_scale_subsidence        '
     WRITE ( 14 )  large_scale_subsidence
     WRITE ( 14 )  'leaf_surface_concentration    '
     WRITE ( 14 )  leaf_surface_concentration
-    WRITE ( 14 )  'long_filter_factor            '
-    WRITE ( 14 )  long_filter_factor
     WRITE ( 14 )  'loop_optimization             '
     WRITE ( 14 )  loop_optimization
@@ -363,14 +358,4 @@
     WRITE ( 14 )  'output_for_t0                 '
     WRITE ( 14 )  output_for_t0
-    WRITE ( 14 )  'overshoot_limit_e             '
-    WRITE ( 14 )  overshoot_limit_e
-    WRITE ( 14 )  'overshoot_limit_pt            '
-    WRITE ( 14 )  overshoot_limit_pt
-    WRITE ( 14 )  'overshoot_limit_u             '
-    WRITE ( 14 )  overshoot_limit_u
-    WRITE ( 14 )  'overshoot_limit_v             '
-    WRITE ( 14 )  overshoot_limit_v
-    WRITE ( 14 )  'overshoot_limit_w             '
-    WRITE ( 14 )  overshoot_limit_w
     WRITE ( 14 )  'passive_scalar                '
     WRITE ( 14 )  passive_scalar
@@ -549,14 +534,4 @@
     WRITE ( 14 )  'ug_vertical_gradient_level_ind'
     WRITE ( 14 )  ug_vertical_gradient_level_ind
-    WRITE ( 14 )  'ups_limit_e                   '
-    WRITE ( 14 )  ups_limit_e
-    WRITE ( 14 )  'ups_limit_pt                  '
-    WRITE ( 14 )  ups_limit_pt
-    WRITE ( 14 )  'ups_limit_u                   '
-    WRITE ( 14 )  ups_limit_u
-    WRITE ( 14 )  'ups_limit_v                   '
-    WRITE ( 14 )  ups_limit_v
-    WRITE ( 14 )  'ups_limit_w                   '
-    WRITE ( 14 )  ups_limit_w
     WRITE ( 14 )  'use_surface_fluxes            '
     WRITE ( 14 )  use_surface_fluxes
