Index: /palm/trunk/SOURCE/Makefile
===================================================================
--- /palm/trunk/SOURCE/Makefile	(revision 4517)
+++ /palm/trunk/SOURCE/Makefile	(revision 4518)
@@ -25,4 +25,7 @@
 # -----------------
 # $Id$
+# Remove dependency of read_restart_data_mod on diagnostic_output_quantities_mod
+# 
+# 4517 2020-05-03 14:29:30Z raasch
 # dependencies for MPI-IO added
 # 
@@ -577,4 +580,5 @@
 	mod_kinds.o \
 	modules.o \
+	restart_data_mpi_io_mod.o \
 	surface_layer_fluxes_mod.o
 diffusion_s.o: \
@@ -1063,5 +1067,4 @@
 	chem_modules.o \
 	cpulog_mod.o \
-	diagnostic_output_quantities_mod.o \
 	gust_mod.o \
 	mod_kinds.o \
Index: /palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- /palm/trunk/SOURCE/data_output_2d.f90	(revision 4517)
+++ /palm/trunk/SOURCE/data_output_2d.f90	(revision 4518)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! remove double index
+! 
+! 4514 2020-04-30 16:29:59Z suehring
 ! Enable output of qsurf and ssurf
 ! 
@@ -891,5 +894,5 @@
                       DO  j = nys, nyn
                          k = topo_top_ind(j,i,0)
-                         local_pf(i,j,nzb+1) = s(k+k,j,i)
+                         local_pf(i,j,nzb+1) = s(k,j,i)
                       ENDDO
                    ENDDO
Index: /palm/trunk/SOURCE/diagnostic_output_quantities_mod.f90
===================================================================
--- /palm/trunk/SOURCE/diagnostic_output_quantities_mod.f90	(revision 4517)
+++ /palm/trunk/SOURCE/diagnostic_output_quantities_mod.f90	(revision 4518)
@@ -25,4 +25,10 @@
 ! -----------------
 ! $Id$
+! * Define arrays over ghost points in order to allow for standard mpi-io 
+!   treatment. By this modularization of restart-data input is possible with
+!   the module interface.
+! * Bugfix: add missing restart input of wtheta_av, wq_av, wu_av, and wv_av.
+! 
+! 4517 2020-05-03 14:29:30Z raasch
 ! use statement for exchange horiz added,
 ! bugfix for call of exchange horiz 2d
@@ -137,4 +143,9 @@
 
     USE kinds
+
+    USE restart_data_mpi_io_mod,                                                                   &
+        ONLY:  rd_mpi_io_check_array,                                                              &
+               rrd_mpi_io,                                                                         &
+               wrd_mpi_io
 
     USE surface_mod,                                                           &
@@ -211,10 +222,10 @@
            doq_check_data_output,                                              &
            doq_define_netcdf_grid,                                             &
+           doq_init,                                                           &
            doq_output_2d,                                                      &
            doq_output_3d,                                                      &
            doq_output_mask,                                                    &
-           doq_init,                                                           &
+           doq_rrd_local,                                                      &
            doq_wrd_local
-!          doq_rrd_local,                                                      &
 
 
@@ -255,7 +266,8 @@
     END INTERFACE doq_prepare
 
-!     INTERFACE doq_rrd_local
-!        MODULE PROCEDURE doq_rrd_local
-!     END INTERFACE doq_rrd_local
+   INTERFACE doq_rrd_local
+       MODULE PROCEDURE doq_rrd_local_ftn
+       MODULE PROCEDURE doq_rrd_local_mpi
+    END INTERFACE doq_rrd_local
 
     INTERFACE doq_wrd_local
@@ -290,5 +302,5 @@
           CASE ( 'ti' )
              IF ( .NOT. ALLOCATED( ti_av ) )  THEN
-                ALLOCATE( ti_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( ti_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              ti_av = 0.0_wp
@@ -296,5 +308,5 @@
           CASE ( 'uu' )
              IF ( .NOT. ALLOCATED( uu_av ) )  THEN
-                ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( uu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              uu_av = 0.0_wp
@@ -302,5 +314,5 @@
           CASE ( 'vv' )
              IF ( .NOT. ALLOCATED( vv_av ) )  THEN
-                ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( vv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              vv_av = 0.0_wp
@@ -308,5 +320,5 @@
           CASE ( 'ww' )
              IF ( .NOT. ALLOCATED( ww_av ) )  THEN
-                ALLOCATE( ww_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( ww_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              ww_av = 0.0_wp
@@ -314,5 +326,5 @@
            CASE ( 'wu' )
              IF ( .NOT. ALLOCATED( wu_av ) )  THEN
-                ALLOCATE( wu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              wu_av = 0.0_wp
@@ -320,5 +332,5 @@
            CASE ( 'wv' )
              IF ( .NOT. ALLOCATED( wv_av ) )  THEN
-                ALLOCATE( wv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              wv_av = 0.0_wp
@@ -326,5 +338,5 @@
            CASE ( 'wtheta' )
              IF ( .NOT. ALLOCATED( wtheta_av ) )  THEN
-                ALLOCATE( wtheta_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wtheta_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              wtheta_av = 0.0_wp
@@ -332,5 +344,5 @@
            CASE ( 'wq' )
              IF ( .NOT. ALLOCATED( wq_av ) )  THEN
-                ALLOCATE( wq_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wq_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              wq_av = 0.0_wp
@@ -350,5 +362,5 @@
           CASE ( 'wspeed' )
              IF ( .NOT. ALLOCATED( wspeed_av ) )  THEN
-                ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wspeed_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              wspeed_av = 0.0_wp
@@ -356,8 +368,8 @@
           CASE ( 'wdir' )
              IF ( .NOT. ALLOCATED( u_center_av ) )  THEN
-                ALLOCATE( u_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( u_center_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              IF ( .NOT. ALLOCATED( v_center_av ) )  THEN
-                ALLOCATE( v_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( v_center_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
              ENDIF
              u_center_av = 0.0_wp
@@ -634,5 +646,5 @@
 
                 IF ( .NOT. ALLOCATED( wdir_av ) )  THEN
-                   ALLOCATE( wdir_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                   ALLOCATE( wdir_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 ENDIF
                 wdir_av = 0.0_wp
@@ -844,5 +856,5 @@
            ELSE
               IF ( .NOT. ALLOCATED( ti_av ) ) THEN
-                 ALLOCATE( ti_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                 ALLOCATE( ti_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                  ti_av = REAL( fill_value, KIND = wp )
               ENDIF
@@ -858,5 +870,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( uu_av ) ) THEN
-                ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( uu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 uu_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -872,5 +884,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( vv_av ) ) THEN
-                ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( vv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 vv_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -886,5 +898,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( ww_av ) ) THEN
-                ALLOCATE( ww_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( ww_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 ww_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -900,5 +912,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wu_av ) ) THEN
-                ALLOCATE( wu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wu_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -914,5 +926,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wv_av ) ) THEN
-                ALLOCATE( wv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wv_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -928,5 +940,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wtheta_av ) ) THEN
-                ALLOCATE( wtheta_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wtheta_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wtheta_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -942,5 +954,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wq_av ) ) THEN
-                ALLOCATE( wq_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wq_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wq_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1000,5 +1012,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wspeed_av ) ) THEN
-                ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wspeed_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wspeed_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1014,5 +1026,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wdir_av ) ) THEN
-                ALLOCATE( wdir_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wdir_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wdir_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1084,5 +1096,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( ti_av ) ) THEN
-                ALLOCATE( ti_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( ti_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 ti_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1096,5 +1108,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( uu_av ) ) THEN
-                ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( uu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 uu_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1108,5 +1120,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( vv_av ) ) THEN
-                ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( vv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 vv_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1120,5 +1132,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( ww_av ) ) THEN
-                ALLOCATE( ww_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( ww_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 ww_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1132,5 +1144,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wu_av ) ) THEN
-                ALLOCATE( wu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wu_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1144,5 +1156,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wv_av ) ) THEN
-                ALLOCATE( wv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wv_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1156,5 +1168,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wtheta_av ) ) THEN
-                ALLOCATE( wtheta_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wtheta_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wtheta_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1168,5 +1180,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wq_av ) ) THEN
-                ALLOCATE( wq_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wq_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wq_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1180,5 +1192,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wspeed_av ) ) THEN
-                ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wspeed_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wspeed_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1192,5 +1204,5 @@
           ELSE
              IF ( .NOT. ALLOCATED( wdir_av ) ) THEN
-                ALLOCATE( wdir_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wdir_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wdir_av = REAL( fill_value, KIND = wp )
              ENDIF
@@ -1435,5 +1447,5 @@
           CASE ( 'ti' )
              IF ( .NOT. ALLOCATED( ti ) )  THEN
-                ALLOCATE( ti(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( ti(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 ti = 0.0_wp
              ENDIF
@@ -1442,5 +1454,5 @@
           CASE ( 'uu' )
              IF ( .NOT. ALLOCATED( uu ) )  THEN
-                ALLOCATE( uu(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( uu(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 uu = 0.0_wp
              ENDIF
@@ -1449,5 +1461,5 @@
           CASE ( 'vv' )
              IF ( .NOT. ALLOCATED( vv ) )  THEN
-                ALLOCATE( vv(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( vv(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 vv = 0.0_wp
              ENDIF
@@ -1456,5 +1468,5 @@
           CASE ( 'ww' )
              IF ( .NOT. ALLOCATED( ww ) )  THEN
-                ALLOCATE( ww(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( ww(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 ww = 0.0_wp
              ENDIF
@@ -1463,5 +1475,5 @@
           CASE ( 'wu' )
              IF ( .NOT. ALLOCATED( wu ) )  THEN
-                ALLOCATE( wu(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wu(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wu = 0.0_wp
              ENDIF
@@ -1470,5 +1482,5 @@
           CASE ( 'wv' )
              IF ( .NOT. ALLOCATED( wv ) )  THEN
-                ALLOCATE( wv(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wv(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wv = 0.0_wp
              ENDIF
@@ -1477,5 +1489,5 @@
           CASE ( 'wtheta' )
              IF ( .NOT. ALLOCATED( wtheta ) )  THEN
-                ALLOCATE( wtheta(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wtheta(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wtheta = 0.0_wp
              ENDIF
@@ -1484,5 +1496,5 @@
           CASE ( 'wq' )
              IF ( .NOT. ALLOCATED( wq ) )  THEN
-                ALLOCATE( wq(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wq(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wq = 0.0_wp
              ENDIF
@@ -1491,5 +1503,5 @@
           CASE ( 'theta_2m*' )
              IF ( .NOT. ALLOCATED( pt_2m ) )  THEN
-                ALLOCATE( pt_2m(nys:nyn,nxl:nxr) )
+                ALLOCATE( pt_2m(nysg:nyng,nxlg:nxrg) )
                 pt_2m = 0.0_wp
              ENDIF
@@ -1498,5 +1510,5 @@
           CASE ( 'wspeed_10m*' )
              IF ( .NOT. ALLOCATED( uv_10m ) )  THEN
-                ALLOCATE( uv_10m(nys:nyn,nxl:nxr) )
+                ALLOCATE( uv_10m(nysg:nyng,nxlg:nxrg) )
                 uv_10m = 0.0_wp
              ENDIF
@@ -1505,5 +1517,5 @@
           CASE ( 'wspeed' )
              IF ( .NOT. ALLOCATED( wspeed ) )  THEN
-                ALLOCATE( wspeed(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wspeed(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wspeed = 0.0_wp
              ENDIF
@@ -1513,13 +1525,13 @@
           CASE ( 'wdir' )
              IF ( .NOT. ALLOCATED( u_center ) )  THEN
-                ALLOCATE( u_center(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( u_center(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 u_center = 0.0_wp
              ENDIF
              IF ( .NOT. ALLOCATED( v_center ) )  THEN
-                ALLOCATE( v_center(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( v_center(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 v_center = 0.0_wp
              ENDIF
              IF ( .NOT. ALLOCATED( wdir ) )  THEN
-                ALLOCATE( wdir(nzb:nzt+1,nys:nyn,nxl:nxr) )
+                ALLOCATE( wdir(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
                 wdir = 0.0_wp
              ENDIF
@@ -1596,5 +1608,5 @@
                       uu(k,j,i) = u(k,j,i) * u(k,j,i)                          &
                        * MERGE( 1.0_wp, 0.0_wp,                                &
-                       BTEST( wall_flags_total_0(k,j,i), 1) )
+                                BTEST( wall_flags_total_0(k,j,i), 1) )
                    ENDDO
                 ENDDO
@@ -1608,5 +1620,5 @@
                       vv(k,j,i) = v(k,j,i) * v(k,j,i)                          &
                        * MERGE( 1.0_wp, 0.0_wp,                                &
-                       BTEST( wall_flags_total_0(k,j,i), 2) )
+                                BTEST( wall_flags_total_0(k,j,i), 2) )
                    ENDDO
                 ENDDO
@@ -1620,5 +1632,5 @@
                       ww(k,j,i) = w(k,j,i) * w(k,j,i)                          &
                        * MERGE( 1.0_wp, 0.0_wp,                                &
-                       BTEST( wall_flags_total_0(k,j,i), 3) )
+                                BTEST( wall_flags_total_0(k,j,i), 3) )
                    ENDDO
                 ENDDO
@@ -1632,5 +1644,5 @@
                       wu(k,j,i) = w(k,j,i) * u(k,j,i)                          &
                        * MERGE( 1.0_wp, 0.0_wp,                                &
-                       BTEST( wall_flags_total_0(k,j,i), 0) )
+                                BTEST( wall_flags_total_0(k,j,i), 0) )
                    ENDDO
                 ENDDO
@@ -1644,5 +1656,5 @@
                       wv(k,j,i) = w(k,j,i) * v(k,j,i)                          &
                        * MERGE( 1.0_wp, 0.0_wp,                                &
-                       BTEST( wall_flags_total_0(k,j,i), 0) )
+                                BTEST( wall_flags_total_0(k,j,i), 0) )
                    ENDDO
                 ENDDO
@@ -1656,5 +1668,5 @@
                       wtheta(k,j,i) = w(k,j,i) * pt(k,j,i)                     &
                        * MERGE( 1.0_wp, 0.0_wp,                                &
-                       BTEST( wall_flags_total_0(k,j,i), 0) )
+                                BTEST( wall_flags_total_0(k,j,i), 0) )
                    ENDDO
                 ENDDO
@@ -1668,5 +1680,5 @@
                       wq(k,j,i) = w(k,j,i) * q(k,j,i)                          &
                        * MERGE( 1.0_wp, 0.0_wp,                                &
-                       BTEST( wall_flags_total_0(k,j,i), 0) )
+                                BTEST( wall_flags_total_0(k,j,i), 0) )
                    ENDDO
                 ENDDO
@@ -1867,5 +1879,4 @@
  SUBROUTINE doq_prepare
 
-
     USE control_parameters,                                                    &
         ONLY:  do2d, do3d, domask, masks
@@ -1941,102 +1952,247 @@
 ! ------------
 !> Subroutine reads local (subdomain) restart data
-!> Note: With the current structure reading of non-standard array is not
-!> possible
-!> COMMENT:  these arrays should be given standard index bounds! (Siggi)
-!------------------------------------------------------------------------------!
-!  SUBROUTINE doq_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc,             &
-!                            nxr_on_file, nynf, nync, nyn_on_file, nysf,         &
-!                            nysc, nys_on_file, tmp_3d_non_standard, found )
-!
-!
-!     USE control_parameters
-!
-!     USE indices
-!
-!     USE kinds
-!
-!     USE pegrid
-!
-!
-!     IMPLICIT NONE
-!
-!     INTEGER(iwp) ::  k               !<
-!     INTEGER(iwp) ::  nxlc            !<
-!     INTEGER(iwp) ::  nxlf            !<
-!     INTEGER(iwp) ::  nxl_on_file     !<
-!     INTEGER(iwp) ::  nxrc            !<
-!     INTEGER(iwp) ::  nxrf            !<
-!     INTEGER(iwp) ::  nxr_on_file     !<
-!     INTEGER(iwp) ::  nync            !<
-!     INTEGER(iwp) ::  nynf            !<
-!     INTEGER(iwp) ::  nyn_on_file     !<
-!     INTEGER(iwp) ::  nysc            !<
-!     INTEGER(iwp) ::  nysf            !<
-!     INTEGER(iwp) ::  nys_on_file     !<
-!
-!     LOGICAL, INTENT(OUT)  :: found
-!
-!     REAL(wp), DIMENSION(:,:,:), ALLOCATABLE  ::  tmp_3d_non_standard !< temporary array for storing 3D data with non standard dimensions
-! !
-! !-- If temporary non-standard array for reading is already allocated,
-! !-- deallocate it.
-!     IF ( ALLOCATED( tmp_3d_non_standard ) )  DEALLOCATE( tmp_3d_non_standard )
-!
-!     found = .TRUE.
-!
-!     SELECT CASE ( restart_string(1:length) )
-!
-!        CASE ( 'ti_av' )
-!           IF ( .NOT. ALLOCATED( ti_av ) )  THEN
-!              ALLOCATE( ti_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-!           ENDIF
-!           IF ( k == 1 )  THEN
-!              ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,  &
-!                                            nxl_on_file:nxr_on_file) )
-!              READ ( 13 )  tmp_3d_non_standard
-!           ENDIF
-!           ti_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-!
-!        CASE ( 'uu_av' )
-!           IF ( .NOT. ALLOCATED( uu_av ) )  THEN
-!              ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-!           ENDIF
-!           IF ( k == 1 )  THEN
-!              ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,  &
-!                                            nxl_on_file:nxr_on_file) )
-!              READ ( 13 )  tmp_3d_non_standard
-!           ENDIF
-!           uu_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-!
-!        CASE ( 'vv_av' )
-!           IF ( .NOT. ALLOCATED( vv_av ) )  THEN
-!              ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-!           ENDIF
-!           IF ( k == 1 )  THEN
-!              ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,  &
-!                                            nxl_on_file:nxr_on_file) )
-!              READ ( 13 )  tmp_3d_non_standard
-!           ENDIF
-!           vv_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-!
-!        CASE ( 'ww_av' )
-!           IF ( .NOT. ALLOCATED( ww_av ) )  THEN
-!              ALLOCATE( ww_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-!           ENDIF
-!           IF ( k == 1 )  THEN
-!              ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,  &
-!                                            nxl_on_file:nxr_on_file) )
-!              READ ( 13 )  tmp_3d_non_standard
-!           ENDIF
-!           ww_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-!
-!
-!        CASE DEFAULT
-!
-!           found = .FALSE.
-!
-!     END SELECT
-!
-!  END SUBROUTINE doq_rrd_local
+!------------------------------------------------------------------------------!
+ SUBROUTINE doq_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc,                             &
+                               nxr_on_file, nynf, nync, nyn_on_file, nysf,                         &
+                               nysc, nys_on_file, tmp_2d, tmp_3d, found )
+
+    USE control_parameters
+
+    USE indices
+
+    USE kinds
+
+    USE pegrid
+
+
+    IMPLICIT NONE
+
+    INTEGER(iwp) ::  k               !<
+    INTEGER(iwp) ::  nxlc            !<
+    INTEGER(iwp) ::  nxlf            !<
+    INTEGER(iwp) ::  nxl_on_file     !<
+    INTEGER(iwp) ::  nxrc            !<
+    INTEGER(iwp) ::  nxrf            !<
+    INTEGER(iwp) ::  nxr_on_file     !<
+    INTEGER(iwp) ::  nync            !<
+    INTEGER(iwp) ::  nynf            !<
+    INTEGER(iwp) ::  nyn_on_file     !<
+    INTEGER(iwp) ::  nysc            !<
+    INTEGER(iwp) ::  nysf            !<
+    INTEGER(iwp) ::  nys_on_file     !<
+
+    LOGICAL, INTENT(OUT)  :: found
+
+    REAL(wp), DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_2d   !<
+
+    REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_3d   !<
+
+
+    found = .TRUE.
+
+    SELECT CASE ( restart_string(1:length) )
+
+       CASE ( 'pt_2m_av' )
+          IF ( .NOT. ALLOCATED( pt_2m_av ) )  THEN
+             ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_2d
+          pt_2m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  =                                     &
+                      tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+    
+       CASE ( 'ti_av' )
+          IF ( .NOT. ALLOCATED( ti_av ) )  THEN
+             ALLOCATE( ti_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          ti_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                       &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'u_center_av' )
+          IF ( .NOT. ALLOCATED( u_center_av ) )  THEN
+             ALLOCATE( u_center_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          u_center_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                 &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'uu_av' )
+          IF ( .NOT. ALLOCATED( uu_av ) )  THEN
+             ALLOCATE( uu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          uu_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                       &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'uv_10m_av' )
+          IF ( .NOT. ALLOCATED( uv_10m_av ) )  THEN
+             ALLOCATE( uv_10m_av(nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_2d
+          uv_10m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  =                                    &
+                       tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'v_center_av' )
+          IF ( .NOT. ALLOCATED( v_center_av ) )  THEN
+             ALLOCATE( v_center_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          v_center_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                 &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'vv_av' )
+          IF ( .NOT. ALLOCATED( vv_av ) )  THEN
+             ALLOCATE( vv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          vv_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                       &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'wtheta_av' )
+          IF ( .NOT. ALLOCATED( wtheta_av ) )  THEN
+             ALLOCATE( wtheta_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          wtheta_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                   &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'wq_av' )
+          IF ( .NOT. ALLOCATED( wq_av ) )  THEN
+             ALLOCATE( wq_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          wq_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                       &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'wspeed_av' )
+          IF ( .NOT. ALLOCATED( wspeed_av ) )  THEN
+             ALLOCATE( wspeed_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          wspeed_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                   &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'wu_av' )
+          IF ( .NOT. ALLOCATED( wu_av ) )  THEN
+             ALLOCATE( wu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          wu_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                       &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'wv_av' )
+          IF ( .NOT. ALLOCATED( wv_av ) )  THEN
+             ALLOCATE( wv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          wv_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                       &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+       CASE ( 'ww_av' )
+          IF ( .NOT. ALLOCATED( ww_av ) )  THEN
+             ALLOCATE( ww_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+          ENDIF
+          IF ( k == 1 )  READ ( 13 )  tmp_3d
+          ww_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                                       &
+                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+
+
+       CASE DEFAULT
+
+          found = .FALSE.
+
+    END SELECT
+
+ END SUBROUTINE doq_rrd_local_ftn
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Read module-specific local restart data arrays (MPI-IO).
+!------------------------------------------------------------------------------!
+ SUBROUTINE doq_rrd_local_mpi
+
+    LOGICAL ::  array_found  !< control flad indicating whether the array is found in the file or not
+
+
+    CALL rd_mpi_io_check_array( 'pt_2m_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( pt_2m_av ) )  ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'pt_2m_av', pt_2m_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'ti_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( ti_av ) )  ALLOCATE( ti_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'ti_av', ti_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'u_center_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( u_center_av ) )  ALLOCATE( u_center_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'u_center_av', u_center_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'uu_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( uu_av ) )  ALLOCATE( uu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'uu_av', uu_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'uv_10m_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( uv_10m_av ) )  ALLOCATE( uv_10m_av(nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'uv_10m_av', uv_10m_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'v_center_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( v_center_av ) )  ALLOCATE( v_center_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'v_center_av', v_center_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'vv_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( vv_av ) )  ALLOCATE( vv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'vv_av', vv_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'ww_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( ww_av ) )  ALLOCATE( ww_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'ww_av', ww_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'wu_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( wu_av ) )  ALLOCATE( wu_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'wu_av', wu_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'wv_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( wv_av ) )  ALLOCATE( wv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'wv_av', wv_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'wtheta_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( wtheta_av ) )  ALLOCATE( wtheta_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'wtheta_av', wtheta_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'wq_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( wq_av ) )  ALLOCATE( wq_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'wq_av', wq_av )
+    ENDIF
+
+    CALL rd_mpi_io_check_array( 'wspeed_av' , found = array_found )
+    IF ( array_found )  THEN
+       IF ( .NOT. ALLOCATED( wspeed_av ) )  ALLOCATE( wspeed_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       CALL rrd_mpi_io( 'wspeed_av', wspeed_av )
+    ENDIF
+
+ END SUBROUTINE doq_rrd_local_mpi
 
 !------------------------------------------------------------------------------!
@@ -2062,4 +2218,9 @@
        ENDIF
 
+       IF ( ALLOCATED( u_center_av ) )  THEN
+          CALL wrd_write_string( 'u_center_av' )
+          WRITE ( 14 )  u_center_av
+       ENDIF
+
        IF ( ALLOCATED( uu_av ) )  THEN
           CALL wrd_write_string( 'uu_av' )
@@ -2072,4 +2233,9 @@
        ENDIF
 
+       IF ( ALLOCATED( v_center_av ) )  THEN
+          CALL wrd_write_string( 'v_center_av' )
+          WRITE ( 14 )  v_center_av
+       ENDIF
+
        IF ( ALLOCATED( vv_av ) )  THEN
           CALL wrd_write_string( 'vv_av' )
@@ -2107,17 +2273,19 @@
        ENDIF
 
-       IF ( ALLOCATED( u_center_av ) )  THEN
-          CALL wrd_write_string( 'u_center_av' )
-          WRITE ( 14 )  u_center_av
-       ENDIF
-
-       IF ( ALLOCATED( v_center_av ) )  THEN
-          CALL wrd_write_string( 'v_center_av' )
-          WRITE ( 14 )  v_center_av
-       ENDIF
-
     ELSEIF ( TRIM( restart_data_format_output ) == 'mpi' )  THEN
 
-       STOP 'mpi-io for doq_wrd_local not realized'
+       IF ( ALLOCATED( pt_2m_av ) )     CALL wrd_mpi_io( 'pt_2m_av', pt_2m_av )
+       IF ( ALLOCATED( ti_av ) )        CALL wrd_mpi_io( 'ti_av', ti_av )
+       IF ( ALLOCATED( u_center_av ) )  CALL wrd_mpi_io( 'u_center_av', u_center_av )
+       IF ( ALLOCATED( uu_av ) )        CALL wrd_mpi_io( 'uu_av', uu_av )
+       IF ( ALLOCATED( uv_10m_av ) )    CALL wrd_mpi_io( 'uv_10m_av', uv_10m_av )
+       IF ( ALLOCATED( vv_av ) )        CALL wrd_mpi_io( 'vv_av', vv_av )
+       IF ( ALLOCATED( v_center_av ) )  CALL wrd_mpi_io( 'v_center_av', v_center_av )
+       IF ( ALLOCATED( wtheta_av ) )    CALL wrd_mpi_io( 'wtheta_av', wtheta_av )
+       IF ( ALLOCATED( wq_av ) )        CALL wrd_mpi_io( 'wq_av', wq_av )
+       IF ( ALLOCATED( wspeed_av ) )    CALL wrd_mpi_io( 'wspeed_av', wspeed_av )
+       IF ( ALLOCATED( wu_av ) )        CALL wrd_mpi_io( 'wu_av', wu_av )
+       IF ( ALLOCATED( wv_av ) )        CALL wrd_mpi_io( 'wv_av', wv_av )
+       IF ( ALLOCATED( ww_av ) )        CALL wrd_mpi_io( 'ww_av', ww_av )
 
     ENDIF
@@ -2126,4 +2294,3 @@
 
 
-
  END MODULE diagnostic_output_quantities_mod
Index: /palm/trunk/SOURCE/module_interface.f90
===================================================================
--- /palm/trunk/SOURCE/module_interface.f90	(revision 4517)
+++ /palm/trunk/SOURCE/module_interface.f90	(revision 4518)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Call of doq_rrd_local enabled
+! 
+! 4517 2020-05-03 14:29:30Z raasch
 ! added restart with MPI-IO for reading local arrays
 ! 
@@ -335,6 +338,6 @@
                doq_output_2d,                                                  &
                doq_output_3d,                                                  &
+               doq_rrd_local,                                                  &
                doq_wrd_local
-!                doq_rrd_local,                                                  &
 
     USE flight_mod,                                                            &
@@ -1878,12 +1881,12 @@
                             ) ! ToDo: change interface to pass variable
 
-!     IF ( .NOT. found )  CALL doq_rrd_local(                                    &
-!                                map_index,                                      &
-!                                nxlf, nxlc, nxl_on_file,                        &
-!                                nxrf, nxrc, nxr_on_file,                        &
-!                                nynf, nync, nyn_on_file,                        &
-!                                nysf, nysc, nys_on_file,                        &
-!                                tmp_3d_non_standard, found                      &
-!                             ) ! ToDo: change interface to pass variable CALL doq_wrd_local
+    IF ( .NOT. found )  CALL doq_rrd_local(                                    &
+                               map_index,                                      &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_2d, tmp_3d, found                           &
+                            ) ! ToDo: change interface to pass variable
 
     IF ( .NOT. found )  CALL gust_rrd_local(                                   &
@@ -1994,5 +1997,5 @@
     IF ( bulk_cloud_model )     CALL bcm_rrd_local
     IF ( air_chemistry )        CALL chem_rrd_local
-!    CALL doq_rrd_local
+    CALL doq_rrd_local
     IF ( gust_module_enabled )  CALL gust_rrd_local
     IF ( particle_advection )   CALL lpm_rrd_local
Index: /palm/trunk/SOURCE/read_restart_data_mod.f90
===================================================================
--- /palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 4517)
+++ /palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 4518)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Move input of diagnostic output quantities to doq_rrd_local
+! 
+! 4517 2020-05-03 14:29:30Z raasch
 ! qsurf and ssurf added
 ! 
@@ -130,15 +133,4 @@
     USE cpulog,                                                                &
         ONLY:  cpu_log, log_point_s
-
-    USE diagnostic_output_quantities_mod,                                      &
-        ONLY:  pt_2m_av,                                                       &
-               ti_av,                                                          &
-               u_center_av,                                                    &
-               uu_av,                                                          &
-               uv_10m_av,                                                      &
-               v_center_av,                                                    &
-               vv_av,                                                          &
-               wspeed_av,                                                      &
-               ww_av
 
     USE grid_variables,                                                        &
@@ -1773,12 +1765,4 @@
                          tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                   CASE ( 'pt_2m_av' )
-                      IF ( .NOT. ALLOCATED( pt_2m_av ) )  THEN
-                         ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) )
-                      ENDIF
-                      IF ( k == 1 )  READ ( 13 )  tmp_2d
-                      pt_2m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  =                            &
-                         tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                    CASE ( 'q' )
                       IF ( k == 1 )  READ ( 13 )  tmp_3d
@@ -1895,15 +1879,4 @@
                          tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                   CASE ( 'ti_av' )
-                      IF ( .NOT. ALLOCATED( ti_av ) )  THEN
-                         ALLOCATE( ti_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-                      ENDIF
-                      IF ( k == 1 )  THEN
-                         ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,             &
-                                                       nxl_on_file:nxr_on_file) )
-                         READ ( 13 )  tmp_3d_non_standard
-                      ENDIF
-                      ti_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-
                    CASE ( 'ts_av' )
                       IF ( .NOT. ALLOCATED( ts_av ) )  THEN
@@ -1934,34 +1907,4 @@
                       u_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =                               &
                          tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
-                   CASE ( 'u_center_av' )
-                      IF ( .NOT. ALLOCATED( u_center_av ) )  THEN
-                         ALLOCATE( u_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-                      ENDIF
-                      IF ( k == 1 )  THEN
-                         ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,             &
-                                                       nxl_on_file:nxr_on_file) )
-                         READ ( 13 )  tmp_3d_non_standard
-                      ENDIF
-                      u_center_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-
-                   CASE ( 'uu_av' )
-                      IF ( .NOT. ALLOCATED( uu_av ) )  THEN
-                         ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-                      ENDIF
-                      IF ( k == 1 )  THEN
-                         ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,             &
-                                                       nxl_on_file:nxr_on_file) )
-                         READ ( 13 )  tmp_3d_non_standard
-                      ENDIF
-                      uu_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-
-                   CASE ( 'uv_10m_av' )
-                      IF ( .NOT. ALLOCATED( uv_10m_av ) )  THEN
-                         ALLOCATE( uv_10m_av(nysg:nyng,nxlg:nxrg) )
-                      ENDIF
-                      IF ( k == 1 )  READ ( 13 )  tmp_2d
-                      uv_10m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)  =                           &
-                         tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
                    CASE ( 'u_m_l' )
@@ -2026,26 +1969,4 @@
                          tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                   CASE ( 'v_center_av' )
-                      IF ( .NOT. ALLOCATED( v_center_av ) )  THEN
-                         ALLOCATE( v_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-                      ENDIF
-                      IF ( k == 1 )  THEN
-                         ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,             &
-                                                       nxl_on_file:nxr_on_file) )
-                         READ ( 13 )  tmp_3d_non_standard
-                      ENDIF
-                      v_center_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-
-                   CASE ( 'vv_av' )
-                      IF ( .NOT. ALLOCATED( vv_av ) )  THEN
-                      ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-                      ENDIF
-                      IF ( k == 1 )  THEN
-                         ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,             &
-                                                       nxl_on_file:nxr_on_file) )
-                         READ ( 13 )  tmp_3d_non_standard
-                      ENDIF
-                      vv_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-
                    CASE ( 'v_m_l' )
                       IF ( k == 1 )  THEN
@@ -2114,15 +2035,4 @@
                          tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                   CASE ( 'ww_av' )
-                      IF ( .NOT. ALLOCATED( ww_av ) )  THEN
-                         ALLOCATE( ww_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-                      ENDIF
-                      IF ( k == 1 )  THEN
-                         ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,             &
-                                                       nxl_on_file:nxr_on_file) )
-                         READ ( 13 )  tmp_3d_non_standard
-                      ENDIF
-                      ww_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
-
                    CASE ( 'w_m_l' )
                       IF ( k == 1 )  THEN
@@ -2164,15 +2074,4 @@
                          w_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp)
                       ENDIF
-
-                   CASE ( 'wspeed_av' )
-                      IF ( .NOT. ALLOCATED( wspeed_av ) )  THEN
-                         ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-                      ENDIF
-                      IF ( k == 1 )  THEN
-                         ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file,             &
-                                                       nxl_on_file:nxr_on_file) )
-                         READ ( 13 )  tmp_3d_non_standard
-                      ENDIF
-                      wspeed_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf)
 
                    CASE ( 'z0_av' )
@@ -2326,10 +2225,4 @@
        ENDIF
 
-       CALL rd_mpi_io_check_array( 'pt_2m_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( pt_2m_av ) )  ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) )
-          CALL rrd_mpi_io( 'pt_2m_av', pt_2m_av )
-       ENDIF
-
        CALL rd_mpi_io_check_array( 'q' , found = array_found )
        IF ( array_found )  THEN
@@ -2425,10 +2318,4 @@
        ENDIF
 
-       CALL rd_mpi_io_check_array( 'ti_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( ti_av ) )  ALLOCATE( ti_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-          CALL rrd_mpi_io( 'ti_av', ti_av )
-       ENDIF
-
        CALL rd_mpi_io_check_array( 'ts_av' , found = array_found )
        IF ( array_found )  THEN
@@ -2451,22 +2338,4 @@
        ENDIF
 
-       CALL rd_mpi_io_check_array( 'u_center_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( u_center_av ) )  ALLOCATE( u_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-          CALL rrd_mpi_io( 'u_center_av', u_center_av )
-       ENDIF
-
-       CALL rd_mpi_io_check_array( 'uu_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( uu_av ) )  ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-          CALL rrd_mpi_io( 'uu_av', uu_av )
-       ENDIF
-
-       CALL rd_mpi_io_check_array( 'uv_10m_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( uv_10m_av ) )  ALLOCATE( uv_10m_av(nysg:nyng,nxlg:nxrg) )
-          CALL rrd_mpi_io( 'uv_10m_av', uv_10m_av )
-       ENDIF
-
        CALL rd_mpi_io_check_array( 'u_m_l' , found = array_found )
        IF ( array_found )  THEN
@@ -2507,16 +2376,4 @@
        ENDIF
 
-       CALL rd_mpi_io_check_array( 'v_center_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( v_center_av ) )  ALLOCATE( v_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-          CALL rrd_mpi_io( 'v_center_av', v_center_av )
-       ENDIF
-
-       CALL rd_mpi_io_check_array( 'vv_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( vv_av ) )  ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-          CALL rrd_mpi_io( 'vv_av', vv_av )
-       ENDIF
-
        CALL rd_mpi_io_check_array( 'v_m_l' , found = array_found )
        IF ( array_found )  THEN
@@ -2562,10 +2419,4 @@
        ENDIF
 
-       CALL rd_mpi_io_check_array( 'ww_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( ww_av ) )  ALLOCATE( w_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-          CALL rrd_mpi_io( 'ww_av', ww_av )
-       ENDIF
-
        CALL rd_mpi_io_check_array( 'w_m_l' , found = array_found )
        IF ( array_found )  THEN
@@ -2590,10 +2441,4 @@
           IF ( .NOT. ALLOCATED( w_m_s ) )  ALLOCATE( w_m_s(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
           CALL rrd_mpi_io( 'w_m_s', w_m_s )
-       ENDIF
-
-       CALL rd_mpi_io_check_array( 'wspeed_av' , found = array_found )
-       IF ( array_found )  THEN
-          IF ( .NOT. ALLOCATED( wspeed_av ) )  ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) )
-          CALL rrd_mpi_io( 'wspeed_av', wspeed_av )
        ENDIF
 
