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

Added error handling for wrong input parameters

File:
1 edited

Legend:

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

    r3241 r3246  
    2828! -----------------
    2929! $Id$
     30! Added error handling for input namelist via parin_fail_message
     31!
     32! 3241 2018-09-12 15:02:00Z raasch
    3033! unused variables removed or commented
    3134!
     
    27872790       line = ' '
    27882791       DO   WHILE ( INDEX( line, '&radiation_parameters' ) == 0 )
    2789           READ ( 11, '(A)', END=10 )  line
    2790        ENDDO
    2791        BACKSPACE ( 11 )
    2792 
    2793 !
    2794 !--    Read user-defined namelist
    2795        READ ( 11, radiation_parameters )
    2796 
    2797 !
    2798 !--    Set flag that indicates that the radiation model is switched on
    2799        radiation = .TRUE.
    2800        
    2801        GOTO 12
    2802 !
    2803 !--    Try to find old namelist
    2804  10    REWIND ( 11 )
    2805        line = ' '
    2806        DO   WHILE ( INDEX( line, '&radiation_par' ) == 0 )
    28072792          READ ( 11, '(A)', END=12 )  line
    28082793       ENDDO
     
    28112796!
    28122797!--    Read user-defined namelist
    2813        READ ( 11, radiation_par )
    2814        
     2798       READ ( 11, radiation_parameters, ERR = 10 )
     2799
     2800!
     2801!--    Set flag that indicates that the radiation model is switched on
     2802       radiation = .TRUE.
     2803
     2804       GOTO 14
     2805
     2806 10    BACKSPACE( 11 )
     2807       READ( 11 ,fmt='(A)') line
     2808       CALL parin_fail_message ( 'radiation_parameters', line )
     2809!
     2810!--    Try to find old namelist
     2811 12    REWIND ( 11 )
     2812       line = ' '
     2813       DO   WHILE ( INDEX( line, '&radiation_par' ) == 0 )
     2814          READ ( 11, '(A)', END=14 )  line
     2815       ENDDO
     2816       BACKSPACE ( 11 )
     2817
     2818!
     2819!--    Read user-defined namelist
     2820       READ ( 11, radiation_par, ERR = 13, END = 14 )
     2821
    28152822       message_string = 'namelist radiation_par is deprecated and will be ' // &
    28162823                     'removed in near future. Please use namelist ' //         &
     
    28182825       CALL message( 'radiation_parin', 'PA0487', 0, 1, 0, 6, 0 )
    28192826
    2820        
    28212827!
    28222828!--    Set flag that indicates that the radiation model is switched on
     
    28292835       ENDIF
    28302836
    2831  12    CONTINUE
     2837       GOTO 14
     2838
     2839 13    BACKSPACE( 11 )
     2840       READ( 11 ,fmt='(A)') line
     2841       CALL parin_fail_message ( 'radiation_par', line )
     2842
     2843 14    CONTINUE
    28322844       
    28332845    END SUBROUTINE radiation_parin
Note: See TracChangeset for help on using the changeset viewer.