Index: palm/trunk/SOURCE/close_file.f90
===================================================================
--- palm/trunk/SOURCE/close_file.f90	(revision 4360)
+++ palm/trunk/SOURCE/close_file.f90	(revision 4559)
@@ -1,20 +1,19 @@
 !> @file close_file.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,10 +24,13 @@
 ! -----------------
 ! $Id$
+! file re-formatted to follow the PALM coding standard
+!
+! 4360 2020-01-07 11:25:50Z suehring
 ! Corrected "Former revisions" section
-! 
+!
 ! 4069 2019-07-01 14:05:51Z Giersch
-! Masked output running index mid has been introduced as a local variable to 
+! Masked output running index mid has been introduced as a local variable to
 ! avoid runtime error (Loop variable has been modified) in time_integration
-! 
+!
 ! 3655 2019-01-07 16:51:22Z knoop
 ! unused variables and format statements removed
@@ -40,16 +42,15 @@
 ! Description:
 ! ------------
-!> Close specified file or all open files, if "0" has been given as the
-!> calling argument. In that case, execute last actions for certain unit 
-!> numbers, if required.
-!------------------------------------------------------------------------------!
+!> Close specified file or all open files, if "0" has been given as the calling argument. In that
+!> case, execute last actions for certain unit numbers, if required.
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE close_file( file_id )
- 
-
-    USE control_parameters,                                                    &
+
+
+    USE control_parameters,                                                                        &
         ONLY:  max_masks, openfile
-                
+
     USE kinds
-    
+
 #if defined( __netcdf )
     USE NETCDF
@@ -57,34 +58,31 @@
 
     USE netcdf_interface,                                                      &
-        ONLY:  id_set_mask, id_set_pr, id_set_pts, id_set_sp,                  &
-               id_set_ts, id_set_xy, id_set_xz, id_set_yz, id_set_3d,          &
-               id_set_fl, nc_stat, netcdf_data_format, netcdf_handle_error
-                
-    USE pegrid                                           
+        ONLY:  id_set_mask, id_set_pr, id_set_pts, id_set_sp,  id_set_ts, id_set_xy, id_set_xz,    &
+               id_set_yz, id_set_3d, id_set_fl, nc_stat, netcdf_data_format, netcdf_handle_error
+
+    USE pegrid
 
     IMPLICIT NONE
 
-    CHARACTER (LEN=10)  ::  datform = 'lit_endian' !< 
-    CHARACTER (LEN=80)  ::  title                  !< 
-
-    INTEGER(iwp) ::  av           !< 
-    INTEGER(iwp) ::  dimx         !< 
-    INTEGER(iwp) ::  dimy         !< 
-    INTEGER(iwp) ::  fid          !< 
-    INTEGER(iwp) ::  file_id      !< 
-    INTEGER(iwp) ::  mid          !< masked output running index 
-    INTEGER(iwp) ::  planz        !< 
-
-    LOGICAL ::  checkuf = .TRUE.  !< 
-    LOGICAL ::  datleg = .TRUE.   !< 
-    LOGICAL ::  dbp = .FALSE.     !< 
-
-    NAMELIST /GLOBAL/  checkuf, datform, dimx, dimy, dbp, planz,               &
-                       title
+    CHARACTER (LEN=10)  ::  datform = 'lit_endian' !<
+    CHARACTER (LEN=80)  ::  title                  !<
+
+    INTEGER(iwp) ::  av           !<
+    INTEGER(iwp) ::  dimx         !<
+    INTEGER(iwp) ::  dimy         !<
+    INTEGER(iwp) ::  fid          !<
+    INTEGER(iwp) ::  file_id      !<
+    INTEGER(iwp) ::  mid          !< masked output running index
+    INTEGER(iwp) ::  planz        !<
+
+    LOGICAL ::  checkuf = .TRUE.  !<
+    LOGICAL ::  datleg = .TRUE.   !<
+    LOGICAL ::  dbp = .FALSE.     !<
+
+    NAMELIST /GLOBAL/  checkuf, datform, dbp, dimx, dimy, planz, title
     NAMELIST /RAHMEN/  datleg
 
 !
-!-- Close specified unit number (if opened) and set a flag that it has
-!-- been opened one time at least
+!-- Close specified unit number (if opened) and set a flag that it has been opened one time at least
     IF ( file_id /= 0 )  THEN
        IF ( openfile(file_id)%opened )  THEN
@@ -162,5 +160,5 @@
 !                CALL netcdf_handle_error( 'close_file', 51 )
 
-             CASE ( 109 ) 
+             CASE ( 109 )
 
                 nc_stat = NF90_CLOSE( id_set_pts )
@@ -206,5 +204,5 @@
                 IF ( myid == 0  .OR.  netcdf_data_format > 4 )  THEN
 !
-!--                decompose fid into mid and av
+!--                Decompose fid into mid and av
                    IF ( fid <= 200+max_masks )  THEN
                       mid = fid - 200
