Changeset 3247


Ignore:
Timestamp:
Sep 14, 2018 7:06:30 AM (3 years ago)
Author:
sward
Message:

parin_fail_message now also outputs the line number at which namelist reading failed

File:
1 edited

Legend:

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

    r3246 r3247  
    2525! -----------------
    2626! $Id$
     27! Subroutine description updated and parin_fail_message now also outputs
     28! the line number in which namelist reading failed
     29!
     30! 3246 2018-09-13 15:14:50Z sward
    2731! Added SUBROUTINE parin_fail_message for error handling of input namelists
    2832!
     
    296300! Description:
    297301! ------------
    298 !> Prints out the given location on stdout
     302!> Abort routine for failures durin reading of namelists
    299303!------------------------------------------------------------------------------!
    300304 
     
    304308        ONLY:  message_string
    305309
     310    USE kinds
     311
    306312    IMPLICIT NONE
    307313
     
    309315    CHARACTER(LEN=*) ::  line
    310316
    311     message_string = 'Error(s) in NAMELIST '// TRIM(location) //                 &
    312                      '&Reading fails at& '// line
     317    CHARACTER(LEN=80) ::  line_dum
     318
     319    INTEGER(iwp) ::  line_counter
     320
     321    line_dum = ' '
     322    line_counter = 0
     323
     324    REWIND( 11 )
     325    DO   WHILE ( INDEX( line_dum, TRIM(line) ) == 0 )
     326         READ ( 11, '(A)', END=20 )  line_dum
     327         line_counter = line_counter + 1
     328    ENDDO
     329
     330 20 WRITE( message_string, '(A,I3,A)' )                                        &
     331                   'Error(s) in NAMELIST '// TRIM(location) //                 &
     332                   '&Reading fails on line ', line_counter,                    &
     333                   ' at&' // line
    313334          CALL message( 'parin', 'PA0271', 1, 2, 0, 6, 0 )
    314335
Note: See TracChangeset for help on using the changeset viewer.