Index: palm/trunk/SOURCE/pmc_general_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_general_mod.f90	(revision 4629)
+++ palm/trunk/SOURCE/pmc_general_mod.f90	(revision 4649)
@@ -1,24 +1,24 @@
  MODULE pmc_general
 
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 ! 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:
-! ------------------
+! -----------------
 !
 !
@@ -26,6 +26,9 @@
 ! -----------------
 ! $Id$
-! support for MPI Fortran77 interface (mpif.h) removed
-! 
+! File re-formatted to follow the PALM coding standard
+!
+! 4629 2020-07-29 09:37:56Z raasch
+! Support for MPI Fortran77 interface (mpif.h) removed
+!
 ! 4360 2020-01-07 11:25:50Z suehring
 ! Corrected "Former revisions" section
@@ -38,5 +41,5 @@
 ! 3655 2019-01-07 16:51:22Z knoop
 ! Determine number of coupled arrays dynamically.
-! 
+!
 ! 1762 2016-02-25 12:31:13Z hellstea
 ! Initial revision by K. Ketelsen
@@ -46,5 +49,5 @@
 !
 ! Structure definition and utilities of Palm Model Coupler
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 
 #if defined( __parallel )
@@ -61,6 +64,4 @@
     SAVE
 
-    INTEGER(iwp), PUBLIC            :: pmc_max_array          !< max # of arrays which can be coupled - will be determined dynamically in pmc_interface
-    
     INTEGER(iwp), PARAMETER, PUBLIC :: da_desclen       =  8  !<
     INTEGER(iwp), PARAMETER, PUBLIC :: da_namelen       = 16  !<
@@ -70,4 +71,7 @@
     INTEGER(iwp), PARAMETER, PUBLIC :: pmc_status_error = -1  !<
 
+    INTEGER(iwp), PUBLIC ::  pmc_max_array  !< max # of arrays which can be coupled
+                                            !< - will be determined dynamically in pmc_interface
+
 
     TYPE, PUBLIC :: xy_ind  !< pair of indices in horizontal plane
@@ -77,50 +81,60 @@
 
     TYPE, PUBLIC ::  arraydef
-       INTEGER(iwp)                   :: coupleindex  !<
-       INTEGER(iwp)                   :: nrdims       !< number of dimensions
-       INTEGER(iwp)                   :: dimkey       !< key for NR dimensions and array type
-       INTEGER(iwp), DIMENSION(4)     :: a_dim        !< size of dimensions
-       TYPE(C_PTR)               :: data         !< pointer of data in parent space
-       TYPE(C_PTR), DIMENSION(2) :: po_data      !< base pointers,
-                                                 !< pmc_s_set_active_data_array
-                                                 !< sets active pointer
-       INTEGER(idp)              :: SendIndex    !< index in send buffer
-       INTEGER(idp)              :: RecvIndex    !< index in receive buffer
-       INTEGER(iwp)              :: SendSize     !< size in send buffer
-       INTEGER(iwp)              :: RecvSize     !< size in receive buffer
-       TYPE(C_PTR)               :: SendBuf      !< data pointer in send buffer
-       TYPE(C_PTR)               :: RecvBuf      !< data pointer in receive buffer
-       CHARACTER(LEN=da_namelen) :: Name         !< name of array
-       TYPE(arraydef), POINTER   :: next
+       CHARACTER(LEN=da_namelen) ::  Name  !< name of array
+
+       INTEGER(iwp) ::  coupleindex  !<
+       INTEGER(iwp) ::  dimkey       !< key for NR dimensions and array type
+       INTEGER(iwp) ::  nrdims       !< number of dimensions
+       INTEGER(iwp) ::  RecvSize     !< size in receive buffer
+       INTEGER(iwp) ::  SendSize     !< size in send buffer
+
+       INTEGER(idp) ::  RecvIndex  !< index in receive buffer
+       INTEGER(idp) ::  SendIndex  !< index in send buffer
+
+       INTEGER(iwp), DIMENSION(4) ::  a_dim  !< size of dimensions
+
+       TYPE(C_PTR) ::  data     !< pointer of data in parent space
+       TYPE(C_PTR) ::  SendBuf  !< data pointer in send buffer
+       TYPE(C_PTR) ::  RecvBuf  !< data pointer in receive buffer
+
+       TYPE(arraydef), POINTER ::  next  !<
+
+       TYPE(C_PTR), DIMENSION(2) ::  po_data  !< base pointers, pmc_s_set_active_data_array
+                                              !< sets active pointer
     END TYPE arraydef
 
-    TYPE(arraydef), PUBLIC, POINTER  :: next
+
+    TYPE(arraydef), PUBLIC, POINTER  :: next  !<
+
 
     TYPE, PUBLIC ::  pedef
        INTEGER(iwp) :: nr_arrays = 0  !< number of arrays which will be transfered
        INTEGER(iwp) :: nrele          !< number of elements, same for all arrays
+
+       TYPE(arraydef), POINTER, DIMENSION(:) ::  array_list  !< list of data arrays to be transfered
        TYPE(xy_ind), POINTER, DIMENSION(:)   ::  locInd      !< xy index local array for remote PE
-       TYPE(arraydef), POINTER, DIMENSION(:) ::  array_list  !< list of data arrays to be transfered
     END TYPE pedef
 
+
     TYPE, PUBLIC ::  childdef
+       INTEGER(iwp) ::  inter_comm         !< inter communicator model and child
+       INTEGER(iwp) ::  inter_npes         !< number of PEs child model
+       INTEGER(iwp) ::  intra_comm         !< intra communicator model and child
+       INTEGER(iwp) ::  intra_rank         !< rank within intra_comm
+       INTEGER(iwp) ::  model_comm         !< communicator of this model
+       INTEGER(iwp) ::  model_npes         !< number of PEs this model
+       INTEGER(iwp) ::  model_rank         !< rank of this model
        INTEGER(idp) ::  totalbuffersize    !<
-       INTEGER(iwp) ::  model_comm         !< communicator of this model
-       INTEGER(iwp) ::  inter_comm         !< inter communicator model and child
-       INTEGER(iwp) ::  intra_comm         !< intra communicator model and child
-       INTEGER(iwp) ::  model_rank         !< rank of this model
-       INTEGER(iwp) ::  model_npes         !< number of PEs this model
-       INTEGER(iwp) ::  inter_npes         !< number of PEs child model
-       INTEGER(iwp) ::  intra_rank         !< rank within intra_comm
        INTEGER(iwp) ::  win_parent_child   !< MPI RMA for preparing data on parent AND child side
        TYPE(pedef), DIMENSION(:), POINTER ::  pes  !< list of all child PEs
     END TYPE childdef
 
+
     TYPE, PUBLIC ::  da_namedef  !< data array name definition
-       INTEGER(iwp)              ::  couple_index  !< unique number of array
-       CHARACTER(LEN=da_desclen) ::  parentdesc    !< parent array description
-       CHARACTER(LEN=da_namelen) ::  nameonparent  !< name of array within parent
        CHARACTER(LEN=da_desclen) ::  childdesc     !< child array description
        CHARACTER(LEN=da_namelen) ::  nameonchild   !< name of array within child
+       CHARACTER(LEN=da_namelen) ::  nameonparent  !< name of array within parent
+       CHARACTER(LEN=da_desclen) ::  parentdesc    !< parent array description
+       INTEGER(iwp)              ::  couple_index  !< unique number of array
     END TYPE da_namedef
 
@@ -137,6 +151,9 @@
  CONTAINS
 
-
-   
+!--------------------------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> @Todo: Missing subroutine description.
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE pmc_g_setname( mychild, couple_index, aname )
 
@@ -144,8 +161,10 @@
 
     CHARACTER(LEN=*)              ::  aname         !<
+
     INTEGER(iwp), INTENT(IN)      ::  couple_index  !<
+
+    INTEGER(iwp) ::  i  !<
+
     TYPE(childdef), INTENT(INOUT) ::  mychild       !<
-
-    INTEGER(iwp) ::  i  !<
 
     TYPE(pedef), POINTER    ::  ape  !<
@@ -164,5 +183,9 @@
 
 
-
+!--------------------------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> @Todo: Missing subroutine description.
+!--------------------------------------------------------------------------------------------------!
  SUBROUTINE sort_2d_i( array, sort_ind )
 
@@ -178,5 +201,5 @@
     INTEGER(iwp), DIMENSION(SIZE(array,1)) ::  tmp  !<
 
-    n = SIZE(array,2)
+    n = SIZE( array, 2 )
     DO  j = 1, n-1
        DO  i = j+1, n
