Changeset 4819


Ignore:
Timestamp:
Dec 10, 2020 12:57:52 PM (4 years ago)
Author:
gronemeier
Message:

Check if netCDF file actually exists before opening it for reading (netcdf_data_input_mod).

File:
1 edited

Legend:

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

    r4807 r4819  
    2424! -----------------
    2525! $Id$
     26! Check if netCDF file actually exists before opening it for reading.
     27!
     28! 4807 2020-12-02 21:02:28Z gronemeier
    2629! Deactivated reading of building_obstruction_full due to improper implementation (conflicts with
    2730! building_obstruction_f and it is also not used anywhere else in the code).
     
    35893592 SUBROUTINE open_read_file( filename, id )
    35903593
     3594    USE control_parameters,                                                                        &
     3595        ONLY: message_string
     3596
    35913597    USE pegrid
    35923598
    35933599    IMPLICIT NONE
    35943600
    3595     CHARACTER (LEN=*), INTENT(IN) ::  filename  !< filename
    3596     INTEGER(iwp), INTENT(INOUT)   ::  id        !< file id
     3601    CHARACTER (LEN=*), INTENT(IN) ::  filename    !< filename
     3602    INTEGER(iwp), INTENT(INOUT)   ::  id          !< file id
     3603    LOGICAL                       ::  file_exists !< true if file exists
    35973604
    35983605#if defined( __netcdf )
     3606!
     3607!-- Check if requested file exists
     3608    INQUIRE( FILE=filename, EXIST=file_exists )
     3609
     3610    IF ( .NOT. file_exists )  THEN
     3611       WRITE( message_string, * ) 'Required input file "' // filename // '" does not exist!'
     3612       CALL message( 'open_read_file', 'PA0516', 2, 2, 0, 6, 1 )
     3613    ENDIF
    35993614
    36003615#if defined( __netcdf4_parallel )
Note: See TracChangeset for help on using the changeset viewer.