Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 4100)
+++ palm/trunk/SOURCE/modules.f90	(revision 4101)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! remove old_dt
+! 
+! 4079 2019-07-09 18:04:41Z suehring
 ! + monotonic_limiter_z
 ! 
@@ -1492,5 +1495,4 @@
     REAL(wp) ::  multi_agent_system_end   = 9999999.9_wp       !< namelist parameter (see documentation)
     REAL(wp) ::  multi_agent_system_start = 0.0_wp             !< namelist parameter (see documentation)
-    REAL(wp) ::  old_dt = 1.0E-10_wp                           !< length of previous timestep
     REAL(wp) ::  omega = 7.29212E-5_wp                         !< namelist parameter
     REAL(wp) ::  omega_sor = 1.8_wp                            !< namelist parameter
Index: palm/trunk/SOURCE/read_restart_data_mod.f90
===================================================================
--- palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 4100)
+++ palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 4101)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! remove old_dt
+! 
+! 4039 2019-06-18 10:32:41Z suehring
 ! input of uu_av, vv_av, ww_av added
 ! 
@@ -538,6 +541,4 @@
              CASE ( 'ocean_mode' )
                 READ ( 13 )  ocean_mode
-             CASE ( 'old_dt' )
-                READ ( 13 )  old_dt
              CASE ( 'omega' )
                 READ ( 13 )  omega
Index: palm/trunk/SOURCE/timestep.f90
===================================================================
--- palm/trunk/SOURCE/timestep.f90	(revision 4100)
+++ palm/trunk/SOURCE/timestep.f90	(revision 4101)
@@ -25,4 +25,11 @@
 ! -----------------
 ! $Id$
+! - consider 2*Km within diffusion criterion as Km is considered twice within
+!   the diffusion of e,
+! - in RANS mode, instead of considering each wind component individually use
+!   the wind speed of 3d wind vector in CFL criterion
+! - do not limit the increase of dt based on its previous value in RANS mode
+!
+! 3658 2019-01-07 20:28:54Z knoop
 ! OpenACC port for SPEC
 ! 
@@ -146,5 +153,5 @@
     USE control_parameters,                                                    &
         ONLY:  cfl_factor, coupling_mode, dt_3d, dt_fixed, dt_max,             &
-               galilei_transformation, old_dt, message_string, rans_mode,      &
+               galilei_transformation, message_string, rans_mode,              &
                stop_dt, terminate_coupled, terminate_coupled_remote,           &
                timestep_reason, u_gtrans, use_ug_for_galilei_tr, v_gtrans
@@ -218,8 +225,4 @@
     !$ACC HOST(kh(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) &
     !$ACC HOST(km(nzb:nzt+1,nysg:nyng,nxlg:nxrg))
-
-!
-!--    Save former time step as reference
-       old_dt = dt_3d
 
 !
@@ -284,27 +287,59 @@
 !
 !--    Variable time step:
-!--    Calculate the maximum time step according to the CFL-criterion,
-!--    individually for each velocity component
+!--    Calculate the maximum time step according to the CFL-criterion
        dt_u_l = 999999.9_wp
        dt_v_l = 999999.9_wp
        dt_w_l = 999999.9_wp
-       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i,j,k) &
-       !$ACC COPY(dt_u_l, dt_v_l, dt_w_l, u_stokes_zu, v_stokes_zu) &
-       !$ACC REDUCTION(MIN: dt_u_l, dt_v_l, dt_w_l) &
-       !$ACC PRESENT(u, v, w, dzu)
-       DO  i = nxl, nxr
-          DO  j = nys, nyn
-             DO  k = nzb+1, nzt
-                dt_u_l = MIN( dt_u_l, ( dx     /                               &
-                                 ( ABS( u(k,j,i) - u_gtrans + u_stokes_zu(k) ) &
-                                   + 1.0E-10_wp ) ) )
-                dt_v_l = MIN( dt_v_l, ( dy     /                               &
-                                 ( ABS( v(k,j,i) - v_gtrans + v_stokes_zu(k) ) &
-                                   + 1.0E-10_wp ) ) )
-                dt_w_l = MIN( dt_w_l, ( dzu(k) /                               &
-                                 ( ABS( w(k,j,i) )            + 1.0E-10_wp ) ) )
+
+       IF ( .NOT. rans_mode )  THEN
+!
+!--       Consider each velocity component individually
+
+          !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i,j,k) &
+          !$ACC COPY(dt_u_l, dt_v_l, dt_w_l, u_stokes_zu, v_stokes_zu) &
+          !$ACC REDUCTION(MIN: dt_u_l, dt_v_l, dt_w_l) &
+          !$ACC PRESENT(u, v, w, dzu)
+          DO  i = nxl, nxr
+             DO  j = nys, nyn
+                DO  k = nzb+1, nzt
+                   dt_u_l = MIN( dt_u_l, ( dx     /                               &
+                                    ( ABS( u(k,j,i) - u_gtrans + u_stokes_zu(k) ) &
+                                      + 1.0E-10_wp ) ) )
+                   dt_v_l = MIN( dt_v_l, ( dy     /                               &
+                                    ( ABS( v(k,j,i) - v_gtrans + v_stokes_zu(k) ) &
+                                      + 1.0E-10_wp ) ) )
+                   dt_w_l = MIN( dt_w_l, ( dzu(k) /                               &
+                                    ( ABS( w(k,j,i) )            + 1.0E-10_wp ) ) )
+                ENDDO
              ENDDO
           ENDDO
-       ENDDO
+
+       ELSE
+!
+!--       Consider the wind speed at the scalar-grid point
+!--       !> @note considering the wind speed instead of each individual wind
+!--       !>       component is only a workaround so far. This might has to be
+!--       !>       changed in the future.
+
+          !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i,j,k) &
+          !$ACC COPY(dt_u_l, u_stokes_zu, v_stokes_zu) &
+          !$ACC REDUCTION(MIN: dt_u_l) &
+          !$ACC PRESENT(u, v, w, dzu)
+          DO  i = nxl, nxr
+             DO  j = nys, nyn
+                DO  k = nzb+1, nzt
+                   dt_u_l = MIN( dt_u_l, ( MIN( dx, dy, dzu(k) ) / ( &
+                      SQRT(  ( 0.5 * ( u(k,j,i) + u(k,j,i+1) ) - u_gtrans + u_stokes_zu(k) )**2   &
+                           + ( 0.5 * ( v(k,j,i) + v(k,j+1,i) ) - v_gtrans + v_stokes_zu(k) )**2   &
+                           + ( 0.5 * ( w(k,j,i) + w(k-1,j,i) )                             )**2 ) &
+                      + 1.0E-10_wp ) ) )
+                ENDDO
+             ENDDO
+          ENDDO
+          
+          dt_v_l = dt_u_l
+          dt_w_l = dt_u_l
+
+       ENDIF
 
 #if defined( __parallel )
@@ -342,6 +377,7 @@
           DO  j = nys, nyn
              DO  k = nzb+1, nzt
-                dt_diff_l = MIN( dt_diff_l, dxyz2_min(k) /                     &
-                                    ( MAX( kh(k,j,i), ABS( km(k,j,i) ) )       &
+                dt_diff_l = MIN( dt_diff_l,                                       &
+                                 dxyz2_min(k) /                                   &
+                                    ( MAX( kh(k,j,i), 2.0_wp * ABS( km(k,j,i) ) ) &
                                       + 1E-20_wp ) )
              ENDDO
@@ -363,7 +399,4 @@
        dt_3d = cfl_factor * MIN( dt_diff, dt_u, dt_v, dt_w, dt_precipitation )
        dt_3d = MIN( dt_3d, dt_max )
-!
-!--    In RANS mode, the time step must not increase by more than a factor of 2
-       IF ( rans_mode )  dt_3d = MIN( dt_3d, dt_max, 2.0_wp * old_dt )
 
 !
@@ -390,5 +423,4 @@
           WRITE( message_string, * ) 'Time step has reached minimum limit.',   &
                '&dt              = ', dt_3d, ' s  Simulation is terminated.',  &
-               '&old_dt          = ', old_dt, ' s',                            &
                '&dt_u            = ', dt_u, ' s',                              &
                '&dt_v            = ', dt_v, ' s',                              &
Index: palm/trunk/SOURCE/vertical_nesting_mod.f90
===================================================================
--- palm/trunk/SOURCE/vertical_nesting_mod.f90	(revision 4100)
+++ palm/trunk/SOURCE/vertical_nesting_mod.f90	(revision 4101)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! remove old_dt
+! 
+! 3802 2019-03-17 13:33:42Z raasch
 ! unused subroutines commented out
 ! 
@@ -3943,5 +3946,5 @@
 #if defined( __parallel )
          USE control_parameters,                                                    &
-             ONLY:  coupling_mode, dt_3d, old_dt
+             ONLY:  coupling_mode, dt_3d
       
          USE interfaces
@@ -3977,10 +3980,4 @@
 !-- Identical timestep for coarse and fine grids
           dt_3d = MIN( dtc, dtf )
-          !> @fixme setting old_dt might be obsolete at this point
-          !>   Due to changes in timestep routine, setting of old_dt might be
-          !>   not necessary any more at this point. However, could not be
-          !>   tested so far.
-          !>   2018-05-18, gronemeier
-          old_dt = dt_3d
 #endif
        END SUBROUTINE vnest_timestep_sync
Index: palm/trunk/SOURCE/write_restart_data_mod.f90
===================================================================
--- palm/trunk/SOURCE/write_restart_data_mod.f90	(revision 4100)
+++ palm/trunk/SOURCE/write_restart_data_mod.f90	(revision 4101)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! remove old_dt
+! 
+! 4039 2019-06-18 10:32:41Z suehring
 ! Modularize diagnostic output
 ! 
@@ -502,7 +505,4 @@
        WRITE ( 14 )  ocean_mode
 
-       CALL wrd_write_string( 'old_dt' ) 
-       WRITE ( 14 )  old_dt
-
        CALL wrd_write_string( 'omega' ) 
        WRITE ( 14 )  omega
