Index: palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3969)
+++ palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3976)
@@ -20,9 +20,12 @@
 ! Current revisions:
 ! -----------------
-! Remove unused variables from last commit
+! 
 ! 
 ! Former revisions:
 ! -----------------
 ! $Id$
+! Remove unused variables from last commit
+! 
+! 3969 2019-05-13 12:14:33Z suehring
 ! - clean-up index notations for emission_values to eliminate magic numbers
 ! - introduce temporary variable dum_var_5d as well as subroutines
Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3969)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3976)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Child initialization also for the redundant ghost points behind the nested 
+! boundaries added (2nd and 3rd ghost-point layers and corners).
+! 
+! 3948 2019-05-03 14:49:57Z hellstea
 ! Some variables renamed, a little cleaning up and some commenting improvements 
 ! 
@@ -2878,4 +2882,7 @@
 !--    Local variables:
        INTEGER(iwp) ::  ic        !< Running child-grid index in the x-direction
+       INTEGER(iwp) ::  icb       !< Index pointing to the first redundant ghost point layer behind the actual boundary
+                                  !< ghost point layer in the x-direction
+       INTEGER(iwp) ::  icbc      !< Index pointing to the boundary ghost point layer in the x-direction
        INTEGER(iwp) ::  icfirst   !< Leftmost child-grid index initialized by the main loops (usually icfirst == icl_init)
        INTEGER(iwp) ::  iclast    !< Rightmost child-grid index initialized by the main loops (usually iclast == icr_init)
@@ -2883,4 +2890,7 @@
        INTEGER(iwp) ::  icr_init  !< Right child-grid index bound for initialization in the x-direction
        INTEGER(iwp) ::  jc        !< Running child-grid index in the y-direction
+       INTEGER(iwp) ::  jcb       !< Index pointing to the first redundant ghost point layer behind the actual boundary
+                                  !< ghost point layer in the y-direction
+       INTEGER(iwp) ::  jcbc      !< Index pointing to the boundary ghost point layer in the y-direction
        INTEGER(iwp) ::  jcfirst   !< Southmost child-grid index initialized by the main loops (usually jcfirst == jcs_init)
        INTEGER(iwp) ::  jclast    !< Northmost child-grid index initialized by the main loops (usually jclast == jcn_init)
@@ -2906,4 +2916,16 @@
        jcn_init = nyn
 
+       icbc = -1
+       icb  = -2
+       jcbc = -1
+       jcb  = -2
+       IF ( var == 'u' )  THEN
+          icbc =  0
+          icb  = -1
+       ELSE IF ( var == 'v' )  THEN
+          jcbc =  0
+          jcb  = -1
+       ENDIF
+       
        IF ( nesting_mode /= 'vertical' )  THEN
           IF ( bc_dirichlet_l )  THEN
@@ -3030,5 +3052,5 @@
           ENDDO
 
-       ENDIF  ! var
+       ENDIF  ! var  
 !
 !--    If the number of grid points in child subdomain in x- or y-direction
@@ -3055,4 +3077,27 @@
              child_array(:,jc,:) = child_array(:,jclast,:)
           ENDDO
+       ENDIF
+!
+!--    Finally, make sure that also the redundant 2nd and 3rd ghost-node layers
+!--    including the corners are properly filled up.
+       IF ( nys == 0 )  THEN
+          DO  jc = -nbgp, jcb  ! jcb = -2 if var == v, else jcb = -1
+             child_array(0:nzt+1,jc,nxlg:nxrg) = child_array(0:nzt+1,jcbc,nxlg:nxrg)
+          ENDDO          
+       ENDIF
+       IF ( nyn == ny )  THEN
+          DO  jc = ny+2, ny+nbgp
+             child_array(0:nzt+1,jc,nxlg:nxrg) = child_array(0:nzt+1,ny+1,nxlg:nxrg)
+          ENDDO
+       ENDIF
+       IF ( nxl == 0 )  THEN
+          DO  ic = -nbgp, icb  ! icb = -2 if var == u, else icb = -1
+             child_array(0:nzt+1,nysg:nyng,ic) = child_array(0:nzt+1,nysg:nyng,icbc)
+          ENDDO          
+       ENDIF
+       IF ( nxr == nx )  THEN
+          DO  ic = nx+2, nx+nbgp
+             child_array(0:nzt+1,nysg:nyng,ic) = child_array(0:nzt+1,nysg:nyng,nx+1)
+          ENDDO   
        ENDIF
 
