Index: palm/trunk/SOURCE/wind_turbine_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 2790)
+++ palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 2792)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! omega_rot_l has to be calculated after determining the indices for the hub in
+! case of restart runs
+! 
+! 2776 2018-01-31 10:44:42Z Giersch
 ! wind_turbine_prerun flag is used to define if module 
 ! related parameters were outputted as restart data
@@ -646,5 +650,5 @@
        IF ( ANY( omega_rot(1:nturbines) < 0.0 ) )  THEN
           message_string = 'omega_rot < 0.0, Please set omega_rot to '     // &
-                           'a value larger than or equal to zero'
+                           'a value equal or larger than zero'
           CALL message( 'wtm_check_parameters', 'PA0462', 1, 2, 0, 6, 0 )
        ENDIF
@@ -924,51 +928,4 @@
        ALLOCATE( index_nact(1:nturbines) )
 
-
-       IF ( speed_control)  THEN
-       
-          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
-
 !
 !------------------------------------------------------------------------------!
@@ -1033,4 +990,53 @@
        
        ENDDO
+
+!
+!--    Call the wtm_init_speed_control subroutine and calculate the local 
+!--    omega_rot for the respective processor.
+       IF ( speed_control)  THEN
+       
+          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
 
 !
