Index: palm/trunk/SOURCE/transpose.f90
===================================================================
--- palm/trunk/SOURCE/transpose.f90	(revision 4415)
+++ palm/trunk/SOURCE/transpose.f90	(revision 4429)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix: cpp-directives added for serial mode
+! 
+! 4415 2020-02-20 10:30:33Z raasch
 ! bugfix for misplaced preprocessor directive
 ! 
@@ -111,6 +114,8 @@
 
 
+#if defined( __parallel )
     USE cpulog,                                                                &
         ONLY:  cpu_log, cpu_log_nowait, log_point_s
+#endif
 
     USE indices,                                                               &
@@ -129,13 +134,18 @@
     INTEGER(iwp) ::  j  !<
     INTEGER(iwp) ::  k  !<
+
+#if defined( __parallel )
     INTEGER(iwp) ::  l  !<
     INTEGER(iwp) ::  ys !<
+#endif
 
     REAL(wp) ::  f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !<
     REAL(wp) ::  f_out(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !<
 
+#if defined( __parallel )
     REAL(wp), DIMENSION(nyn_x-nys_x+1,nzb_y:nzt_y,nxl_y:nxr_y,0:pdims(2)-1) ::  work !<
 #if __acc_fft_device
     !$ACC DECLARE CREATE(work)
+#endif
 #endif
 
@@ -271,5 +281,5 @@
  SUBROUTINE transpose_xz( f_in, f_inv )
 
-
+#if defined( __parallel )
     USE cpulog,                                                                &
         ONLY:  cpu_log, cpu_log_nowait, log_point_s
@@ -277,7 +287,12 @@
     USE fft_xy,                                                                &
         ONLY:  f_vec_x, temperton_fft_vec
+#endif
 
     USE indices,                                                               &
-        ONLY:  nnx, nx, nxl, nxr, nyn, nys, nz
+        ONLY:  nx, nxl, nxr, nyn, nys, nz
+#if defined( __parallel )
+    USE indices,                                                               &
+        ONLY:  nnx
+#endif
 
     USE kinds
@@ -293,14 +308,18 @@
     INTEGER(iwp) ::  j  !<
     INTEGER(iwp) ::  k  !<
+#if defined( __parallel )
     INTEGER(iwp) ::  l  !<
     INTEGER(iwp) ::  mm !<
     INTEGER(iwp) ::  xs !<
+#endif
 
     REAL(wp) ::  f_in(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !<
     REAL(wp) ::  f_inv(nys:nyn,nxl:nxr,1:nz) !<
 
+#if defined( __parallel )
     REAL(wp), DIMENSION(nys_x:nyn_x,nnx,nzb_x:nzt_x,0:pdims(1)-1) ::  work !<
 #if __acc_fft_device
     !$ACC DECLARE CREATE(work)
+#endif
 #endif
 
@@ -460,6 +479,8 @@
 
 
+#if defined( __parallel )
     USE cpulog,                                                                &
         ONLY:  cpu_log, cpu_log_nowait, log_point_s
+#endif
 
     USE indices,                                                               &
@@ -478,13 +499,17 @@
     INTEGER(iwp) ::  j  !<
     INTEGER(iwp) ::  k  !<
+#if defined( __parallel )
     INTEGER(iwp) ::  l  !<
     INTEGER(iwp) ::  ys !<
+#endif
 
     REAL(wp) ::  f_in(0:ny,nxl_y:nxr_y,nzb_y:nzt_y)  !<
     REAL(wp) ::  f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !<
 
+#if defined( __parallel )
     REAL(wp), DIMENSION(nyn_x-nys_x+1,nzb_y:nzt_y,nxl_y:nxr_y,0:pdims(2)-1) ::  work !<
 #if __acc_fft_device
     !$ACC DECLARE CREATE(work)
+#endif
 #endif
 
@@ -575,4 +600,5 @@
 !> (k,j,i) (cf. transpose_yx).
 !------------------------------------------------------------------------------!
+#if defined( __parallel )
  SUBROUTINE transpose_yxd( f_in, f_out )
 
@@ -604,5 +630,4 @@
     REAL(wp) ::  f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !<
     REAL(wp) ::  work(nnx*nny*nnz)                   !<
-#if defined( __parallel )
 
 !
@@ -641,7 +666,6 @@
     ENDDO
 
-#endif
-
  END SUBROUTINE transpose_yxd
+#endif
 
 
@@ -703,6 +727,8 @@
 
 
+#if defined( __parallel )
     USE cpulog,                                                                &
         ONLY:  cpu_log, cpu_log_nowait, log_point_s
+#endif
 
     USE indices,                                                               &
@@ -721,13 +747,17 @@
     INTEGER(iwp) ::  j  !<
     INTEGER(iwp) ::  k  !<
+#if defined( __parallel )
     INTEGER(iwp) ::  l  !<
     INTEGER(iwp) ::  zs !<
+#endif
 
     REAL(wp) ::  f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !<
     REAL(wp) ::  f_out(nxl_z:nxr_z,nys_z:nyn_z,1:nz) !<
 
+#if defined( __parallel )
     REAL(wp), DIMENSION(nxl_z:nxr_z,nzt_y-nzb_y+1,nys_z:nyn_z,0:pdims(1)-1) ::  work !<
 #if __acc_fft_device
     !$ACC DECLARE CREATE(work)
+#endif
 #endif
 
@@ -864,4 +894,5 @@
 
 
+#if defined( __parallel )
     USE cpulog,                                                                &
         ONLY:  cpu_log, cpu_log_nowait, log_point_s
@@ -869,7 +900,12 @@
     USE fft_xy,                                                                &
         ONLY:  f_vec_x, temperton_fft_vec
+#endif
 
     USE indices,                                                               &
-        ONLY:  nnx, nx, nxl, nxr, nyn, nys, nz
+        ONLY:  nx, nxl, nxr, nyn, nys, nz
+#if defined( __parallel )
+    USE indices,                                                               &
+        ONLY:  nnx
+#endif
 
     USE kinds
@@ -885,14 +921,18 @@
     INTEGER(iwp) ::  j  !<
     INTEGER(iwp) ::  k  !<
+#if defined( __parallel )
     INTEGER(iwp) ::  l  !<
     INTEGER(iwp) ::  mm !<
     INTEGER(iwp) ::  xs !<
+#endif
 
     REAL(wp) ::  f_inv(nys:nyn,nxl:nxr,1:nz)         !<
     REAL(wp) ::  f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !<
 
+#if defined( __parallel )
     REAL(wp), DIMENSION(nys_x:nyn_x,nnx,nzb_x:nzt_x,0:pdims(1)-1) ::  work !<
 #if __acc_fft_device
     !$ACC DECLARE CREATE(work)
+#endif
 #endif
 
@@ -1054,6 +1094,8 @@
 
 
+#if defined( __parallel )
     USE cpulog,                                                                &
         ONLY:  cpu_log, cpu_log_nowait, log_point_s
+#endif
 
     USE indices,                                                               &
@@ -1072,13 +1114,17 @@
     INTEGER(iwp) ::  j  !<
     INTEGER(iwp) ::  k  !<
+#if defined( __parallel )
     INTEGER(iwp) ::  l  !<
     INTEGER(iwp) ::  zs !<
+#endif
 
     REAL(wp) ::  f_in(nxl_z:nxr_z,nys_z:nyn_z,1:nz)  !<
     REAL(wp) ::  f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !<
 
+#if defined( __parallel )
     REAL(wp), DIMENSION(nxl_z:nxr_z,nzt_y-nzb_y+1,nys_z:nyn_z,0:pdims(1)-1) ::  work !<
 #if __acc_fft_device
     !$ACC DECLARE CREATE(work)
+#endif
 #endif
 
@@ -1170,4 +1216,5 @@
 !> (k,j,i) (cf. transpose_zy).
 !------------------------------------------------------------------------------!
+#if defined( __parallel )
  SUBROUTINE transpose_zyd( f_in, f_out )
 
@@ -1199,6 +1246,4 @@
     REAL(wp) ::  f_out(0:ny,nxl_yd:nxr_yd,nzb_yd:nzt_yd) !<
     REAL(wp) ::  work(nnx*nny*nnz)                       !<
-
-#if defined( __parallel )
 
 !
@@ -1253,5 +1298,4 @@
     ENDDO
 
-#endif
-
  END SUBROUTINE transpose_zyd
+#endif
