Ignore:
Timestamp:
Jan 15, 2021 3:22:11 PM (3 years ago)
Author:
raasch
Message:

local namelist parameter added to switch off the module although the respective module namelist appears in the namelist file, further copyright updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/wind_turbine_model_mod.f90

    r4828 r4843  
    2121! Current revisions:
    2222! -----------------
    23 ! 
    24 ! 
     23!
     24!
    2525! Former revisions:
    2626! -----------------
    2727! $Id$
     28! reading of namelist file and actions in case of namelist errors revised so that statement labels
     29! and goto statements are not required any more,
     30! local namelist parameter added to switch off the module although the respective module namelist
     31! appears in the namelist file
     32!
     33! 4828 2021-01-05 11:21:41Z Giersch
    2834! reset n_turbines_max to 1E4 (10 000), because it was set to 1 000 in r4497 by mistake
    2935!
     
    530536    IMPLICIT NONE
    531537
    532     CHARACTER(LEN=80) ::  line  !< dummy string that contains the current line of the parameter file
    533 
    534     NAMELIST /wind_turbine_parameters/                                                             &
    535              air_density, tower_diameter, dt_data_output_wtm,                                      &
    536                 gear_efficiency, gear_ratio, generator_efficiency,                                 &
    537                 generator_inertia, rotor_inertia, yaw_misalignment_max,                            &
    538                 generator_torque_max, generator_torque_rate_max, yaw_misalignment_min,             &
    539                 region_15_min, region_2_min, n_airfoils, n_turbines,                               &
    540                 rotor_speed, yaw_angle, pitch_angle, pitch_control,                                &
    541                 generator_speed_rated, generator_power_rated, hub_x, hub_y, hub_z,                 &
    542                 nacelle_radius, rotor_radius, segment_length_tangential, segment_width_radial,     &
    543                 region_2_slope, speed_control, tilt_angle, time_turbine_on,                        &
    544                 smearing_kernel_size, tower_cd, pitch_rate,                                        &
    545                 yaw_control, yaw_speed, tip_loss_correction
    546 !                , nacelle_cd
    547 
    548 !
    549 !-- Try to find wind turbine model package:
    550     REWIND ( 11 )
    551     line = ' '
    552     DO WHILE ( INDEX ( line, '&wind_turbine_parameters' ) == 0 )
    553        READ ( 11, '(A)', END = 12 )  line
    554     ENDDO
    555     BACKSPACE ( 11 )
    556 
    557 !
    558 !-- Read user-defined namelist:
    559     READ ( 11, wind_turbine_parameters, ERR = 10, END = 12 )
    560 !
    561 !-- Set flag that indicates that the wind turbine model is switched on:
    562     wind_turbine = .TRUE.
    563 
    564     GOTO 12
    565 
    566  10 BACKSPACE ( 11 )
    567     READ ( 11, '(A)' ) line
    568     CALL parin_fail_message( 'wind_turbine_parameters', line )
    569 
    570  12 CONTINUE  ! TBD Change from continue, mit ierrn machen
     538    CHARACTER(LEN=100) ::  line  !< dummy string that contains the current line of the parameter file
     539
     540    INTEGER(iwp) ::  io_status   !< status after reading the namelist file
     541
     542    LOGICAL ::  switch_off_module = .FALSE.  !< local namelist parameter to switch off the module
     543                                             !< although the respective module namelist appears in
     544                                             !< the namelist file
     545
     546    NAMELIST /wind_turbine_parameters/  air_density,                                               &
     547                                        dt_data_output_wtm,                                        &
     548                                        gear_efficiency,                                           &
     549                                        gear_ratio,                                                &
     550                                        generator_efficiency,                                      &
     551                                        generator_inertia,                                         &
     552                                        generator_power_rated,                                     &
     553                                        generator_speed_rated,                                     &
     554                                        generator_torque_max,                                      &
     555                                        generator_torque_rate_max,                                 &
     556                                        hub_x,                                                     &
     557                                        hub_y,                                                     &
     558                                        hub_z,                                                     &
     559                                        nacelle_radius,                                            &
     560                                        n_airfoils,                                                &
     561                                        n_turbines,                                                &
     562                                        pitch_angle,                                               &
     563                                        pitch_control,                                             &
     564                                        pitch_rate,                                                &
     565                                        region_15_min,                                             &
     566                                        region_2_min,                                              &
     567                                        region_2_slope,                                            &
     568                                        rotor_inertia,                                             &
     569                                        rotor_radius,                                              &
     570                                        rotor_speed,                                               &
     571                                        segment_length_tangential,                                 &
     572                                        segment_width_radial,                                      &
     573                                        smearing_kernel_size,                                      &
     574                                        speed_control,                                             &
     575                                        switch_off_module,                                         &
     576                                        tilt_angle,                                                &
     577                                        time_turbine_on,                                           &
     578                                        tip_loss_correction,                                       &
     579                                        tower_cd,                                                  &
     580                                        tower_diameter,                                            &
     581                                        yaw_angle,                                                 &
     582                                        yaw_control,                                               &
     583                                        yaw_misalignment_max,                                      &
     584                                        yaw_misalignment_min,                                      &
     585                                        yaw_speed
     586
     587!
     588!-- Move to the beginning of the namelist file and try to find and read the namelist.
     589    REWIND( 11 )
     590    READ( 11, wind_turbine_parameters, IOSTAT=io_status )
     591
     592!
     593!-- Action depending on the READ status
     594    IF ( io_status == 0 )  THEN
     595!
     596!--    wind_turbine_parameters namelist was found and read correctly. Enable the
     597!--    wind turbine module.
     598       IF ( .NOT. switch_off_module )  wind_turbine = .TRUE.
     599
     600    ELSEIF ( io_status > 0 )  THEN
     601!
     602!--    wind_turbine_parameters namelist was found but contained errors. Print an error message
     603!--    including the line that caused the problem.
     604       BACKSPACE( 11 )
     605       READ( 11 , '(A)' ) line
     606       CALL parin_fail_message( 'wind_turbine_parameters', line )
     607
     608    ENDIF
    571609
    572610 END SUBROUTINE wtm_parin
Note: See TracChangeset for help on using the changeset viewer.