Index: palm/trunk/SOURCE/wind_turbine_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 4412)
+++ palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 4420)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! Added output control for wind turbine model
+! 
+! 4412 2020-02-19 14:53:13Z maronga
 ! Bugfix: corrected character length in dimension_names
 ! 
@@ -166,6 +169,8 @@
     
     LOGICAL ::  initial_write_coordinates = .FALSE. 
-
-    REAL(wp) ::  dt_wtm          = 1.0_wp
+    
+    REAL(wp) ::  dt_data_output_wtm = 1.0_wp       !< data output interval
+    REAL(wp) ::  time_wtm           = 0.0_wp       !< time since last data output
+    
     
     REAL(wp) ::  segment_length  = 1.0_wp          !< length of the segments, the rotor area is divided into
@@ -441,4 +446,9 @@
 
     PUBLIC                                                                     &
+           dt_data_output_wtm,                                                 &
+           time_wtm,                                                           &
+           wind_turbine
+
+    PUBLIC                                                                     &
            wtm_parin,                                                          &
            wtm_check_parameters,                                               &
@@ -467,5 +477,8 @@
        CHARACTER (LEN=80) ::  line  !< dummy string that contains the current line of the parameter file 
 
-       NAMELIST /wind_turbine_par/   air_dens, dtow, gear_eff, gear_ratio,     &
+                                  
+       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,      &
@@ -478,17 +491,4 @@
                                   yaw_control, yaw_speed, tl_cor
 !                                  , turb_cd_nacelle
-                                  
-       NAMELIST /wind_turbine_parameters/                                      &
-                                  air_dens, dtow, 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
 !
 !--    Try to find wind turbine model package
@@ -502,10 +502,10 @@
 !
 !--    Read user-defined namelist
-       READ ( 11, wind_turbine_parameters, ERR = 10 )
+       READ ( 11, wind_turbine_parameters, ERR = 10, END = 12 )
 !
 !--    Set flag that indicates that the wind turbine model is switched on
        wind_turbine = .TRUE.
        
-       GOTO 14
+       GOTO 12
 
  10    BACKSPACE( 11 )
@@ -513,33 +513,6 @@
        CALL parin_fail_message( 'wind_turbine_parameters', line )
 
-!
-!--    Try to find wind turbine model package
- 12    REWIND ( 11 )
-       line = ' '
-       DO WHILE ( INDEX( line, '&wind_turbine_par' ) == 0 )
-          READ ( 11, '(A)', END=14 )  line
-       ENDDO
-       BACKSPACE ( 11 )
-
-!
-!--    Read user-defined namelist
-       READ ( 11, wind_turbine_par, ERR = 13, END = 14 )
-      
-       message_string = 'namelist wind_tubrine_par is deprecated and will ' // &
-                        'be removed in near future. &Please use namelist ' //  &
-                        'wind_turbine_parameters instead' 
-       CALL message( 'wtm_parin', 'PA0487', 0, 1, 0, 6, 0 )     
-      
-!
-!--    Set flag that indicates that the wind turbine model is switched on
-       wind_turbine = .TRUE.
-
-       GOTO 14
-
- 13    BACKSPACE( 11 )
-       READ( 11 , '(A)') line
-       CALL parin_fail_message( 'wind_turbine_par', line )
-
- 14    CONTINUE   ! TBD Change from continue, mit ierrn machen
+
+ 12    CONTINUE   ! TBD Change from continue, mit ierrn machen
 
 
@@ -556,6 +529,6 @@
 
        IMPLICIT NONE
-
-       
+       
+
        CALL wrd_write_string( 'omega_gen' )
        WRITE ( 14 )  omega_gen
@@ -678,7 +651,12 @@
        ENDIF
 
+       IF ( dt_data_output_wtm <= 0.0 )  THEN
+          message_string = 'dt_data_output_wtm must be > 0.0'
+       CALL message( 'check_parameters', 'PA0709', 1, 2, 0, 6, 0 )
+    ENDIF
+       
  
     END SUBROUTINE wtm_check_parameters 
-    
+!     
                                         
 !------------------------------------------------------------------------------!
@@ -1323,5 +1301,5 @@
        ntimesteps = MIN( CEILING(                                                 &
                      ( end_time - MAX( time_turbine_on, time_since_reference_point )&
-                     ) / MAX( 0.1_wp, dt_wtm ) ), ntimesteps_max )
+                     ) / MAX( 0.1_wp, dt_data_output_wtm ) ), ntimesteps_max )
 
        
@@ -2730,8 +2708,4 @@
        ENDIF   
 
-
-!
-!--    NetCDF output, should be moved
-       CALL wtm_data_output
        
        CALL cpu_log( log_point_s(61), 'wtm_forces', 'stop' )
