Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 2911)
+++ palm/trunk/SOURCE/Makefile	(revision 2912)
@@ -1345,4 +1345,5 @@
 	chemistry_model_mod.o \
 	cpulog_mod.o\
+	gust_mod.o \
 	land_surface_model_mod.o \
 	microphysics_mod.o \
@@ -1673,4 +1674,5 @@
 write_restart_data_mod.o: \
 	chemistry_model_mod.o \
+	gust_mod.o \
 	land_surface_model_mod.o \
 	microphysics_mod.o \
Index: palm/trunk/SOURCE/gust_mod.f90
===================================================================
--- palm/trunk/SOURCE/gust_mod.f90	(revision 2911)
+++ palm/trunk/SOURCE/gust_mod.f90	(revision 2912)
@@ -24,5 +24,5 @@
 ! Former revisions:
 ! -----------------
-!
+! $Id$
 ! Initial interface definition
 !
@@ -67,6 +67,8 @@
        gust_data_output_3d, &
        gust_statistics, &
-       gust_read_restart_data, &
-       gust_write_restart_data
+       gust_rrd_global, &
+       gust_wrd_global, &
+       gust_rrd_local, &
+       gust_wrd_local
 !
 !-- Public parameters, constants and initial values
@@ -132,11 +134,19 @@
     END INTERFACE gust_statistics
 
-    INTERFACE gust_read_restart_data
-       MODULE PROCEDURE gust_read_restart_data
-    END INTERFACE gust_read_restart_data
-
-    INTERFACE gust_write_restart_data
-       MODULE PROCEDURE gust_write_restart_data
-    END INTERFACE gust_write_restart_data
+    INTERFACE gust_rrd_global
+       MODULE PROCEDURE gust_rrd_global
+    END INTERFACE gust_rrd_global
+
+    INTERFACE gust_wrd_global
+       MODULE PROCEDURE gust_wrd_global
+    END INTERFACE gust_wrd_global
+
+    INTERFACE gust_rrd_local
+       MODULE PROCEDURE gust_rrd_local
+    END INTERFACE gust_rrd_local
+
+    INTERFACE gust_wrd_local
+       MODULE PROCEDURE gust_wrd_local
+    END INTERFACE gust_wrd_local
 
  CONTAINS
@@ -447,11 +457,101 @@
 !> This routine reads the respective restart data for the gust module.
 !------------------------------------------------------------------------------!
-    SUBROUTINE gust_read_restart_data
-
-
-       IMPLICIT NONE
-
-
-    END SUBROUTINE gust_read_restart_data
+    SUBROUTINE gust_rrd_global( found )
+
+
+       USE control_parameters,                                                 &
+           ONLY: length, restart_string
+
+
+       IMPLICIT NONE
+
+       LOGICAL, INTENT(OUT)  ::  found
+
+
+       found = .TRUE.
+
+
+       SELECT CASE ( restart_string(1:length) )
+
+          CASE ( 'global_paramter' )
+!             READ ( 13 )  global_parameter
+
+          CASE DEFAULT
+
+             found = .FALSE.
+
+       END SELECT
+
+
+    END SUBROUTINE gust_rrd_global
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> This routine reads the respective restart data for the gust module.
+!------------------------------------------------------------------------------!
+    SUBROUTINE gust_rrd_local( i, 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) ::  i               !<
+       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   !<
+
+!
+!-- Here the reading of user-defined restart data follows:
+!-- Sample for user-defined output
+
+
+       found = .TRUE.
+
+
+       SELECT CASE ( restart_string(1:length) )
+
+          CASE ( 'u2_av' )
+!             IF ( .NOT. ALLOCATED( u2_av ) ) THEN
+!                  ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+!             ENDIF
+!             IF ( k == 1 )  READ ( 13 )  tmp_3d
+!                u2_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 gust_rrd_local
 
 
@@ -461,11 +561,41 @@
 !> This routine writes the respective restart data for the gust module.
 !------------------------------------------------------------------------------!
-    SUBROUTINE gust_write_restart_data
-
-
-       IMPLICIT NONE
-
-
-    END SUBROUTINE gust_write_restart_data
+    SUBROUTINE gust_wrd_global
+
+
+       IMPLICIT NONE
+
+! needs preceeding allocation if array
+!       CALL wrd_write_string( 'global_parameter' )
+!       WRITE ( 14 )  global_parameter
+
+!       IF ( ALLOCATED( inflow_damping_factor ) )  THEN
+!          CALL wrd_write_string( 'inflow_damping_factor' )
+!          WRITE ( 14 )  inflow_damping_factor
+!       ENDIF
+
+
+    END SUBROUTINE gust_wrd_global
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> This routine writes the respective restart data for the gust module.
+!------------------------------------------------------------------------------!
+    SUBROUTINE gust_wrd_local
+
+
+       IMPLICIT NONE
+
+
+! needs preceeding allocation because sould be array
+!          IF ( ALLOCATED( u2_av ) )  THEN
+!             CALL wrd_write_string( 'u2_av' )
+!             WRITE ( 14 )  u2_av
+!          ENDIF
+
+
+    END SUBROUTINE gust_wrd_local
 
 
Index: palm/trunk/SOURCE/read_restart_data_mod.f90
===================================================================
--- palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 2911)
+++ palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 2912)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added gust module interface calls
+! 
+! 2894 2018-03-15 09:17:58Z Giersch
 ! Initial revision
 ! 
@@ -81,4 +84,7 @@
        USE grid_variables,                                                     &
            ONLY:  dx, dy
+
+       USE gust_mod,                                                           &
+           ONLY :  gust_rrd_global
 
        USE indices,                                                            &
@@ -726,4 +732,6 @@
                 IF ( .NOT. found ) CALL stg_rrd_global ( found )
 
+                IF ( .NOT. found ) CALL gust_rrd_global( found )
+
                 IF ( .NOT. found ) CALL user_rrd_global( found )
 
@@ -1005,4 +1013,7 @@
     USE cpulog,                                                                &
         ONLY:  cpu_log, log_point_s
+
+    USE gust_mod,                                                           &
+        ONLY :  gust_rrd_local
 
     USE indices,                                                               &
@@ -1981,4 +1992,12 @@
 
 !
+!--                Read gust module restart data
+                   IF ( .NOT. found ) CALL gust_rrd_local( i, 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 )
+
+!
 !--                Read user-defined restart data
                    IF ( .NOT. found ) CALL user_rrd_local( i, k, nxlf,         &
Index: palm/trunk/SOURCE/write_restart_data_mod.f90
===================================================================
--- palm/trunk/SOURCE/write_restart_data_mod.f90	(revision 2911)
+++ palm/trunk/SOURCE/write_restart_data_mod.f90	(revision 2912)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added gust module interface calls
+! 
+! 2894 2018-03-15 09:17:58Z Giersch
 ! Initial revision 
 !
@@ -80,4 +83,7 @@
            ONLY:  dx, dy
 
+       USE gust_mod,                                                           &
+           ONLY :  gust_module_enabled, gust_wrd_global
+
        USE indices,                                                            &
            ONLY:  nz, nx, ny
@@ -884,4 +890,7 @@
 !-- If required, write restart data for turbulence generator.
        IF ( syn_turb_gen )  CALL stg_wrd_global
+!
+!-- If required, write restart data for gust module.
+       IF ( gust_module_enabled )  CALL gust_wrd_global
 
 !
@@ -913,4 +922,7 @@
        USE chemistry_model_mod,                                                &
            ONLY:  chem_wrd_local
+
+       USE gust_mod,                                                           &
+           ONLY :  gust_module_enabled, gust_wrd_local
                 
        USE indices,                                                            &
@@ -1369,4 +1381,10 @@
 
 !
+!-- If required, write restart data for gust module.
+       IF ( gust_module_enabled )  THEN
+          CALL gust_wrd_local
+       ENDIF
+
+!
 !-- Write user-related restart data.
        CALL user_wrd_local
