Ignore:
Timestamp:
Jul 11, 2017 9:37:02 AM (7 years ago)
Author:
gronemeier
Message:

bugfix: re-arranged call for error messages for ENVPAR file

File:
1 edited

Legend:

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

    r2304 r2310  
    2525! -----------------
    2626! $Id$
     27! Bugfix: re-arranged call for error messages for ENVPAR file
     28!
     29! 2304 2017-07-04 14:35:55Z suehring
    2730! Bugfix, enable restarts for child domain.
    2831!
     
    348351    IMPLICIT NONE
    349352
    350     INTEGER(iwp) ::  i   !<
     353    INTEGER(iwp) ::  i      !<
     354    INTEGER(iwp) ::  ioerr  !< error flag for open/read/write
    351355
    352356
     
    446450!-- generated by mrun)
    447451    CALL location_message( 'reading environment parameters from ENVPAR', .FALSE. )
    448     OPEN ( 90, FILE='ENVPAR', STATUS='OLD', FORM='FORMATTED', ERR=30 )
    449     READ ( 90, envpar, ERR=31, END=32 )
    450     CLOSE ( 90 )
     452
     453    OPEN ( 90, FILE='ENVPAR', STATUS='OLD', FORM='FORMATTED', IOSTAT=ioerr )
     454
     455    IF ( ioerr /= 0 )  THEN
     456       message_string = 'local file ENVPAR not found' //                       &
     457                        '&some variables for steering may not be properly set'
     458       CALL message( 'parin', 'PA0276', 0, 1, 0, 6, 0 )
     459    ELSE
     460       READ ( 90, envpar, IOSTAT=ioerr )
     461       IF ( ioerr < 0 )  THEN
     462          message_string = 'no envpar-NAMELIST found in local file '  //       &
     463                           'ENVPAR&some variables for steering may '  //       &
     464                           'not be properly set'
     465          CALL message( 'parin', 'PA0278', 0, 1, 0, 6, 0 )
     466       ELSEIF ( ioerr > 0 )  THEN
     467          message_string = 'errors in local file ENVPAR' //                    &
     468                           '&some variables for steering may not be properly set'
     469          CALL message( 'parin', 'PA0277', 0, 1, 0, 6, 0 )
     470       ENDIF
     471       CLOSE ( 90 )
     472    ENDIF
     473
    451474    CALL location_message( 'finished', .TRUE. )
    452475
     
    686709    CALL location_message( 'finished', .TRUE. )
    687710
    688     RETURN
    689 
    690  30 message_string = 'local file ENVPAR not found' //                          &
    691                      '&some variables for steering may not be properly set'
    692     CALL message( 'parin', 'PA0276', 0, 1, 0, 6, 0 )
    693     RETURN
    694 
    695  31 message_string = 'errors in local file ENVPAR' //                          &
    696                      '&some variables for steering may not be properly set'
    697     CALL message( 'parin', 'PA0277', 0, 1, 0, 6, 0 )
    698     RETURN
    699 
    700  32 message_string = 'no envpar-NAMELIST found in local file ENVPAR'  //       &
    701                      '&some variables for steering may not be properly set'
    702     CALL message( 'parin', 'PA0278', 0, 1, 0, 6, 0 )
    703 
    704711 END SUBROUTINE parin
Note: See TracChangeset for help on using the changeset viewer.