Index: /palm/trunk/SOURCE/Makefile
===================================================================
--- /palm/trunk/SOURCE/Makefile	(revision 4676)
+++ /palm/trunk/SOURCE/Makefile	(revision 4677)
@@ -1,18 +1,18 @@
-#--------------------------------------------------------------------------------#
+#--------------------------------------------------------------------------------------------------#
 # 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/>.
+# 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-2020  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
+#--------------------------------------------------------------------------------------------------#
 #
 # WARNING: don't write filenames with extension .f90 in this header!!!!
@@ -25,4 +25,7 @@
 # -----------------
 # $Id$
+# file re-formatted to follow the PALM coding standard
+#
+# 4655 2020-08-28 14:28:34Z pavelkrc
 # Bugfix: Add possibility to output surface data during spinup
 #
Index: /palm/trunk/SOURCE/local_stop.f90
===================================================================
--- /palm/trunk/SOURCE/local_stop.f90	(revision 4676)
+++ /palm/trunk/SOURCE/local_stop.f90	(revision 4677)
@@ -1,36 +1,38 @@
 !> @file local_stop.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 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.
+! 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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current revisions:
 ! -----------------
-! 
-! 
+!
+!
 ! Former revisions:
 ! -----------------
 ! $Id$
+! file re-formatted to follow the PALM coding standard
+!
+! 4564 2020-06-12 14:03:36Z raasch
 ! Vertical nesting method of Huq et al. (2019) removed
-! 
+!
 ! 4444 2020-03-05 15:59:50Z raasch
 ! bugfix: misplaced cpp-directive moved
-! 
+!
 ! 4360 2020-01-07 11:25:50Z suehring
 ! Corrected "Former revisions" section
-! 
+!
 ! 3655 2019-01-07 16:51:22Z knoop
 ! Added an empty output string to stop keywords to clean up job protocol
@@ -43,17 +45,16 @@
 ! ------------
 !> Stop program execution
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE local_stop
- 
+
 #if defined( __parallel )
 
-    USE control_parameters,                                                    &
-        ONLY:  abort_mode, coupling_mode, coupling_mode_remote, dt_restart,    &
-               stop_dt, terminate_coupled, terminate_coupled_remote,           &
-               terminate_run, time_restart
+    USE control_parameters,                                                                        &
+        ONLY:  abort_mode, coupling_mode, coupling_mode_remote, dt_restart, stop_dt,               &
+               terminate_coupled, terminate_coupled_remote, terminate_run, time_restart
 
     USE pegrid
 
-    USE pmc_interface,                                                         &
+    USE pmc_interface,                                                                             &
         ONLY:  nested_run
 
@@ -63,6 +64,6 @@
        IF ( nested_run )  THEN
 !
-!--       Workaround: If any of the nested model crashes, it aborts the whole
-!--       run with MPI_ABORT, regardless of the reason given by abort_mode
+!--       Workaround: If any of the nested model crashes, it aborts the whole run with MPI_ABORT,
+!--                   regardless of the reason given by abort_mode
           CALL MPI_ABORT( MPI_COMM_WORLD, 9999, ierr )
        ELSE
@@ -84,17 +85,16 @@
              IF ( myid == 0 )  THEN
                 PRINT*, '+++ local_stop:'
-                PRINT*, '    local model "', TRIM( coupling_mode ), &
-                     '" stops now'
+                PRINT*, '    local model "', TRIM( coupling_mode ), '" stops now'
              ENDIF
 !
-!--          Inform the remote model of the termination and its reason, provided
-!--          the remote model has not already been informed of another 
-!--          termination reason (terminate_coupled > 0) before.
+!--          Inform the remote model of the termination and its reason, provided the remote model
+!--          has not already been informed of another termination reason (terminate_coupled > 0)
+!--          before.
              IF ( terminate_coupled == 0 )  THEN
                 terminate_coupled = 1
                 IF ( myid == 0 ) THEN
-                   CALL MPI_SENDRECV( &
-                        terminate_coupled,        1, MPI_INTEGER, target_id,  0, &
-                        terminate_coupled_remote, 1, MPI_INTEGER, target_id,  0, &
+                   CALL MPI_SENDRECV(                                                              &
+                        terminate_coupled,        1, MPI_INTEGER, target_id,  0,                   &
+                        terminate_coupled_remote, 1, MPI_INTEGER, target_id,  0,                   &
                         comm_inter, status, ierr )
                 ENDIF
@@ -107,6 +107,5 @@
              IF ( myid == 0 )  THEN
                 PRINT*, '+++ local_stop:'
-                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), &
-                     '" stopped'
+                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), '" stopped'
              ENDIF
              CALL MPI_FINALIZE( ierr )
@@ -116,6 +115,5 @@
              IF ( myid == 0 )  THEN
                 PRINT*, '+++ local_stop:'
-                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), &
-                     '" terminated'
+                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), '" terminated'
                 PRINT*, '    with stop_dt = .T.'
              ENDIF
@@ -125,6 +123,5 @@
              IF ( myid == 0 )  THEN
                 PRINT*, '+++ local_stop:'
-                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), &
-                     '" terminated'
+                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), '" terminated'
                 PRINT*, '    with terminate_run = .T. (CPU-time limit)'
              ENDIF
@@ -134,6 +131,5 @@
              IF ( myid == 0 )  THEN
                 PRINT*, '+++ local_stop:'
-                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), &
-                     '" terminated'
+                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), '" terminated'
                 PRINT*, '    with terminate_run = .T. (restart)'
              ENDIF
@@ -144,6 +140,5 @@
              IF ( myid == 0 )  THEN
                 PRINT*, '+++ local_stop:'
-                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), &
-                     '" terminated'
+                PRINT*, '    remote model "', TRIM( coupling_mode_remote ), '" terminated'
                 PRINT*, '    with terminate_run = .T. (single restart)'
              ENDIF
@@ -161,3 +156,3 @@
 #endif
 
- END SUBROUTINE local_stop    
+ END SUBROUTINE local_stop
Index: /palm/trunk/SOURCE/local_system.f90
===================================================================
--- /palm/trunk/SOURCE/local_system.f90	(revision 4676)
+++ /palm/trunk/SOURCE/local_system.f90	(revision 4677)
@@ -1,30 +1,32 @@
 !> @file local_system.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 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.
+! 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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current 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
 ! Corrected "Former revisions" section
@@ -37,7 +39,7 @@
 ! ------------
 !> System calls for different operating systems
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE local_system( command )
- 
+
 
     CHARACTER (LEN=*) ::  command !<
@@ -45,3 +47,3 @@
     CALL SYSTEM( command )
 
- END SUBROUTINE local_system    
+ END SUBROUTINE local_system
Index: /palm/trunk/SOURCE/local_tremain.f90
===================================================================
--- /palm/trunk/SOURCE/local_tremain.f90	(revision 4676)
+++ /palm/trunk/SOURCE/local_tremain.f90	(revision 4677)
@@ -1,30 +1,32 @@
 !> @file local_tremain.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 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.
+! 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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current 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
 ! Corrected "Former revisions" section
@@ -37,12 +39,12 @@
 ! ------------
 !> For different operating systems get the remaining cpu-time of the job
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE local_tremain( remaining_time )
- 
 
-    USE control_parameters,                                                    &
+
+    USE control_parameters,                                                                        &
         ONLY:  maximum_cpu_time_allowed
 
-    USE cpulog,                                                                &
+    USE cpulog,                                                                                    &
         ONLY:  initial_wallclock_time
 
@@ -56,11 +58,10 @@
     INTEGER(idp) ::  count_rate            !<
 
-    REAL(wp)     ::  actual_wallclock_time !<
+    REAL(wp)     ::  current_wallclock_time !<
     REAL(wp)     ::  remaining_time        !<
 
     CALL SYSTEM_CLOCK( count, count_rate )
-    actual_wallclock_time = REAL( count, KIND=wp ) / REAL( count_rate, KIND=wp )
-    remaining_time = maximum_cpu_time_allowed - &
-                     ( actual_wallclock_time - initial_wallclock_time )
+    current_wallclock_time = REAL( count, KIND=wp ) / REAL( count_rate, KIND=wp )
+    remaining_time = maximum_cpu_time_allowed - ( current_wallclock_time - initial_wallclock_time )
 
  END SUBROUTINE local_tremain
Index: /palm/trunk/SOURCE/local_tremain_ini.f90
===================================================================
--- /palm/trunk/SOURCE/local_tremain_ini.f90	(revision 4676)
+++ /palm/trunk/SOURCE/local_tremain_ini.f90	(revision 4677)
@@ -1,30 +1,32 @@
 !> @file local_tremain_ini.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 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.
+! 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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current 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
 ! Corrected "Former revisions" section
@@ -37,11 +39,11 @@
 ! ------------
 !> Initialization of CPU-time measurements for different operating systems
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE local_tremain_ini
- 
-      
-    USE cpulog,                                                                &
+
+
+    USE cpulog,                                                                                    &
         ONLY:  initial_wallclock_time
-        
+
     USE kinds
 
Index: /palm/trunk/SOURCE/message.f90
===================================================================
--- /palm/trunk/SOURCE/message.f90	(revision 4676)
+++ /palm/trunk/SOURCE/message.f90	(revision 4677)
@@ -1,20 +1,19 @@
 !> @file message.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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current revisions:
@@ -25,6 +24,9 @@
 ! -----------------
 ! $Id$
+! file re-formatted to follow the PALM coding standard
+!
+! 4580 2020-06-29 07:54:21Z raasch
 ! bugfix for aborts in case of nested runs
-! 
+!
 ! 4578 2020-06-25 15:43:32Z gronemeier
 ! bugfix : do not save input values from last call of routines debug_message and location_message
@@ -45,6 +47,6 @@
 !
 ! 3885 2019-04-11 11:29:34Z kanani
-! Changes related to global restructuring of location messages and introduction
-! of additional debug messages
+! Changes related to global restructuring of location messages and introduction of additional debug
+! messages
 !
 ! 3655 2019-01-07 16:51:22Z knoop
@@ -64,9 +66,9 @@
 !> file_id: 6 - stdout (*)
 !> flush_file: 0 - no action, 1 - flush the respective output buffer
-!------------------------------------------------------------------------------!
- SUBROUTINE message( routine_name, message_identifier, requested_action, &
-                     message_level, output_on_pe, file_id, flush_file )
-
-    USE control_parameters,                                                    &
+!--------------------------------------------------------------------------------------------------!
+ SUBROUTINE message( routine_name, message_identifier, requested_action, message_level,            &
+                     output_on_pe, file_id, flush_file )
+
+    USE control_parameters,                                                                        &
         ONLY:  abort_mode, message_string
 
@@ -75,5 +77,5 @@
     USE pegrid
 
-    USE pmc_interface,                                                         &
+    USE pmc_interface,                                                                             &
         ONLY:  cpl_id, nested_run
 
@@ -112,6 +114,5 @@
 !-- Create the complete output string, starting with the message level
     IF ( message_level == 0 )  THEN
-       header_string = '--- informative message' // TRIM(nest_string) //       &
-                       ' ---'
+       header_string = '--- informative message' // TRIM(nest_string) // ' ---'
     ELSEIF ( message_level == 1 )  THEN
        header_string = '+++ warning message' // TRIM(nest_string) // ' ---'
@@ -119,27 +120,25 @@
        header_string = '+++ error message' // TRIM(nest_string) // ' ---'
     ELSE
-       WRITE( header_string,'(A,I2)' )  '+++ unknown message level' //         &
-                                        TRIM(nest_string) // ': ',             &
-                                        message_level
+       WRITE( header_string,'(A,I2)' )  '+++ unknown message level' //                             &
+                                        TRIM(nest_string) // ': ', message_level
     ENDIF
 
 !
 !-- Add the message identifier and the generating routine
-    header_string_2 = 'ID: ' // message_identifier // &
+    header_string_2 = 'ID: ' // message_identifier //                                              &
                       '  generated by routine: ' // TRIM( routine_name )
 
     information_string_1 = 'Further information can be found at'
-    IF(message_identifier(1:2) == 'NC') THEN
-       information_string_2 = 'http://palm.muk.uni-hannover.de/trac/wiki/doc' // &
-                              '/app/errmsg#NC'
+    IF ( message_identifier(1:2) == 'NC' )  THEN
+       information_string_2 = 'http://palm.muk.uni-hannover.de/trac/wiki/doc/app/errmsg#NC'
     ELSE
-       information_string_2 = 'http://palm.muk.uni-hannover.de/trac/wiki/doc' // &
-                              '/app/errmsg#' // message_identifier
-    ENDIF
-
-
-!
-!-- Output the output string and the corresponding message string which had
-!-- been already assigned in the calling subroutine.
+       information_string_2 = 'http://palm.muk.uni-hannover.de/trac/wiki/doc/app/errmsg#' //       &
+                              message_identifier
+    ENDIF
+
+
+!
+!-- Output the output string and the corresponding message string which had been already assigned in
+!-- the calling subroutine.
 !
 !-- First find out if output shall be done on this PE.
@@ -210,8 +209,6 @@
        IF ( pe_out_of_range )  THEN
           WRITE ( *, '(A)' )  '+++ WARNING from routine message:'
-          WRITE ( *, '(A,I6,A)' )  '    PE ', output_on_pe, &
-                                   ' choosed for output is larger '
-          WRITE ( *, '(A,I6)' )  '    than the maximum number of used PEs', &
-                                 numprocs-1
+          WRITE ( *, '(A,I6,A)' )  '    PE ', output_on_pe, ' choosed for output is larger '
+          WRITE ( *, '(A,I6)' )  '    than the maximum number of used PEs', numprocs-1
           WRITE ( *, '(A)' )  '    Output is done on PE0 instead'
        ENDIF
@@ -224,6 +221,6 @@
        abort_mode = requested_action
 !
-!--    Since nested runs always use MPI_ABORT, let only the PE which output a message initiate
-!--    the abort. Others just wait.
+!--    Since nested runs always use MPI_ABORT, let only the PE which output a message initiate the
+!--    abort. Others just wait.
        IF ( nested_run  .AND.  requested_action == 1  .AND.  .NOT. do_output )  THEN
 #if defined( __parallel )
@@ -342,12 +339,12 @@
 
 
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 ! Description:
 ! ------------
 !> Abort routine for failures durin reading of namelists
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE parin_fail_message( location, line )
 
-    USE control_parameters,                                                    &
+    USE control_parameters,                                                                        &
         ONLY:  message_string
 
@@ -372,8 +369,6 @@
     ENDDO
 
- 20 WRITE( message_string, '(A,I3,A)' )                                        &
-                   'Error(s) in NAMELIST '// TRIM(location) //                 &
-                   '&Reading fails on line ', line_counter,                    &
-                   ' at&' // line
+ 20 WRITE( message_string, '(A,I3,A)' ) 'Error(s) in NAMELIST '// TRIM(location) //                &
+                                        '&Reading fails on line ', line_counter, ' at&' // line
     CALL message( 'parin', 'PA0271', 1, 2, 0, 6, 0 )
 
Index: /palm/trunk/SOURCE/mod_kinds.f90
===================================================================
--- /palm/trunk/SOURCE/mod_kinds.f90	(revision 4676)
+++ /palm/trunk/SOURCE/mod_kinds.f90	(revision 4677)
@@ -1,36 +1,38 @@
 !> @file mod_kinds.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 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.
+! 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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current 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
-! 
+!
 ! 4000 2019-05-24 07:20:44Z raasch
 ! preprocessor switch added for choosing the real precision
-! 
+!
 ! 3655 2019-01-07 16:51:22Z knoop
 ! Corrected "Former revisions" section
-! 
+!
 ! 1306 2014-03-13 14:30:59Z raasch
 ! Initial revision
@@ -39,12 +41,12 @@
 ! ------------
 !> Standard kind definitions
-!> wp (working precision) and iwp (integer working precision) are the kinds
-!> used by default in all variable declarations.
+!> wp (working precision) and iwp (integer working precision) are the kinds used by default in all
+!> variable declarations.
 !> By default, PALM is using wp = dp (64bit), and iwp = isp (32bit).
-!> If you like to switch to other precision, then please set wp/iwp
-!> appropriately by assigning other kinds below.
-!------------------------------------------------------------------------------!
+!> If you like to switch to other precision, then please set wp/iwp appropriately by assigning other
+!> kinds below.
+!--------------------------------------------------------------------------------------------------!
  MODULE kinds
- 
+
 
     IMPLICIT NONE
Index: /palm/trunk/SOURCE/mod_particle_attributes.f90
===================================================================
--- /palm/trunk/SOURCE/mod_particle_attributes.f90	(revision 4676)
+++ /palm/trunk/SOURCE/mod_particle_attributes.f90	(revision 4677)
@@ -1,20 +1,19 @@
 !> @file mod_particle_attributes.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 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.
+! 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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current revisions:
@@ -25,17 +24,21 @@
 ! -----------------
 ! $Id$
+! file re-formatted to follow the PALM coding standard
+!
+! 4628 2020-07-29 07:23:03Z raasch
 ! extensions required for MPI-I/O of particle data to restart files
-! 
+!
 ! 4360 2020-01-07 11:25:50Z suehring
 ! Corrected "Former revisions" section
-! 
+!
 ! 4043 2019-06-18 16:59:00Z schwenkel
 ! Remove min_nr_particle
-! 
+!
 ! 4017 2019-06-06 12:16:46Z schwenkel
 ! interoperable C datatypes introduced in particle type to avoid compiler warnings
-! 
+!
 ! 3720 2019-02-06 13:19:55Z knoop
 ! time_prel replaced by last_particle_release_time
+!
 ! 1359 2014-04-11 17:15:14Z hoffmann
 ! new module containing all particle related variables
@@ -45,6 +48,6 @@
 ! ------------
 !> Definition of variables used to compute particle transport
-!------------------------------------------------------------------------------!
-MODULE particle_attributes
+!--------------------------------------------------------------------------------------------------!
+ MODULE particle_attributes
 
     USE, INTRINSIC ::  ISO_C_BINDING
@@ -54,4 +57,6 @@
 
     USE kinds
+
+    INTEGER(iwp), PARAMETER ::  max_number_of_particle_groups = 10 !< maximum allowed number of particle groups
 
     CHARACTER(LEN=varnamelength), DIMENSION(50) ::  part_output = ' '  !< namelist parameter
@@ -63,48 +68,48 @@
     INTEGER(iwp) ::  ibc_par_t                                    !< particle top boundary condition dummy
     INTEGER(iwp) ::  number_of_output_particles = 0               !< number of output particles
-    INTEGER(iwp) ::  number_of_particles = 0                      !< number of particles for each grid box (3d array is saved on prt_count)
+    INTEGER(iwp) ::  number_of_particles = 0                      !< number of particles for each grid box (3d array is saved on
+                                                                  !< prt_count)
     INTEGER(iwp) ::  number_of_particle_groups = 1                !< namelist parameter (see documentation)
     INTEGER(iwp) ::  part_inc = 1                                 !< increment of particles in output file
 
-    INTEGER(iwp), PARAMETER ::  max_number_of_particle_groups = 10 !< maximum allowed number of particle groups
+    INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE ::  prt_count  !< 3d array of number of particles of every grid box
 
-    INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE ::  prt_count  !< 3d array of number of particles of every grid box
-    
     LOGICAL ::  particle_advection = .FALSE.              !< parameter to steer the advection of particles
     LOGICAL ::  unlimited_dimension = .TRUE.              !< umlimited dimension for particle output
-    LOGICAL ::  use_sgs_for_particles = .FALSE.           !< namelist parameter (see documentation)    
+    LOGICAL ::  use_sgs_for_particles = .FALSE.           !< namelist parameter (see documentation)
     LOGICAL ::  wang_kernel = .FALSE.                     !< flag for collision kernel
 
     REAL(wp) ::  alloc_factor = 20.0_wp                   !< namelist parameter (see documentation)
-    REAL(wp) ::  oversize = 100.0_wp                      !< reserve spare particles in output file (in % relative to initial number)
+    REAL(wp) ::  oversize = 100.0_wp                      !< reserve spare particles in output file (in % relative to initial
+                                                          !< number)
     REAL(wp) ::  particle_advection_start = 0.0_wp        !< namelist parameter (see documentation)
     REAL(wp) ::  part_percent = 100.0_wp                  !< percentage of particles in output file
 
     TYPE, PUBLIC ::  particle_type
-        REAL(wp)     ::  aux1          !< auxiliary multi-purpose feature
-        REAL(wp)     ::  aux2          !< auxiliary multi-purpose feature
-        REAL(wp)     ::  radius        !< radius of particle
-        REAL(wp)     ::  age           !< age of particle
-        REAL(wp)     ::  age_m         !<
-        REAL(wp)     ::  dt_sum        !<
-        REAL(wp)     ::  e_m           !< interpolated sgs tke
-        REAL(wp)     ::  origin_x      !< origin x-position of particle (changed cyclic bc)
-        REAL(wp)     ::  origin_y      !< origin y-position of particle (changed cyclic bc)
-        REAL(wp)     ::  origin_z      !< origin z-position of particle (changed cyclic bc)
-        REAL(wp)     ::  rvar1         !<
-        REAL(wp)     ::  rvar2         !<
-        REAL(wp)     ::  rvar3         !<
-        REAL(wp)     ::  speed_x       !< speed of particle in x
-        REAL(wp)     ::  speed_y       !< speed of particle in y
-        REAL(wp)     ::  speed_z       !< speed of particle in z
-        REAL(wp)     ::  weight_factor !< weighting factor
-        REAL(wp)     ::  x             !< x-position
-        REAL(wp)     ::  y             !< y-position
-        REAL(wp)     ::  z             !< z-position
-        INTEGER(iwp) ::  class         !< radius class needed for collision
-        INTEGER(iwp) ::  group         !< number of particle group
-        INTEGER(idp) ::  id            !< particle ID (64 bit integer)
-        LOGICAL      ::  particle_mask !< if this parameter is set to false the particle will be deleted
-        INTEGER(iwp) ::  block_nr      !< number for sorting (removable?)
+        REAL(wp)     ::  aux1             !< auxiliary multi-purpose feature
+        REAL(wp)     ::  aux2             !< auxiliary multi-purpose feature
+        REAL(wp)     ::  radius           !< radius of particle
+        REAL(wp)     ::  age              !< age of particle
+        REAL(wp)     ::  age_m            !<
+        REAL(wp)     ::  dt_sum           !<
+        REAL(wp)     ::  e_m              !< interpolated sgs tke
+        REAL(wp)     ::  origin_x         !< origin x-position of particle (changed cyclic bc)
+        REAL(wp)     ::  origin_y         !< origin y-position of particle (changed cyclic bc)
+        REAL(wp)     ::  origin_z         !< origin z-position of particle (changed cyclic bc)
+        REAL(wp)     ::  rvar1            !<
+        REAL(wp)     ::  rvar2            !<
+        REAL(wp)     ::  rvar3            !<
+        REAL(wp)     ::  speed_x          !< speed of particle in x
+        REAL(wp)     ::  speed_y          !< speed of particle in y
+        REAL(wp)     ::  speed_z          !< speed of particle in z
+        REAL(wp)     ::  weight_factor    !< weighting factor
+        REAL(wp)     ::  x                !< x-position
+        REAL(wp)     ::  y                !< y-position
+        REAL(wp)     ::  z                !< z-position
+        INTEGER(iwp) ::  class            !< radius class needed for collision
+        INTEGER(iwp) ::  group            !< number of particle group
+        INTEGER(idp) ::  id               !< particle ID (64 bit integer)
+        LOGICAL      ::  particle_mask    !< if this parameter is set to false the particle will be deleted
+        INTEGER(iwp) ::  block_nr         !< number for sorting (removable?)
         INTEGER(iwp) ::  particle_nr=-1   !< particle number for particle IO (increment one
     END TYPE particle_type
@@ -121,6 +126,5 @@
     END TYPE particle_groups_type
 
-    TYPE(particle_groups_type), DIMENSION(max_number_of_particle_groups) ::    &
-       particle_groups
+    TYPE(particle_groups_type), DIMENSION(max_number_of_particle_groups) ::  particle_groups
 
     TYPE  grid_particle_def
@@ -145,3 +149,3 @@
 
 
-END MODULE particle_attributes
+ END MODULE particle_attributes
Index: /palm/trunk/SOURCE/model_1d_mod.f90
===================================================================
--- /palm/trunk/SOURCE/model_1d_mod.f90	(revision 4676)
+++ /palm/trunk/SOURCE/model_1d_mod.f90	(revision 4677)
@@ -1,20 +1,19 @@
 !> @file model_1d_mod.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/>.
+! 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-2020 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 !
 ! Current revisions:
@@ -25,4 +24,7 @@
 ! -----------------
 ! $Id$
+! file re-formatted to follow the PALM coding standard
+!
+! 4586 2020-07-01 16:16:43Z gronemeier
 ! renamed Richardson flux number into gradient Richardson number
 !
@@ -53,28 +55,25 @@
 !>        the 1D model uses different turbulence closure approaches at least if
 !>        the 3D model is set to LES-mode.
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
  MODULE model_1d_mod
 
-    USE arrays_3d,                                                             &
-        ONLY:  dd2zu, ddzu, ddzw, dzu, dzw, pt_init, q_init, ug, u_init,       &
-               vg, v_init, zu
-
-    USE basic_constants_and_equations_mod,                                     &
+    USE arrays_3d,                                                                                 &
+        ONLY:  dd2zu, ddzu, ddzw, dzu, dzw, pt_init, q_init, ug, u_init, vg, v_init, zu
+
+    USE basic_constants_and_equations_mod,                                                         &
         ONLY:  g, kappa, pi
 
-    USE control_parameters,                                                    &
-        ONLY:  constant_diffusion, constant_flux_layer, dissipation_1d, f,     &
-               humidity, ibc_e_b, intermediate_timestep_count,                 &
-               intermediate_timestep_count_max, km_constant,                   &
-               message_string, mixing_length_1d, prandtl_number,               &
-               roughness_length, run_description_header, simulated_time_chr,   &
-               timestep_scheme, tsc, z0h_factor
-
-    USE indices,                                                               &
+    USE control_parameters,                                                                        &
+        ONLY:  constant_diffusion, constant_flux_layer, dissipation_1d, f, humidity, ibc_e_b,      &
+               intermediate_timestep_count, intermediate_timestep_count_max, km_constant,          &
+               message_string, mixing_length_1d, prandtl_number, roughness_length,                 &
+               run_description_header, simulated_time_chr, timestep_scheme, tsc, z0h_factor
+
+    USE indices,                                                                                   &
         ONLY:  nzb, nzb_diff, nzt
 
     USE kinds
 
-    USE pegrid,                                                                &
+    USE pegrid,                                                                                    &
         ONLY:  myid
 
@@ -176,7 +175,6 @@
 !
 !-- Public variables
-    PUBLIC  damp_level_1d, damp_level_ind_1d, diss1d, dt_pr_1d,                &
-            dt_run_control_1d, e1d, end_time_1d, kh1d, km1d, l1d, ri1d, u1d,   &
-            us1d, usws1d, v1d, vsws1d
+    PUBLIC  damp_level_1d, damp_level_ind_1d, diss1d, dt_pr_1d, dt_run_control_1d, e1d,            &
+            end_time_1d, kh1d, km1d, l1d, ri1d, u1d, us1d, usws1d, v1d, vsws1d
 
 
@@ -185,5 +183,5 @@
  SUBROUTINE init_1d_model
 
-    USE grid_variables,                                                        &
+    USE grid_variables,                                                                            &
         ONLY:  dx, dy
 
@@ -196,11 +194,11 @@
 !
 !-- Allocate required 1D-arrays
-    ALLOCATE( diss1d(nzb:nzt+1), diss1d_p(nzb:nzt+1),                          &
-              e1d(nzb:nzt+1), e1d_p(nzb:nzt+1), kh1d(nzb:nzt+1),               &
-              km1d(nzb:nzt+1), l1d(nzb:nzt+1), l1d_init(nzb:nzt+1),            &
-              l1d_diss(nzb:nzt+1), ri1d(nzb:nzt+1), te_diss(nzb:nzt+1),        &
-              te_dissm(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),               &
+    ALLOCATE( diss1d(nzb:nzt+1), diss1d_p(nzb:nzt+1),                                              &
+              e1d(nzb:nzt+1), e1d_p(nzb:nzt+1), kh1d(nzb:nzt+1),                                   &
+              km1d(nzb:nzt+1), l1d(nzb:nzt+1), l1d_init(nzb:nzt+1),                                &
+              l1d_diss(nzb:nzt+1), ri1d(nzb:nzt+1), te_diss(nzb:nzt+1),                            &
+              te_dissm(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_p(nzb:nzt+1),  v1d(nzb:nzt+1), v1d_p(nzb:nzt+1) )
 
@@ -223,6 +221,5 @@
 !--       Blackadar mixing length
           IF ( f /= 0.0_wp )  THEN
-             lambda = 2.7E-4_wp * SQRT( ug(nzt+1)**2 + vg(nzt+1)**2 ) /        &
-                               ABS( f ) + 1E-10_wp
+             lambda = 2.7E-4_wp * SQRT( ug(nzt+1)**2 + vg(nzt+1)**2 ) / ABS( f ) + 1E-10_wp
           ELSE
              lambda = 30.0_wp
@@ -258,7 +255,7 @@
 
 !
-!-- Set initial horizontal velocities at the lowest grid levels to a very small
-!-- value in order to avoid too small time steps caused by the diffusion limit
-!-- in the initial phase of a run (at k=1, dz/2 occurs in the limiting formula!)
+!-- Set initial horizontal velocities at the lowest grid levels to a very small value in order to
+!-- avoid too small time steps caused by the diffusion limit in the initial phase of a run (at k=1,
+!-- dz/2 occurs in the limiting formula!)
     u1d(0:1)   = 0.1_wp
     u1d_p(0:1) = 0.1_wp
@@ -310,9 +307,9 @@
 
 
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 ! Description:
 ! ------------
 !> Runge-Kutta time differencing scheme for the 1D-model.
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 
  SUBROUTINE time_integration_1d
@@ -335,6 +332,6 @@
 
 !
-!-- Determine the time step at the start of a 1D-simulation and
-!-- determine and printout quantities used for run control
+!-- Determine the time step at the start of a 1D-simulation and determine and printout quantities
+!-- used for run control
     dt_1d = 0.01_wp
     CALL run_control_1d
@@ -345,10 +342,8 @@
 
 !
-!--    Depending on the timestep scheme, carry out one or more intermediate
-!--    timesteps
+!--    Depending on the timestep scheme, carry out one or more intermediate timesteps
 
        intermediate_timestep_count = 0
-       DO  WHILE ( intermediate_timestep_count < &
-                   intermediate_timestep_count_max )
+       DO  WHILE ( intermediate_timestep_count < intermediate_timestep_count_max )
 
           intermediate_timestep_count = intermediate_timestep_count + 1
@@ -357,6 +352,5 @@
 
 !
-!--       Compute all tendency terms. If a constant-flux layer is simulated,
-!--       k starts at nzb+2.
+!--       Compute all tendency terms. If a constant-flux layer is simulated, k starts at nzb+2.
           DO  k = nzb_diff, nzt
 
@@ -365,13 +359,13 @@
 !
 !--          u-component
-             te_u(k) =  f * ( v1d(k) - vg(k) ) + ( &
-                              kmzp * ( u1d(k+1) - u1d(k) ) * ddzu(k+1) &
-                            - kmzm * ( u1d(k) - u1d(k-1) ) * ddzu(k)   &
+             te_u(k) =  f * ( v1d(k) - vg(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(k+1) - v1d(k) ) * ddzu(k+1) &
-                            - kmzm * ( v1d(k) - v1d(k-1) ) * ddzu(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
@@ -387,29 +381,28 @@
                 ELSE
                    pt_0 = pt_init(k) * ( 1.0_wp + 0.61_wp * q_init(k) )
-                   flux = ( ( pt_init(k+1) - pt_init(k-1) ) +                  &
-                            0.61_wp * ( pt_init(k+1) * q_init(k+1) -           &
-                                        pt_init(k-1) * q_init(k-1)   )         &
+                   flux = ( ( pt_init(k+1) - pt_init(k-1) ) +                                      &
+                            0.61_wp * ( pt_init(k+1) * q_init(k+1) -                               &
+                                        pt_init(k-1) * q_init(k-1)   )                             &
                           ) * dd2zu(k)
                 ENDIF
 
 !
-!--             Calculate dissipation rate if no prognostic equation is used for
-!--             dissipation rate
+!--             Calculate dissipation rate if no prognostic equation is used for dissipation rate.
                 IF ( dissipation_1d == 'detering' )  THEN
                    diss1d(k) = c_0**3 * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k)
                 ELSEIF ( dissipation_1d == 'as_in_3d_model' )  THEN
-                   diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l1d_init(k) &
-                               ) * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k)
+                   diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l1d_init(k) )                   &
+                               * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k)
                 ENDIF
 !
 !--             TKE
-                te_e(k) = km1d(k) * ( ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2&
-                                    + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2&
-                                    )                                          &
-                                    - g / pt_0 * kh1d(k) * flux                &
-                                    +            (                             &
-                                     kmzp * ( e1d(k+1) - e1d(k) ) * ddzu(k+1)  &
-                                   - kmzm * ( e1d(k) - e1d(k-1) ) * ddzu(k)    &
-                                                 ) * ddzw(k) / sig_e           &
+                te_e(k) = km1d(k) * ( ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2                    &
+                                    + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2                    &
+                                    )                                                              &
+                                    - g / pt_0 * kh1d(k) * flux                                    &
+                                    +            (                                                 &
+                                     kmzp * ( e1d(k+1) - e1d(k) ) * ddzu(k+1)                      &
+                                   - kmzm * ( e1d(k) - e1d(k-1) ) * ddzu(k)                        &
+                                                 ) * ddzw(k) / sig_e                               &
                                    - diss1d(k)
 
@@ -420,20 +413,20 @@
                       alpha_buoyancy = 1.0_wp - l1d(k) / lambda
                    ELSE
-                      alpha_buoyancy = 1.0_wp - ( 1.0_wp + ( c_2 - 1.0_wp )    &
-                                                         / ( c_2 - c_1    ) )  &
+                      alpha_buoyancy = 1.0_wp - ( 1.0_wp + ( c_2 - 1.0_wp )                        &
+                                                         / ( c_2 - c_1    ) )                      &
                                               * l1d(k) / lambda
                    ENDIF
                    c_3 = ( c_1 - c_2 ) * alpha_buoyancy + 1.0_wp
-                   te_diss(k) = ( km1d(k) *                                    &
-                                  ( ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2  &
-                                  + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2  &
-                                  ) * ( c_1 + (c_2 - c_1) * l1d(k) / lambda )  &
-                                  - g / pt_0 * kh1d(k) * flux * c_3            &
-                                  - c_2 * diss1d(k)                            &
-                                ) * diss1d(k) / ( e1d(k) + 1.0E-20_wp )        &
-                                + (   kmzp * ( diss1d(k+1) - diss1d(k) )       &
-                                           * ddzu(k+1)                         &
-                                    - kmzm * ( diss1d(k) - diss1d(k-1) )       &
-                                           * ddzu(k)                           &
+                   te_diss(k) = ( km1d(k) *                                                        &
+                                  ( ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2                      &
+                                  + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2                      &
+                                  ) * ( c_1 + (c_2 - c_1) * l1d(k) / lambda )                      &
+                                  - g / pt_0 * kh1d(k) * flux * c_3                                &
+                                  - c_2 * diss1d(k)                                                &
+                                ) * diss1d(k) / ( e1d(k) + 1.0E-20_wp )                            &
+                                + (   kmzp * ( diss1d(k+1) - diss1d(k) )                           &
+                                           * ddzu(k+1)                                             &
+                                    - kmzm * ( diss1d(k) - diss1d(k-1) )                           &
+                                           * ddzu(k)                                               &
                                   ) * ddzw(k) / sig_diss
 
@@ -445,6 +438,6 @@
 !
 !--       Tendency terms at the top of the constant-flux layer.
-!--       Finite differences of the momentum fluxes are computed using half the
-!--       normal grid length (2.0*ddzw(k)) for the sake of enhanced accuracy
+!--       Finite differences of the momentum fluxes are computed using half the normal grid length
+!--       (2.0*ddzw(k)) for the sake of enhanced accuracy
           IF ( constant_flux_layer )  THEN
 
@@ -457,17 +450,16 @@
              ELSE
                 pt_0 = pt_init(k) * ( 1.0_wp + 0.61_wp * q_init(k) )
-                flux = ( ( pt_init(k+1) - pt_init(k-1) ) +                     &
-                         0.61_wp * ( pt_init(k+1) * q_init(k+1) -              &
-                                     pt_init(k-1) * q_init(k-1)   )            &
+                flux = ( ( pt_init(k+1) - pt_init(k-1) ) +                                         &
+                         0.61_wp * ( pt_init(k+1) * q_init(k+1) -                                  &
+                                     pt_init(k-1) * q_init(k-1)   )                                &
                        ) * dd2zu(k)
              ENDIF
 
 !
-!--          Calculate dissipation rate if no prognostic equation is used for
-!--          dissipation rate
+!--          Calculate dissipation rate if no prognostic equation is used for dissipation rate.
              IF ( dissipation_1d == 'detering' )  THEN
                 diss1d(k) = c_0**3 * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k)
              ELSEIF ( dissipation_1d == 'as_in_3d_model' )  THEN
-                diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l1d_init(k) )  &
+                diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l1d_init(k) )                      &
                             * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k)
              ENDIF
@@ -475,11 +467,11 @@
 !
 !--          u-component
-             te_u(k) = f * ( v1d(k) - vg(k) ) + (                              &
-                       kmzp * ( u1d(k+1) - u1d(k) ) * ddzu(k+1) + usws1d       &
+             te_u(k) = f * ( v1d(k) - vg(k) ) + (                                                  &
+                       kmzp * ( u1d(k+1) - u1d(k) ) * ddzu(k+1) + usws1d                           &
                                                 ) * 2.0_wp * ddzw(k)
 !
 !--          v-component
-             te_v(k) = -f * ( u1d(k) - ug(k) ) + (                             &
-                       kmzp * ( v1d(k+1) - v1d(k) ) * ddzu(k+1) + vsws1d       &
+             te_v(k) = -f * ( u1d(k) - ug(k) ) + (                                                 &
+                       kmzp * ( v1d(k+1) - v1d(k) ) * ddzu(k+1) + vsws1d                           &
                                                  ) * 2.0_wp * ddzw(k)
 !
@@ -490,12 +482,12 @@
                 !>   while for u and v it is not?
                 !>   2018-04-23, gronemeier
-                te_e(k) = km1d(k) * ( ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2&
-                                    + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2&
-                                    )                                          &
-                                    - g / pt_0 * kh1d(k) * flux                &
-                                    +           (                              &
-                                     kmzp * ( e1d(k+1) - e1d(k) ) * ddzu(k+1)  &
-                                   - kmzm * ( e1d(k) - e1d(k-1) ) * ddzu(k)    &
-                                                 ) * ddzw(k) / sig_e           &
+                te_e(k) = km1d(k) * ( ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2                    &
+                                    + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2                    &
+                                    )                                                              &
+                                    - g / pt_0 * kh1d(k) * flux                                    &
+                                    +           (                                                  &
+                                     kmzp * ( e1d(k+1) - e1d(k) ) * ddzu(k+1)                      &
+                                   - kmzm * ( e1d(k) - e1d(k-1) ) * ddzu(k)                        &
+                                                 ) * ddzw(k) / sig_e                               &
                                    - diss1d(k)
              ENDIF
@@ -507,8 +499,6 @@
           DO  k = nzb+1, nzt
 
-             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) )
+             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
@@ -516,18 +506,15 @@
 
              DO  k = nzb+1, nzt
-                e1d_p(k) = 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
 
 !
-!--          Eliminate negative TKE values, which can result from the
-!--          integration due to numerical inaccuracies. In such cases the TKE
-!--          value is reduced to 10 percent of its old value.
+!--          Eliminate negative TKE values, which can result from the integration due to numerical
+!--          inaccuracies. In such cases the TKE value is reduced to 10 percent of its old value.
              WHERE ( e1d_p < 0.0_wp )  e1d_p = 0.1_wp * e1d
 
              IF ( dissipation_1d == 'prognostic' )  THEN
                 DO  k = nzb+1, nzt
-                   diss1d_p(k) = diss1d(k) + dt_1d * ( tsc(2) * te_diss(k) + &
-                                                       tsc(3) * te_dissm(k) )
+                   diss1d_p(k) = diss1d(k) + dt_1d * ( tsc(2) * te_diss(k) + tsc(3) * te_dissm(k) )
                 ENDDO
                 WHERE ( diss1d_p < 0.0_wp )  diss1d_p = 0.1_wp * diss1d
@@ -556,6 +543,5 @@
                 ENDIF
 
-             ELSEIF ( intermediate_timestep_count < &
-                         intermediate_timestep_count_max )  THEN
+             ELSEIF ( intermediate_timestep_count < intermediate_timestep_count_max )  THEN
 
                 DO  k = nzb+1, nzt
@@ -570,6 +556,5 @@
                    IF ( dissipation_1d == 'prognostic' )  THEN
                       DO k = nzb+1, nzt
-                         te_dissm(k) = -9.5625_wp * te_diss(k)  &
-                                     +  5.3125_wp * te_dissm(k)
+                         te_dissm(k) = -9.5625_wp * te_diss(k) + 5.3125_wp * te_dissm(k)
                       ENDDO
                    ENDIF
@@ -581,8 +566,8 @@
 !
 !--       Boundary conditions for the prognostic variables.
-!--       At the top boundary (nzt+1) u, v, e, and diss keep their initial
-!--       values (ug(nzt+1), vg(nzt+1), 0, 0).
-!--       At the bottom boundary, Dirichlet condition is used for u and v (0)
-!--       and Neumann condition for e and diss (e(nzb)=e(nzb+1)).
+!--       At the top boundary (nzt+1) u, v, e, and diss keep their initial values (ug(nzt+1),
+!--       vg(nzt+1), 0, 0).
+!--       At the bottom boundary, Dirichlet condition is used for u and v (0) and Neumann condition
+!--       for e and diss (e(nzb)=e(nzb+1)).
           u1d_p(nzb) = 0.0_wp
           v1d_p(nzb) = 0.0_wp
@@ -611,7 +596,7 @@
 !
 !--                Stable stratification
-                   ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /          &
-                          ( LOG( zu(nzb+1) / z0h1d ) + 5.0_wp * ri1d(nzb+1) *  &
-                                          ( zu(nzb+1) - z0h1d ) / zu(nzb+1)    &
+                   ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /                              &
+                          ( LOG( zu(nzb+1) / z0h1d ) + 5.0_wp * ri1d(nzb+1) *                      &
+                                          ( zu(nzb+1) - z0h1d ) / zu(nzb+1)                        &
                           )
                 ELSE
@@ -619,10 +604,8 @@
 !--                Unstable stratification
                    a = SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) )
-                   b = SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) /                  &
-                       zu(nzb+1) * z0h1d )
-
-                   ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /          &
-                          LOG( (a-1.0_wp) / (a+1.0_wp) *                       &
-                               (b+1.0_wp) / (b-1.0_wp) )
+                   b = SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) / zu(nzb+1) * z0h1d )
+
+                   ts1d = kappa * ( pt_init(nzb+1) - pt_init(nzb) ) /                              &
+                          LOG( (a-1.0_wp) / (a+1.0_wp) * (b+1.0_wp) / (b-1.0_wp) )
                 ENDIF
 
@@ -634,6 +617,6 @@
 !
 !--          Compute the gradient Richardson numbers,
-!--          first at the top of the constant-flux layer using u* of the
-!--          previous time step (+1E-30, if u* = 0), then in the remaining area.
+!--          first at the top of the constant-flux layer using u* of the previous time step
+!--          (+1E-30, if u* = 0), then in the remaining area.
 !--          There, the Ri numbers of the previous time step are used.
 
@@ -646,6 +629,5 @@
                    flux = ts1d + 0.61_wp * pt_init(k) * qs1d
                 ENDIF
-                ri1d(nzb+1) = zu(nzb+1) * kappa * g * flux /                   &
-                               ( pt_0 * ( us1d**2 + 1E-30_wp ) )
+                ri1d(nzb+1) = zu(nzb+1) * kappa * g * flux / ( pt_0 * ( us1d**2 + 1E-30_wp ) )
              ENDIF
 
@@ -656,28 +638,27 @@
                 ELSE
                    pt_0 = pt_init(k) * ( 1.0_wp + 0.61_wp * q_init(k) )
-                   flux = ( ( pt_init(k+1) - pt_init(k-1) )                    &
-                            + 0.61_wp                                          &
-                            * (   pt_init(k+1) * q_init(k+1)                   &
-                                - pt_init(k-1) * q_init(k-1) )                 &
+                   flux = ( ( pt_init(k+1) - pt_init(k-1) )                                        &
+                            + 0.61_wp                                                              &
+                            * (   pt_init(k+1) * q_init(k+1)                                       &
+                                - pt_init(k-1) * q_init(k-1) )                                     &
                           ) * dd2zu(k)
                 ENDIF
                 IF ( ri1d(k) >= 0.0_wp )  THEN
-                   ri1d(k) = g / pt_0 * flux /                                 &
-                              (  ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2     &
-                               + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2     &
-                               + 1E-30_wp                                      &
+                   ri1d(k) = g / pt_0 * flux /                                                     &
+                              (  ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2                         &
+                               + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2                         &
+                               + 1E-30_wp                                                          &
                               )
                 ELSE
-                   ri1d(k) = g / pt_0 * flux /                                 &
-                              (  ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2     &
-                               + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2     &
-                               + 1E-30_wp                                      &
+                   ri1d(k) = g / pt_0 * flux /                                                     &
+                              (  ( ( u1d(k+1) - u1d(k-1) ) * dd2zu(k) )**2                         &
+                               + ( ( v1d(k+1) - v1d(k-1) ) * dd2zu(k) )**2                         &
+                               + 1E-30_wp                                                          &
                               ) * ( 1.0_wp - 16.0_wp * ri1d(k) )**0.25_wp
                 ENDIF
              ENDDO
 !
-!--          Richardson numbers must remain restricted to a realistic value
-!--          range. It is exceeded excessively for very small velocities
-!--          (u,v --> 0).
+!--          Richardson numbers must remain restricted to a realistic value range. It is exceeded
+!--           excessively for very small velocities (u,v --> 0).
              WHERE ( ri1d < -5.0_wp )  ri1d = -5.0_wp
              WHERE ( ri1d > 1.0_wp )  ri1d = 1.0_wp
@@ -691,7 +672,7 @@
 !
 !--                Stable stratification
-                   us1d = kappa * uv_total / (                                 &
-                             LOG( zu(nzb+1) / z01d ) + 5.0_wp * ri1d(nzb+1) *  &
-                                              ( zu(nzb+1) - z01d ) / zu(nzb+1) &
+                   us1d = kappa * uv_total / ( LOG( zu(nzb+1) / z01d )                             &
+                                               + 5.0_wp * ri1d(nzb+1) * ( zu(nzb+1) - z01d )       &
+                                                 / zu(nzb+1)                                       &
                                              )
                 ELSE
@@ -699,10 +680,8 @@
 !--                Unstable stratification
                    a = 1.0_wp / SQRT( SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) ) )
-                   b = 1.0_wp / SQRT( SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) /   &
-                                                     zu(nzb+1) * z01d ) )
-                   us1d = kappa * uv_total / (                                 &
-                              LOG( (1.0_wp+b) / (1.0_wp-b) * (1.0_wp-a) /      &
-                                   (1.0_wp+a) ) +                              &
-                              2.0_wp * ( ATAN( b ) - ATAN( a ) )               &
+                   b = 1.0_wp / SQRT( SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) / zu(nzb+1) * z01d ) )
+                   us1d = kappa * uv_total / ( LOG( (1.0_wp+b) / (1.0_wp-b) * (1.0_wp-a) /         &
+                                                    (1.0_wp+a) ) +                                 &
+                                               2.0_wp * ( ATAN( b ) - ATAN( a ) )                  &
                                              )
                 ENDIF
@@ -714,8 +693,8 @@
 
 !
-!--             Boundary condition for the turbulent kinetic energy and
-!--             dissipation rate at the top of the constant-flux layer.
-!--             Additional Neumann condition de/dz = 0 at nzb is set to ensure
-!--             compatibility with the 3D model.
+!--             Boundary condition for the turbulent kinetic energy and dissipation rate at the top
+!--             of the constant-flux layer.
+!--             Additional Neumann condition de/dz = 0 at nzb is set to ensure compatibility with
+!--             the 3D model.
                 IF ( ibc_e_b == 2 )  THEN
                    e1d(nzb+1) = ( us1d / c_0 )**2
@@ -734,17 +713,15 @@
 !
 !--                   Stable stratification
-                      qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /         &
-                          ( LOG( zu(nzb+1) / z0h1d ) + 5.0_wp * ri1d(nzb+1) *  &
-                                          ( zu(nzb+1) - z0h1d ) / zu(nzb+1)    &
-                          )
+                      qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /                             &
+                             ( LOG( zu(nzb+1) / z0h1d ) + 5.0_wp * ri1d(nzb+1) *                   &
+                                             ( zu(nzb+1) - z0h1d ) / zu(nzb+1)                     &
+                             )
                    ELSE
 !
 !--                   Unstable stratification
                       a = SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) )
-                      b = SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) /               &
-                                         zu(nzb+1) * z0h1d )
-                      qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /         &
-                             LOG( (a-1.0_wp) / (a+1.0_wp) *                    &
-                                  (b+1.0_wp) / (b-1.0_wp) )
+                      b = SQRT( 1.0_wp - 16.0_wp * ri1d(nzb+1) / zu(nzb+1) * z0h1d )
+                      qs1d = kappa * ( q_init(nzb+1) - q_init(nzb) ) /                             &
+                             LOG( (a-1.0_wp) / (a+1.0_wp) * (b+1.0_wp) / (b-1.0_wp) )
                    ENDIF
                 ELSE
@@ -755,8 +732,7 @@
 
 !
-!--          Compute the diabatic mixing length. The unstable stratification
-!--          must not be considered for l1d (km1d) as it is already considered
-!--          in the dissipation of TKE via l1d_diss. Otherwise, km1d would be
-!--          too large.
+!--          Compute the diabatic mixing length. The unstable stratification must not be considered
+!--          for l1d (km1d) as it is already considered in the dissipation of TKE via l1d_diss.
+!--          Otherwise, km1d would be too large.
              IF ( dissipation_1d /= 'prognostic' )  THEN
                 IF ( mixing_length_1d == 'blackadar' )  THEN
@@ -767,6 +743,5 @@
                       ELSE
                          l1d(k) = l1d_init(k)
-                         l1d_diss(k) = l1d_init(k) *                           &
-                                       SQRT( 1.0_wp - 16.0_wp * ri1d(k) )
+                         l1d_diss(k) = l1d_init(k) * SQRT( 1.0_wp - 16.0_wp * ri1d(k) )
                       ENDIF
                    ENDDO
@@ -775,6 +750,6 @@
                       dpt_dz = ( pt_init(k+1) - pt_init(k-1) ) * dd2zu(k)
                       IF ( dpt_dz > 0.0_wp )  THEN
-                         l_stable = 0.76_wp * SQRT( e1d(k) )                   &
-                                  / SQRT( g / pt_init(k) * dpt_dz ) + 1E-5_wp
+                         l_stable = 0.76_wp * SQRT( e1d(k) )                                       &
+                                    / SQRT( g / pt_init(k) * dpt_dz ) + 1E-5_wp
                       ELSE
                          l_stable = l1d_init(k)
@@ -786,19 +761,17 @@
              ELSE
                 DO  k = nzb+1, nzt
-                   l1d(k) = c_0**3 * e1d(k) * SQRT( e1d(k) )                   &
-                          / ( diss1d(k) + 1.0E-30_wp )
+                   l1d(k) = c_0**3 * e1d(k) * SQRT( e1d(k) ) / ( diss1d(k) + 1.0E-30_wp )
                 ENDDO
              ENDIF
 
 !
-!--          Compute the diffusion coefficients for momentum via the
-!--          corresponding Prandtl-layer relationship and according to
-!--          Prandtl-Kolmogorov, respectively
+!--          Compute the diffusion coefficients for momentum via the corresponding Prandtl-layer
+!--          relationship and according to Prandtl-Kolmogorov, respectively
              IF ( constant_flux_layer )  THEN
                 IF ( ri1d(nzb+1) >= 0.0_wp )  THEN
-                   km1d(nzb+1) = us1d * kappa * zu(nzb+1) /                    &
+                   km1d(nzb+1) = us1d * kappa * zu(nzb+1) /                                        &
                                  ( 1.0_wp + 5.0_wp * ri1d(nzb+1) )
                 ELSE
-                   km1d(nzb+1) = us1d * kappa * zu(nzb+1) *                    &
+                   km1d(nzb+1) = us1d * kappa * zu(nzb+1) *                                        &
                                  ( 1.0_wp - 16.0_wp * ri1d(nzb+1) )**0.25_wp
                 ENDIF
@@ -823,6 +796,5 @@
 
 !
-!--          Compute the diffusion coefficient for heat via the relationship
-!--          kh = phim / phih * km
+!--          Compute the diffusion coefficient for heat via the relationship kh = phim / phih * km
              DO  k = nzb+1, nzt
                 IF ( ri1d(k) >= 0.0_wp )  THEN
@@ -865,6 +837,6 @@
     ENDDO   ! time loop
 !
-!-- Set intermediate_timestep_count back to zero. This is required e.g. for
-!-- initial calls of calc_mean_profile.
+!-- Set intermediate_timestep_count back to zero. This is required e.g. for initial calls of
+!-- calc_mean_profile.
     intermediate_timestep_count = 0
 
@@ -872,9 +844,9 @@
 
 
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 ! Description:
 ! ------------
 !> Compute and print out quantities for run control of the 1D model.
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 
  SUBROUTINE run_control_1d
@@ -922,6 +894,6 @@
        alpha = alpha / ( 2.0_wp * pi ) * 360.0_wp
 
-       WRITE ( 15, 101 )  current_timestep_number_1d, simulated_time_chr, &
-                          dt_1d, umax, vmax, us1d, alpha, energy
+       WRITE ( 15, 101 )  current_timestep_number_1d, simulated_time_chr, dt_1d, umax, vmax, us1d, &
+                          alpha, energy
 !
 !--    Write buffer contents to disc immediately
@@ -932,8 +904,8 @@
 !
 !-- formats
-100 FORMAT (///'1D run control output:'/ &
-              &'------------------------------'// &
-           &'ITER.   HH:MM:SS    DT      UMAX   VMAX    U*   ALPHA   ENERG.'/ &
-           &'-------------------------------------------------------------')
+100 FORMAT (///'1D run control output:'/                                                           &
+               '------------------------------'//                                                  &
+            'ITER.   HH:MM:SS    DT      UMAX   VMAX    U*   ALPHA   ENERG.'/                      &
+            '-------------------------------------------------------------')
 101 FORMAT (I7,1X,A9,1X,F6.2,2X,F6.2,1X,F6.2,1X,F6.3,2X,F5.1,2X,F7.2)
 
@@ -943,9 +915,9 @@
 
 
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 ! Description:
 ! ------------
 !> Compute the time step w.r.t. the diffusion criterion
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 
  SUBROUTINE timestep_1d
@@ -965,6 +937,6 @@
 
 !
-!-- Compute the currently feasible time step according to the diffusion
-!-- criterion. At nzb+1 the half grid length is used.
+!-- Compute the currently feasible time step according to the diffusion criterion. At nzb+1 the half
+!-- grid length is used.
     fac = 0.125
     dt_diff = dt_max_1d
@@ -985,6 +957,6 @@
        stop_dt_1d = .TRUE.
 
-       WRITE( message_string, * ) 'timestep has exceeded the lower limit&',    &
-                                  'dt_1d = ',dt_1d,' s   simulation stopped!'
+       WRITE( message_string, * ) 'timestep has exceeded the lower limit&', 'dt_1d = ',dt_1d,      &
+                                  ' s   simulation stopped!'
        CALL message( 'timestep_1d', 'PA0192', 1, 2, 0, 6, 0 )
 
@@ -995,9 +967,9 @@
 
 
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 ! Description:
 ! ------------
 !> List output of profiles from the 1D-model
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 
  SUBROUTINE print_1d_model
@@ -1029,6 +1001,6 @@
        WRITE ( 17, 101 )
        DO  k = nzt+1, nzb, -1
-          WRITE ( 17, 103)  k, zu(k), u1d(k), v1d(k), pt_init(k), e1d(k),      &
-                            ri1d(k), km1d(k), kh1d(k), l1d(k), diss1d(k)
+          WRITE ( 17, 103)  k, zu(k), u1d(k), v1d(k), pt_init(k), e1d(k), ri1d(k), km1d(k),        &
+                            kh1d(k), l1d(k), diss1d(k)
        ENDDO
        WRITE ( 17, 101 )
