Index: palm/trunk/SOURCE/vertical_nesting_mod.f90
===================================================================
--- palm/trunk/SOURCE/vertical_nesting_mod.f90	(revision 3232)
+++ palm/trunk/SOURCE/vertical_nesting_mod.f90	(revision 3241)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3232 2018-09-07 12:21:44Z raasch
 ! references to mrun replaced by palmrun, and updated
 ! 
@@ -137,5 +140,4 @@
 
     INTEGER(iwp)                              :: n_cell_c         !> total no. of CG grid points in a PE
-    INTEGER(iwp)                              :: n_cell_f         !> total no. of FG grid points in a PE
     INTEGER(iwp),DIMENSION(2)                 :: pdims_partner    !> processor topology of partner PE
     INTEGER(iwp)                              :: target_idex      !> temporary variable
@@ -185,5 +187,5 @@
             f_rnk_lst, c_rnk_lst, cfratio, pdims_partner,                     &
             nxc, nxf, nyc, nyf, nzc, nzf,                                     &
-            ngp_c, ngp_f, target_idex, n_cell_c, n_cell_f,                    &
+            ngp_c, ngp_f, target_idex, n_cell_c,                              &
             offset, map_coord, TYPE_VNEST_BC, TYPE_VNEST_ANTER                
 
@@ -253,6 +255,4 @@
         USE interfaces
         USE pegrid
-        USE surface_mod,                                                       &
-            ONLY :  surf_def_h, surf_def_v
         USE turbulence_closure_mod,                                            &
             ONLY :  tcm_diffusivities
@@ -264,8 +264,4 @@
         INTEGER(iwp)                          :: i
         INTEGER(iwp)                          :: j
-        INTEGER(iwp)                          :: k
-        INTEGER(iwp)                          :: im
-        INTEGER(iwp)                          :: jn
-        INTEGER(iwp)                          :: ko
         INTEGER(iwp)                          :: iif
         INTEGER(iwp)                          :: jjf
@@ -480,20 +476,20 @@
                 comm_inter,status, ierr )
             interpol3d => u
-            call interpolate_to_fine_u ( 101 )
+            call interpolate_to_fine_u
    
             CALL MPI_RECV( work3d,n_cell_c, MPI_REAL, target_idex, 102, &
                 comm_inter,status, ierr )
             interpol3d => v
-            call interpolate_to_fine_v ( 102 )
+            call interpolate_to_fine_v
    
             CALL MPI_RECV( work3d,n_cell_c, MPI_REAL, target_idex, 103, &
                 comm_inter,status, ierr )
             interpol3d => w
-            call interpolate_to_fine_w ( 103 )
+            call interpolate_to_fine_w
    
             CALL MPI_RECV( work3d,n_cell_c, MPI_REAL, target_idex, 105, &
                 comm_inter,status, ierr )
             interpol3d => pt
-            call interpolate_to_fine_s ( 105 )
+            call interpolate_to_fine_s
    
             IF ( humidity )  THEN
@@ -501,5 +497,5 @@
                 comm_inter,status, ierr )
             interpol3d => q
-            call interpolate_to_fine_s ( 116 )
+            call interpolate_to_fine_s
             ENDIF
 
@@ -507,14 +503,14 @@
                 comm_inter,status, ierr )
             interpol3d => e
-            call interpolate_to_fine_s ( 104 )
+            call interpolate_to_fine_s
    
 !-- kh,km no target attribute, use of pointer not possible
             CALL MPI_RECV( work3d,n_cell_c, MPI_REAL, target_idex, 106, &
                 comm_inter,status, ierr )
-            call interpolate_to_fine_kh ( 106 )
+            call interpolate_to_fine_kh
    
             CALL MPI_RECV( work3d,n_cell_c, MPI_REAL, target_idex, 107, &
                 comm_inter,status, ierr )
-            call interpolate_to_fine_km ( 107 )
+            call interpolate_to_fine_km
    
             DEALLOCATE(   work3d       )
@@ -644,5 +640,5 @@
     CONTAINS
    
-       SUBROUTINE interpolate_to_fine_w( tag )
+       SUBROUTINE interpolate_to_fine_w
       
            USE arrays_3d
@@ -655,5 +651,4 @@
            IMPLICIT NONE
       
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -776,5 +771,5 @@
        END SUBROUTINE interpolate_to_fine_w
       
-       SUBROUTINE interpolate_to_fine_u( tag )
+       SUBROUTINE interpolate_to_fine_u
       
       
@@ -788,5 +783,4 @@
            IMPLICIT NONE
       
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -922,5 +916,5 @@
       
       
-       SUBROUTINE interpolate_to_fine_v( tag )
+       SUBROUTINE interpolate_to_fine_v
       
       
@@ -934,5 +928,4 @@
            IMPLICIT NONE
 
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -1066,5 +1059,5 @@
       
       
-       SUBROUTINE interpolate_to_fine_s( tag )
+       SUBROUTINE interpolate_to_fine_s
       
       
@@ -1078,5 +1071,4 @@
            IMPLICIT NONE
 
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -1216,5 +1208,5 @@
       
       
-       SUBROUTINE interpolate_to_fine_kh( tag )
+       SUBROUTINE interpolate_to_fine_kh
       
       
@@ -1228,5 +1220,4 @@
            IMPLICIT NONE
 
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -1248,22 +1239,6 @@
            REAL(wp)                           :: edot
            REAL(wp)                           :: eplus
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: uprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: vprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: wprs
            REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ptprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: eprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: kmprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: khprs
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: tspr 
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: uprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: vprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: wprf
            REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ptprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: eprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: kmprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: khprf
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: uswspr
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: vswspr
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: uspr
       
       
@@ -1384,5 +1359,5 @@
        END SUBROUTINE interpolate_to_fine_kh
       
-       SUBROUTINE interpolate_to_fine_km( tag )
+       SUBROUTINE interpolate_to_fine_km
       
       
@@ -1396,5 +1371,4 @@
            IMPLICIT NONE
 
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -1416,21 +1390,6 @@
            REAL(wp)                           :: edot
            REAL(wp)                           :: eplus
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: uprs 
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: vprs 
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: wprs 
            REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ptprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: eprs 
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: kmprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: khprs
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: vprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: wprf
            REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ptprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: eprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: kmprf
-           REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: khprf
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: uswspr
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: vswspr
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: tspr 
-           REAL(wp), DIMENSION(:,:), ALLOCATABLE   :: uspr
       
       
@@ -1554,5 +1513,5 @@
       
       
-       SUBROUTINE interpolate_to_fine_flux( tag )
+       SUBROUTINE interpolate_to_fine_flux
       
       
@@ -1566,19 +1525,12 @@
            IMPLICIT NONE
 
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
-           INTEGER(iwp)                       :: k
            INTEGER(iwp)                       :: iif
            INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
-           INTEGER(iwp)                       :: nzbottom
-           INTEGER(iwp)                       :: nztop
            INTEGER(iwp)                       :: bottomx
            INTEGER(iwp)                       :: bottomy
-           INTEGER(iwp)                       :: bottomz
            INTEGER(iwp)                       :: topx
            INTEGER(iwp)                       :: topy
-           INTEGER(iwp)                       :: topz
            REAL(wp)                           :: eps
            REAL(wp)                           :: alpha
@@ -1715,6 +1667,4 @@
         INTEGER(iwp)                          :: iif
         INTEGER(iwp)                          :: jjf
-        REAL(wp)                              :: c_max
-        REAL(wp)                              :: denom
     
     
@@ -1868,8 +1818,6 @@
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
-           INTEGER(iwp)                       :: k
            INTEGER(iwp)                       :: iif
            INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
            INTEGER(iwp)                       :: bottomx
            INTEGER(iwp)                       :: bottomy
@@ -1973,5 +1921,4 @@
            INTEGER(iwp)                       :: iif
            INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
            INTEGER(iwp)                       :: bottomx
            INTEGER(iwp)                       :: bottomy
@@ -2073,5 +2020,4 @@
            INTEGER(iwp)                       :: iif
            INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
            INTEGER(iwp)                       :: bottomx
            INTEGER(iwp)                       :: bottomy
@@ -2182,5 +2128,4 @@
            INTEGER(iwp)                       :: iif
            INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
            INTEGER(iwp)                       :: bottomx
            INTEGER(iwp)                       :: bottomy
@@ -2332,6 +2277,4 @@
         INTEGER(iwp)                          :: iif
         INTEGER(iwp)                          :: jjf
-        REAL(wp)                              :: c_max
-        REAL(wp)                              :: denom
     
     
@@ -2474,5 +2417,4 @@
            INTEGER(iwp)                       :: iif
            INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
            INTEGER(iwp)                       :: bottomx
            INTEGER(iwp)                       :: bottomy
@@ -2614,8 +2556,6 @@
            INTEGER(iwp)                       :: bottomx
            INTEGER(iwp)                       :: bottomy
-           INTEGER(iwp)                       :: bottomz
            INTEGER(iwp)                       :: topx
            INTEGER(iwp)                       :: topy
-           INTEGER(iwp)                       :: topz
            REAL(wp)                           :: eps
            REAL(wp)                           :: alpha
@@ -2766,7 +2706,4 @@
         INTEGER(iwp)                          ::  j
         INTEGER(iwp)                          ::  k
-        INTEGER(iwp)                          ::  im
-        INTEGER(iwp)                          ::  jn
-        INTEGER(iwp)                          ::  ko
         INTEGER(iwp)                          ::  kb !< variable to set respective boundary value, depends on facing. 
         INTEGER(iwp)                          ::  l  !< running index boundary type, for up- and downward-facing walls
@@ -2969,5 +2906,5 @@
             anterpol3d => u
       
-            CALL anterpolate_to_crse_u ( 101 )
+            CALL anterpolate_to_crse_u
             CALL MPI_SEND( work3d, 1, TYPE_VNEST_ANTER, target_idex,  &
                 101, comm_inter, ierr)
@@ -2975,5 +2912,5 @@
             anterpol3d => v
    
-            CALL anterpolate_to_crse_v ( 102 )
+            CALL anterpolate_to_crse_v
             CALL MPI_SEND( work3d, 1, TYPE_VNEST_ANTER, target_idex,  &
                 102, comm_inter, ierr)
@@ -2981,5 +2918,5 @@
             anterpol3d => pt
    
-            CALL anterpolate_to_crse_s ( 105 )
+            CALL anterpolate_to_crse_s
             CALL MPI_SEND( work3d, 1, TYPE_VNEST_ANTER, target_idex,  &
                 105, comm_inter, ierr)
@@ -2990,5 +2927,5 @@
             anterpol3d => q
    
-            CALL anterpolate_to_crse_s ( 106 )
+            CALL anterpolate_to_crse_s
             CALL MPI_SEND( work3d, 1, TYPE_VNEST_ANTER, target_idex,  &
                 106, comm_inter, ierr)
@@ -3001,5 +2938,5 @@
                                  bdims_rem(1,1)  :bdims_rem(1,2)))
             anterpol3d => w
-            CALL anterpolate_to_crse_w ( 103 )
+            CALL anterpolate_to_crse_w
             CALL MPI_SEND( work3d, 1, TYPE_VNEST_ANTER, target_idex,  &
                 103, comm_inter, ierr)
@@ -3013,5 +2950,5 @@
 
     CONTAINS
-       SUBROUTINE anterpolate_to_crse_u( tag )
+       SUBROUTINE anterpolate_to_crse_u
       
       
@@ -3025,5 +2962,203 @@
            IMPLICIT NONE
 
-           INTEGER(iwp), intent(in)           :: tag
+           INTEGER(iwp)                       :: i
+           INTEGER(iwp)                       :: j
+           INTEGER(iwp)                       :: k
+           INTEGER(iwp)                       :: iif
+           INTEGER(iwp)                       :: jjf
+           INTEGER(iwp)                       :: kkf
+           INTEGER(iwp)                       :: bottomy
+           INTEGER(iwp)                       :: bottomz
+           INTEGER(iwp)                       :: topy
+           INTEGER(iwp)                       :: topz
+           REAL(wp)                           :: aweight
+      
+           !
+           !-- Anterpolation of the velocity components u
+           !-- only values in yz-planes that coincide in the fine and
+           !-- the coarse grid are considered
+      
+           DO k = bdims_rem(3,1)+1, bdims_rem(3,2)
+      
+               bottomz = (dzc/dzf) * (k-1) + 1
+               topz    = (dzc/dzf) * k
+      
+               DO j = bdims_rem(2,1),bdims_rem(2,2)
+       
+                   bottomy = (nyf+1) / (nyc+1) * j
+                   topy    = (nyf+1) / (nyc+1) * (j+1) - 1
+      
+                   DO i = bdims_rem(1,1),bdims_rem(1,2)
+      
+                       iif = (nxf+1) / (nxc+1) * i
+      
+                       aweight   = 0.0
+      
+                       DO kkf = bottomz, topz
+                           DO jjf = bottomy, topy
+      
+                               aweight   = aweight + anterpol3d(kkf,jjf,iif) *        &
+                                   (dzf/dzc) * (dyf/dyc)
+      
+                           END DO
+                       END DO
+      
+                       work3d(k,j,i)   = aweight
+      
+                   END DO
+      
+               END DO
+      
+           END DO
+      
+      
+      
+       END SUBROUTINE anterpolate_to_crse_u
+      
+      
+       SUBROUTINE anterpolate_to_crse_v
+      
+      
+           USE arrays_3d
+           USE control_parameters
+           USE grid_variables
+           USE indices
+           USE pegrid
+           
+      
+           IMPLICIT NONE
+
+           INTEGER(iwp)                       :: i
+           INTEGER(iwp)                       :: j
+           INTEGER(iwp)                       :: k
+           INTEGER(iwp)                       :: iif
+           INTEGER(iwp)                       :: jjf
+           INTEGER(iwp)                       :: kkf
+           INTEGER(iwp)                       :: bottomx
+           INTEGER(iwp)                       :: bottomz
+           INTEGER(iwp)                       :: topx
+           INTEGER(iwp)                       :: topz
+           REAL(wp)                           :: aweight
+
+           !
+           !-- Anterpolation of the velocity components v
+           !-- only values in xz-planes that coincide in the fine and
+           !-- the coarse grid are considered
+      
+           DO k = bdims_rem(3,1)+1, bdims_rem(3,2)
+      
+               bottomz = (dzc/dzf) * (k-1) + 1
+               topz    = (dzc/dzf) * k
+      
+               DO j = bdims_rem(2,1), bdims_rem(2,2)
+      
+                   jjf = (nyf+1) / (nyc+1) * j
+      
+                   DO i = bdims_rem(1,1), bdims_rem(1,2)
+      
+                       bottomx = (nxf+1) / (nxc+1) * i
+                       topx    = (nxf+1) / (nxc+1) * (i+1) - 1
+      
+                       aweight   = 0.0
+      
+                       DO kkf = bottomz, topz
+                           DO iif = bottomx, topx
+      
+                               aweight   = aweight + anterpol3d(kkf,jjf,iif) *        &
+                                   (dzf/dzc) * (dxf/dxc)
+      
+      
+                           END DO
+                       END DO
+      
+                       work3d(k,j,i)   = aweight
+      
+                   END DO
+               END DO
+           END DO
+      
+      
+      
+       END SUBROUTINE anterpolate_to_crse_v
+      
+      
+       SUBROUTINE anterpolate_to_crse_w
+      
+      
+           USE arrays_3d
+           USE control_parameters
+           USE grid_variables
+           USE indices
+           USE pegrid
+           
+      
+           IMPLICIT NONE
+
+           INTEGER(iwp)                       :: i
+           INTEGER(iwp)                       :: j
+           INTEGER(iwp)                       :: k
+           INTEGER(iwp)                       :: iif
+           INTEGER(iwp)                       :: jjf
+           INTEGER(iwp)                       :: kkf
+           INTEGER(iwp)                       :: bottomx
+           INTEGER(iwp)                       :: bottomy
+           INTEGER(iwp)                       :: topx
+           INTEGER(iwp)                       :: topy
+           REAL(wp)                           :: aweight
+
+           !
+           !-- Anterpolation of the velocity components w
+           !-- only values in xy-planes that coincide in the fine and
+           !-- the coarse grid are considered
+      
+           DO k = bdims_rem(3,1), bdims_rem(3,2)-1
+      
+               kkf = cfratio(3) * k
+      
+               DO j = bdims_rem(2,1), bdims_rem(2,2)
+      
+                   bottomy = (nyf+1) / (nyc+1) * j
+                   topy    = (nyf+1) / (nyc+1) * (j+1) - 1
+      
+                   DO i = bdims_rem(1,1), bdims_rem(1,2)
+      
+                       bottomx = (nxf+1) / (nxc+1) * i
+                       topx    = (nxf+1) / (nxc+1) * (i+1) - 1
+      
+                       aweight   = 0.0
+      
+                       DO jjf = bottomy, topy
+                           DO iif = bottomx, topx
+      
+                               aweight   = aweight + anterpol3d (kkf,jjf,iif) *        &
+                                   (dxf/dxc) * (dyf/dyc)
+      
+                           END DO
+                       END DO
+      
+                       work3d(k,j,i)   = aweight
+      
+                   END DO
+      
+               END DO
+      
+           END DO
+      
+      
+       END SUBROUTINE anterpolate_to_crse_w
+      
+      
+       SUBROUTINE anterpolate_to_crse_s
+      
+      
+           USE arrays_3d
+           USE control_parameters
+           USE grid_variables
+           USE indices
+           USE pegrid
+           
+      
+           IMPLICIT NONE
+
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -3041,212 +3176,4 @@
       
            !
-           !-- Anterpolation of the velocity components u
-           !-- only values in yz-planes that coincide in the fine and
-           !-- the coarse grid are considered
-      
-           DO k = bdims_rem(3,1)+1, bdims_rem(3,2)
-      
-               bottomz = (dzc/dzf) * (k-1) + 1
-               topz    = (dzc/dzf) * k
-      
-               DO j = bdims_rem(2,1),bdims_rem(2,2)
-       
-                   bottomy = (nyf+1) / (nyc+1) * j
-                   topy    = (nyf+1) / (nyc+1) * (j+1) - 1
-      
-                   DO i = bdims_rem(1,1),bdims_rem(1,2)
-      
-                       iif = (nxf+1) / (nxc+1) * i
-      
-                       aweight   = 0.0
-      
-                       DO kkf = bottomz, topz
-                           DO jjf = bottomy, topy
-      
-                               aweight   = aweight + anterpol3d(kkf,jjf,iif) *        &
-                                   (dzf/dzc) * (dyf/dyc)
-      
-                           END DO
-                       END DO
-      
-                       work3d(k,j,i)   = aweight
-      
-                   END DO
-      
-               END DO
-      
-           END DO
-      
-      
-      
-       END SUBROUTINE anterpolate_to_crse_u
-      
-      
-       SUBROUTINE anterpolate_to_crse_v( tag )
-      
-      
-           USE arrays_3d
-           USE control_parameters
-           USE grid_variables
-           USE indices
-           USE pegrid
-           
-      
-           IMPLICIT NONE
-
-           INTEGER(iwp), intent(in)           :: tag
-           INTEGER(iwp)                       :: i
-           INTEGER(iwp)                       :: j
-           INTEGER(iwp)                       :: k
-           INTEGER(iwp)                       :: iif
-           INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
-           INTEGER(iwp)                       :: bottomx
-           INTEGER(iwp)                       :: bottomy
-           INTEGER(iwp)                       :: bottomz
-           INTEGER(iwp)                       :: topx
-           INTEGER(iwp)                       :: topy
-           INTEGER(iwp)                       :: topz
-           REAL(wp)                           :: aweight
-
-           !
-           !-- Anterpolation of the velocity components v
-           !-- only values in xz-planes that coincide in the fine and
-           !-- the coarse grid are considered
-      
-           DO k = bdims_rem(3,1)+1, bdims_rem(3,2)
-      
-               bottomz = (dzc/dzf) * (k-1) + 1
-               topz    = (dzc/dzf) * k
-      
-               DO j = bdims_rem(2,1), bdims_rem(2,2)
-      
-                   jjf = (nyf+1) / (nyc+1) * j
-      
-                   DO i = bdims_rem(1,1), bdims_rem(1,2)
-      
-                       bottomx = (nxf+1) / (nxc+1) * i
-                       topx    = (nxf+1) / (nxc+1) * (i+1) - 1
-      
-                       aweight   = 0.0
-      
-                       DO kkf = bottomz, topz
-                           DO iif = bottomx, topx
-      
-                               aweight   = aweight + anterpol3d(kkf,jjf,iif) *        &
-                                   (dzf/dzc) * (dxf/dxc)
-      
-      
-                           END DO
-                       END DO
-      
-                       work3d(k,j,i)   = aweight
-      
-                   END DO
-               END DO
-           END DO
-      
-      
-      
-       END SUBROUTINE anterpolate_to_crse_v
-      
-      
-       SUBROUTINE anterpolate_to_crse_w( tag )
-      
-      
-           USE arrays_3d
-           USE control_parameters
-           USE grid_variables
-           USE indices
-           USE pegrid
-           
-      
-           IMPLICIT NONE
-
-           INTEGER(iwp), intent(in)           :: tag
-           INTEGER(iwp)                       :: i
-           INTEGER(iwp)                       :: j
-           INTEGER(iwp)                       :: k
-           INTEGER(iwp)                       :: iif
-           INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
-           INTEGER(iwp)                       :: bottomx
-           INTEGER(iwp)                       :: bottomy
-           INTEGER(iwp)                       :: bottomz
-           INTEGER(iwp)                       :: topx
-           INTEGER(iwp)                       :: topy
-           INTEGER(iwp)                       :: topz
-           REAL(wp)                           :: aweight
-
-           !
-           !-- Anterpolation of the velocity components w
-           !-- only values in xy-planes that coincide in the fine and
-           !-- the coarse grid are considered
-      
-           DO k = bdims_rem(3,1), bdims_rem(3,2)-1
-      
-               kkf = cfratio(3) * k
-      
-               DO j = bdims_rem(2,1), bdims_rem(2,2)
-      
-                   bottomy = (nyf+1) / (nyc+1) * j
-                   topy    = (nyf+1) / (nyc+1) * (j+1) - 1
-      
-                   DO i = bdims_rem(1,1), bdims_rem(1,2)
-      
-                       bottomx = (nxf+1) / (nxc+1) * i
-                       topx    = (nxf+1) / (nxc+1) * (i+1) - 1
-      
-                       aweight   = 0.0
-      
-                       DO jjf = bottomy, topy
-                           DO iif = bottomx, topx
-      
-                               aweight   = aweight + anterpol3d (kkf,jjf,iif) *        &
-                                   (dxf/dxc) * (dyf/dyc)
-      
-                           END DO
-                       END DO
-      
-                       work3d(k,j,i)   = aweight
-      
-                   END DO
-      
-               END DO
-      
-           END DO
-      
-      
-       END SUBROUTINE anterpolate_to_crse_w
-      
-      
-       SUBROUTINE anterpolate_to_crse_s( tag )
-      
-      
-           USE arrays_3d
-           USE control_parameters
-           USE grid_variables
-           USE indices
-           USE pegrid
-           
-      
-           IMPLICIT NONE
-
-           INTEGER(iwp), intent(in)           :: tag
-           INTEGER(iwp)                       :: i
-           INTEGER(iwp)                       :: j
-           INTEGER(iwp)                       :: k
-           INTEGER(iwp)                       :: iif
-           INTEGER(iwp)                       :: jjf
-           INTEGER(iwp)                       :: kkf
-           INTEGER(iwp)                       :: bottomx
-           INTEGER(iwp)                       :: bottomy
-           INTEGER(iwp)                       :: bottomz
-           INTEGER(iwp)                       :: topx
-           INTEGER(iwp)                       :: topy
-           INTEGER(iwp)                       :: topz
-           REAL(wp)                           :: aweight
-      
-           !
            !-- Anterpolation of the potential temperature pt
            !-- all fine grid values are considered
@@ -3317,9 +3244,4 @@
         INTEGER(iwp)                          :: i
         INTEGER(iwp)                          :: j
-        INTEGER(iwp)                          :: k
-        INTEGER(iwp)                          :: im
-        INTEGER(iwp)                          :: jn
-        INTEGER(iwp)                          :: ko
-   
    
         !
@@ -3437,5 +3359,5 @@
             anterpol3d => e
    
-            CALL anterpolate_to_crse_e ( 104 )
+            CALL anterpolate_to_crse_e
 
             CALL MPI_SEND( work3d, 1, TYPE_VNEST_ANTER, target_idex,  &
@@ -3453,5 +3375,5 @@
    
    
-       SUBROUTINE anterpolate_to_crse_e( tag )
+       SUBROUTINE anterpolate_to_crse_e
       
       
@@ -3465,5 +3387,4 @@
            IMPLICIT NONE
 
-           INTEGER(iwp), intent(in)           :: tag
            INTEGER(iwp)                       :: i
            INTEGER(iwp)                       :: j
@@ -3565,12 +3486,6 @@
 
 
-       USE control_parameters,                                                    &
-           ONLY:  coupling_mode, coupling_mode_remote, coupling_topology, dz
-
-       USE grid_variables,                                                        &
-           ONLY:  dx, dy
-           
-       USE indices,                                                               &
-           ONLY: nbgp, nx, ny, nz
+       USE control_parameters,                                                 &
+           ONLY:  coupling_mode
 
        USE kinds
@@ -3588,5 +3503,5 @@
                CALL MPI_SEND( pdims, 2, MPI_INTEGER, numprocs, 33, comm_inter, &
                    ierr )
-               CALL MPI_RECV( pdims_partner, 2, MPI_INTEGER, numprocs, 66,      &
+               CALL MPI_RECV( pdims_partner, 2, MPI_INTEGER, numprocs, 66,     &
                    comm_inter, status, ierr )
            ELSEIF ( coupling_mode == 'vnested_fine') THEN
@@ -3649,14 +3564,13 @@
 #if defined( __parallel )
 
-       USE control_parameters,                                                    &
-           ONLY:  coupling_mode, coupling_mode_remote, coupling_topology, dz,     &
+       USE control_parameters,                                                 &
+           ONLY:  coupling_mode, coupling_topology, dz,                        &
                   dz_stretch_level_start, message_string
 
-       USE grid_variables,                                                        &
+       USE grid_variables,                                                     &
            ONLY:  dx, dy
            
-       USE indices,                                                               &
-           ONLY: nbgp, nx, ny, nz, nxl, nxr, nys, nyn, nzb, nzt, &
-                 nxlg, nxrg, nysg, nyng
+       USE indices,                                                            &
+           ONLY: nbgp, nx, ny, nz, nxl, nxr, nys, nyn, nzb, nzt
 
        USE kinds
@@ -3666,5 +3580,4 @@
        IMPLICIT NONE
 
-       INTEGER(iwp)                           :: dest_rnk
        INTEGER(iwp)                           :: i              !<
        INTEGER(iwp)                           :: j              !<
