Index: /palm/trunk/SCRIPTS/palm_simple_build
===================================================================
--- /palm/trunk/SCRIPTS/palm_simple_build	(revision 2867)
+++ /palm/trunk/SCRIPTS/palm_simple_build	(revision 2868)
@@ -19,9 +19,12 @@
 # Current revisions:
 # -----------------
-# Bugfix: adjusted name of build_dir
+# 
 # 
 # Former revisions:
 # -----------------
 # $Id$
+# Bugfix: adjusted name of build_dir
+# 
+# 2852 2018-03-05 14:43:22Z knoop
 # Refactoring of the palm_simple_ build and run scripts
 # 
Index: /palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 2867)
+++ /palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 2868)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Local conditional Neumann conditions for one-way coupling removed.  
+! 
+! 2853 2018-03-05 14:44:20Z suehring
 ! Bugfix in init log-law correction.
 ! 
@@ -4074,5 +4077,5 @@
                                          BTEST( wall_flags_0(k,j,i), 3 ) )
 !
-!--                TO_DO: zero setting of temperature within topography creates
+!--                 TO_DO: zero setting of temperature within topography creates
 !--                       wrong results
 !                   pt(nzb:nzb_s_inner(j,i),j,i) = 0.0_wp
@@ -4252,46 +4255,4 @@
              ENDIF
 
-             IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
-                CALL pmci_extrap_ifoutflow_lr( u, 'l', 'u' )
-                CALL pmci_extrap_ifoutflow_lr( v, 'l', 'v' )
-                CALL pmci_extrap_ifoutflow_lr( w, 'l', 'w' )
-                CALL pmci_extrap_ifoutflow_lr( e, 'l', 'e' )
-
-                IF ( .NOT. neutral )  THEN
-                   CALL pmci_extrap_ifoutflow_lr( pt, 'l', 's' )
-                ENDIF
-
-                IF ( humidity )  THEN
-                   CALL pmci_extrap_ifoutflow_lr( q, 'l', 's' )
-
-                   IF ( cloud_physics  .AND.  microphysics_morrison )  THEN
-
-                      CALL pmci_extrap_ifoutflow_lr( qc, 'l', 's' )
-                      CALL pmci_extrap_ifoutflow_lr( nc, 'l', 's' )
-
-                   ENDIF
-
-                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
-
-                      CALL pmci_extrap_ifoutflow_lr( qr, 'l', 's' )
-                      CALL pmci_extrap_ifoutflow_lr( nr, 'l', 's' )
-
-                   ENDIF
-
-                ENDIF
-
-                IF ( passive_scalar )  THEN
-                   CALL pmci_extrap_ifoutflow_lr( s, 'l', 's' )
-                ENDIF
-
-                IF ( air_chemistry )  THEN
-                   DO  n = 1, nspec
-                      CALL pmci_extrap_ifoutflow_lr( chem_species(n)%conc,     &
-                                                     'l', 's' )
-                   ENDDO
-                ENDIF
-
-             ENDIF
-
           ENDIF
 !
@@ -4381,4 +4342,5 @@
                                           logc_kbounds_w_r,                    &
                                           nzt_topo_nestbc_r, 'r', 's' )
+             ENDIF
 
              IF ( air_chemistry )  THEN
@@ -4392,43 +4354,4 @@
                                              nzt_topo_nestbc_r, 'r', 's' )
                 ENDDO
-             ENDIF
-
-             ENDIF
-
-             IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
-                CALL pmci_extrap_ifoutflow_lr( u, 'r', 'u' )
-                CALL pmci_extrap_ifoutflow_lr( v, 'r', 'v' )
-                CALL pmci_extrap_ifoutflow_lr( w, 'r', 'w' )
-                CALL pmci_extrap_ifoutflow_lr( e, 'r', 'e' )
-
-                IF ( .NOT. neutral )  THEN
-                   CALL pmci_extrap_ifoutflow_lr( pt, 'r', 's' )
-                ENDIF
-
-                IF ( humidity )  THEN
-                   CALL pmci_extrap_ifoutflow_lr( q, 'r', 's' )
-
-                   IF ( cloud_physics  .AND.  microphysics_morrison )  THEN
-                      CALL pmci_extrap_ifoutflow_lr( qc, 'r', 's' )
-                      CALL pmci_extrap_ifoutflow_lr( nc, 'r', 's' )  
-                   ENDIF
-
-                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
-                      CALL pmci_extrap_ifoutflow_lr( qr, 'r', 's' )
-                      CALL pmci_extrap_ifoutflow_lr( nr, 'r', 's' )
-                   ENDIF
-
-                ENDIF
-
-                IF ( passive_scalar )  THEN
-                   CALL pmci_extrap_ifoutflow_lr( s, 'r', 's' )
-                ENDIF
-
-                IF ( air_chemistry )  THEN
-                   DO  n = 1, nspec
-                      CALL pmci_extrap_ifoutflow_lr( chem_species(n)%conc,     &
-                                                     'r', 's' )
-                   ENDDO
-                ENDIF
              ENDIF
 
@@ -4527,43 +4450,4 @@
              ENDIF
 
-             IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
-                CALL pmci_extrap_ifoutflow_sn( u, 's', 'u' )
-                CALL pmci_extrap_ifoutflow_sn( v, 's', 'v' )
-                CALL pmci_extrap_ifoutflow_sn( w, 's', 'w' )
-                CALL pmci_extrap_ifoutflow_sn( e, 's', 'e' )
-
-                IF ( .NOT. neutral )  THEN
-                   CALL pmci_extrap_ifoutflow_sn( pt, 's', 's' )
-                ENDIF
-
-                IF ( humidity )  THEN
-                   CALL pmci_extrap_ifoutflow_sn( q,  's', 's' )
-
-                   IF ( cloud_physics  .AND.  microphysics_morrison )  THEN
-                      CALL pmci_extrap_ifoutflow_sn( qc, 's', 's' ) 
-                      CALL pmci_extrap_ifoutflow_sn( nc, 's', 's' ) 
-                   ENDIF
-
-                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
-                      CALL pmci_extrap_ifoutflow_sn( qr, 's', 's' )      
-                      CALL pmci_extrap_ifoutflow_sn( nr, 's', 's' ) 
-
-                   ENDIF
-
-                ENDIF
-
-                IF ( passive_scalar )  THEN
-                   CALL pmci_extrap_ifoutflow_sn( s,  's', 's' )
-                ENDIF
-
-                IF ( air_chemistry )  THEN
-                   DO  n = 1, nspec
-                      CALL pmci_extrap_ifoutflow_sn( chem_species(n)%conc,     &
-                                                     's', 's' )
-                   ENDDO
-                ENDIF
-
-             ENDIF
-
           ENDIF
 !
@@ -4662,43 +4546,5 @@
                 ENDDO
              ENDIF
-
-             IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
-                CALL pmci_extrap_ifoutflow_sn( u, 'n', 'u' )
-                CALL pmci_extrap_ifoutflow_sn( v, 'n', 'v' )
-                CALL pmci_extrap_ifoutflow_sn( w, 'n', 'w' )
-                CALL pmci_extrap_ifoutflow_sn( e, 'n', 'e' )
-
-                IF ( .NOT. neutral )  THEN
-                   CALL pmci_extrap_ifoutflow_sn( pt, 'n', 's' )
-                ENDIF
-
-                IF ( humidity )  THEN
-                   CALL pmci_extrap_ifoutflow_sn( q,  'n', 's' )
-
-                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
-                      CALL pmci_extrap_ifoutflow_sn( qc, 'n', 's' )
-                      CALL pmci_extrap_ifoutflow_sn( nc, 'n', 's' )
-                   ENDIF
-
-                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
-                      CALL pmci_extrap_ifoutflow_sn( qr, 'n', 's' )
-                      CALL pmci_extrap_ifoutflow_sn( nr, 'n', 's' )
-                   ENDIF
-
-                ENDIF
-
-                IF ( passive_scalar )  THEN
-                   CALL pmci_extrap_ifoutflow_sn( s,  'n', 's' )
-                ENDIF
-
-                IF ( air_chemistry )  THEN
-                   DO  n = 1, nspec
-                      CALL pmci_extrap_ifoutflow_sn( chem_species(n)%conc,     &
-                                                     'n', 's' )
-                   ENDDO
-                ENDIF
-
-             ENDIF
-
+             
           ENDIF
 
@@ -4762,45 +4608,5 @@
           ENDDO
        ENDIF
-
-       IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
-
-          CALL pmci_extrap_ifoutflow_t( u,  'u' )
-          CALL pmci_extrap_ifoutflow_t( v,  'v' )
-          CALL pmci_extrap_ifoutflow_t( w,  'w' )
-          CALL pmci_extrap_ifoutflow_t( e,  'e' )
-
-          IF ( .NOT. neutral )  THEN
-             CALL pmci_extrap_ifoutflow_t( pt, 's' )
-          ENDIF
-
-          IF ( humidity )  THEN
-
-             CALL pmci_extrap_ifoutflow_t( q, 's' )
-
-             IF ( cloud_physics  .AND.  microphysics_morrison )  THEN
-                CALL pmci_extrap_ifoutflow_t( qc, 's' )
-                CALL pmci_extrap_ifoutflow_t( nc, 's' )
-             ENDIF
-
-             IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
-                CALL pmci_extrap_ifoutflow_t( qr, 's' )
-                CALL pmci_extrap_ifoutflow_t( nr, 's' )
-
-             ENDIF
-
-          ENDIF
-
-          IF ( passive_scalar )  THEN
-             CALL pmci_extrap_ifoutflow_t( s, 's' )
-          ENDIF
-
-          IF ( air_chemistry )  THEN
-             DO  n = 1, nspec
-                CALL pmci_extrap_ifoutflow_t( chem_species(n)%conc, 's' )
-             ENDDO
-          ENDIF
-
-       ENDIF
-
+    
    END SUBROUTINE pmci_interpolation
 
@@ -5413,212 +5219,5 @@
       ENDIF
 
-   END SUBROUTINE pmci_interp_tril_t
-
-
-
-    SUBROUTINE pmci_extrap_ifoutflow_lr( f, edge, var )
-!
-!--    After the interpolation of ghost-node values for the child-domain
-!--    boundary conditions, this subroutine checks if there is a local outflow
-!--    through the boundary. In that case this subroutine overwrites the
-!--    interpolated values by values extrapolated from the domain. This
-!--    subroutine handles the left and right boundaries. However, this operation
-!--    is only needed in case of one-way coupling.
-
-       IMPLICIT NONE
-
-       CHARACTER(LEN=1), INTENT(IN) ::  edge   !<
-       CHARACTER(LEN=1), INTENT(IN) ::  var    !<
-
-       INTEGER(iwp) ::  i       !<
-       INTEGER(iwp) ::  ib      !<
-       INTEGER(iwp) ::  ibgp    !<
-       INTEGER(iwp) ::  ied     !<
-       INTEGER(iwp) ::  j       !<
-       INTEGER(iwp) ::  k       !<
-       INTEGER(iwp) ::  k_wall  !<
-
-       REAL(wp) ::  outnor    !<
-       REAL(wp) ::  vdotnor   !<
-
-       REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg), INTENT(INOUT) :: f !<
-!
-!--    Check which edge is to be handled: left or right
-       IF ( edge == 'l' )  THEN
-          IF ( var == 'u' )  THEN
-             i   = nxl
-             ib  = nxl - 1
-             ied = nxl + 1
-          ELSE
-             i   = nxl - 1
-             ib  = nxl - 2
-             ied = nxl
-          ENDIF
-          outnor = -1.0_wp
-       ELSEIF ( edge == 'r' )  THEN
-          i      = nxr + 1
-          ib     = nxr + 2
-          ied    = nxr
-          outnor = 1.0_wp
-       ENDIF
-
-       DO  j = nys, nyn+1
-!
-!--       Determine vertical index of topography top at grid point (j,i)
-          k_wall = get_topography_top_index_ji( j, i, TRIM( var ) )
-
-          DO  k = k_wall, nzt+1
-             vdotnor = outnor * u(k,j,ied)
-!
-!--          Local outflow
-             IF ( vdotnor > 0.0_wp )  THEN
-                f(k,j,i) = f(k,j,ied)
-             ENDIF
-          ENDDO
-          IF ( (var == 'u' )  .OR.  (var == 'v' )  .OR.  (var == 'w') )  THEN
-             f(k_wall,j,i) = 0.0_wp
-          ENDIF
-       ENDDO
-!
-!--    Store the boundary values also into the redundant ghost node layers.
-       IF ( edge == 'l' )  THEN
-          DO ibgp = -nbgp, ib
-             f(0:nzt+1,nysg:nyng,ibgp) = f(0:nzt+1,nysg:nyng,i)
-          ENDDO
-       ELSEIF ( edge == 'r' )  THEN
-          DO ibgp = ib, nx+nbgp
-             f(0:nzt+1,nysg:nyng,ibgp) = f(0:nzt+1,nysg:nyng,i)
-          ENDDO
-       ENDIF
-
-    END SUBROUTINE pmci_extrap_ifoutflow_lr
-
-
-
-    SUBROUTINE pmci_extrap_ifoutflow_sn( f, edge, var )
-!
-!--    After  the interpolation of ghost-node values for the child-domain
-!--    boundary conditions, this subroutine checks if there is a local outflow
-!--    through the boundary. In that case this subroutine overwrites the
-!--    interpolated values by values extrapolated from the domain. This
-!--    subroutine handles the south and north boundaries.
-
-       IMPLICIT NONE
-
-       CHARACTER(LEN=1), INTENT(IN) ::  edge   !<
-       CHARACTER(LEN=1), INTENT(IN) ::  var    !<
-      
-       INTEGER(iwp) ::  i         !<
-       INTEGER(iwp) ::  j         !<
-       INTEGER(iwp) ::  jb        !<
-       INTEGER(iwp) ::  jbgp      !<
-       INTEGER(iwp) ::  jed       !<
-       INTEGER(iwp) ::  k         !<
-       INTEGER(iwp) ::  k_wall    !<
-
-       REAL(wp)     ::  outnor    !<
-       REAL(wp)     ::  vdotnor   !<
-
-       REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg), INTENT(INOUT) :: f !<
-
-!
-!--    Check which edge is to be handled: left or right
-       IF ( edge == 's' )  THEN
-          IF ( var == 'v' )  THEN
-             j   = nys
-             jb  = nys - 1
-             jed = nys + 1
-          ELSE
-             j   = nys - 1
-             jb  = nys - 2
-             jed = nys
-          ENDIF
-          outnor = -1.0_wp
-       ELSEIF ( edge == 'n' )  THEN
-          j      = nyn + 1
-          jb     = nyn + 2
-          jed    = nyn
-          outnor = 1.0_wp
-       ENDIF
-
-       DO  i = nxl, nxr+1
-!
-!--       Determine vertical index of topography top at grid point (j,i)
-          k_wall = get_topography_top_index_ji( j, i, TRIM( var ) )
-
-          DO  k = k_wall, nzt+1
-             vdotnor = outnor * v(k,jed,i)
-!
-!--          Local outflow
-             IF ( vdotnor > 0.0_wp )  THEN
-                f(k,j,i) = f(k,jed,i)
-             ENDIF
-          ENDDO
-          IF ( (var == 'u' )  .OR.  (var == 'v' )  .OR.  (var == 'w') )  THEN
-             f(k_wall,j,i) = 0.0_wp
-          ENDIF
-       ENDDO
-!
-!--    Store the boundary values also into the redundant ghost node layers.
-       IF ( edge == 's' )  THEN
-          DO  jbgp = -nbgp, jb
-             f(0:nzt+1,jbgp,nxlg:nxrg) = f(0:nzt+1,j,nxlg:nxrg)
-          ENDDO
-       ELSEIF ( edge == 'n' )  THEN
-          DO  jbgp = jb, ny+nbgp
-             f(0:nzt+1,jbgp,nxlg:nxrg) = f(0:nzt+1,j,nxlg:nxrg)
-          ENDDO
-       ENDIF
-
-    END SUBROUTINE pmci_extrap_ifoutflow_sn
-
- 
-
-    SUBROUTINE pmci_extrap_ifoutflow_t( f, var )
-!
-!--    Interpolation of ghost-node values used as the child-domain boundary
-!--    conditions. This subroutine handles the top boundary. It is based on
-!--    trilinear interpolation.
-
-       IMPLICIT NONE
-
-       CHARACTER(LEN=1), INTENT(IN) ::  var   !<
-      
-       INTEGER(iwp) ::  i     !<
-       INTEGER(iwp) ::  j     !<
-       INTEGER(iwp) ::  k     !<
-       INTEGER(iwp) ::  ked   !<
-
-       REAL(wp) ::  vdotnor   !<
-
-       REAL(wp), DIMENSION(nzb:nzt+1,nys-nbgp:nyn+nbgp,nxl-nbgp:nxr+nbgp),     &
-                 INTENT(INOUT) ::  f   !<
-     
-
-       IF ( var == 'w' )  THEN
-          k    = nzt
-          ked  = nzt - 1
-       ELSE
-          k    = nzt + 1
-          ked  = nzt
-       ENDIF
-
-       DO  i = nxl, nxr
-          DO  j = nys, nyn
-             vdotnor = w(ked,j,i)
-!
-!--          Local outflow
-             IF ( vdotnor > 0.0_wp )  THEN
-                f(k,j,i) = f(ked,j,i)
-             ENDIF
-          ENDDO
-       ENDDO
-!
-!--    Just fill up the second ghost-node layer for w
-       IF ( var == 'w' )  THEN
-          f(nzt+1,:,:) = f(nzt,:,:)
-       ENDIF
-
-    END SUBROUTINE pmci_extrap_ifoutflow_t
+    END SUBROUTINE pmci_interp_tril_t
 
 
