Index: palm/trunk/SOURCE/nesting_offl_mod.f90
===================================================================
--- palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 4079)
+++ palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 4125)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! In order to enable netcdf parallel access, allocate dummy arrays for the 
+! lateral boundary data on cores that actually do not belong to these 
+! boundaries. 
+! 
+! 4079 2019-07-09 18:04:41Z suehring
 ! - Set boundary condition for w at nzt+1 at the lateral boundaries, even 
 !   though these won't enter the numerical solution. However, due to the mass
@@ -1197,6 +1202,8 @@
        ALLOCATE( nest_offl%vg(0:1,1:nzt) )
 !
-!--    Allocate arrays for reading boundary values. Arrays will incorporate 2 
-!--    time levels in order to interpolate in between. 
+!--    Allocate arrays for reading left/right boundary values. Arrays will 
+!--    incorporate 2  time levels in order to interpolate in between. If the core has 
+!--    no boundary, allocate a dummy array, in order to enable netcdf parallel
+!--    access. Dummy arrays will be allocated with dimension length zero.
        IF ( bc_dirichlet_l )  THEN
           ALLOCATE( nest_offl%u_left(0:1,nzb+1:nzt,nys:nyn)  )
@@ -1207,4 +1214,12 @@
           IF ( air_chemistry )  ALLOCATE( nest_offl%chem_left(0:1,nzb+1:nzt,nys:nyn,&
                                           1:UBOUND( chem_species, 1 )) )
+       ELSE
+          ALLOCATE( nest_offl%u_left(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_left(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_left(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_left(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_left(1:1,1:1,1:1)  )
+          IF ( air_chemistry )  ALLOCATE( nest_offl%chem_left(1:1,1:1,1:1,     &
+                                          1:UBOUND( chem_species, 1 )) )
        ENDIF
        IF ( bc_dirichlet_r )  THEN
@@ -1216,5 +1231,18 @@
           IF ( air_chemistry )  ALLOCATE( nest_offl%chem_right(0:1,nzb+1:nzt,nys:nyn,&
                                           1:UBOUND( chem_species, 1 )) )
-       ENDIF
+       ELSE
+          ALLOCATE( nest_offl%u_right(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_right(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_right(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_right(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_right(1:1,1:1,1:1)  )
+          IF ( air_chemistry )  ALLOCATE( nest_offl%chem_right(1:1,1:1,1:1,    &
+                                          1:UBOUND( chem_species, 1 )) )
+       ENDIF
+!
+!--    Allocate arrays for reading north/south boundary values. Arrays will 
+!--    incorporate 2  time levels in order to interpolate in between. If the core has 
+!--    no boundary, allocate a dummy array, in order to enable netcdf parallel
+!--    access. Dummy arrays will be allocated with dimension length zero.
        IF ( bc_dirichlet_n )  THEN
           ALLOCATE( nest_offl%u_north(0:1,nzb+1:nzt,nxlu:nxr) )
@@ -1225,4 +1253,12 @@
           IF ( air_chemistry )  ALLOCATE( nest_offl%chem_north(0:1,nzb+1:nzt,nxl:nxr,&
                                           1:UBOUND( chem_species, 1 )) )
+       ELSE
+          ALLOCATE( nest_offl%u_north(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_north(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_north(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_north(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_north(1:1,1:1,1:1)  )
+          IF ( air_chemistry )  ALLOCATE( nest_offl%chem_north(1:1,1:1,1:1,    &
+                                          1:UBOUND( chem_species, 1 )) )
        ENDIF
        IF ( bc_dirichlet_s )  THEN
@@ -1234,6 +1270,17 @@
           IF ( air_chemistry )  ALLOCATE( nest_offl%chem_south(0:1,nzb+1:nzt,nxl:nxr,&
                                           1:UBOUND( chem_species, 1 )) )
-       ENDIF
-       
+       ELSE
+          ALLOCATE( nest_offl%u_south(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%v_south(1:1,1:1,1:1)  )
+          ALLOCATE( nest_offl%w_south(1:1,1:1,1:1)  )
+          IF ( humidity )       ALLOCATE( nest_offl%q_south(1:1,1:1,1:1)  )
+          IF ( .NOT. neutral )  ALLOCATE( nest_offl%pt_south(1:1,1:1,1:1)  )
+          IF ( air_chemistry )  ALLOCATE( nest_offl%chem_south(1:1,1:1,1:1,    &
+                                          1:UBOUND( chem_species, 1 )) )
+       ENDIF
+!
+!--    Allocate arrays for reading data at the top boundary. In contrast to the
+!--    lateral boundaries, every core reads these data so that no dummy
+!--    arrays need to be allocated.
        ALLOCATE( nest_offl%u_top(0:1,nys:nyn,nxlu:nxr) )
        ALLOCATE( nest_offl%v_top(0:1,nysv:nyn,nxl:nxr) )
