Changeset 4434
- Timestamp:
- Mar 3, 2020 10:02:18 AM (5 years ago)
- Location:
- palm/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/.palm.iofiles
r4430 r4434 16 16 PIDS_UVEM inopt:tr d3#:d3r $base_data/$run_identifier/INPUT _uvlookup* 17 17 PIDS_VM inopt:tr d3#:d3r $base_data/$run_identifier/INPUT _vmeas* 18 PIDS_WTM inopt:tr d3#:d3r $base_data/$run_identifier/INPUT _wtmpar* 18 19 rrtmg_lw.nc inopt:tr d3#:d3r $base_data/$run_identifier/INPUT _rlw 19 20 rrtmg_sw.nc inopt:tr d3#:d3r $base_data/$run_identifier/INPUT _rsw -
palm/trunk/SOURCE/Makefile
r4420 r4434 1303 1303 cpulog_mod.o \ 1304 1304 data_output_module.o \ 1305 netcdf_data_input_mod.o \ 1305 1306 mod_kinds.o \ 1306 1307 modules.o -
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r4404 r4434 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added optional netcdf data input for wtm array input parameters 28 ! 29 ! 4404 2020-02-12 17:01:53Z suehring 27 30 ! Fix misplaced preprocessor directives. 28 31 ! … … 646 649 CHARACTER(LEN=100) :: input_file_uvem = 'PIDS_UVEM' !< Name of file which comprises static uv_exposure model input data 647 650 CHARACTER(LEN=100) :: input_file_vm = 'PIDS_VM' !< Name of file which comprises virtual measurement data 648 651 CHARACTER(LEN=100) :: input_file_wtm = 'PIDS_WTM' !< Name of file which comprises wind turbine model input data 652 649 653 CHARACTER(LEN=25), ALLOCATABLE, DIMENSION(:) :: string_values !< output of string variables read from netcdf input files 650 654 CHARACTER(LEN=50), DIMENSION(:), ALLOCATABLE :: vars_pids !< variable in input file … … 661 665 LOGICAL :: input_pids_uvem = .FALSE. !< Flag indicating whether uv-expoure-model input file containing static information exists 662 666 LOGICAL :: input_pids_vm = .FALSE. !< Flag indicating whether input file for virtual measurements exist 667 LOGICAL :: input_pids_wtm = .FALSE. !< Flag indicating whether input file for wind turbine model exists 663 668 664 669 LOGICAL :: collective_read = .FALSE. !< Enable NetCDF collective read … … 764 769 input_pids_static, & 765 770 input_pids_dynamic, input_pids_vm, input_file_vm, & 771 input_pids_wtm, input_file_wtm, & 766 772 num_var_pids, & 767 773 pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f, & … … 827 833 INQUIRE( FILE = TRIM( input_file_vm ) // TRIM( coupling_char ), & 828 834 EXIST = input_pids_vm ) 835 INQUIRE( FILE = TRIM( input_file_wtm ) // TRIM( coupling_char ), & 836 EXIST = input_pids_wtm ) 829 837 #endif 830 838 -
palm/trunk/SOURCE/wind_turbine_model_mod.f90
r4426 r4434 26 26 ! ----------------- 27 27 ! $Id$ 28 ! added optional netcdf data input for wtm array input parameters 29 ! 30 ! 4426 2020-02-27 10:02:19Z oliver.maas 28 31 ! define time as unlimited dimension so that no maximum number 29 32 ! of time steps has to be given for wtm_data_output … … 145 148 USE kinds 146 149 150 USE netcdf_data_input_mod, & 151 ONLY: check_existence, & 152 close_input_file, & 153 get_variable, & 154 input_pids_wtm, & 155 inquire_num_variables, & 156 inquire_variable_names, & 157 input_file_wtm, & 158 num_var_pids, & 159 open_read_file, & 160 pids_id, & 161 vars_pids 162 147 163 USE pegrid 148 164 … … 479 495 SUBROUTINE wtm_parin 480 496 481 482 497 IMPLICIT NONE 483 498 484 499 CHARACTER (LEN=80) :: line !< dummy string that contains the current line of the parameter file 485 500 486 487 501 NAMELIST /wind_turbine_parameters/ & 488 502 air_dens, dtow, dt_data_output_wtm, gear_eff,& … … 520 534 CALL parin_fail_message( 'wind_turbine_parameters', line ) 521 535 522 523 536 12 CONTINUE ! TBD Change from continue, mit ierrn machen 524 525 537 526 538 END SUBROUTINE wtm_parin … … 635 647 IMPLICIT NONE 636 648 637 IF ( ( .NOT.speed_control ) .AND. pitch_control ) THEN 638 message_string = 'pitch_control = .TRUE. requires '// & 639 'speed_control = .TRUE.' 640 CALL message( 'wtm_check_parameters', 'PA0461', 1, 2, 0, 6, 0 ) 649 IF ( .NOT. input_pids_wtm ) THEN 650 IF ( ( .NOT.speed_control ) .AND. pitch_control ) THEN 651 message_string = 'pitch_control = .TRUE. requires '// & 652 'speed_control = .TRUE.' 653 CALL message( 'wtm_check_parameters', 'PA0461', 1, 2, 0, 6, 0 ) 654 ENDIF 655 656 IF ( ANY( omega_rot(1:nturbines) < 0.0 ) ) THEN 657 message_string = 'omega_rot < 0.0, Please set omega_rot to ' // & 658 'a value equal or larger than zero' 659 CALL message( 'wtm_check_parameters', 'PA0462', 1, 2, 0, 6, 0 ) 660 ENDIF 661 662 663 IF ( ANY( rcx(1:nturbines) == 9999999.9_wp ) .OR. & 664 ANY( rcy(1:nturbines) == 9999999.9_wp ) .OR. & 665 ANY( rcz(1:nturbines) == 9999999.9_wp ) ) THEN 666 667 message_string = 'rcx, rcy, rcz ' // & 668 'have to be given for each turbine.' 669 CALL message( 'wtm_check_parameters', 'PA0463', 1, 2, 0, 6, 0 ) 670 ENDIF 641 671 ENDIF 642 672 643 IF ( ANY( omega_rot(1:nturbines) < 0.0 ) ) THEN644 message_string = 'omega_rot < 0.0, Please set omega_rot to ' // &645 'a value equal or larger than zero'646 CALL message( 'wtm_check_parameters', 'PA0462', 1, 2, 0, 6, 0 )647 ENDIF648 649 650 IF ( ANY( rcx(1:nturbines) == 9999999.9_wp ) .OR. &651 ANY( rcy(1:nturbines) == 9999999.9_wp ) .OR. &652 ANY( rcz(1:nturbines) == 9999999.9_wp ) ) THEN653 654 message_string = 'rcx, rcy, rcz ' // &655 'have to be given for each turbine.'656 CALL message( 'wtm_check_parameters', 'PA0463', 1, 2, 0, 6, 0 )657 658 ENDIF659 660 673 END SUBROUTINE wtm_check_parameters 661 674 ! … … 668 681 SUBROUTINE wtm_init_arrays 669 682 670 671 683 IMPLICIT NONE 672 684 673 685 REAL(wp) :: delta_r_factor !< 674 686 REAL(wp) :: delta_r_init !< 687 688 ! 689 ! Read wtm input file (netcdf) if it exists 690 IF ( input_pids_wtm ) THEN 691 692 ! 693 !-- Open the wtm input file 694 #if defined( __netcdf ) 695 CALL open_read_file( TRIM( input_file_wtm ) // & 696 TRIM( coupling_char ), pids_id ) 697 698 CALL inquire_num_variables( pids_id, num_var_pids ) 699 700 ! 701 !-- Allocate memory to store variable names and read them 702 ALLOCATE( vars_pids(1:num_var_pids) ) 703 CALL inquire_variable_names( pids_id, vars_pids ) 704 705 ! 706 !-- Input of all wtm parameters 707 IF ( check_existence( vars_pids, 'dtow' ) ) THEN 708 CALL get_variable( pids_id, 'dtow', dtow(1:nturbines)) 709 ENDIF 710 711 IF ( check_existence( vars_pids, 'omega_rot' ) ) THEN 712 CALL get_variable( pids_id, 'omega_rot', omega_rot(1:nturbines)) 713 ENDIF 714 715 IF ( check_existence( vars_pids, 'pitch_add' ) ) THEN 716 CALL get_variable( pids_id, 'pitch_add', pitch_add(1:nturbines)) 717 ENDIF 718 719 IF ( check_existence( vars_pids, 'phi_yaw' ) ) THEN 720 CALL get_variable( pids_id, 'phi_yaw', phi_yaw(1:nturbines)) 721 ENDIF 722 723 IF ( check_existence( vars_pids, 'rcx' ) ) THEN 724 CALL get_variable( pids_id, 'rcx', rcx(1:nturbines)) 725 ENDIF 726 727 IF ( check_existence( vars_pids, 'rcy' ) ) THEN 728 CALL get_variable( pids_id, 'rcy', rcy(1:nturbines)) 729 ENDIF 730 731 IF ( check_existence( vars_pids, 'rcz' ) ) THEN 732 CALL get_variable( pids_id, 'rcz', rcz(1:nturbines)) 733 ENDIF 734 735 IF ( check_existence( vars_pids, 'rnac' ) ) THEN 736 CALL get_variable( pids_id, 'rnac', rnac(1:nturbines)) 737 ENDIF 738 739 IF ( check_existence( vars_pids, 'rr' ) ) THEN 740 CALL get_variable( pids_id, 'rr', rr(1:nturbines)) 741 ENDIF 742 ! 743 ! IF ( check_existence( vars_pids, 'turb_cd_nacelle' ) ) THEN 744 ! CALL get_variable( pids_id, 'turb_cd_nacelle', turb_cd_nacelle(1:nturbines)) 745 ! ENDIF 746 747 IF ( check_existence( vars_pids, 'turb_cd_tower' ) ) THEN 748 CALL get_variable( pids_id, 'turb_cd_tower', turb_cd_tower(1:nturbines)) 749 ENDIF 750 ! 751 !-- Close wtm input file 752 CALL close_input_file( pids_id ) 753 754 ENDIF 755 #endif 675 756 676 757 ! … … 1273 1354 CALL wtm_read_blade_tables 1274 1355 1275 1276 1277 1278 1279 1356 IF ( debug_output ) CALL debug_message( 'wtm_init', 'end' ) 1280 1357 … … 2216 2293 !-- and the direction of the flow relative to the rotor: 2217 2294 2218 phi_rel(rseg) = ATAN ( u_rot /&2295 phi_rel(rseg) = ATAN2( u_rot , & 2219 2296 ( omega_rot(inot) * cur_r - & 2220 2297 vtheta(rseg) ) ) … … 2574 2651 !-- Can't be allocated before dt_3d is set 2575 2652 IF ( start_up ) THEN 2576 WDLON = NINT( 30.0_wp / dt_3d) ! 30s running mean array2653 WDLON = MAX( 1 , NINT( 30.0_wp / dt_3d ) ) ! 30s running mean array 2577 2654 ALLOCATE( wd30(1:nturbines,1:WDLON) ) 2578 2655 wd30 = 999.0_wp ! Set to dummy value 2579 2656 ALLOCATE( wd30_l(1:WDLON) ) 2580 2657 2581 WDSHO = NINT( 2.0_wp / dt_3d) ! 2s running mean array2658 WDSHO = MAX( 1 , NINT( 2.0_wp / dt_3d ) ) ! 2s running mean array 2582 2659 ALLOCATE( wd2(1:nturbines,1:WDSHO) ) 2583 2660 wd2 = 999.0_wp ! Set to dummy value
Note: See TracChangeset
for help on using the changeset viewer.