Index: palm/trunk/SOURCE/timestep_scheme_steering.f90
===================================================================
--- palm/trunk/SOURCE/timestep_scheme_steering.f90	(revision 4901)
+++ palm/trunk/SOURCE/timestep_scheme_steering.f90	(revision 1)
@@ -1,36 +1,14 @@
-!> @file timestep_scheme_steering.f90
-!--------------------------------------------------------------------------------------------------!
-! This file is part of the PALM model system.
-!
-! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General
-! Public License as published by the Free Software Foundation, either version 3 of the License, or
-! (at your option) any later version.
-!
-! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
-! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-! Public License for more details.
-!
-! You should have received a copy of the GNU General Public License along with PALM. If not, see
-! <http://www.gnu.org/licenses/>.
-!
-! Copyright 1997-2021 Leibniz Universitaet Hannover
-!--------------------------------------------------------------------------------------------------!
-!
-!
-! Current revisions:
+ SUBROUTINE timestep_scheme_steering
+
+!------------------------------------------------------------------------------!
+! Actual revisions:
 ! -----------------
 ! 
-! 
+!
 ! Former revisions:
 ! -----------------
-! $Id$
-! File re-formatted to follow the PALM coding standard
-!
-!
-! 4360 2020-01-07 11:25:50Z suehring
-! Corrected "Former revisions" section
-!
-! 3655 2019-01-07 16:51:22Z knoop
-! OpenACC port for SPEC
+! $Log: timestep_scheme_steering.f90,v $
+! Revision 1.2  2005/03/26 21:17:06  raasch
+! No pressure term for Runge-Kutta-schemes (tsc(4)=0.0)
 !
 ! Revision 1.1  2004/01/28 15:34:47  raasch
@@ -40,15 +18,9 @@
 ! Description:
 ! ------------
-!> Depending on the timestep scheme set the steering factors for the prognostic equations.
-!--------------------------------------------------------------------------------------------------!
- SUBROUTINE timestep_scheme_steering
+! Depending on the timestep scheme set the steering factors for the prognostic
+! equations.
+!------------------------------------------------------------------------------!
 
-
-    USE control_parameters,                                                                        &
-        ONLY:  intermediate_timestep_count,                                                        &
-               timestep_scheme,                                                                    &
-               tsc
-
-    USE kinds
+    USE control_parameters
 
     IMPLICIT NONE
@@ -57,27 +29,68 @@
     IF ( timestep_scheme(1:5) == 'runge' )  THEN
 !
-!--    Runge-Kutta schemes (here the factors depend on the respective intermediate step)
+!--    Runge-Kutta schemes (here the factors depend on the respective
+!--    intermediate step)
        IF ( timestep_scheme == 'runge-kutta-2' )  THEN
           IF ( intermediate_timestep_count == 1 )  THEN
-             tsc(1:5) = (/ 1.0_wp, 1.0_wp,  0.0_wp, 0.0_wp, 0.0_wp /)
+             tsc(1:5) = (/ 1.0, 1.0,  0.0, 0.0, 0.0 /)
           ELSE
-             tsc(1:5) = (/ 1.0_wp, 0.5_wp, -0.5_wp, 0.0_wp, 1.0_wp /)
+             tsc(1:5) = (/ 1.0, 0.5, -0.5, 0.0, 1.0 /)
           ENDIF
        ELSE
           IF ( intermediate_timestep_count == 1 )  THEN
-             tsc(1:5) = (/ 1.0_wp,  1.0_wp /  3.0_wp,          0.0_wp, 0.0_wp, 0.0_wp /)
+             tsc(1:5) = (/ 1.0,   1.0/3.0,        0.0, 0.0, 0.0 /)
           ELSEIF ( intermediate_timestep_count == 2 )  THEN
-             tsc(1:5) = (/ 1.0_wp, 15.0_wp / 16.0_wp, -25.0_wp/48.0_wp, 0.0_wp, 0.0_wp /)
+             tsc(1:5) = (/ 1.0, 15.0/16.0, -25.0/48.0, 0.0, 0.0 /)
           ELSE
-             tsc(1:5) = (/ 1.0_wp,  8.0_wp / 15.0_wp,   1.0_wp/15.0_wp, 0.0_wp, 1.0_wp /)
-          ENDIF
+             tsc(1:5) = (/ 1.0,  8.0/15.0,   1.0/15.0, 0.0, 1.0 /)
+          ENDIF          
        ENDIF
 
-       !$ACC UPDATE DEVICE(tsc(1:5))
+    ELSE
 
-    ELSEIF ( timestep_scheme == 'euler' )  THEN
+       IF ( .NOT. dt_fixed )  THEN
 !
-!--    Euler scheme
-       tsc(1:5) = (/ 1.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, 1.0_wp /)
+!--       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, 1.0, 1.0 /)
+             ELSE
+                tsc(1:5) = (/ 0.0, 2.0, 0.0, 1.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, 1.0, 1.0 /)
+             ELSE
+                tsc(1:5) = (/ 0.0, 2.0, 0.0, 1.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, 1.0, 1.0 /)
+          ELSE
+             dt_changed = .FALSE.
+             IF ( timestep_scheme == 'euler' )  THEN
+                tsc(1:5) = (/ 1.0, 1.0, 0.0, 1.0, 1.0 /)
+             ELSE
+                tsc(1:5) = (/ 0.0, 2.0, 0.0, 1.0, 2.0 /)
+             ENDIF
+          ENDIF
+
+       ENDIF
 
     ENDIF
