Index: palm/trunk/SOURCE/lagrangian_particle_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/lagrangian_particle_model_mod.f90	(revision 4018)
+++ palm/trunk/SOURCE/lagrangian_particle_model_mod.f90	(revision 4020)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Removing submodules 
+! 
+! 4018 2019-06-06 13:41:50Z eckhard
 ! Bugfix for former revision
 ! 
@@ -301,4 +304,9 @@
     REAL(wp) ::  z0_av_global                              !< horizontal mean value of z0
     
+    REAL(wp) ::  rclass_lbound !<
+    REAL(wp) ::  rclass_ubound !<
+
+    REAL(wp), PARAMETER ::  c_0 = 3.0_wp         !< parameter for lagrangian timescale
+    
     REAL(wp), DIMENSION(max_number_of_particle_groups) ::  density_ratio = 9999999.9_wp  !< namelist parameter (see documentation)
     REAL(wp), DIMENSION(max_number_of_particle_groups) ::  pdx = 9999999.9_wp            !< namelist parameter (see documentation)
@@ -315,11 +323,26 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE     ::  log_z_z0   !< Precalculate LOG(z/z0)  
     
+    INTEGER(iwp), PARAMETER ::  NR_2_direction_move = 10000 !<
+    INTEGER(iwp)            ::  nr_move_north               !<
+    INTEGER(iwp)            ::  nr_move_south               !<
+
+    TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  move_also_north
+    TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  move_also_south
     
+    REAL(wp) ::  epsilon       !<
+    REAL(wp) ::  urms          !<
+
+    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  epsclass  !< dissipation rate class
+    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  radclass  !< radius class
+    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  winf      !<
     
-    
-    INTEGER(iwp) :: ip
-    INTEGER(iwp) :: jp
-    INTEGER(iwp) :: kp
-    
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ec        !<
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ecf       !<
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  gck       !<
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  hkernel   !<
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  hwratio   !<
+        
+    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ckernel !<        
+        
     INTEGER(iwp), PARAMETER         :: PHASE_INIT    = 1  !<
     INTEGER(iwp), PARAMETER, PUBLIC :: PHASE_RELEASE = 2  !<
@@ -340,10 +363,6 @@
            lpm_rrd_local, &
            lpm_check_parameters
-!            lpm_check_data_output
 
     PUBLIC lagrangian_particle_model, & 
-           ip, &
-           jp, &                       
-           kp, &
            max_number_particles_per_gridbox, &
            radius_merge, &
@@ -358,8 +377,4 @@
        MODULE PROCEDURE lpm_check_parameters
     END INTERFACE lpm_check_parameters
-!     
-!     INTERFACE lpm_check_data_output
-!        MODULE PROCEDURE lpm_check_data_output
-!     END INTERFACE lpm_check_data_output    
 
     INTERFACE lpm_parin
@@ -403,93 +418,63 @@
     END INTERFACE lpm_wrd_global    
         
-    INTERFACE  
-       MODULE SUBROUTINE lpm_advec(ip,jp,kp)
-       END SUBROUTINE
+    INTERFACE lpm_advec
+       MODULE PROCEDURE lpm_advec
+    END INTERFACE lpm_advec
+    
+    INTERFACE lpm_calc_liquid_water_content
+       MODULE PROCEDURE lpm_calc_liquid_water_content
     END INTERFACE
     
-    INTERFACE  
-       MODULE SUBROUTINE lpm_calc_liquid_water_content
-       END SUBROUTINE
+    INTERFACE lpm_boundary_conds
+       MODULE PROCEDURE lpm_boundary_conds
+    END INTERFACE lpm_boundary_conds
+    
+    INTERFACE lpm_droplet_condensation
+       MODULE PROCEDURE lpm_droplet_condensation
     END INTERFACE
     
-    INTERFACE  
-       MODULE SUBROUTINE lpm_boundary_conds(location_bc, i,j,k)
-           CHARACTER (LEN=*), INTENT(IN) ::  location_bc !< case statement for boundary conditions
-            INTEGER(iwp), INTENT(IN) ::  i !< grid index of particle box along x
-            INTEGER(iwp), INTENT(IN) ::  j !< grid index of particle box along y
-            INTEGER(iwp), INTENT(IN) ::  k !< grid index of particle box along z
-
-       END SUBROUTINE
-    END INTERFACE
+    INTERFACE lpm_droplet_collision
+       MODULE PROCEDURE lpm_droplet_collision
+    END INTERFACE lpm_droplet_collision
     
-    INTERFACE  
-       MODULE SUBROUTINE lpm_droplet_condensation(i,j,k)
-            INTEGER(iwp), INTENT(IN) ::  i !< grid index of particle box along x
-            INTEGER(iwp), INTENT(IN) ::  j !< grid index of particle box along y
-            INTEGER(iwp), INTENT(IN) ::  k !< grid index of particle box along z
-       END SUBROUTINE
-    END INTERFACE
+    INTERFACE lpm_init_kernels
+       MODULE PROCEDURE lpm_init_kernels
+    END INTERFACE lpm_init_kernels
     
-    INTERFACE  
-       MODULE SUBROUTINE lpm_droplet_collision(i,j,k)
-            INTEGER(iwp), INTENT(IN) ::  i !< grid index of particle box along x
-            INTEGER(iwp), INTENT(IN) ::  j !< grid index of particle box along y
-            INTEGER(iwp), INTENT(IN) ::  k !< grid index of particle box along z
-       END SUBROUTINE
-    END INTERFACE 
+    INTERFACE lpm_splitting
+       MODULE PROCEDURE lpm_splitting
+    END INTERFACE lpm_splitting
     
-    INTERFACE  
-       MODULE SUBROUTINE lpm_init_kernels
-       END SUBROUTINE
-    END INTERFACE
+    INTERFACE lpm_merging
+       MODULE PROCEDURE lpm_merging
+    END INTERFACE lpm_merging
     
-    INTERFACE  
-       MODULE SUBROUTINE lpm_splitting
-       END SUBROUTINE
-    END INTERFACE
+    INTERFACE lpm_exchange_horiz
+       MODULE PROCEDURE lpm_exchange_horiz
+    END INTERFACE lpm_exchange_horiz
+
+    INTERFACE lpm_move_particle
+       MODULE PROCEDURE lpm_move_particle
+    END INTERFACE lpm_move_particle
+
+    INTERFACE realloc_particles_array
+       MODULE PROCEDURE realloc_particles_array
+    END INTERFACE realloc_particles_array
+
+    INTERFACE dealloc_particles_array
+       MODULE PROCEDURE dealloc_particles_array
+    END INTERFACE dealloc_particles_array
     
-    INTERFACE  
-       MODULE SUBROUTINE lpm_merging
-       END SUBROUTINE
-    END INTERFACE    
+    INTERFACE lpm_sort_in_subboxes
+       MODULE PROCEDURE lpm_sort_in_subboxes
+    END INTERFACE lpm_sort_in_subboxes
+
+    INTERFACE lpm_sort_timeloop_done
+       MODULE PROCEDURE lpm_sort_timeloop_done
+    END INTERFACE lpm_sort_timeloop_done
     
-    INTERFACE 
-       MODULE SUBROUTINE lpm_exchange_horiz
-       END SUBROUTINE
-    END INTERFACE 
-
-    INTERFACE 
-       MODULE SUBROUTINE lpm_move_particle
-       END SUBROUTINE
-    END INTERFACE 
-
-    INTERFACE 
-       MODULE SUBROUTINE realloc_particles_array(i,j,k,size_in)
-          INTEGER(iwp), INTENT(IN) ::  i !< grid index of particle box along x
-          INTEGER(iwp), INTENT(IN) ::  j !< grid index of particle box along y
-          INTEGER(iwp), INTENT(IN) ::  k !< grid index of particle box along z
-          INTEGER(iwp), INTENT(IN), OPTIONAL ::  size_in !< grid index of particle box along z
-        END SUBROUTINE  
-    END INTERFACE 
-
-    INTERFACE 
-       MODULE SUBROUTINE dealloc_particles_array
-       END SUBROUTINE
-    END INTERFACE 
-    
-    INTERFACE  
-       MODULE SUBROUTINE lpm_sort_in_subboxes
-       END SUBROUTINE
-    END INTERFACE
-
-    INTERFACE  
-       MODULE SUBROUTINE lpm_sort_timeloop_done
-       END SUBROUTINE
-    END INTERFACE
-    
-    INTERFACE  
-       MODULE SUBROUTINE lpm_pack
-       END SUBROUTINE
-    END INTERFACE
+    INTERFACE lpm_pack
+       MODULE PROCEDURE lpm_pack
+    END INTERFACE lpm_pack
     
     
@@ -3108,7 +3093,4 @@
  END SUBROUTINE lpm_rrd_global
 
- 
-END MODULE lagrangian_particle_model_mod
-
 
 !------------------------------------------------------------------------------!
@@ -3119,12 +3101,6 @@
 !> grid scale) as well as the boundary conditions of particles. As a next step
 !> this submodule should be excluded as an own file. 
-!------------------------------------------------------------------------------!
-SUBMODULE (lagrangian_particle_model_mod) lpm_dynamics
-
-  REAL(wp), PARAMETER ::  c_0 = 3.0_wp         !< parameter for lagrangian timescale
-  
- CONTAINS
-    
- MODULE SUBROUTINE lpm_advec (ip,jp,kp)
+!------------------------------------------------------------------------------!   
+ SUBROUTINE lpm_advec (ip,jp,kp)
 
     LOGICAL ::  subbox_at_wall !< flag to see if the current subgridbox is adjacent to a wall
@@ -4121,5 +4097,5 @@
 !> (see offset_ocean_*)
 !------------------------------------------------------------------------------! 
- MODULE SUBROUTINE lpm_boundary_conds( location_bc , i, j, k )
+ SUBROUTINE lpm_boundary_conds( location_bc , i, j, k )
 
     CHARACTER (LEN=*), INTENT(IN) ::  location_bc !< general mode: boundary conditions at bottom/top of the model domain
@@ -4624,37 +4600,5 @@
  
  
-END SUBMODULE
- 
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-!> This is a submodule of the lagrangian particle model. It contains all 
-!> microphysical processes of the lpm. This includes activation, condensation 
-!> and collision of cloud and rain droplets.  
-!> As a next step this submodule should be excluded as an own file. 
-!------------------------------------------------------------------------------!
-SUBMODULE (lagrangian_particle_model_mod) lpm_microphysics
-
-    REAL(wp) ::  epsilon       !<
-    REAL(wp) ::  urms          !<
-
-    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  epsclass  !< dissipation rate class
-    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  radclass  !< radius class
-    REAL(wp), DIMENSION(:),   ALLOCATABLE ::  winf      !<
-    
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ec        !<
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ecf       !<
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  gck       !<
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  hkernel   !<
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  hwratio   !<
-    
-    REAL(wp) ::  rclass_lbound !<
-    REAL(wp) ::  rclass_ubound !<    
-    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ckernel !<    
- 
- CONTAINS
- 
- MODULE SUBROUTINE lpm_droplet_condensation (i,j,k)
+ SUBROUTINE lpm_droplet_condensation (i,j,k)
 
     INTEGER(iwp), INTENT(IN) :: i              !<
@@ -4925,5 +4869,5 @@
 !> Calculate the liquid water content for each grid box.
 !------------------------------------------------------------------------------!
- MODULE SUBROUTINE lpm_calc_liquid_water_content
+ SUBROUTINE lpm_calc_liquid_water_content
 
 
@@ -4995,5 +4939,5 @@
 !>              collision efficiencies.
 !------------------------------------------------------------------------------! 
- MODULE SUBROUTINE lpm_droplet_collision (i,j,k)
+ SUBROUTINE lpm_droplet_collision (i,j,k)
     
     INTEGER(iwp), INTENT(IN) ::  i        !<
@@ -5222,5 +5166,5 @@
 !> dissipation classes, calculated at simulation start only.
 !------------------------------------------------------------------------------! 
- MODULE SUBROUTINE lpm_init_kernels
+ SUBROUTINE lpm_init_kernels
 
     INTEGER(iwp) ::  i !<
@@ -6015,5 +5959,5 @@
 ! Unterstrasser and Soelch, 2014. 
 !------------------------------------------------------------------------------!
- MODULE SUBROUTINE lpm_splitting
+ SUBROUTINE lpm_splitting
 
     INTEGER(iwp) ::  i                !< 
@@ -6541,5 +6485,5 @@
 ! Unterstrasser and Soelch, 2014. 
 !------------------------------------------------------------------------------!
- MODULE SUBROUTINE lpm_merging
+ SUBROUTINE lpm_merging
 
     INTEGER(iwp) ::  i         !<      
@@ -6606,22 +6550,5 @@
 
  
-END SUBMODULE
-
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-!> Exchange of particles between the subdomains.
-!------------------------------------------------------------------------------!
-SUBMODULE(lagrangian_particle_model_mod) lpm_utilities
-
-    INTEGER(iwp), PARAMETER ::  NR_2_direction_move = 10000 !<
-    INTEGER(iwp)            ::  nr_move_north               !<
-    INTEGER(iwp)            ::  nr_move_south               !<
-
-    TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  move_also_north
-    TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  move_also_south
-
- CONTAINS
+
  
 !------------------------------------------------------------------------------!
@@ -6639,5 +6566,5 @@
 !> be adjusted.
 !------------------------------------------------------------------------------!
- MODULE SUBROUTINE lpm_exchange_horiz
+ SUBROUTINE lpm_exchange_horiz
 
     INTEGER(iwp) ::  i                 !< grid index (x) of particle positition
@@ -7454,5 +7381,5 @@
 !> cell.
 !------------------------------------------------------------------------------!
- MODULE SUBROUTINE lpm_move_particle
+ SUBROUTINE lpm_move_particle
  
     INTEGER(iwp)        ::  i           !< grid index (x) of particle position
@@ -7587,5 +7514,5 @@
 !> particle array to assure enough memory is available. 
 !------------------------------------------------------------------------------!
- MODULE SUBROUTINE realloc_particles_array ( i, j, k, size_in )
+ SUBROUTINE realloc_particles_array ( i, j, k, size_in )
 
     INTEGER(iwp), INTENT(IN)                       ::  i              !<
@@ -7645,5 +7572,5 @@
 !> Not needed but allocated space for particles is dealloced. 
 !------------------------------------------------------------------------------!
- MODULE SUBROUTINE dealloc_particles_array
+ SUBROUTINE dealloc_particles_array
 
  
@@ -7723,5 +7650,5 @@
 !> Sort all particles into the 8 respective subgrid boxes
 !------------------------------------------------------------------------------!
-   MODULE SUBROUTINE lpm_sort_in_subboxes
+   SUBROUTINE lpm_sort_in_subboxes
 
        INTEGER(iwp) ::  i  !<
@@ -7802,5 +7729,5 @@
 !> Move all particles not marked for deletion to lowest indices (packing)
 !------------------------------------------------------------------------------!
-    MODULE SUBROUTINE lpm_pack
+    SUBROUTINE lpm_pack
     
        INTEGER(iwp) ::  n       !<
@@ -7845,5 +7772,5 @@
 !> complete the LES timestep. 
 !------------------------------------------------------------------------------!
-    MODULE SUBROUTINE lpm_sort_timeloop_done
+    SUBROUTINE lpm_sort_timeloop_done
 
        INTEGER(iwp) :: end_index     !< particle end index for each sub-box
@@ -7924,5 +7851,4 @@
 
     END SUBROUTINE lpm_sort_timeloop_done 
- 
- 
-END SUBMODULE
+
+END MODULE lagrangian_particle_model_mod
