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/land_surface_model_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!
     
    49944997       line = ' '
    49954998       DO   WHILE ( INDEX( line, '&land_surface_parameters' ) == 0 )
    4996           READ ( 11, '(A)', END=10 )  line
     4999          READ ( 11, '(A)', END=12 )  line
    49975000       ENDDO
    49985001       BACKSPACE ( 11 )
     
    50005003!
    50015004!--    Read user-defined namelist
    5002        READ ( 11, land_surface_parameters )
     5005       READ ( 11, land_surface_parameters, ERR = 10 )
    50035006
    50045007!
     
    50065009       land_surface = .TRUE.
    50075010       
    5008        GOTO 12
     5011       GOTO 14
     5012
     5013 10    BACKSPACE( 11 )
     5014       READ( 11 ,fmt='(A)') line
     5015       CALL parin_fail_message ( 'land_surface_parameters', line )
    50095016!
    50105017!--    Try to find old namelist
    5011  10    REWIND ( 11 )
     5018 12    REWIND ( 11 )
    50125019       line = ' '
    50135020       DO   WHILE ( INDEX( line, '&lsm_par' ) == 0 )
    5014           READ ( 11, '(A)', END=12 )  line
     5021          READ ( 11, '(A)', END=14 )  line
    50155022       ENDDO
    50165023       BACKSPACE ( 11 )
     
    50185025!
    50195026!--    Read user-defined namelist
    5020        READ ( 11, lsm_par )
     5027       READ ( 11, lsm_par, ERR = 13, END = 14 )
    50215028
    50225029       message_string = 'namelist lsm_par is deprecated and will be ' // &
     
    50285035!--    Set flag that indicates that the land surface model is switched on
    50295036       land_surface = .TRUE.
    5030 
    5031 
    5032  12    CONTINUE
     5037       
     5038       GOTO 14
     5039
     5040 13    BACKSPACE( 11 )
     5041       READ( 11 ,fmt='(A)') line
     5042       CALL parin_fail_message ( 'lsm_par', line )
     5043
     5044
     5045 14    CONTINUE
    50335046       
    50345047
Note: See TracChangeset for help on using the changeset viewer.