Index: /palm/trunk/SOURCE/wind_turbine_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 4446)
+++ /palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 4447)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! renamed wind_turbine_parameters namelist variables
+! 
+! 4438 2020-03-03 20:49:28Z suehring
 ! Bugfix: shifted netcdf preprocessor directive to correct position
 ! 
@@ -179,6 +182,6 @@
 !-- Variables specified in the namelist wind_turbine_par
 
-    INTEGER(iwp) ::  nairfoils = 8   !< number of airfoils of the used turbine model (for ADM-R and ALM)
-    INTEGER(iwp) ::  nturbines = 1   !< number of turbines
+    INTEGER(iwp) ::  n_airfoils = 8   !< number of airfoils of the used turbine model (for ADM-R and ALM)
+    INTEGER(iwp) ::  n_turbines = 1   !< number of turbines
 
     
@@ -189,8 +192,8 @@
     REAL(wp), TARGET                ::  output_values_0d_target !< pointer for 2d output array     
     
-    LOGICAL ::  pitch_control = .FALSE.   !< switch for use of pitch controller
-    LOGICAL ::  speed_control = .FALSE.   !< switch for use of speed controller
-    LOGICAL ::  yaw_control   = .FALSE.   !< switch for use of yaw controller
-    LOGICAL ::  tl_cor        = .FALSE.    !< switch for use of tip loss correct.
+    LOGICAL ::  pitch_control       = .FALSE.   !< switch for use of pitch controller
+    LOGICAL ::  speed_control       = .FALSE.   !< switch for use of speed controller
+    LOGICAL ::  yaw_control         = .FALSE.   !< switch for use of yaw controller
+    LOGICAL ::  tip_loss_correction = .FALSE.   !< switch for use of tip loss correct.
     
     LOGICAL ::  initial_write_coordinates = .FALSE. 
@@ -200,23 +203,23 @@
     
     
-    REAL(wp) ::  segment_length  = 1.0_wp          !< length of the segments, the rotor area is divided into
-                                                   !< (in tangential direction, as factor of MIN(dx,dy,dz))
-    REAL(wp) ::  segment_width   = 0.5_wp          !< width of the segments, the rotor area is divided into
-                                                   !< (in radial direction, as factor of MIN(dx,dy,dz))
-    REAL(wp) ::  time_turbine_on = 0.0_wp          !< time at which turbines are started
-    REAL(wp) ::  tilt            = 0.0_wp          !< vertical tilt of the rotor [degree] ( positive = backwards )
-
-
-    REAL(wp), DIMENSION(1:100) ::  dtow             = 0.0_wp  !< tower diameter [m]
-    REAL(wp), DIMENSION(1:100), TARGET ::  omega_rot        = 0.9_wp  !< inital or constant rotor speed [rad/s]
-    REAL(wp), DIMENSION(1:100) ::  phi_yaw          = 0.0_wp  !< yaw angle [degree] ( clockwise, 0 = facing west )
-    REAL(wp), DIMENSION(1:100) ::  pitch_add        = 0.0_wp  !< constant pitch angle
-    REAL(wp), DIMENSION(1:100) ::  rcx        = 9999999.9_wp  !< position of hub in x-direction
-    REAL(wp), DIMENSION(1:100) ::  rcy        = 9999999.9_wp  !< position of hub in y-direction
-    REAL(wp), DIMENSION(1:100) ::  rcz        = 9999999.9_wp  !< position of hub in z-direction
-    REAL(wp), DIMENSION(1:100) ::  rnac             = 0.0_wp  !< nacelle diameter [m]
-    REAL(wp), DIMENSION(1:100) ::  rr              = 63.0_wp  !< rotor radius [m]
-!    REAL(wp), DIMENSION(1:100) ::  turb_cd_nacelle = 0.85_wp  !< drag coefficient for nacelle
-    REAL(wp), DIMENSION(1:100) ::  turb_cd_tower    = 1.2_wp  !< drag coefficient for tower
+    REAL(wp) ::  segment_length_tangential  = 1.0_wp  !< length of the segments, the rotor area is divided into
+                                                      !< (in tangential direction, as factor of MIN(dx,dy,dz))
+    REAL(wp) ::  segment_width_radial       = 0.5_wp  !< width of the segments, the rotor area is divided into
+                                                      !< (in radial direction, as factor of MIN(dx,dy,dz))
+    REAL(wp) ::  time_turbine_on            = 0.0_wp  !< time at which turbines are started
+    REAL(wp) ::  tilt_angle                       = 0.0_wp  !< vertical tilt_angle of the rotor [degree] ( positive = backwards )
+
+
+    REAL(wp), DIMENSION(1:100) ::  tower_diameter      = 0.0_wp       !< tower diameter [m]
+    REAL(wp), DIMENSION(1:100), TARGET ::  rotor_speed = 0.9_wp       !< inital or constant rotor speed [rad/s]
+    REAL(wp), DIMENSION(1:100) ::  yaw_angle           = 0.0_wp       !< yaw angle [degree] ( clockwise, 0 = facing west )
+    REAL(wp), DIMENSION(1:100) ::  pitch_angle         = 0.0_wp       !< constant pitch angle
+    REAL(wp), DIMENSION(1:100) ::  hub_x               = 9999999.9_wp !< position of hub in x-direction
+    REAL(wp), DIMENSION(1:100) ::  hub_y               = 9999999.9_wp !< position of hub in y-direction
+    REAL(wp), DIMENSION(1:100) ::  hub_z               = 9999999.9_wp !< position of hub in z-direction
+    REAL(wp), DIMENSION(1:100) ::  nacelle_radius      = 0.0_wp       !< nacelle diameter [m]
+    REAL(wp), DIMENSION(1:100) ::  rotor_radius                  = 63.0_wp      !< rotor radius [m]
+!    REAL(wp), DIMENSION(1:100) ::  nacelle_cd     = 0.85_wp      !< drag coefficient for nacelle
+    REAL(wp), DIMENSION(1:100) ::  tower_cd       = 1.2_wp       !< drag coefficient for tower
 
 !
@@ -224,18 +227,18 @@
 !-- Default values are from the NREL 5MW research turbine (Jonkman, 2008)
 
-    REAL(wp) ::  rated_power    = 5296610.0_wp    !< rated turbine power [W]
-    REAL(wp) ::  gear_ratio     = 97.0_wp         !< Gear ratio from rotor to generator
-    REAL(wp) ::  inertia_rot    = 34784179.0_wp   !< Inertia of the rotor [kg*m2]
-    REAL(wp) ::  inertia_gen    = 534.116_wp      !< Inertia of the generator [kg*m2]
-    REAL(wp) ::  gen_eff        = 0.944_wp        !< Electric efficiency of the generator
-    REAL(wp) ::  gear_eff       = 1.0_wp          !< Loss between rotor and generator
-    REAL(wp) ::  air_dens       = 1.225_wp        !< Air density to convert to W [kg/m3]
-    REAL(wp) ::  rated_genspeed = 121.6805_wp     !< Rated generator speed [rad/s]
-    REAL(wp) ::  max_torque_gen = 47402.91_wp     !< Maximum of the generator torque [Nm]
-    REAL(wp) ::  slope2         = 2.332287_wp     !< Slope constant for region 2
-    REAL(wp) ::  min_reg2       = 91.21091_wp     !< Lower generator speed boundary of region 2 [rad/s]
-    REAL(wp) ::  min_reg15      = 70.16224_wp     !< Lower generator speed boundary of region 1.5 [rad/s]
-    REAL(wp) ::  max_trq_rate   = 15000.0_wp      !< Max generator torque increase [Nm/s]
-    REAL(wp) ::  pitch_rate     = 8.0_wp          !< Max pitch rate [degree/s]
+    REAL(wp) ::  generator_power_rated     = 5296610.0_wp    !< rated turbine power [W]
+    REAL(wp) ::  gear_ratio                = 97.0_wp         !< Gear ratio from rotor to generator
+    REAL(wp) ::  rotor_inertia             = 34784179.0_wp   !< Inertia of the rotor [kg*m2]
+    REAL(wp) ::  generator_inertia         = 534.116_wp      !< Inertia of the generator [kg*m2]
+    REAL(wp) ::  generator_efficiency      = 0.944_wp        !< Electric efficiency of the generator
+    REAL(wp) ::  gear_efficiency           = 1.0_wp          !< Loss between rotor and generator
+    REAL(wp) ::  air_density               = 1.225_wp        !< Air density to convert to W [kg/m3]
+    REAL(wp) ::  generator_speed_rated     = 121.6805_wp     !< Rated generator speed [rad/s]
+    REAL(wp) ::  generator_torque_max      = 47402.91_wp     !< Maximum of the generator torque [Nm]
+    REAL(wp) ::  region_2_slope            = 2.332287_wp     !< Slope constant for region 2
+    REAL(wp) ::  region_2_min              = 91.21091_wp     !< Lower generator speed boundary of region 2 [rad/s]
+    REAL(wp) ::  region_15_min             = 70.16224_wp     !< Lower generator speed boundary of region 1.5 [rad/s]
+    REAL(wp) ::  generator_torque_rate_max = 15000.0_wp      !< Max generator torque increase [Nm/s]
+    REAL(wp) ::  pitch_rate                = 8.0_wp          !< Max pitch rate [degree/s]
 
 
@@ -243,7 +246,7 @@
 !-- Variables specified in the namelist for yaw control
 
-    REAL(wp) ::  yaw_speed = 0.005236_wp   !< speed of the yaw actuator [rad/s]
-    REAL(wp) ::  max_miss = 0.08726_wp     !< maximum tolerated yaw missalignment [rad]
-    REAL(wp) ::  min_miss = 0.008726_wp    !< minimum yaw missalignment for which the actuator stops [rad]
+    REAL(wp) ::  yaw_speed            = 0.005236_wp    !< speed of the yaw actuator [rad/s]
+    REAL(wp) ::  yaw_misalignment_max = 0.08726_wp     !< maximum tolerated yaw missalignment [rad]
+    REAL(wp) ::  yaw_misalignment_min = 0.008726_wp    !< minimum yaw missalignment for which the actuator stops [rad]
 
 !
@@ -392,13 +395,13 @@
     
     REAL(wp) ::  Fcorner             !< corner freq for the controller low pass filter
-    REAL(wp) ::  min_reg25           !< min region 2.5
+    REAL(wp) ::  region_25_min       !< min region 2.5
     REAL(wp) ::  om_rate             !< rotor speed change
     REAL(wp) ::  slope15             !< slope in region 1.5
-    REAL(wp) ::  slope25             !< slope in region 2.5
+    REAL(wp) ::  region_25_slope     !< slope in region 2.5
     REAL(wp) ::  trq_rate            !< torque change
     REAL(wp) ::  vs_sysp             !< 
     REAL(wp) ::  lp_coeff            !< coeff for the controller low pass filter 
 
-    REAL(wp), DIMENSION(100) :: omega_rot_l = 0.0_wp !< local rot speed [rad/s]
+    REAL(wp), DIMENSION(100) :: rotor_speed_l = 0.0_wp !< local rot speed [rad/s]
 
 !
@@ -406,5 +409,5 @@
 
     REAL(wp), DIMENSION(:)  , ALLOCATABLE ::  yawdir           !< direction to yaw
-    REAL(wp), DIMENSION(:)  , ALLOCATABLE ::  phi_yaw_l        !< local (cpu) yaw angle
+    REAL(wp), DIMENSION(:)  , ALLOCATABLE ::  yaw_angle_l      !< local (cpu) yaw angle
     REAL(wp), DIMENSION(:)  , ALLOCATABLE ::  wd30_l           !< local (cpu) long running avg of the wd
     REAL(wp), DIMENSION(:)  , ALLOCATABLE ::  wd2_l            !< local (cpu) short running avg of the wd
@@ -421,9 +424,9 @@
 !
 !-- 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) ::  pitch_angle_old           = 0.0_wp  !< old constant pitch angle
+    REAL(wp), DIMENSION(1:100) ::  generator_speed         = 0.0_wp  !< curr. generator speed
+    REAL(wp), DIMENSION(1:100) ::  generator_speed_f       = 0.0_wp  !< filtered generator speed
+    REAL(wp), DIMENSION(1:100) ::  generator_speed_old     = 0.0_wp  !< last generator speed
+    REAL(wp), DIMENSION(1:100) ::  generator_speed_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
@@ -503,16 +506,17 @@
 
        NAMELIST /wind_turbine_parameters/                                      &
-                                  air_dens, dtow, dt_data_output_wtm, gear_eff,&
-                                  gear_ratio,                                  &
-                                  gen_eff, inertia_gen, inertia_rot, max_miss, &
-                                  max_torque_gen, max_trq_rate, min_miss,      &
-                                  min_reg15, min_reg2, nairfoils, nturbines,   &
-                                  omega_rot, phi_yaw, pitch_add, pitch_control,&
-                                  rated_genspeed, rated_power, rcx, rcy, rcz,  &
-                                  rnac, rr, segment_length, segment_width,     &
-                                  slope2, speed_control, tilt, time_turbine_on,&
-                                  turb_cd_tower, pitch_rate,                   &
-                                  yaw_control, yaw_speed, tl_cor
-!                                  , turb_cd_nacelle
+                   air_density, tower_diameter, dt_data_output_wtm,            &
+                   gear_efficiency, gear_ratio, generator_efficiency,          &
+                   generator_inertia, rotor_inertia, yaw_misalignment_max,     &
+                   generator_torque_max, generator_torque_rate_max, yaw_misalignment_min,                     &
+                   region_15_min, region_2_min, n_airfoils, n_turbines,        &
+                   rotor_speed, yaw_angle, pitch_angle, pitch_control,         &
+                   generator_speed_rated, generator_power_rated, hub_x, hub_y, hub_z,&
+                   nacelle_radius, rotor_radius, segment_length_tangential, segment_width_radial,  &
+                   region_2_slope, speed_control, tilt_angle, time_turbine_on, &
+                   tower_cd, pitch_rate,                                  &
+                   yaw_control, yaw_speed, tip_loss_correction
+!                   , nacelle_cd
+
 !
 !--    Try to find wind turbine model package
@@ -553,27 +557,27 @@
        
 
-       CALL wrd_write_string( 'omega_gen' )
-       WRITE ( 14 )  omega_gen
-
-       CALL wrd_write_string( 'omega_gen_f' )
-       WRITE ( 14 )  omega_gen_f
-
-       CALL wrd_write_string( 'omega_gen_f_old' )
-       WRITE ( 14 )  omega_gen_f_old
-
-       CALL wrd_write_string( 'omega_gen_old' )
-       WRITE ( 14 )  omega_gen_old
-
-       CALL wrd_write_string( 'omega_rot' )
-       WRITE ( 14 )  omega_rot
-
-       CALL wrd_write_string( 'phi_yaw' )
-       WRITE ( 14 )  phi_yaw
-
-       CALL wrd_write_string( 'pitch_add' )
-       WRITE ( 14 )  pitch_add
-
-       CALL wrd_write_string( 'pitch_add_old' )
-       WRITE ( 14 )  pitch_add_old
+       CALL wrd_write_string( 'generator_speed' )
+       WRITE ( 14 )  generator_speed
+
+       CALL wrd_write_string( 'generator_speed_f' )
+       WRITE ( 14 )  generator_speed_f
+
+       CALL wrd_write_string( 'generator_speed_f_old' )
+       WRITE ( 14 )  generator_speed_f_old
+
+       CALL wrd_write_string( 'generator_speed_old' )
+       WRITE ( 14 )  generator_speed_old
+
+       CALL wrd_write_string( 'rotor_speed' )
+       WRITE ( 14 )  rotor_speed
+
+       CALL wrd_write_string( 'yaw_angle' )
+       WRITE ( 14 )  yaw_angle
+
+       CALL wrd_write_string( 'pitch_angle' )
+       WRITE ( 14 )  pitch_angle
+
+       CALL wrd_write_string( 'pitch_angle_old' )
+       WRITE ( 14 )  pitch_angle_old
 
        CALL wrd_write_string( 'torque_gen' )
@@ -609,20 +613,20 @@
     SELECT CASE ( restart_string(1:length) )
 
-       CASE ( 'omega_gen' )
-          READ ( 13 )  omega_gen
-       CASE ( 'omega_gen_f' )
-          READ ( 13 )  omega_gen_f
-       CASE ( 'omega_gen_f_old' )
-          READ ( 13 )  omega_gen_f_old
-       CASE ( 'omega_gen_old' )
-          READ ( 13 )  omega_gen_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 ( 'generator_speed' )
+          READ ( 13 )  generator_speed
+       CASE ( 'generator_speed_f' )
+          READ ( 13 )  generator_speed_f
+       CASE ( 'generator_speed_f_old' )
+          READ ( 13 )  generator_speed_f_old
+       CASE ( 'generator_speed_old' )
+          READ ( 13 )  generator_speed_old
+       CASE ( 'rotor_speed' )
+          READ ( 13 )  rotor_speed
+       CASE ( 'yaw_angle' )
+          READ ( 13 )  yaw_angle
+       CASE ( 'pitch_angle' )
+          READ ( 13 )  pitch_angle
+       CASE ( 'pitch_angle_old' )
+          READ ( 13 )  pitch_angle_old
        CASE ( 'torque_gen' )
           READ ( 13 )  torque_gen
@@ -656,6 +660,6 @@
           ENDIF
 
-          IF ( ANY( omega_rot(1:nturbines) < 0.0 ) )  THEN
-             message_string = 'omega_rot < 0.0, Please set omega_rot to '     // &
+          IF ( ANY( rotor_speed(1:n_turbines) < 0.0 ) )  THEN
+             message_string = 'rotor_speed < 0.0, Please set rotor_speed to '     // &
                                'a value equal or larger than zero'
              CALL message( 'wtm_check_parameters', 'PA0462', 1, 2, 0, 6, 0 )
@@ -663,9 +667,9 @@
 
 
-          IF ( ANY( rcx(1:nturbines) == 9999999.9_wp ) .OR.                       &
-                ANY( rcy(1:nturbines) == 9999999.9_wp ) .OR.                       &
-                ANY( rcz(1:nturbines) == 9999999.9_wp ) )  THEN
+          IF ( ANY( hub_x(1:n_turbines) == 9999999.9_wp ) .OR.                   &
+                ANY( hub_y(1:n_turbines) == 9999999.9_wp ) .OR.                  &
+                ANY( hub_z(1:n_turbines) == 9999999.9_wp ) )  THEN
              
-             message_string = 'rcx, rcy, rcz '                                 // &
+             message_string = 'hub_x, hub_y, hub_z '                          // &
                                'have to be given for each turbine.'          
              CALL message( 'wtm_check_parameters', 'PA0463', 1, 2, 0, 6, 0 )          
@@ -707,46 +711,46 @@
 !
 !--       Input of all wtm parameters
-          IF ( check_existence( vars_pids, 'dtow' ) )  THEN
-             CALL get_variable( pids_id, 'dtow', dtow(1:nturbines))
+          IF ( check_existence( vars_pids, 'tower_diameter' ) )  THEN
+             CALL get_variable( pids_id, 'tower_diameter', tower_diameter(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'omega_rot' ) )  THEN
-             CALL get_variable( pids_id, 'omega_rot', omega_rot(1:nturbines))
+          IF ( check_existence( vars_pids, 'rotor_speed' ) )  THEN
+             CALL get_variable( pids_id, 'rotor_speed', rotor_speed(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'pitch_add' ) )  THEN
-             CALL get_variable( pids_id, 'pitch_add', pitch_add(1:nturbines))
+          IF ( check_existence( vars_pids, 'pitch_angle' ) )  THEN
+             CALL get_variable( pids_id, 'pitch_angle', pitch_angle(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'phi_yaw' ) )  THEN
-             CALL get_variable( pids_id, 'phi_yaw', phi_yaw(1:nturbines))
+          IF ( check_existence( vars_pids, 'yaw_angle' ) )  THEN
+             CALL get_variable( pids_id, 'yaw_angle', yaw_angle(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'rcx' ) )  THEN
-             CALL get_variable( pids_id, 'rcx', rcx(1:nturbines))
+          IF ( check_existence( vars_pids, 'hub_x' ) )  THEN
+             CALL get_variable( pids_id, 'hub_x', hub_x(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'rcy' ) )  THEN
-             CALL get_variable( pids_id, 'rcy', rcy(1:nturbines))
+          IF ( check_existence( vars_pids, 'hub_y' ) )  THEN
+             CALL get_variable( pids_id, 'hub_y', hub_y(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'rcz' ) )  THEN
-             CALL get_variable( pids_id, 'rcz', rcz(1:nturbines))
+          IF ( check_existence( vars_pids, 'hub_z' ) )  THEN
+             CALL get_variable( pids_id, 'hub_z', hub_z(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'rnac' ) )  THEN
-             CALL get_variable( pids_id, 'rnac', rnac(1:nturbines))
+          IF ( check_existence( vars_pids, 'nacelle_radius' ) )  THEN
+             CALL get_variable( pids_id, 'nacelle_radius', nacelle_radius(1:n_turbines))
           ENDIF
 
-          IF ( check_existence( vars_pids, 'rr' ) )  THEN
-             CALL get_variable( pids_id, 'rr', rr(1:nturbines))
+          IF ( check_existence( vars_pids, 'rotor_radius' ) )  THEN
+             CALL get_variable( pids_id, 'rotor_radius', rotor_radius(1:n_turbines))
           ENDIF
 ! 
-!           IF ( check_existence( vars_pids, 'turb_cd_nacelle' ) )  THEN
-!              CALL get_variable( pids_id, 'turb_cd_nacelle', turb_cd_nacelle(1:nturbines))
+!           IF ( check_existence( vars_pids, 'nacelle_cd' ) )  THEN
+!              CALL get_variable( pids_id, 'nacelle_cd', nacelle_cd(1:n_turbines))
 !           ENDIF
 
-          IF ( check_existence( vars_pids, 'turb_cd_tower' ) )  THEN
-             CALL get_variable( pids_id, 'turb_cd_tower', turb_cd_tower(1:nturbines))
+          IF ( check_existence( vars_pids, 'tower_cd' ) )  THEN
+             CALL get_variable( pids_id, 'tower_cd', tower_cd(1:n_turbines))
           ENDIF
 !
@@ -761,6 +765,6 @@
 !--    the maximum possible numbers of rings and segments have to be calculated:
 
-       ALLOCATE( nrings(1:nturbines) )
-       ALLOCATE( delta_r(1:nturbines) )
+       ALLOCATE( nrings(1:n_turbines) )
+       ALLOCATE( delta_r(1:n_turbines) )
 
        nrings(:)  = 0
@@ -769,14 +773,14 @@
 !
 !--    Thickness (radial) of each ring and length (tangential) of each segment:
-       delta_r_factor = segment_width
-       delta_t_factor = segment_length
+       delta_r_factor = segment_width_radial
+       delta_t_factor = segment_length_tangential
        delta_r_init   = delta_r_factor * MIN( dx, dy, dz(1))
 
-       DO inot = 1, nturbines
+       DO inot = 1, n_turbines
 !
 !--       Determine number of rings:
-          nrings(inot) = NINT( rr(inot) / delta_r_init )
-
-          delta_r(inot) = rr(inot) / nrings(inot)
+          nrings(inot) = NINT( rotor_radius(inot) / delta_r_init )
+
+          delta_r(inot) = rotor_radius(inot) / nrings(inot)
 
        ENDDO
@@ -784,6 +788,6 @@
        nrings_max = MAXVAL(nrings)
 
-       ALLOCATE( nsegs(1:nrings_max,1:nturbines) )
-       ALLOCATE( nsegs_total(1:nturbines) )
+       ALLOCATE( nsegs(1:nrings_max,1:n_turbines) )
+       ALLOCATE( nsegs_total(1:n_turbines) )
 
        nsegs(:,:)     = 0
@@ -791,5 +795,5 @@
 
 
-       DO inot = 1, nturbines
+       DO inot = 1, n_turbines
           DO ring = 1, nrings(inot)
 !
@@ -824,21 +828,21 @@
 !
 !--    Allocate 1D arrays (dimension = number of turbines)
-       ALLOCATE( i_hub(1:nturbines) )
-       ALLOCATE( i_smear(1:nturbines) )
-       ALLOCATE( j_hub(1:nturbines) )
-       ALLOCATE( j_smear(1:nturbines) )
-       ALLOCATE( k_hub(1:nturbines) )
-       ALLOCATE( k_smear(1:nturbines) )
-       ALLOCATE( torque_total(1:nturbines) )
-       ALLOCATE( thrust_rotor(1:nturbines) )
+       ALLOCATE( i_hub(1:n_turbines) )
+       ALLOCATE( i_smear(1:n_turbines) )
+       ALLOCATE( j_hub(1:n_turbines) )
+       ALLOCATE( j_smear(1:n_turbines) )
+       ALLOCATE( k_hub(1:n_turbines) )
+       ALLOCATE( k_smear(1:n_turbines) )
+       ALLOCATE( torque_total(1:n_turbines) )
+       ALLOCATE( thrust_rotor(1:n_turbines) )
 
 !
 !--    Allocation of the 1D arrays for yaw control
-       ALLOCATE( yawdir(1:nturbines) )
-       ALLOCATE( u_inflow(1:nturbines) )
-       ALLOCATE( wdir(1:nturbines) )
-       ALLOCATE( u_inflow_l(1:nturbines) )
-       ALLOCATE( wdir_l(1:nturbines) )
-       ALLOCATE( phi_yaw_l(1:nturbines) )
+       ALLOCATE( yawdir(1:n_turbines) )
+       ALLOCATE( u_inflow(1:n_turbines) )
+       ALLOCATE( wdir(1:n_turbines) )
+       ALLOCATE( u_inflow_l(1:n_turbines) )
+       ALLOCATE( wdir_l(1:n_turbines) )
+       ALLOCATE( yaw_angle_l(1:n_turbines) )
        
 !
@@ -866,7 +870,7 @@
 !
 !--    Allocate additional 2D arrays
-       ALLOCATE( rotx(1:nturbines,1:3) )
-       ALLOCATE( roty(1:nturbines,1:3) )
-       ALLOCATE( rotz(1:nturbines,1:3) )
+       ALLOCATE( rotx(1:n_turbines,1:3) )
+       ALLOCATE( roty(1:n_turbines,1:3) )
+       ALLOCATE( rotz(1:n_turbines,1:3) )
 
 !
@@ -883,10 +887,10 @@
 !
 !--    Allocate additional 3D arrays
-       ALLOCATE( u_int(1:nturbines,1:nrings_max,1:nsegs_max) )
-       ALLOCATE( u_int_1_l(1:nturbines,1:nrings_max,1:nsegs_max) )
-       ALLOCATE( v_int(1:nturbines,1:nrings_max,1:nsegs_max) )
-       ALLOCATE( v_int_1_l(1:nturbines,1:nrings_max,1:nsegs_max) )
-       ALLOCATE( w_int(1:nturbines,1:nrings_max,1:nsegs_max) )
-       ALLOCATE( w_int_1_l(1:nturbines,1:nrings_max,1:nsegs_max) )
+       ALLOCATE( u_int(1:n_turbines,1:nrings_max,1:nsegs_max) )
+       ALLOCATE( u_int_1_l(1:n_turbines,1:nrings_max,1:nsegs_max) )
+       ALLOCATE( v_int(1:n_turbines,1:nrings_max,1:nsegs_max) )
+       ALLOCATE( v_int_1_l(1:n_turbines,1:nrings_max,1:nsegs_max) )
+       ALLOCATE( w_int(1:n_turbines,1:nrings_max,1:nsegs_max) )
+       ALLOCATE( w_int_1_l(1:n_turbines,1:nrings_max,1:nsegs_max) )
 
 !
@@ -903,9 +907,9 @@
 
        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
+          generator_speed(:)             = 0.0_wp
+          generator_speed_old(:)         = 0.0_wp
+          generator_speed_f(:)           = 0.0_wp
+          generator_speed_f_old(:)       = 0.0_wp
+          pitch_angle_old(:)         = 0.0_wp
           torque_gen(:)            = 0.0_wp
           torque_gen_old(:)        = 0.0_wp
@@ -917,5 +921,5 @@
        u_inflow(:)              = 0.0_wp
        u_inflow_l(:)            = 0.0_wp
-       phi_yaw_l(:)             = 0.0_wp
+       yaw_angle_l(:)           = 0.0_wp
 
 !
@@ -1001,8 +1005,8 @@
        IF ( debug_output )  CALL debug_message( 'wtm_init', 'start' )
        
-       ALLOCATE( index_nacb(1:nturbines) )
-       ALLOCATE( index_nacl(1:nturbines) )
-       ALLOCATE( index_nacr(1:nturbines) )
-       ALLOCATE( index_nact(1:nturbines) )
+       ALLOCATE( index_nacb(1:n_turbines) )
+       ALLOCATE( index_nacl(1:n_turbines) )
+       ALLOCATE( index_nacr(1:n_turbines) )
+       ALLOCATE( index_nact(1:n_turbines) )
 
 !
@@ -1030,11 +1034,11 @@
 !--    the area where the wtm is active. ABS (...) is required because the 
 !--    default value of dz_stretch_level_start is -9999999.9_wp (negative). 
-       IF ( ABS( dz_stretch_level_start(1) ) <= MAXVAL(rcz(1:nturbines)) +     &
-                                                MAXVAL(rr(1:nturbines)) +      &
+       IF ( ABS( dz_stretch_level_start(1) ) <= MAXVAL(hub_z(1:n_turbines)) +  &
+                                                MAXVAL(rotor_radius(1:n_turbines)) +     &
                                                 eps_min)  THEN
           WRITE( message_string, * ) 'The lowest level where vertical ',       &
                                      'stretching is applied &have to be ',     &
-                                     'greater than ',MAXVAL(rcz(1:nturbines)) +&
-                                      MAXVAL(rr(1:nturbines)) + eps_min
+                                     'greater than ',MAXVAL(hub_z(1:n_turbines)) &
+                                      + MAXVAL(rotor_radius(1:n_turbines)) + eps_min
           CALL message( 'wtm_init', 'PA0484', 1, 2, 0, 6, 0 )
        ENDIF 
@@ -1052,14 +1056,14 @@
        
 !--    Change tilt angle to rad:
-       tilt = tilt * pi / 180.0_wp
+       tilt_angle = tilt_angle * pi / 180.0_wp
       
 !
 !--    Change yaw angle to rad:
        IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN
-          phi_yaw(:) = phi_yaw(:) * pi / 180.0_wp
+          yaw_angle(:) = yaw_angle(:) * pi / 180.0_wp
        ENDIF
 
 
-       DO inot = 1, nturbines
+       DO inot = 1, n_turbines
 !
 !--       Rotate the rotor coordinates in case yaw and tilt are defined
@@ -1068,7 +1072,7 @@
 !
 !--       Determine the indices of the hub height
-          i_hub(inot) = INT(   rcx(inot)                 / dx )
-          j_hub(inot) = INT( ( rcy(inot) + 0.5_wp * dy ) / dy )
-          k_hub(inot) = INT( ( rcz(inot) + 0.5_wp * dz(1) ) / dz(1) )
+          i_hub(inot) = INT(   hub_x(inot)                 / dx )
+          j_hub(inot) = INT( ( hub_y(inot) + 0.5_wp * dy ) / dy )
+          k_hub(inot) = INT( ( hub_z(inot) + 0.5_wp * dz(1) ) / dz(1) )
 
 !
@@ -1077,7 +1081,7 @@
 !--       eps_min, the smearing area can be further limited and regarded as a
 !--       function of eps_min:
-          i_smear(inot) = CEILING( ( rr(inot) + eps_min ) / dx )
-          j_smear(inot) = CEILING( ( rr(inot) + eps_min ) / dy )
-          k_smear(inot) = CEILING( ( rr(inot) + eps_min ) / dz(1) )
+          i_smear(inot) = CEILING( ( rotor_radius(inot) + eps_min ) / dx )
+          j_smear(inot) = CEILING( ( rotor_radius(inot) + eps_min ) / dy )
+          k_smear(inot) = CEILING( ( rotor_radius(inot) + eps_min ) / dz(1) )
        
        ENDDO
@@ -1085,5 +1089,5 @@
 !
 !--    Call the wtm_init_speed_control subroutine and calculate the local 
-!--    omega_rot for the respective processor.
+!--    rotor_speed for the respective processor.
        IF ( speed_control)  THEN
        
@@ -1092,28 +1096,28 @@
           IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN
 
-             DO inot = 1, nturbines
+             DO inot = 1, n_turbines
 
                 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
+                   generator_speed_f(inot) = 0.0_wp
+                   rotor_speed_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
+                   generator_speed_f(inot) = 0.0_wp
+                   rotor_speed_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
+                   generator_speed_f(inot) = 0.0_wp
+                   rotor_speed_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
+                   generator_speed_f(inot) = 0.0_wp
+                   rotor_speed_l(inot) = 0.0_wp
                 ENDIF
 
@@ -1121,5 +1125,5 @@
                    IF ( ( nys <= j_hub(inot) ) .AND. ( nyn >= j_hub(inot) ) ) THEN
 
-                      omega_rot_l(inot) = omega_gen(inot) / gear_ratio
+                      rotor_speed_l(inot) = generator_speed(inot) / gear_ratio
 
                    ENDIF
@@ -1151,5 +1155,5 @@
 
        
-       DO inot = 1, nturbines                     ! loop over number of turbines
+       DO inot = 1, n_turbines                     ! loop over number of turbines
 !
 !--       Determine the grid index (u-grid) that corresponds to the location of
@@ -1161,6 +1165,6 @@
 !--       Determine the left and the right edge of the nacelle (corresponding
 !--       grid point indices):
-          index_nacl(inot) = INT( ( rcy(inot) - rnac(inot) + 0.5_wp * dy ) / dy )
-          index_nacr(inot) = INT( ( rcy(inot) + rnac(inot) + 0.5_wp * dy ) / dy )
+          index_nacl(inot) = INT( ( hub_y(inot) - nacelle_radius(inot) + 0.5_wp * dy ) / dy )
+          index_nacr(inot) = INT( ( hub_y(inot) + nacelle_radius(inot) + 0.5_wp * dy ) / dy )
 !
 !--       Determine the bottom and the top edge of the nacelle (corresponding
@@ -1169,12 +1173,12 @@
 !--       surface. All points between z=0 and z=dz/s would already be contained
 !--       in grid box 1.
-          index_nacb(inot) = INT( ( rcz(inot) - rnac(inot) ) / dz(1) ) + 1
-          index_nact(inot) = INT( ( rcz(inot) + rnac(inot) ) / dz(1) ) + 1
+          index_nacb(inot) = INT( ( hub_z(inot) - nacelle_radius(inot) ) / dz(1) ) + 1
+          index_nact(inot) = INT( ( hub_z(inot) + nacelle_radius(inot) ) / dz(1) ) + 1
 
 !
 !--       Determine the indices of the grid boxes containing the left and 
 !--       the right boundaries of the tower:
-          tower_n = ( rcy(inot) + 0.5_wp * dtow(inot) - 0.5_wp * dy ) / dy
-          tower_s = ( rcy(inot) - 0.5_wp * dtow(inot) - 0.5_wp * dy ) / dy
+          tower_n = ( hub_y(inot) + 0.5_wp * tower_diameter(inot) - 0.5_wp * dy ) / dy
+          tower_s = ( hub_y(inot) - 0.5_wp * tower_diameter(inot) - 0.5_wp * dy ) / dy
 
 !
@@ -1195,29 +1199,29 @@
 !--                      leftmost and rightmost grid box:
                             IF ( j == tower_s )  THEN
-                               tow_cd_surf(k,j,i) = ( rcz(inot) -              &
+                               tow_cd_surf(k,j,i) = ( hub_z(inot) -              &
                                     ( k_hub(inot) * dz(1) - 0.5_wp * dz(1) ) )*& ! extension in z-direction
                                   ( ( tower_s + 1.0_wp + 0.5_wp ) * dy    -    &
-                                    ( rcy(inot) - 0.5_wp * dtow(inot) ) ) *    & ! extension in y-direction
-                                  turb_cd_tower(inot)
+                                    ( hub_y(inot) - 0.5_wp * tower_diameter(inot) ) ) *    & ! extension in y-direction
+                                  tower_cd(inot)
                             ELSEIF ( j == tower_n )  THEN
-                               tow_cd_surf(k,j,i) = ( rcz(inot)            -   &
+                               tow_cd_surf(k,j,i) = ( hub_z(inot)            -   &
                                     ( k_hub(inot) * dz(1) - 0.5_wp * dz(1) ) )*& ! extension in z-direction
-                                  ( ( rcy(inot) + 0.5_wp * dtow(inot) )   -    &
+                                  ( ( hub_y(inot) + 0.5_wp * tower_diameter(inot) )   -    &
                                     ( tower_n + 0.5_wp ) * dy )           *    & ! extension in y-direction
-                                  turb_cd_tower(inot)
+                                  tower_cd(inot)
 !
 !--                         grid boxes inbetween
 !--                         (where tow_cd_surf = grid box area):
                             ELSE
-                               tow_cd_surf(k,j,i) = ( rcz(inot) -              &
+                               tow_cd_surf(k,j,i) = ( hub_z(inot) -              &
                                     ( k_hub(inot) * dz(1) - 0.5_wp * dz(1) ) )*&
-                                    dy * turb_cd_tower(inot)
+                                    dy * tower_cd(inot)
                             ENDIF
 !
 !--                      tower lies completely within one grid box:
                          ELSE
-                            tow_cd_surf(k,j,i) = ( rcz(inot) - ( k_hub(inot) * &
+                            tow_cd_surf(k,j,i) = ( hub_z(inot) - ( k_hub(inot) * &
                                        dz(1) - 0.5_wp * dz(1) ) ) *            &
-                                       dtow(inot) * turb_cd_tower(inot)
+                                       tower_diameter(inot) * tower_cd(inot)
                          ENDIF
 !
@@ -1232,11 +1236,11 @@
                                tow_cd_surf(k,j,i) = dz(1) * (                  &
                                       ( tower_s + 1 + 0.5_wp ) * dy         -  &
-                                      ( rcy(inot) - 0.5_wp * dtow(inot) )      &
-                                                        ) * turb_cd_tower(inot)
+                                      ( hub_y(inot) - 0.5_wp * tower_diameter(inot) )      &
+                                                        ) * tower_cd(inot)
                             ELSEIF ( j == tower_n )  THEN
                                tow_cd_surf(k,j,i) = dz(1) * (                  &
-                                      ( rcy(inot) + 0.5_wp * dtow(inot) )   -  &
+                                      ( hub_y(inot) + 0.5_wp * tower_diameter(inot) )   -  &
                                       ( tower_n + 0.5_wp ) * dy                &
-                                                         ) * turb_cd_tower(inot)
+                                                         ) * tower_cd(inot)
 !
 !--                         grid boxes inbetween
@@ -1244,11 +1248,11 @@
                             ELSE
                                tow_cd_surf(k,j,i) = dz(1) * dy *               &
-                                                    turb_cd_tower(inot)
+                                                    tower_cd(inot)
                             ENDIF
 !
 !--                         tower lies completely within one grid box:
                          ELSE
-                            tow_cd_surf(k,j,i) = dz(1) * dtow(inot) *          &
-                                                turb_cd_tower(inot)
+                            tow_cd_surf(k,j,i) = dz(1) * tower_diameter(inot) *          &
+                                                tower_cd(inot)
                          ENDIF ! end if larger than grid box
 
@@ -1279,12 +1283,12 @@
 !          DO  i_ip = 1, upper_end
 !             yvalue   = dy_int * ( i_ip - 0.5_wp ) + 0.5_wp * dy           !<--- segmentation fault
-!             sqrt_arg = rnac(inot)**2 - ( yvalue - rcy(inot) )**2          !<--- segmentation fault
+!             sqrt_arg = nacelle_radius(inot)**2 - ( yvalue - hub_y(inot) )**2          !<--- segmentation fault
 !             IF ( sqrt_arg >= 0.0_wp )  THEN
 !!
 !!--             bottom intersection point
-!                circle_points(1,i_ip) = rcz(inot) - SQRT( sqrt_arg )
+!                circle_points(1,i_ip) = hub_z(inot) - SQRT( sqrt_arg )
 !!
 !!--             top intersection point
-!                circle_points(2,i_ip) = rcz(inot) + SQRT( sqrt_arg )       !<--- segmentation fault
+!                circle_points(2,i_ip) = hub_z(inot) + SQRT( sqrt_arg )       !<--- segmentation fault
 !             ELSE
 !                circle_points(:,i_ip) = -111111                            !<--- segmentation fault
@@ -1338,5 +1342,5 @@
 !                         IF ( ( nxlg <= i ) .AND. ( nxrg >= i ) ) THEN
 !                            nac_cd_surf(k,j,i) = nac_cd_surf(k,j,i) +        &  !<--- segmentation fault
-!                                                  dy_int * dz_int * turb_cd_nacelle(inot)
+!                                                  dy_int * dz_int * nacelle_cd(inot)
 !                         ENDIF   
 !                      ENDDO
@@ -1382,6 +1386,6 @@
 !
 !--    Define dimensions in output file
-       ALLOCATE( ndim(1:nturbines) )
-       DO  n = 1, nturbines
+       ALLOCATE( ndim(1:n_turbines) )
+       DO  n = 1, n_turbines
           ndim(n) = n
        ENDDO
@@ -1389,5 +1393,5 @@
                                    dimension_name = 'turbine',                 &
                                    output_type = 'int32',                      &
-                                   bounds = (/1_iwp, nturbines/),              &
+                                   bounds = (/1_iwp, n_turbines/),             &
                                    values_int32 = ndim )
        DEALLOCATE( ndim )
@@ -1649,5 +1653,5 @@
        REAL(wp), DIMENSION(:,:), ALLOCATABLE  :: turb_cl_table      !<
                                           
-       ALLOCATE ( read_cl_cd(1:2*nairfoils+1) )
+       ALLOCATE ( read_cl_cd(1:2*n_airfoils+1) )
 
 !
@@ -1718,6 +1722,6 @@
        ENDDO rloop2 
 
-       ALLOCATE( alpha_attack_tab(1:dlen), turb_cl_table(1:dlen,1:nairfoils),  &
-                 turb_cd_table(1:dlen,1:nairfoils) )
+       ALLOCATE( alpha_attack_tab(1:dlen), turb_cl_table(1:dlen,1:n_airfoils), &
+                 turb_cd_table(1:dlen,1:n_airfoils) )
 
        DO jj = 1,dlen+1
@@ -1728,5 +1732,5 @@
           READ ( 90, * ) read_cl_cd
           alpha_attack_tab(jj) = read_cl_cd(1)
-          DO ii= 1, nairfoils
+          DO ii= 1, n_airfoils
              turb_cl_table(jj,ii) = read_cl_cd(ii*2)
              turb_cd_table(jj,ii) = read_cl_cd(ii*2+1)
@@ -1740,5 +1744,5 @@
 
 !
-!--    For each possible radial position (resolution: 0.1 m --> 631 values if rr(1)=63m)
+!--    For each possible radial position (resolution: 0.1 m --> 631 values if rotor_radius(1)=63m)
 !--    and each possible angle of attack (resolution: 0.1 degrees --> 3601 values!)
 !--    determine the lift and drag coefficient by interpolating between the
@@ -1751,5 +1755,5 @@
        ALLOCATE( turb_cd_sel2(1:dlenbl) )
 
-       radres     = INT( rr(1) * 10.0_wp ) + 1_iwp
+       radres     = INT( rotor_radius(1) * 10.0_wp ) + 1_iwp
        dlenbl_int = INT( 360.0_wp / accu_cl_cd_tab ) + 1_iwp
 
@@ -1866,6 +1870,6 @@
 !--    Calculation of the rotation matrix for the application of the tilt to
 !--    the rotors
-       rot_eigen_rad(1) = SIN( phi_yaw(inot) )    ! x-component of the radial eigenvector
-       rot_eigen_rad(2) = COS( phi_yaw(inot) )    ! y-component of the radial eigenvector 
+       rot_eigen_rad(1) = SIN( yaw_angle(inot) )  ! x-component of the radial eigenvector
+       rot_eigen_rad(2) = COS( yaw_angle(inot) )  ! y-component of the radial eigenvector 
        rot_eigen_rad(3) = 0.0_wp                  ! z-component of the radial eigenvector
 
@@ -1874,6 +1878,6 @@
        rot_eigen_azi(3) = 1.0_wp                  ! z-component of the azimuth eigenvector
 
-       rot_eigen_nor(1) =  COS( phi_yaw(inot) )   ! x-component of the normal eigenvector
-       rot_eigen_nor(2) = -SIN( phi_yaw(inot) )   ! y-component of the normal eigenvector
+       rot_eigen_nor(1) =  COS( yaw_angle(inot) ) ! x-component of the normal eigenvector
+       rot_eigen_nor(2) = -SIN( yaw_angle(inot) ) ! y-component of the normal eigenvector
        rot_eigen_nor(3) = 0.0_wp                  ! z-component of the normal eigenvector
     
@@ -1883,27 +1887,27 @@
 
        rot_coord_trans(inot,1,1) = rot_eigen_rad(1)**2                   *     &
-                                   ( 1.0_wp - COS( tilt ) ) + COS( tilt ) 
+                                   ( 1.0_wp - COS( tilt_angle ) ) + COS( tilt_angle ) 
        rot_coord_trans(inot,1,2) = rot_eigen_rad(1) * rot_eigen_rad(2)   *     &
-                                   ( 1.0_wp - COS( tilt ) )              -     &
-                                   rot_eigen_rad(3) * SIN( tilt )
+                                   ( 1.0_wp - COS( tilt_angle ) )              -     &
+                                   rot_eigen_rad(3) * SIN( tilt_angle )
        rot_coord_trans(inot,1,3) = rot_eigen_rad(1) * rot_eigen_rad(3)   *     &
-                                   ( 1.0_wp - COS( tilt ) )              +     &
-                                   rot_eigen_rad(2) * SIN( tilt )
+                                   ( 1.0_wp - COS( tilt_angle ) )              +     &
+                                   rot_eigen_rad(2) * SIN( tilt_angle )
        rot_coord_trans(inot,2,1) = rot_eigen_rad(2) * rot_eigen_rad(1)   *     &
-                                   ( 1.0_wp - COS( tilt ) )              +     &
-                                   rot_eigen_rad(3) * SIN( tilt )
+                                   ( 1.0_wp - COS( tilt_angle ) )              +     &
+                                   rot_eigen_rad(3) * SIN( tilt_angle )
        rot_coord_trans(inot,2,2) = rot_eigen_rad(2)**2                   *     &
-                                   ( 1.0_wp - COS( tilt ) ) + COS( tilt ) 
+                                   ( 1.0_wp - COS( tilt_angle ) ) + COS( tilt_angle ) 
        rot_coord_trans(inot,2,3) = rot_eigen_rad(2) * rot_eigen_rad(3)   *     &
-                                   ( 1.0_wp - COS( tilt ) )              -     &
-                                   rot_eigen_rad(1) * SIN( tilt )
+                                   ( 1.0_wp - COS( tilt_angle ) )              -     &
+                                   rot_eigen_rad(1) * SIN( tilt_angle )
        rot_coord_trans(inot,3,1) = rot_eigen_rad(3) * rot_eigen_rad(1)   *     &
-                                   ( 1.0_wp - COS( tilt ) )              -     &
-                                   rot_eigen_rad(2) * SIN( tilt )
+                                   ( 1.0_wp - COS( tilt_angle ) )              -     &
+                                   rot_eigen_rad(2) * SIN( tilt_angle )
        rot_coord_trans(inot,3,2) = rot_eigen_rad(3) * rot_eigen_rad(2)   *     &
-                                   ( 1.0_wp - COS( tilt ) )              +     &
-                                   rot_eigen_rad(1) * SIN( tilt )
+                                   ( 1.0_wp - COS( tilt_angle ) )              +     &
+                                   rot_eigen_rad(1) * SIN( tilt_angle )
        rot_coord_trans(inot,3,3) = rot_eigen_rad(3)**2                   *     &
-                                   ( 1.0_wp - COS( tilt ) ) + COS( tilt )
+                                   ( 1.0_wp - COS( tilt_angle ) ) + COS( tilt_angle )
 
 !
@@ -1973,8 +1977,8 @@
 !
 !--       Loop over number of turbines:
-          DO inot = 1, nturbines
-
-             cos_yaw = COS(phi_yaw(inot))
-             sin_yaw = SIN(phi_yaw(inot))
+          DO inot = 1, n_turbines
+
+             cos_yaw = COS(yaw_angle(inot))
+             sin_yaw = SIN(yaw_angle(inot))
 !
 !--          Loop over rings of each turbine:
@@ -2016,7 +2020,7 @@
 !
 !--                Coordinates of the single segments (center points):
-                   rbx(ring,rseg) = rcx(inot) + cur_r * rote(1)
-                   rby(ring,rseg) = rcy(inot) + cur_r * rote(2)
-                   rbz(ring,rseg) = rcz(inot) + cur_r * rote(3)
+                   rbx(ring,rseg) = hub_x(inot) + cur_r * rote(1)
+                   rby(ring,rseg) = hub_y(inot) + cur_r * rote(2)
+                   rbz(ring,rseg) = hub_z(inot) + cur_r * rote(3)
 
 !--                !-----------------------------------------------------------!
@@ -2178,9 +2182,9 @@
 !--       Exchange between PEs (information required on each PE):
 #if defined( __parallel )
-          CALL MPI_ALLREDUCE( u_int_1_l, u_int, nturbines * MAXVAL(nrings) *   &
+          CALL MPI_ALLREDUCE( u_int_1_l, u_int, n_turbines * MAXVAL(nrings) *   &
                               MAXVAL(nsegs), MPI_REAL, MPI_SUM, comm2d, ierr )
-          CALL MPI_ALLREDUCE( v_int_1_l, v_int, nturbines * MAXVAL(nrings) *   &
+          CALL MPI_ALLREDUCE( v_int_1_l, v_int, n_turbines * MAXVAL(nrings) *   &
                               MAXVAL(nsegs), MPI_REAL, MPI_SUM, comm2d, ierr )
-          CALL MPI_ALLREDUCE( w_int_1_l, w_int, nturbines * MAXVAL(nrings) *   &
+          CALL MPI_ALLREDUCE( w_int_1_l, w_int, n_turbines * MAXVAL(nrings) *   &
                               MAXVAL(nsegs), MPI_REAL, MPI_SUM, comm2d, ierr )
 #else
@@ -2194,5 +2198,5 @@
 !--       Loop over number of turbines:
 
-          DO inot = 1, nturbines
+          DO inot = 1, n_turbines
 pit_loop: DO
 
@@ -2200,11 +2204,11 @@
                 torque_total(inot) = 0.0_wp
                 thrust_rotor(inot) = 0.0_wp
-                pitch_add(inot)    = pitch_add(inot) + 0.25_wp
-!                 IF ( myid == 0 ) PRINT*, 'Pitch', inot, pitch_add(inot)
+                pitch_angle(inot)    = pitch_angle(inot) + 0.25_wp
+!                 IF ( myid == 0 ) PRINT*, 'Pitch', inot, pitch_angle(inot)
              ELSE
-                cos_yaw = COS(phi_yaw(inot))
-                sin_yaw = SIN(phi_yaw(inot))
+                cos_yaw = COS(yaw_angle(inot))
+                sin_yaw = SIN(yaw_angle(inot))
                 IF ( pitch_control )  THEN
-                   pitch_add(inot) = MAX(pitch_add_old(inot) - pitch_rate *    &
+                   pitch_angle(inot) = MAX(pitch_angle_old(inot) - pitch_rate *    &
                                          dt_3d , 0.0_wp )
                 ENDIF
@@ -2261,9 +2265,9 @@
 !
 !--                Coordinates of the single segments (center points):
-                   rbx(ring,rseg) = rcx(inot) + cur_r * rote(1)
-
-                   rby(ring,rseg) = rcy(inot) + cur_r * rote(2)
-
-                   rbz(ring,rseg) = rcz(inot) + cur_r * rote(3)
+                   rbx(ring,rseg) = hub_x(inot) + cur_r * rote(1)
+
+                   rby(ring,rseg) = hub_y(inot) + cur_r * rote(2)
+
+                   rbz(ring,rseg) = hub_z(inot) + cur_r * rote(3)
 
 !
@@ -2296,5 +2300,5 @@
 
                    phi_rel(rseg) = ATAN2( u_rot ,                               &
-                                         ( omega_rot(inot) * cur_r -           &
+                                         ( rotor_speed(inot) * cur_r -          &
                                            vtheta(rseg) ) )
 
@@ -2337,5 +2341,5 @@
 !
 !--                Correct with collective pitch angle:
-                   alpha_attack(rseg) = alpha_attack(rseg) - pitch_add(inot)
+                   alpha_attack(rseg) = alpha_attack(rseg) - pitch_angle(inot)
 
 !
@@ -2343,5 +2347,5 @@
 !--                to the rotor:
                    vrel(rseg) = SQRT( u_rot**2 +                               &
-                                      ( omega_rot(inot) * cur_r -              &
+                                      ( rotor_speed(inot) * cur_r -            &
                                         vtheta(rseg) )**2 )
 
@@ -2393,5 +2397,5 @@
                                         ( (2.0_wp*pi) / 360.0_wp )
 
-                   IF ( tl_cor )  THEN
+                   IF ( tip_loss_correction )  THEN
                    
 !--                  Tip loss correction following Schito
@@ -2401,5 +2405,5 @@
 !--                  
                      tl_factor = ( 2.0 / pi ) *                                &
-                          ACOS( EXP( -1.0 * ( 3.0 * ( rr(inot) - cur_r ) /     &
+                          ACOS( EXP( -1.0 * ( 3.0 * ( rotor_radius(inot) - cur_r ) /     &
                           ( 2.0 * cur_r * abs( sin( phi_rel(rseg) ) ) ) ) ) )
                           
@@ -2476,13 +2480,13 @@
 !--             the force balance of the accelerating torque
 !--             and the torque of the rotating rotor and generator
-                om_rate = ( torque_total(inot) * air_dens * gear_eff -         &
-                            gear_ratio * torque_gen_old(inot) ) /              &
-                          ( inertia_rot +                                      & 
-                            gear_ratio * gear_ratio * inertia_gen ) * dt_3d
+                om_rate = ( torque_total(inot) * air_density * gear_efficiency - &
+                            gear_ratio * torque_gen_old(inot) ) /                &
+                          ( rotor_inertia +                                        & 
+                            gear_ratio * gear_ratio * generator_inertia ) * dt_3d
 
 !
 !--             The generator speed is given by the product of gear gear_ratio
 !--             and rotor speed
-                omega_gen(inot) = gear_ratio * ( omega_rot(inot) + om_rate )     
+                generator_speed(inot) = gear_ratio * ( rotor_speed(inot) + om_rate )     
              
              ENDIF
@@ -2495,7 +2499,7 @@
 !--             maximum pitch rate, then the pitch loop is repeated with a pitch
 !--             gain
-                IF ( (  omega_gen(inot)  > rated_genspeed   )  .AND.           &
-                     ( pitch_add(inot) < 25.0_wp ) .AND.                       &
-                     ( pitch_add(inot) < pitch_add_old(inot) +                 & 
+                IF ( (  generator_speed(inot)  > generator_speed_rated   )  .AND.    &
+                     ( pitch_angle(inot) < 25.0_wp ) .AND.                       &
+                     ( pitch_angle(inot) < pitch_angle_old(inot) +                 & 
                        pitch_rate * dt_3d  ) ) THEN 
                    pitch_sw = .TRUE.
@@ -2507,5 +2511,5 @@
 !
 !--             The current pitch is saved for the next time step
-                pitch_add_old(inot) = pitch_add(inot)
+                pitch_angle_old(inot) = pitch_angle(inot)
                 pitch_sw = .FALSE.
              ENDIF
@@ -2554,7 +2558,7 @@
 !--
 !--          Calculation of the boundaries:
-             i_smear(inot) = CEILING( ( rr(inot) * ABS( roty(inot,1) ) +       &
+             i_smear(inot) = CEILING( ( rotor_radius(inot) * ABS( roty(inot,1) ) +       &
                                         eps_min ) / dx )
-             j_smear(inot) = CEILING( ( rr(inot) * ABS( roty(inot,2) ) +       &
+             j_smear(inot) = CEILING( ( rotor_radius(inot) * ABS( roty(inot,2) ) +       &
                                         eps_min ) / dy )
 
@@ -2654,10 +2658,10 @@
              IF ( start_up )  THEN
                 WDLON = MAX( 1 , NINT( 30.0_wp / dt_3d ) )  ! 30s running mean array
-                ALLOCATE( wd30(1:nturbines,1:WDLON) )
+                ALLOCATE( wd30(1:n_turbines,1:WDLON) )
                 wd30 = 999.0_wp                  ! Set to dummy value
                 ALLOCATE( wd30_l(1:WDLON) )
                 
                 WDSHO = MAX( 1 , NINT( 2.0_wp / dt_3d ) )   ! 2s running mean array
-                ALLOCATE( wd2(1:nturbines,1:WDSHO) )
+                ALLOCATE( wd2(1:n_turbines,1:WDSHO) )
                 wd2 = 999.0_wp                   ! Set to dummy value
                 ALLOCATE( wd2_l(1:WDSHO) )
@@ -2669,5 +2673,5 @@
 !--
 !--          Loop over number of turbines:
-             DO inot = 1, nturbines
+             DO inot = 1, n_turbines
 !
 !--             Find processor at i_hub, j_hub             
@@ -2687,5 +2691,5 @@
                       CALL wtm_yawcontrol( inot )
 
-                      phi_yaw_l(inot) = phi_yaw(inot)
+                      yaw_angle_l(inot) = yaw_angle(inot)
                       
                    ENDIF
@@ -2697,18 +2701,18 @@
 !--          Transfer of information to the other cpus
 #if defined( __parallel )         
-             CALL MPI_ALLREDUCE( u_inflow_l, u_inflow, nturbines, MPI_REAL,    &
+             CALL MPI_ALLREDUCE( u_inflow_l, u_inflow, n_turbines, MPI_REAL,   &
                                  MPI_SUM, comm2d, ierr )
-             CALL MPI_ALLREDUCE( wdir_l, wdir, nturbines, MPI_REAL, MPI_SUM,   &
+             CALL MPI_ALLREDUCE( wdir_l, wdir, n_turbines, MPI_REAL, MPI_SUM,  &
                                  comm2d, ierr )
-             CALL MPI_ALLREDUCE( phi_yaw_l, phi_yaw, nturbines, MPI_REAL,      &
+             CALL MPI_ALLREDUCE( yaw_angle_l, yaw_angle, n_turbines, MPI_REAL, &
                                  MPI_SUM, comm2d, ierr )
 #else
              u_inflow = u_inflow_l
              wdir     = wdir_l
-             phi_yaw  = phi_yaw_l
+             yaw_angle  = yaw_angle_l
              
              
 #endif
-             DO inot = 1, nturbines
+             DO inot = 1, n_turbines
 !             
 !--             Update rotor orientation                
@@ -2722,17 +2726,17 @@
 !
 !--          Transfer of information to the other cpus
-!              CALL MPI_ALLREDUCE( omega_gen, omega_gen_old, nturbines,        &
+!              CALL MPI_ALLREDUCE( generator_speed, generator_speed_old, n_turbines,        &
 !                                  MPI_REAL,MPI_SUM, comm2d, ierr )
 #if defined( __parallel )    
-             CALL MPI_ALLREDUCE( torque_gen, torque_gen_old, nturbines,        &
+             CALL MPI_ALLREDUCE( torque_gen, torque_gen_old, n_turbines,                           &
                                  MPI_REAL, MPI_SUM, comm2d, ierr )
-             CALL MPI_ALLREDUCE( omega_rot_l, omega_rot, nturbines,            &
+             CALL MPI_ALLREDUCE( rotor_speed_l, rotor_speed, n_turbines,                           &
                                  MPI_REAL, MPI_SUM, comm2d, ierr )
-             CALL MPI_ALLREDUCE( omega_gen_f, omega_gen_f_old, nturbines,      &
+             CALL MPI_ALLREDUCE( generator_speed_f, generator_speed_f_old, n_turbines,             &
                                  MPI_REAL, MPI_SUM, comm2d, ierr )
 #else
              torque_gen_old  = torque_gen
-             omega_rot       = omega_rot_l
-             omega_gen_f_old = omega_gen_f
+             rotor_speed       = rotor_speed_l
+             generator_speed_f_old = generator_speed_f
 #endif
             
@@ -2742,5 +2746,5 @@
           
           
-          DO inot = 1, nturbines
+          DO inot = 1, n_turbines
 
 
@@ -2748,12 +2752,12 @@
              IF ( myid == 0 ) THEN
                 IF ( openfile_turb_mod(400+inot)%opened )  THEN
-                   WRITE ( 400+inot, 106 ) time_since_reference_point, omega_rot(inot),    &
-                             omega_gen(inot), torque_gen_old(inot),            &
-                             torque_total(inot), pitch_add(inot),              &
-                             torque_gen_old(inot)*omega_gen(inot)*gen_eff,     &
-                             torque_total(inot)*omega_rot(inot)*air_dens,      &
-                             thrust_rotor(inot),                               & 
-                             wdir(inot)*180.0_wp/pi,                           &
-                             (phi_yaw(inot))*180.0_wp/pi                   
+                   WRITE ( 400+inot, 106 ) time_since_reference_point, rotor_speed(inot),          &
+                             generator_speed(inot), torque_gen_old(inot),                          &
+                             torque_total(inot), pitch_angle(inot),                                &
+                             torque_gen_old(inot)*generator_speed(inot)*generator_efficiency,      &
+                             torque_total(inot)*rotor_speed(inot)*air_density,                     &
+                             thrust_rotor(inot),                                                   & 
+                             wdir(inot)*180.0_wp/pi,                                               &
+                             (yaw_angle(inot))*180.0_wp/pi                   
                              
                 ELSE
@@ -2764,12 +2768,12 @@
                                            turbine_id ), FORM='FORMATTED' )
                    WRITE ( 400+inot, 105 ) inot
-                   WRITE ( 400+inot, 106 ) time_since_reference_point, omega_rot(inot),    &
-                             omega_gen(inot), torque_gen_old(inot),            &
-                             torque_total(inot), pitch_add(inot),              &
-                             torque_gen_old(inot)*omega_gen(inot)*gen_eff,     &
-                             torque_total(inot)*omega_rot(inot)*air_dens,      &
-                             thrust_rotor(inot),                               & 
-                             wdir(inot)*180.0_wp/pi,                           &                   
-                             (phi_yaw(inot))*180.0_wp/pi
+                   WRITE ( 400+inot, 106 ) time_since_reference_point, rotor_speed(inot),          &
+                             generator_speed(inot), torque_gen_old(inot),                          &
+                             torque_total(inot), pitch_angle(inot),                                &
+                             torque_gen_old(inot)*generator_speed(inot)*generator_efficiency,      &
+                             torque_total(inot)*rotor_speed(inot)*air_density,                     &
+                             thrust_rotor(inot),                                                   &
+                             wdir(inot)*180.0_wp/pi,                                               &
+                             (yaw_angle(inot))*180.0_wp/pi
                 ENDIF
              ENDIF
@@ -2843,8 +2847,8 @@
           IF ( .NOT. ANY( wd30_l == 999.) ) THEN 
 
-             missal = SUM( wd30_l ) / SIZE( wd30_l ) - phi_yaw(inot)
-!
-!--          Check if turbine is missaligned by more than max_miss
-             IF ( ABS( missal ) > max_miss )  THEN
+             missal = SUM( wd30_l ) / SIZE( wd30_l ) - yaw_angle(inot)
+!
+!--          Check if turbine is missaligned by more than yaw_misalignment_max
+             IF ( ABS( missal ) > yaw_misalignment_max )  THEN
 !
 !--             Check in which direction to yaw          
@@ -2852,5 +2856,5 @@
 !
 !--             Start yawing of turbine
-                phi_yaw(inot) = phi_yaw(inot) + yawdir(inot) * yaw_speed * dt_3d
+                yaw_angle(inot) = yaw_angle(inot) + yawdir(inot) * yaw_speed * dt_3d
                 doyaw(inot) = .TRUE.
                 wd30_l = 999.  ! fill with dummies again
@@ -2863,5 +2867,5 @@
 !--    If turbine is already yawing:
 !--    Initialize 2 s running mean and yaw until the missalignment is smaller
-!--    than min_miss
+!--    than yaw_misalignment_min
 
        ELSE
@@ -2876,13 +2880,13 @@
 !
 !--          Calculate missalignment of turbine        
-             missal = SUM( wd2_l - phi_yaw(inot) ) / SIZE( wd2_l )
+             missal = SUM( wd2_l - yaw_angle(inot) ) / SIZE( wd2_l )
 !
 !--          Check if missalignment is still larger than 0.5 degree and if the
 !--          yaw direction is still right
-             IF ( ( ABS( missal ) > min_miss )  .AND.                          &
+             IF ( ( ABS( missal ) > yaw_misalignment_min )  .AND.              &
                   ( yawdir(inot) == SIGN( 1.0_wp, missal ) ) )  THEN
 !
 !--             Continue yawing        
-                phi_yaw(inot) = phi_yaw(inot) + yawdir(inot) * yaw_speed * dt_3d
+                yaw_angle(inot) = yaw_angle(inot) + yawdir(inot) * yaw_speed * dt_3d
              ELSE
 !
@@ -2894,5 +2898,5 @@
 !
 !--          Continue yawing
-             phi_yaw(inot) = phi_yaw(inot) + yawdir(inot) * yaw_speed * dt_3d
+             yaw_angle(inot) = yaw_angle(inot) + yawdir(inot) * yaw_speed * dt_3d
           ENDIF
       
@@ -2919,25 +2923,26 @@
 !
 !--    Calculate slope constant for region 15
-       slope15   = ( slope2 * min_reg2 * min_reg2 ) / ( min_reg2 - min_reg15 )
+       slope15         = ( region_2_slope * region_2_min * region_2_min ) /                        &
+                         ( region_2_min - region_15_min )
 !
 !--    Calculate upper limit of slipage region
-       vs_sysp   = rated_genspeed / 1.1_wp
+       vs_sysp         = generator_speed_rated / 1.1_wp
 !
 !--    Calculate slope of slipage region
-       slope25   = ( rated_power / rated_genspeed ) /                          &
-                   ( rated_genspeed - vs_sysp )
+       region_25_slope = ( generator_power_rated / generator_speed_rated ) /                       &
+                       ( generator_speed_rated - vs_sysp )
 !
 !--    Calculate lower limit of slipage region
-       min_reg25 = ( slope25 - SQRT( slope25 * ( slope25 - 4.0_wp *            &
-                                                 slope2 * vs_sysp ) ) ) /      &
-                   ( 2.0_wp * slope2 ) 
+       region_25_min   = ( region_25_slope - SQRT( region_25_slope *                               &
+                         ( region_25_slope - 4.0_wp * region_2_slope * vs_sysp ) ) ) /             &
+                         ( 2.0_wp * region_2_slope ) 
 !
 !--    Frequency for the simple low pass filter
-       Fcorner   = 0.25_wp
+       Fcorner       = 0.25_wp
 ! 
 !--    At the first timestep the torque is set to its maximum to prevent
 !--    an overspeeding of the rotor
        IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN
-          torque_gen_old(:) = max_torque_gen
+          torque_gen_old(:) = generator_torque_max
        ENDIF  
      
@@ -2968,27 +2973,27 @@
 !--    for the control of the generator torque       
        lp_coeff = EXP( -2.0_wp * 3.14_wp * dt_3d * Fcorner )
-       omega_gen_f(inot) = ( 1.0_wp - lp_coeff ) * omega_gen(inot) + lp_coeff *&
-                           omega_gen_f_old(inot)
-
-       IF ( omega_gen_f(inot) <= min_reg15 )  THEN
+       generator_speed_f(inot) = ( 1.0_wp - lp_coeff ) * generator_speed(inot) + lp_coeff *&
+                           generator_speed_f_old(inot)
+
+       IF ( generator_speed_f(inot) <= region_15_min )  THEN
 !                        
 !--       Region 1: Generator torque is set to zero to accelerate the rotor:
           torque_gen(inot) = 0
        
-       ELSEIF ( omega_gen_f(inot) <= min_reg2 )  THEN
+       ELSEIF ( generator_speed_f(inot) <= region_2_min )  THEN
 !                        
 !--       Region 1.5: Generator torque is increasing linearly with rotor speed:
-          torque_gen(inot) = slope15 * ( omega_gen_f(inot) - min_reg15 )
+          torque_gen(inot) = slope15 * ( generator_speed_f(inot) - region_15_min )
                          
-       ELSEIF ( omega_gen_f(inot) <= min_reg25 )  THEN
+       ELSEIF ( generator_speed_f(inot) <= region_25_min )  THEN
 !
 !--       Region 2: Generator torque is increased by the square of the generator
 !--                 speed to keep the TSR optimal:
-          torque_gen(inot) = slope2 * omega_gen_f(inot) * omega_gen_f(inot)
+          torque_gen(inot) = region_2_slope * generator_speed_f(inot) * generator_speed_f(inot)
        
-       ELSEIF ( omega_gen_f(inot) < rated_genspeed )  THEN
+       ELSEIF ( generator_speed_f(inot) < generator_speed_rated )  THEN
 !                        
 !--       Region 2.5: Slipage region between 2 and 3:
-          torque_gen(inot) = slope25 * ( omega_gen_f(inot) - vs_sysp )
+          torque_gen(inot) = region_25_slope * ( generator_speed_f(inot) - vs_sysp )
        
        ELSE
@@ -2996,5 +3001,5 @@
 !--       Region 3: Generator torque is antiproportional to the rotor speed to
 !--                 keep the power constant:
-          torque_gen(inot) = rated_power / omega_gen_f(inot)
+          torque_gen(inot) = generator_power_rated / generator_speed_f(inot)
        
        ENDIF
@@ -3002,12 +3007,13 @@
 !--    Calculate torque rate and confine with a max
        trq_rate = ( torque_gen(inot) - torque_gen_old(inot) ) / dt_3d
-       trq_rate = MIN( MAX( trq_rate, -1.0_wp * max_trq_rate ), max_trq_rate )
+       trq_rate = MIN( MAX( trq_rate, -1.0_wp * generator_torque_rate_max ), &
+                  generator_torque_rate_max )
 !                        
 !--    Calculate new gen torque and confine with max torque                         
        torque_gen(inot) = torque_gen_old(inot) + trq_rate * dt_3d
-       torque_gen(inot) = MIN( torque_gen(inot), max_torque_gen )                                             
+       torque_gen(inot) = MIN( torque_gen(inot), generator_torque_max )                                             
 !
 !--    Overwrite values for next timestep                        
-       omega_rot_l(inot) = omega_gen(inot) / gear_ratio
+       rotor_speed_l(inot) = generator_speed(inot) / gear_ratio
 
     
@@ -3194,6 +3200,6 @@
 !--       At the first call of this routine write the spatial coordinates.
           IF ( .NOT. initial_write_coordinates )  THEN
-             ALLOCATE ( output_values_1d_target(1:nturbines) )
-             output_values_1d_target = rcx(1:nturbines)
+             ALLOCATE ( output_values_1d_target(1:n_turbines) )
+             output_values_1d_target = hub_x(1:n_turbines)
              output_values_1d_pointer => output_values_1d_target      
              return_value = dom_write_var( nc_filename,                              &
@@ -3201,7 +3207,7 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1/),                        &
-                                        bounds_end   = (/nturbines/) )
-
-             output_values_1d_target = rcy(1:nturbines)
+                                        bounds_end   = (/n_turbines/) )
+
+             output_values_1d_target = hub_y(1:n_turbines)
              output_values_1d_pointer => output_values_1d_target      
              return_value = dom_write_var( nc_filename,                              &
@@ -3209,7 +3215,7 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1/),                        &
-                                        bounds_end   = (/nturbines/) )
-
-             output_values_1d_target = rcz(1:nturbines)
+                                        bounds_end   = (/n_turbines/) )
+
+             output_values_1d_target = hub_z(1:n_turbines)
              output_values_1d_pointer => output_values_1d_target      
              return_value = dom_write_var( nc_filename,                              &
@@ -3217,5 +3223,5 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1/),                        &
-                                        bounds_end   = (/nturbines/) )                                       
+                                        bounds_end   = (/n_turbines/) )                                       
                                         
              initial_write_coordinates = .TRUE.
@@ -3225,6 +3231,6 @@
           t_ind = t_ind + 1
           
-          ALLOCATE ( output_values_1d_target(1:nturbines) )
-          output_values_1d_target = omega_rot(:)
+          ALLOCATE ( output_values_1d_target(1:n_turbines) )
+          output_values_1d_target = rotor_speed(:)
           output_values_1d_pointer => output_values_1d_target
           
@@ -3233,7 +3239,7 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
-
-          output_values_1d_target = omega_gen(:)
+                                        bounds_end   = (/n_turbines, t_ind /) )
+
+          output_values_1d_target = generator_speed(:)
           output_values_1d_pointer => output_values_1d_target    
           return_value = dom_write_var( nc_filename,                                 &
@@ -3241,5 +3247,5 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
+                                        bounds_end   = (/n_turbines, t_ind /) )
 
           output_values_1d_target = torque_gen_old(:)
@@ -3250,5 +3256,5 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
+                                        bounds_end   = (/n_turbines, t_ind /) )
 
           output_values_1d_target = torque_total(:)
@@ -3259,7 +3265,7 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
-
-          output_values_1d_target = pitch_add(:)
+                                        bounds_end   = (/n_turbines, t_ind /) )
+
+          output_values_1d_target = pitch_angle(:)
           output_values_1d_pointer => output_values_1d_target    
 
@@ -3268,7 +3274,7 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
-
-          output_values_1d_target = torque_gen_old(:)*omega_gen(:)*gen_eff
+                                        bounds_end   = (/n_turbines, t_ind /) )
+
+          output_values_1d_target = torque_gen_old(:)*generator_speed(:)*generator_efficiency
           output_values_1d_pointer => output_values_1d_target    
     
@@ -3277,8 +3283,8 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
-
-          DO inot = 1, nturbines
-             output_values_1d_target(inot) = torque_total(inot)*omega_rot(inot)*air_dens
+                                        bounds_end   = (/n_turbines, t_ind /) )
+
+          DO inot = 1, n_turbines
+             output_values_1d_target(inot) = torque_total(inot)*rotor_speed(inot)*air_density
           ENDDO
           output_values_1d_pointer => output_values_1d_target    
@@ -3288,5 +3294,5 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
+                                        bounds_end   = (/n_turbines, t_ind /) )
 
           output_values_1d_target = thrust_rotor(:)
@@ -3297,5 +3303,5 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
+                                        bounds_end   = (/n_turbines, t_ind /) )
 
           output_values_1d_target = wdir(:)*180.0_wp/pi
@@ -3306,7 +3312,7 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
-
-          output_values_1d_target = (phi_yaw(:))*180.0_wp/pi
+                                        bounds_end   = (/n_turbines, t_ind /) )
+
+          output_values_1d_target = (yaw_angle(:))*180.0_wp/pi
           output_values_1d_pointer => output_values_1d_target    
 
@@ -3315,5 +3321,5 @@
                                         values_realwp_1d = output_values_1d_pointer, &
                                         bounds_start = (/1, t_ind/),                 &
-                                        bounds_end   = (/nturbines, t_ind /) )
+                                        bounds_end   = (/n_turbines, t_ind /) )
 
           output_values_0d_target = time_since_reference_point
@@ -3323,5 +3329,5 @@
                                         'time',                                      &
                                         values_realwp_0d = output_values_0d_pointer, &
-                                           bounds_start = (/t_ind/),                    &
+                                           bounds_start = (/t_ind/),                 &
                                      bounds_end   = (/t_ind/) )         
           
Index: /palm/trunk/TESTS/cases/wind_turbine_model/INPUT/wind_turbine_model_p3d
===================================================================
--- /palm/trunk/TESTS/cases/wind_turbine_model/INPUT/wind_turbine_model_p3d	(revision 4446)
+++ /palm/trunk/TESTS/cases/wind_turbine_model/INPUT/wind_turbine_model_p3d	(revision 4447)
@@ -38,26 +38,26 @@
          time_turbine_on  = 1.0,
 
-         nturbines = 4,
-         rcx =   300.0, 600.0, 300.0, 600.0,
-         rcy =   300.0, 300.0, 600.0, 600.0,
-         rcz =   480.0, 480.0, 480.0, 480.0,
-         rr  =    63.0, 63.0, 63.0, 63.0,
-         rnac =    1.5, 1.5, 1.5, 1.5,
-         dtow =    4.0, 4.0, 4.0, 4.0,
+         n_turbines = 4,
+         hub_x =   300.0, 600.0, 300.0, 600.0,
+         hub_y =   300.0, 300.0, 600.0, 600.0,
+         hub_z =   480.0, 480.0, 480.0, 480.0,
+         rotor_radius  =    63.0, 63.0, 63.0, 63.0,
+         nacelle_radius =    1.5, 1.5, 1.5, 1.5,
+         tower_diameter =    4.0, 4.0, 4.0, 4.0,
 
-         omega_rot = 0.9, 0.9, 0.9, 0.9,
-         phi_yaw = -20.0, 10.0, 0.0, 30.0,
-         tilt = 0.0,
-         rated_power = 5296610.0,
+         rotor_speed = 0.9, 0.9, 0.9, 0.9,
+         yaw_angle = -20.0, 10.0, 0.0, 30.0,
+         tilt_angle = 0.0,
+         generator_power_rated = 5296610.0,
          speed_control = .T.,
          pitch_control = .T.,
-         pitch_add = 0.0,
+         pitch_angle = 0.0,
          yaw_control = .T.,
          yaw_speed = 0.01,
     
-         turb_cd_tower   = 1.2, 1.2, 1.2, 1.2,
+         tower_cd   = 1.2, 1.2, 1.2, 1.2,
         
-         segment_length = 1.0,
-         segment_width  = 0.5,
+         segment_length_tangential = 1.0,
+         segment_width_radial  = 0.5,
         
-         nairfoils = 8, /
+         n_airfoils = 8, /
