Ignore:
Timestamp:
Sep 13, 2018 3:14:50 PM (3 years ago)
Author:
sward
Message:

Added error handling for wrong input parameters

File:
1 edited

Legend:

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

    r3241 r3246  
    2525! -----------------
    2626! $Id$
     27! Added error handling for input namelist via parin_fail_message
     28!
     29! 3241 2018-09-12 15:02:00Z raasch
    2730! unused variables removed
    2831!
     
    250253       line = ' '
    251254       DO   WHILE ( INDEX( line, '&virtual_flight_parameters' ) == 0 )
    252           READ ( 11, '(A)', END=10 )  line
    253        ENDDO
    254        BACKSPACE ( 11 )
    255 
    256 !
    257 !--    Read namelist
    258        READ ( 11, virtual_flight_parameters )
    259 !
    260 !--    Set switch that virtual flights shall be carried out
    261        virtual_flight = .TRUE.
    262 
    263        GOTO 12
    264 !
    265 !--    Try to find the old namelist
    266  10    REWIND ( 11 )
    267        line = ' '
    268        DO   WHILE ( INDEX( line, '&flight_par' ) == 0 )
    269255          READ ( 11, '(A)', END=12 )  line
    270256       ENDDO
     
    273259!
    274260!--    Read namelist
    275        READ ( 11, flight_par )
     261       READ ( 11, virtual_flight_parameters, ERR = 10 )
     262!
     263!--    Set switch that virtual flights shall be carried out
     264       virtual_flight = .TRUE.
     265
     266       GOTO 14
     267
     268 10    BACKSPACE( 11 )
     269       READ( 11 ,fmt='(A)') line
     270       CALL parin_fail_message ( 'virtual_flight_parameters', line )
     271!
     272!--    Try to find the old namelist
     273 12    REWIND ( 11 )
     274       line = ' '
     275       DO   WHILE ( INDEX( line, '&flight_par' ) == 0 )
     276          READ ( 11, '(A)', END=14 )  line
     277       ENDDO
     278       BACKSPACE ( 11 )
     279
     280!
     281!--    Read namelist
     282       READ ( 11, flight_par, ERR = 13, END = 14 )
    276283       
    277284       message_string = 'namelist flight_par is deprecated and will be ' // &
     
    283290       virtual_flight = .TRUE.
    284291
    285  12    CONTINUE
     292       GOTO 14
     293
     294 13    BACKSPACE( 11 )
     295       READ( 11 ,fmt='(A)') line
     296       CALL parin_fail_message ( 'flight_par', line )
     297
     298 14    CONTINUE
    286299
    287300    END SUBROUTINE flight_parin
Note: See TracChangeset for help on using the changeset viewer.