Changeset 3246 for palm/trunk/SOURCE/wind_turbine_model_mod.f90
- Timestamp:
- Sep 13, 2018 3:14:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/wind_turbine_model_mod.f90
r3241 r3246 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Added error handling for input namelist via parin_fail_message 29 ! 30 ! 3241 2018-09-12 15:02:00Z raasch 28 31 ! unused variables removed 29 32 ! … … 535 538 line = ' ' 536 539 DO WHILE ( INDEX( line, '&wind_turbine_parameters' ) == 0 ) 537 READ ( 11, '(A)', END=10 ) line538 ENDDO539 BACKSPACE ( 11 )540 541 !542 !-- Read user-defined namelist543 READ ( 11, wind_turbine_parameters, IOSTAT=ierrn )544 545 IF ( ierrn < 0 ) THEN546 message_string = 'no wind_turbine_parameters-NAMELIST found: ' // &547 'End of file has reached'548 CALL message( 'wtm_parin', 'PA0460', 1, 2, 0, 6, 0 )549 ELSEIF ( ierrn > 0 ) THEN550 message_string = 'errors in wind_turbine_parameters-NAMELIST: ' // &551 'some variables for steering may not be properly set'552 CALL message( 'wtm_parin', 'PA0466', 1, 2, 0, 6, 0 )553 ENDIF554 555 !556 !-- Set flag that indicates that the wind turbine model is switched on557 wind_turbine = .TRUE.558 559 GOTO 12560 561 !562 !-- Try to find wind turbine model package563 10 REWIND ( 11 )564 line = ' '565 DO WHILE ( INDEX( line, '&wind_turbine_par' ) == 0 )566 540 READ ( 11, '(A)', END=12 ) line 567 541 ENDDO … … 570 544 ! 571 545 !-- Read user-defined namelist 572 READ ( 11, wind_turbine_par, IOSTAT=ierrn ) 573 574 IF ( ierrn < 0 ) THEN 575 message_string = 'no wind_turbine_par-NAMELIST found: ' // & 576 'End of file has reached' 577 CALL message( 'wtm_parin', 'PA0460', 1, 2, 0, 6, 0 ) 578 ELSEIF ( ierrn > 0 ) THEN 579 message_string = 'errors in wind_turbine_par-NAMELIST: ' // & 580 'some variables for steering may not be properly set' 581 CALL message( 'wtm_parin', 'PA0466', 1, 2, 0, 6, 0 ) 582 ENDIF 546 READ ( 11, wind_turbine_parameters, ERR = 10 ) 547 ! 548 !-- Set flag that indicates that the wind turbine model is switched on 549 wind_turbine = .TRUE. 550 551 GOTO 14 552 553 10 BACKSPACE( 11 ) 554 READ( 11 ,fmt='(A)') line 555 CALL parin_fail_message ( 'wind_turbine_parameters', line ) 556 557 ! 558 !-- Try to find wind turbine model package 559 12 REWIND ( 11 ) 560 line = ' ' 561 DO WHILE ( INDEX( line, '&wind_turbine_par' ) == 0 ) 562 READ ( 11, '(A)', END=14 ) line 563 ENDDO 564 BACKSPACE ( 11 ) 565 566 ! 567 !-- Read user-defined namelist 568 READ ( 11, wind_turbine_par, ERR = 13, END = 14 ) 583 569 584 570 message_string = 'namelist wind_tubrine_par is deprecated and will ' // & … … 591 577 wind_turbine = .TRUE. 592 578 593 12 CONTINUE ! TBD Change from continue, mit ierrn machen 579 GOTO 14 580 581 13 BACKSPACE( 11 ) 582 READ( 11 ,fmt='(A)') line 583 CALL parin_fail_message ( 'wind_turbine_par', line ) 584 585 14 CONTINUE ! TBD Change from continue, mit ierrn machen 594 586 595 587
Note: See TracChangeset
for help on using the changeset viewer.