Index: palm/trunk/SOURCE/gust_mod.f90
===================================================================
--- palm/trunk/SOURCE/gust_mod.f90	(revision 2821)
+++ 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
 
 
