Index: palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 2562)
+++ palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 2563)
@@ -685,5 +685,5 @@
                         res@trXMaxF = max(max_x)
                         res@trYMinF = min(min_y)
-                        res@trYMaxF = max(max_y)
+                        res@trYMaxF = max(max_y*10)
 			
 			plot_h(q)  = gsn_csm_xy(wks,x_axis(q,:),\
Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 2562)
+++ palm/trunk/SOURCE/Makefile	(revision 2563)
@@ -25,4 +25,8 @@
 # -----------------
 # $Id$
+# wind_turbine_model_mod.o and synthetic_turbulence_generator_mod.o were added to
+# write_var_list.o and virtual_flight_mod.o was deleted from read_var_list.o  
+# 
+# 2544 2017-10-13 18:09:32Z maronga
 # Added date_and_time_mod 
 # 
@@ -626,5 +630,5 @@
    spectra_mod.o surface_mod.o urban_surface_mod.o
 read_var_list.o: modules.o mod_kinds.o model_1d_mod.o netcdf_interface_mod.o plant_canopy_model_mod.o \
-   spectra_mod.o microphysics_mod.o urban_surface_mod.o vertical_nesting_mod.o virtual_flight_mod.o
+   spectra_mod.o microphysics_mod.o urban_surface_mod.o vertical_nesting_mod.o
 run_control.o: modules.o cpulog_mod.o mod_kinds.o
 set_slicer_attributes_dvrp.o: modules.o mod_kinds.o
@@ -697,3 +701,4 @@
 	spectra_mod.o surface_mod.o
 write_var_list.o: modules.o mod_kinds.o model_1d_mod.o netcdf_interface_mod.o plant_canopy_model_mod.o\
-   spectra_mod.o microphysics_mod.o urban_surface_mod.o vertical_nesting_mod.o virtual_flight_mod.o
+   spectra_mod.o microphysics_mod.o urban_surface_mod.o vertical_nesting_mod.o virtual_flight_mod.o\
+   wind_turbine_model_mod.o synthetic_turbulence_generator_mod.o
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 2562)
+++ palm/trunk/SOURCE/modules.f90	(revision 2563)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Variable wind_turbine was added to control_parameters
+! 
+! 2550 2017-10-16 17:12:01Z boeske
 ! complex_terrain namelist parameter added
 ! 
@@ -1242,4 +1245,5 @@
     LOGICAL ::  virtual_flight = .FALSE.                     !< use virtual flight model?
     LOGICAL ::  wall_adjustment = .TRUE.                     !< namelist parameter
+    LOGICAL ::  wind_turbine = .FALSE.                       !< flag for use of wind turbine model 
     LOGICAL ::  write_binary = .FALSE.                       !< ENVPAR namelist parameter to steer restart I/O (ENVPAR is created by mrun)
     LOGICAL ::  ws_scheme_sca = .FALSE.                      !< use Wicker-Skamarock scheme (scalar advection)?
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 2562)
+++ palm/trunk/SOURCE/parin.f90	(revision 2563)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Changed position where restart files are closed.
+! 
+! 2550 2017-10-16 17:12:01Z boeske
 ! Added complex_terrain
 ! 
@@ -559,7 +562,4 @@
  12       IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
              CALL read_var_list
-!
-!--          The restart file will be reopened when reading the subdomain data
-             CALL close_file( 13 )
 
 !
@@ -698,4 +698,10 @@
 
 !
+!--       The restart file will be reopened when reading the subdomain data
+          IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
+             CALL close_file( 13 )
+          ENDIF
+
+!
 !--       Check in case of initial run, if the grid point numbers are well
 !--       defined and allocate some arrays which are already needed in
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 2562)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 2563)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Variable wind_turbine moved to module control_parameters
+! 
+! 2320 2017-07-21 12:47:43Z suehring
 ! Modularize large-scale forcing and nudging
 ! 
@@ -260,5 +263,6 @@
                scalar_advec, scalar_advec, simulated_time, sloping_surface,    &
                timestep_scheme, tsc, use_subsidence_tendencies,                &
-               use_upstream_for_tke, ws_scheme_mom, ws_scheme_sca
+               use_upstream_for_tke, wind_turbine, ws_scheme_mom,              & 
+               ws_scheme_sca
 
     USE cpulog,                                                                &
@@ -358,5 +362,5 @@
 
     USE wind_turbine_model_mod,                                                &
-        ONLY:  wind_turbine, wtm_tendencies
+        ONLY:  wtm_tendencies
 
 
Index: palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- palm/trunk/SOURCE/read_var_list.f90	(revision 2562)
+++ palm/trunk/SOURCE/read_var_list.f90	(revision 2563)
@@ -25,4 +25,11 @@
 ! -----------------
 ! $Id$
+! CALL stg_read_restart_data moved to synthetic_turbulence_generator_mod and
+! CALL flight_read_restart_data moved to virtual_flights_mod. Furthermore 
+! *** end default *** marks the end of the standard parameter list of restart
+! files and *** end *** marks the end of all parameter including module
+! parameter. Therefore the call of flight_skip_var_list becomes unnecessary.
+! 
+! 2372 2017-08-25 12:37:32Z sward
 ! y_shift added to vars, version no. increased
 ! 
@@ -220,7 +227,4 @@
     USE control_parameters
 
-    USE flight_mod,                                                            &
-        ONLY:  flight_read_restart_data
-
     USE grid_variables,                                                        &
         ONLY:  dx, dy
@@ -255,7 +259,4 @@
                v_max, v_max_ijk, w_max, w_max_ijk
 
-    USE synthetic_turbulence_generator_mod,                                    &
-        ONLY:  stg_read_restart_data
-
     USE vertical_nesting_mod,                                                  &
         ONLY:  vnest_init
@@ -272,5 +273,5 @@
 !-- Make version number check first
     READ ( 13 )  version_on_file
-    binary_version = '4.2'
+    binary_version = '4.3'
     IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
        WRITE( message_string, * ) 'version mismatch concerning control ', &
@@ -349,5 +350,5 @@
 !--          increased. The same changes must also be done in write_var_list.
     READ ( 13 )  variable_chr
-    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
+    DO  WHILE ( TRIM( variable_chr ) /= '*** end default ***' )
 
        SELECT CASE ( TRIM( variable_chr ) )
@@ -842,7 +843,4 @@
     ENDDO
 
-    IF ( virtual_flight )  CALL flight_read_restart_data
-
-    IF ( synthetic_turbulence_generator )  CALL stg_read_restart_data
 
  END SUBROUTINE read_var_list
@@ -984,5 +982,5 @@
     READ ( 13 )  variable_chr
 
-    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
+    DO  WHILE ( TRIM( variable_chr ) /= '*** end default ***' )
 
        SELECT CASE ( TRIM( variable_chr ) )
@@ -1072,9 +1070,4 @@
  SUBROUTINE skip_var_list
 
-    USE control_parameters,                                                    &
-        ONLY:  virtual_flight
-
-    USE flight_mod,                                                            &
-        ONLY:  flight_skip_var_list
 
     IMPLICIT NONE
@@ -1096,8 +1089,4 @@
 
     ENDDO
-!
-!-- In case of virtual flights, skip also variables related to
-!-- this module.
-    IF ( virtual_flight )  CALL flight_skip_var_list
 
 
Index: palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 2562)
+++ palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 2563)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! stg_read_restart_data is called in stg_parin in the case of a restart run
+! 
+! 2259 2017-06-08 09:09:11Z gronemeier
 ! Initial revision
 !
@@ -194,5 +197,5 @@
 !-- Public interfaces
     PUBLIC  stg_check_parameters, stg_header, stg_init, stg_main, stg_parin,   &
-            stg_read_restart_data, stg_write_restart_data
+            stg_write_restart_data
 
 !
@@ -659,4 +662,8 @@
 !-- on
     synthetic_turbulence_generator = .TRUE.
+
+    IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN
+       CALL stg_read_restart_data
+    ENDIF
 
  10 CONTINUE
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 2562)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 2563)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Variable wind_turbine moved to module control_parameters
+! 
+! 2365 2017-08-21 14:59:59Z kanani
 ! Vertical grid nesting implemented (SadiqHuq)
 ! 
@@ -323,5 +326,5 @@
                use_initial_profile_as_reference,                               &
                use_single_reference_value, u_gtrans, v_gtrans, virtual_flight, &
-               ws_scheme_mom, ws_scheme_sca
+               wind_turbine, ws_scheme_mom, ws_scheme_sca
 
     USE cpulog,                                                                &
@@ -400,5 +403,5 @@
 
     USE wind_turbine_model_mod,                                                &
-        ONLY:  wind_turbine, wtm_forces
+        ONLY:  wtm_forces
 
     USE vertical_nesting_mod,                                                  &
Index: palm/trunk/SOURCE/virtual_flight_mod.f90
===================================================================
--- palm/trunk/SOURCE/virtual_flight_mod.f90	(revision 2562)
+++ palm/trunk/SOURCE/virtual_flight_mod.f90	(revision 2563)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! flight_read_restart_data is called in flight_parin in the case of a restart 
+! run. flight_skip_var_list is not necessary anymore due to marker changes in
+! restart files.
+! 
+! 2271 2017-06-09 12:34:55Z sward
 ! Todo added
 ! 
@@ -115,8 +120,4 @@
     END INTERFACE flight_measurement
     
-    INTERFACE flight_skip_var_list 
-       MODULE PROCEDURE flight_skip_var_list
-    END INTERFACE flight_skip_var_list
-    
     INTERFACE flight_read_restart_data 
        MODULE PROCEDURE flight_read_restart_data
@@ -133,6 +134,5 @@
 !-- Public interfaces
     PUBLIC flight_init, flight_header, flight_parin, flight_measurement,       &
-           flight_skip_var_list, flight_read_restart_data,                     &
-           flight_write_restart_data
+           flight_write_restart_data                    
 !
 !-- Public variables
@@ -192,5 +192,7 @@
     SUBROUTINE flight_parin 
 
-    
+       USE control_parameters,                                                 &
+           ONLY:  initializing_actions  
+      
        IMPLICIT NONE
 
@@ -216,4 +218,8 @@
 !--    Set switch that virtual flights shall be carried out
        virtual_flight = .TRUE.
+
+       IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN
+          CALL flight_read_restart_data
+       ENDIF
 
  10    CONTINUE
@@ -854,24 +860,4 @@
 
     END SUBROUTINE flight_check_parameters
-    
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-!> Skipping the flight-module variables from restart-file (binary format).
-!------------------------------------------------------------------------------!
-    SUBROUTINE flight_skip_var_list  
-           
-       IMPLICIT NONE
-       
-       CHARACTER (LEN=1)  ::  cdum
-       CHARACTER (LEN=30) ::  variable_chr
-       
-       READ ( 13 )  variable_chr
-       DO  WHILE ( TRIM( variable_chr ) /= '*** end flight ***' )
-          READ ( 13 )  cdum
-          READ ( 13 )  variable_chr
-       ENDDO    
-       
-    END SUBROUTINE flight_skip_var_list  
    
 !------------------------------------------------------------------------------!
Index: palm/trunk/SOURCE/wind_turbine_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 2562)
+++ palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 2563)
@@ -26,4 +26,9 @@
 ! -----------------
 ! $Id$
+! Restart runs with wind turbine model are possible now. For this purpose, two 
+! new subroutines wtm_write_restart_data and wtm_read_restart_data had to be 
+! defined
+! 
+! 2553 2017-10-18 08:03:45Z Giersch
 ! Bugfix of vertical loop in wtm_tendencies to account for different turbine 
 ! heights, bugfix of the interpolation of the u-component concerning the 
@@ -104,5 +109,6 @@
 
     USE control_parameters,                                                    &
-        ONLY:  dt_3d, dz, message_string, simulated_time
+        ONLY:  dt_3d, dz, message_string, simulated_time, wind_turbine,        & 
+               initializing_actions
 
     USE cpulog,                                                                &
@@ -124,6 +130,4 @@
 
     PRIVATE
-
-    LOGICAL ::  wind_turbine=.FALSE.   !< switch for use of wind turbine model
 
 !
@@ -265,7 +269,5 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE ::  alpha_attack !< 
     REAL(wp), DIMENSION(:), ALLOCATABLE ::  chord        !< 
-    REAL(wp), DIMENSION(:), ALLOCATABLE ::  omega_gen    !< curr. generator speed
     REAL(wp), DIMENSION(:), ALLOCATABLE ::  phi_rel      !< 
-    REAL(wp), DIMENSION(:), ALLOCATABLE ::  pitch_add_old!<
     REAL(wp), DIMENSION(:), ALLOCATABLE ::  torque_total !<
     REAL(wp), DIMENSION(:), ALLOCATABLE ::  thrust_rotor !<
@@ -337,12 +339,7 @@
     REAL(wp) ::  vs_sysp             !< 
     REAL(wp) ::  lp_coeff            !< coeff for the controller low pass filter 
-    
-    REAL(wp), DIMENSION(:), ALLOCATABLE :: omega_gen_old   !< last gen. speed
-    REAL(wp), DIMENSION(:), ALLOCATABLE :: omega_gen_f     !< filtered gen. sp
-    REAL(wp), DIMENSION(:), ALLOCATABLE :: omega_gen_f_old !< last filt. gen. sp
-    REAL(wp), DIMENSION(:), ALLOCATABLE :: torque_gen      !< generator torque
-    REAL(wp), DIMENSION(:), ALLOCATABLE :: torque_gen_old  !< last gen. torque
 
     REAL(wp), DIMENSION(100) :: omega_rot_l = 0.0_wp !< local rot speed [rad/s]
+
 !
 !-- Fixed variables for the yaw controller
@@ -362,4 +359,14 @@
     INTEGER(iwp)                          ::  WDSHO            !<
 
+!
+!-- Variables that have to be saved in the binary file for restarts
+    REAL(wp), DIMENSION(1:100) ::  pitch_add_old           = 0.0_wp  !< old constant pitch angle
+    REAL(wp), DIMENSION(1:100) ::  omega_gen               = 0.0_wp  !< curr. generator speed
+    REAL(wp), DIMENSION(1:100) ::  omega_gen_f             = 0.0_wp  !< filtered generator speed
+    REAL(wp), DIMENSION(1:100) ::  omega_gen_old           = 0.0_wp  !< last generator speed
+    REAL(wp), DIMENSION(1:100) ::  omega_gen_f_old         = 0.0_wp  !< last filtered generator speed
+    REAL(wp), DIMENSION(1:100) ::  torque_gen              = 0.0_wp  !< generator torque
+    REAL(wp), DIMENSION(1:100) ::  torque_gen_old          = 0.0_wp  !< last generator torque
+
 
     SAVE
@@ -369,4 +376,12 @@
        MODULE PROCEDURE wtm_parin
     END INTERFACE wtm_parin
+
+    INTERFACE wtm_write_restart_data 
+       MODULE PROCEDURE wtm_write_restart_data 
+    END INTERFACE wtm_write_restart_data
+
+    INTERFACE wtm_read_restart_data 
+       MODULE PROCEDURE wtm_read_restart_data
+    END INTERFACE wtm_read_restart_data 
     
     INTERFACE wtm_check_parameters
@@ -410,5 +425,6 @@
     
     PUBLIC wtm_check_parameters, wtm_forces, wtm_init, wtm_init_arrays,        &
-           wtm_parin, wtm_tendencies, wind_turbine 
+           wtm_parin, wtm_write_restart_data, wtm_tendencies
+
 
  CONTAINS
@@ -467,4 +483,8 @@
        wind_turbine = .TRUE.
 
+       IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN
+          CALL wtm_read_restart_data
+       ENDIF
+
  10    CONTINUE   ! TBD Change from continue, mit ierrn machen
 
@@ -472,4 +492,93 @@
     END SUBROUTINE wtm_parin
 
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> This routine writes the respective restart data.
+!------------------------------------------------------------------------------!
+    SUBROUTINE wtm_write_restart_data  
+
+       IMPLICIT NONE
+       
+       WRITE ( 14 )  'omega_gen                     '
+       WRITE ( 14 )  omega_gen
+       WRITE ( 14 )  'omega_gen_f                   '
+       WRITE ( 14 )  omega_gen_f
+       WRITE ( 14 )  'omega_gen_f_old               '
+       WRITE ( 14 )  omega_gen_f_old
+       WRITE ( 14 )  'omega_gen_old                 '
+       WRITE ( 14 )  omega_gen_old
+       WRITE ( 14 )  'omega_rot                     '
+       WRITE ( 14 )  omega_rot
+       WRITE ( 14 )  'phi_yaw                       '
+       WRITE ( 14 )  phi_yaw(:)
+       WRITE ( 14 )  'pitch_add                     '
+       WRITE ( 14 )  pitch_add
+       WRITE ( 14 )  'pitch_add_old                 '
+       WRITE ( 14 )  pitch_add_old
+       WRITE ( 14 )  'torque_gen                    '
+       WRITE ( 14 )  torque_gen
+       WRITE ( 14 )  'torque_gen_old                '
+       WRITE ( 14 )  torque_gen_old
+     
+       WRITE ( 14 )  '*** end wtm ***               '
+       
+    END SUBROUTINE wtm_write_restart_data    
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> This routine reads the respective restart data.
+!------------------------------------------------------------------------------!
+ SUBROUTINE wtm_read_restart_data
+
+
+    IMPLICIT NONE
+
+    CHARACTER (LEN=30) ::  variable_chr  !< dummy variable to read string
+
+
+    READ ( 13 )  variable_chr
+    DO  WHILE ( TRIM( variable_chr ) /= '*** end wtm ***' )
+
+       SELECT CASE ( TRIM( variable_chr ) )
+
+          CASE ( 'omega_gen' )
+             READ ( 13 )  omega_gen
+          CASE ( 'omega_gen_f' )
+             READ ( 13 )  omega_gen_f
+          CASE ( 'omega_gen_old' )
+             READ ( 13 )  omega_gen_old
+          CASE ( 'omega_gen_f_old' )
+             READ ( 13 )  omega_gen_f_old
+          CASE ( 'omega_rot' )
+             READ ( 13 )  omega_rot
+          CASE ( 'phi_yaw' )
+             READ ( 13 )  phi_yaw
+          CASE ( 'pitch_add' )
+             READ ( 13 )  pitch_add
+          CASE ( 'pitch_add_old' )
+             READ ( 13 )  pitch_add_old
+          CASE ( 'torque_gen' )
+             READ ( 13 )  torque_gen
+          CASE ( 'torque_gen_old' )
+             READ ( 13 )  torque_gen_old
+
+       END SELECT
+
+       READ ( 13 )  variable_chr
+
+    ENDDO
+
+ END SUBROUTINE wtm_read_restart_data
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Check namelist parameter
+!------------------------------------------------------------------------------!
     SUBROUTINE wtm_check_parameters
 
@@ -594,14 +703,4 @@
 
 !
-!--    Allocation of the 1D arrays for speed pitch_control
-       ALLOCATE( omega_gen(1:nturbines) )
-       ALLOCATE( omega_gen_old(1:nturbines) )
-       ALLOCATE( omega_gen_f(1:nturbines) )
-       ALLOCATE( omega_gen_f_old(1:nturbines) )
-       ALLOCATE( pitch_add_old(1:nturbines) )
-       ALLOCATE( torque_gen(1:nturbines) )
-       ALLOCATE( torque_gen_old(1:nturbines) )
-
-!
 !--    Allocation of the 1D arrays for yaw control
        ALLOCATE( yawdir(1:nturbines) )
@@ -672,12 +771,14 @@
        thrust_rotor(:)          = 0.0_wp
 
-       omega_gen(:)             = 0.0_wp
-       omega_gen_old(:)         = 0.0_wp
-       omega_gen_f(:)           = 0.0_wp
-       omega_gen_f_old(:)       = 0.0_wp
-       pitch_add_old(:)         = 0.0_wp
-       torque_gen(:)            = 0.0_wp
-       torque_gen_old(:)        = 0.0_wp
-       
+       IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN
+          omega_gen(:)             = 0.0_wp
+          omega_gen_old(:)         = 0.0_wp
+          omega_gen_f(:)           = 0.0_wp
+          omega_gen_f_old(:)       = 0.0_wp
+          pitch_add_old(:)         = 0.0_wp
+          torque_gen(:)            = 0.0_wp
+          torque_gen_old(:)        = 0.0_wp
+       ENDIF
+
        yawdir(:)                = 0.0_wp
        wdir(:)                  = 0.0_wp
@@ -776,4 +877,44 @@
           CALL wtm_speed_control
 
+          IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN
+
+             DO inot = 1, nturbines
+
+                IF ( nxl > i_hub(inot) ) THEN
+                   torque_gen(inot) = 0.0_wp
+                   omega_gen_f(inot) = 0.0_wp
+                   omega_rot_l(inot) = 0.0_wp
+                ENDIF
+
+                IF ( nxr < i_hub(inot) ) THEN
+                   torque_gen(inot) = 0.0_wp
+                   omega_gen_f(inot) = 0.0_wp
+                   omega_rot_l(inot) = 0.0_wp
+                ENDIF
+
+                IF ( nys > j_hub(inot) ) THEN
+                   torque_gen(inot) = 0.0_wp
+                   omega_gen_f(inot) = 0.0_wp
+                   omega_rot_l(inot) = 0.0_wp
+                ENDIF
+
+                IF ( nyn < j_hub(inot) ) THEN
+                   torque_gen(inot) = 0.0_wp
+                   omega_gen_f(inot) = 0.0_wp
+                   omega_rot_l(inot) = 0.0_wp
+                ENDIF
+
+                IF ( ( nxl <= i_hub(inot) ) .AND. ( nxr >= i_hub(inot) ) ) THEN
+                   IF ( ( nys <= j_hub(inot) ) .AND. ( nyn >= j_hub(inot) ) ) THEN
+
+                      omega_rot_l(inot) = omega_gen(inot) / gear_ratio
+
+                   ENDIF
+                ENDIF
+
+             END DO
+
+          ENDIF
+
        ENDIF
 
@@ -814,5 +955,7 @@
 !
 !--    Change yaw angle to rad:
-       phi_yaw(:) = phi_yaw(:) * pi / 180.0_wp
+       IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN
+          phi_yaw(:) = phi_yaw(:) * pi / 180.0_wp
+       ENDIF
 
 
@@ -2366,5 +2509,7 @@
 !--    At the first timestep the torque is set to its maximum to prevent
 !--    an overspeeding of the rotor
-       torque_gen_old(:) = max_torque_gen  
+       IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN
+          torque_gen_old(:) = max_torque_gen
+       ENDIF  
      
     END SUBROUTINE wtm_init_speed_control
Index: palm/trunk/SOURCE/write_var_list.f90
===================================================================
--- palm/trunk/SOURCE/write_var_list.f90	(revision 2562)
+++ palm/trunk/SOURCE/write_var_list.f90	(revision 2563)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! Function call wtm_write_restart_data was added and the end of the standard 
+! parameter list is now marked with *** end default ***. The end of the whole
+! parameter list including module parameter is marked with *** end ***
+! 
+! 2372 2017-08-25 12:37:32Z sward
 ! y_shift added to vars, version no. increased
 ! 
@@ -233,4 +238,7 @@
         ONLY:  vnest_init
 
+    USE wind_turbine_model_mod,                                                &
+        ONLY:  wtm_write_restart_data  
+
     IMPLICIT NONE
 
@@ -238,5 +246,5 @@
 
 
-    binary_version = '4.2'
+    binary_version = '4.3'
 
     WRITE ( 14 )  binary_version
@@ -739,6 +747,11 @@
 
 !
-!-- Set the end-of-file mark
-    WRITE ( 14 )  '*** end ***                   '
+!-- Set the end-of-file mark for default parameter
+    WRITE ( 14 )  '*** end default ***           '
+
+!
+!-- If required, write restart data for wind turbine model.
+    IF ( wind_turbine )  CALL wtm_write_restart_data
+
 !
 !-- If required, write restart data for virtual measurements.
@@ -749,4 +762,8 @@
     IF ( synthetic_turbulence_generator )  CALL stg_write_restart_data
 
+!
+!-- Set the end-of-file mark for default parameter
+    WRITE ( 14 )  '*** end ***            '
+
 
  END SUBROUTINE write_var_list
