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/urban_surface_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
    3134!
     
    53495352                           soil_inner_temperature,                             &
    53505353                           window_inner_temperature
     5354                           
     5355                           
     5356 
    53515357!
    53525358!--    Try to find urban surface model package
     
    53545360       line = ' '
    53555361       DO   WHILE ( INDEX( line, '&urban_surface_parameters' ) == 0 )
    5356           READ ( 11, '(A)', END=10 )  line
    5357        ENDDO
    5358        BACKSPACE ( 11 )
    5359 
    5360 !
    5361 !--    Read user-defined namelist
    5362        READ ( 11, urban_surface_parameters )
    5363 !
    5364 !--    Set flag that indicates that the land surface model is switched on
    5365        urban_surface = .TRUE.
    5366 
    5367        GOTO 12
    5368 !
    5369 !--    Try to find old namelist
    5370  10    REWIND ( 11 )
    5371        line = ' '
    5372        DO   WHILE ( INDEX( line, '&urban_surface_par' ) == 0 )
    53735362          READ ( 11, '(A)', END=12 )  line
    53745363       ENDDO
     
    53775366!
    53785367!--    Read user-defined namelist
    5379        READ ( 11, urban_surface_par )
     5368       READ ( 11, urban_surface_parameters, ERR = 10 )
     5369
     5370!
     5371!--    Set flag that indicates that the urban surface model is switched on
     5372       urban_surface = .TRUE.
     5373
     5374       GOTO 14
     5375
     5376 10    BACKSPACE( 11 )
     5377       READ( 11 ,fmt='(A)') line
     5378       CALL parin_fail_message ( 'urban_surface_parameters', line )
     5379!
     5380!--    Try to find old namelist
     5381 12    REWIND ( 11 )
     5382       line = ' '
     5383       DO   WHILE ( INDEX( line, '&urban_surface_par' ) == 0 )
     5384          READ ( 11, '(A)', END=14 )  line
     5385       ENDDO
     5386       BACKSPACE ( 11 )
     5387
     5388!
     5389!--    Read user-defined namelist
     5390       READ ( 11, urban_surface_par, ERR = 13, END = 14 )
    53805391
    53815392       message_string = 'namelist urban_surface_par is deprecated and will be ' // &
    5382                      'removed in near future. Please use namelist ' //             &
    5383                      'urban_surface_parameters instead' 
     5393                     'removed in near future. Please use namelist ' //   &
     5394                     'urban_surface_parameters instead'
    53845395       CALL message( 'usm_parin', 'PA0487', 0, 1, 0, 6, 0 )
    5385 !
    5386 !--    Set flag that indicates that the land surface model is switched on
     5396
     5397!
     5398!--    Set flag that indicates that the urban surface model is switched on
    53875399       urban_surface = .TRUE.
    53885400
    5389  12    CONTINUE
     5401       GOTO 14
     5402
     5403 13    BACKSPACE( 11 )
     5404       READ( 11 ,fmt='(A)') line
     5405       CALL parin_fail_message ( 'urban_surface_par', line )
     5406
     5407
     5408 14    CONTINUE
    53905409
    53915410
Note: See TracChangeset for help on using the changeset viewer.