Index: /palm/trunk/SOURCE/exchange_horiz_2d.f90
===================================================================
--- /palm/trunk/SOURCE/exchange_horiz_2d.f90	(revision 701)
+++ /palm/trunk/SOURCE/exchange_horiz_2d.f90	(revision 702)
@@ -4,4 +4,7 @@
 ! Current revisions:
 ! -----------------
+!
+! Bugfix in declaration of ar in exchange_horiz_2d_int and number of MPI-blocks
+! in MPI_SENDRECV().
 !
 ! Former revisions:
@@ -55,6 +58,6 @@
 !--    One-dimensional decomposition along y, boundary values can be exchanged
 !--    within the PE memory
-       ar(:,nxl-nbgp:nxl-1) = ar(:,nxr-nbgp+1:nxr)
-       ar(:,nxr+1:nxr+nbgp) = ar(:,nxl:nxl+nbgp-1)
+       ar(:,nxlg:nxl-1) = ar(:,nxr-nbgp+1:nxr)
+       ar(:,nxr+1:nxrg) = ar(:,nxl:nxl+nbgp-1)
 
     ELSE
@@ -62,12 +65,14 @@
 !--    Send left boundary, receive right one
 
-       CALL MPI_SENDRECV( ar(nysg,nxl), 1, type_y, pleft,  0, &
-                          ar(nysg,nxr+1), 1, type_y, pright, 0, &
+       CALL MPI_SENDRECV( ar(nysg,nxl), 1, type_y, pleft,  0,                 &
+                          ar(nysg,nxr+1), 1, type_y, pright, 0,               &
                           comm2d, status, ierr )
 !
 !--    Send right boundary, receive left one
-       CALL MPI_SENDRECV( ar(nysg,nxr+1-nbgp), 1, type_y, pright,  1, &
-                          ar(nysg,nxlg), 1, type_y, pleft,   1, &
-                          comm2d, status, ierr )
+       CALL MPI_SENDRECV( ar(nysg,nxr+1-nbgp), 1, type_y, pright,  1,         &
+                          ar(nysg,nxlg), 1, type_y, pleft,   1,               &
+                          comm2d, status, ierr )
+                          
+     
     ENDIF
 
@@ -76,6 +81,6 @@
 !--    One-dimensional decomposition along x, boundary values can be exchanged
 !--    within the PE memory
-       ar(nys-nbgp:nys-1,:) = ar(nyn-nbgp+1:nyn,:)
-       ar(nyn+1:nyn+nbgp,:) = ar(nys:nys+nbgp-1,:)
+       ar(nysg:nys-1,:) = ar(nyn-nbgp+1:nyn,:)
+       ar(nyn+1:nyng,:) = ar(nys:nys+nbgp-1,:)
 
     ELSE
@@ -83,11 +88,11 @@
 !--    Send front boundary, receive rear one
 
-       CALL MPI_SENDRECV( ar(nys,nxlg), 1, type_x, psouth, 0, &        !replace number of sended elements from 
-                          ar(nyn+1,nxlg), 1, type_x, pnorth, 0, &      ! nbgp to 1
+       CALL MPI_SENDRECV( ar(nys,nxlg), 1, type_x, psouth, 0,                 &         
+                          ar(nyn+1,nxlg), 1, type_x, pnorth, 0,               &
                           comm2d, status, ierr )
 !
 !--    Send rear boundary, receive front one
-       CALL MPI_SENDRECV( ar(nyn+1-nbgp,nxlg), 1, type_x, pnorth, 1, &
-                          ar(nysg,nxlg), 1, type_x, psouth, 1, &
+       CALL MPI_SENDRECV( ar(nyn+1-nbgp,nxlg), 1, type_x, pnorth, 1,          &
+                          ar(nysg,nxlg), 1, type_x, psouth, 1,                &
                           comm2d, status, ierr )
 
@@ -99,11 +104,11 @@
 !-- Lateral boundary conditions in the non-parallel case
     IF ( bc_lr == 'cyclic' )  THEN
-       ar(:,nxl-nbgp:nxl-1) = ar(:,nxr-nbgp+1:nxr)
-       ar(:,nxr+1:nxr+nbgp) = ar(:,nxl:nxl+nbgp-1)
+       ar(:,nxlg:nxl-1) = ar(:,nxr-nbgp+1:nxr)
+       ar(:,nxr+1:nxrg) = ar(:,nxl:nxl+nbgp-1)
     ENDIF
 
     IF ( bc_ns == 'cyclic' )  THEN
-       ar(nys-nbgp:nys-1,:) = ar(nyn-nbgp+1:nyn,:)
-       ar(nyn+1:nyn+nbgp,:) = ar(nys:nys+nbgp-1,:)
+       ar(nysg:nys-1,:) = ar(nyn-nbgp+1:nyn,:)
+       ar(nyn+1:nyng,:) = ar(nys:nys+nbgp-1,:)
     ENDIF
 
@@ -157,8 +162,6 @@
     IMPLICIT NONE
 
-    REAL ::  ar(nysg:nyng,nxlg:nxrg)
+    INTEGER ::  ar(nysg:nyng,nxlg:nxrg)
     INTEGER :: i
-
-
 
     CALL cpu_log( log_point_s(13), 'exchange_horiz_2d', 'start' )
@@ -173,17 +176,18 @@
 !--    One-dimensional decomposition along y, boundary values can be exchanged
 !--    within the PE memory
-       ar(nys:nyn,nxl-1) = ar(nys:nyn,nxr)
-       ar(nys:nyn,nxr+1) = ar(nys:nyn,nxl)
+       ar(:,nxlg:nxl-1) = ar(:,nxr-nbgp+1:nxr)
+       ar(:,nxr+1:nxrg) = ar(:,nxl:nxl+nbgp-1)
+
 
     ELSE
 !
 !--    Send left boundary, receive right one
-       CALL MPI_SENDRECV( ar(nysg,nxl), 1, type_y_int, pleft,  0, &
-                          ar(nysg,nxr+1), 1, type_y_int, pright, 0, &
+       CALL MPI_SENDRECV( ar(nysg,nxl), 1, type_y_int, pleft,  0,             &
+                          ar(nysg,nxr+1), 1, type_y_int, pright, 0,           &
                           comm2d, status, ierr )
 !
 !--    Send right boundary, receive left one
-       CALL MPI_SENDRECV( ar(nysg,nxr+1-nbgp), 1, type_y_int, pright,  1, &
-                          ar(nysg,nxlg), 1, type_y_int, pleft,   1, &
+       CALL MPI_SENDRECV( ar(nysg,nxr+1-nbgp), 1, type_y_int, pright,  1,     &
+                          ar(nysg,nxlg), 1, type_y_int, pleft,   1,           &
                           comm2d, status, ierr )
 
@@ -201,12 +205,12 @@
 !
 !--    Send front boundary, receive rear one
-       CALL MPI_SENDRECV( ar(nys,nxlg),1, type_x_int, psouth, 0, &
-                          ar(nyn+1,nxlg),1, type_x_int, pnorth, 0, &
-                          comm2d, status, ierr )
+       CALL MPI_SENDRECV( ar(nys,nxlg), 1, type_x_int, psouth, 0,             &
+                          ar(nyn+1,nxlg), 1, type_x_int, pnorth, 0,           &
+                          comm2d, status, ierr )                          
 
 !
 !--    Send rear boundary, receive front one
-       CALL MPI_SENDRECV( ar(nyn+1-nbgp,nxlg), nbgp, type_x_int, pnorth, 1, &
-                          ar(nysg,nxlg), nbgp, type_x_int, psouth, 1, &
+       CALL MPI_SENDRECV( ar(nyn+1-nbgp,nxlg), 1, type_x_int, pnorth, 1,      &
+                          ar(nysg,nxlg), 1, type_x_int, psouth, 1,            &
                           comm2d, status, ierr )
 
@@ -218,6 +222,6 @@
 !-- Lateral boundary conditions in the non-parallel case
     IF ( bc_lr == 'cyclic' )  THEN
-       ar(nys:nyn,nxl-1) = ar(nys:nyn,nxr)
-       ar(nys:nyn,nxr+1) = ar(nys:nyn,nxl)
+       ar(:,nxlg:nxl-1) = ar(:,nxr-nbgp+1:nxr)
+       ar(:,nxr+1:nxrg) = ar(:,nxl:nxl+nbgp-1)
     ENDIF
 
@@ -228,5 +232,4 @@
 
 #endif
-
     CALL cpu_log( log_point_s(13), 'exchange_horiz_2d', 'stop' )
 
Index: /palm/trunk/SOURCE/user_read_restart_data.f90
===================================================================
--- /palm/trunk/SOURCE/user_read_restart_data.f90	(revision 701)
+++ /palm/trunk/SOURCE/user_read_restart_data.f90	(revision 702)
@@ -7,4 +7,6 @@
 ! Current revisions:
 ! -----------------
+!
+! nys-1, nyn+1, nxl-1, nxr+1 changed to nysg, nyng, nxlg, nxrg.
 !
 ! Former revisions:
@@ -82,9 +84,9 @@
 !                CASE ( 'u2_av' )
 !                   IF ( .NOT. ALLOCATED( u2_av ) ) THEN
-!                      ALLOCATE( u2_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
+!                      ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
 !                   ENDIF
 !                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-!                   u2_av(:,nysc-1:nync+1,nxlc-1:nxrc+1) = &
-!                                          tmp_3d(:,nysf-1:nynf+1,nxlf-1:nxrf+1)
+!                   u2_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+!                                          tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 !
 !                CASE DEFAULT
