Ignore:
Timestamp:
Feb 5, 2016 1:06:51 PM (8 years ago)
Author:
gronemeier
Message:

Bugfix:calculation of time levels for parallel NetCDF output

File:
1 edited

Legend:

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

    r1683 r1745  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Bugfix: added MPI barrier after deleting existing non-extendable file by PE0
    2222!
    2323! Former revisions:
     
    647647                CALL handle_netcdf_error( 'check_open', 21 )
    648648                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
    649              ENDIF
    650 
    651           ENDIF         
     649#if defined( __parallel ) && ! defined ( __check )
     650!
     651!--             Set a barrier in order to assure that PE0 deleted the old file
     652!--             before any other processor tries to open a new file
     653                CALL MPI_BARRIER( comm2d, ierr )
     654#endif
     655             ENDIF
     656
     657          ENDIF
    652658
    653659          IF ( .NOT. netcdf_extend )  THEN
     
    703709                CALL handle_netcdf_error( 'check_open', 24 )
    704710                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
    705              ENDIF
    706 
    707           ENDIF         
     711#if defined( __parallel ) && ! defined ( __check )
     712!
     713!--             Set a barrier in order to assure that PE0 deleted the old file
     714!--             before any other processor tries to open a new file
     715                CALL MPI_BARRIER( comm2d, ierr )
     716#endif
     717             ENDIF
     718
     719          ENDIF
    708720
    709721          IF ( .NOT. netcdf_extend )  THEN
     
    759771                CALL handle_netcdf_error( 'check_open', 27 )
    760772                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
    761              ENDIF
    762 
    763           ENDIF         
     773#if defined( __parallel ) && ! defined ( __check )
     774!
     775!--             Set a barrier in order to assure that PE0 deleted the old file
     776!--             before any other processor tries to open a new file
     777                CALL MPI_BARRIER( comm2d, ierr )
     778#endif
     779             ENDIF
     780
     781          ENDIF
    764782
    765783          IF ( .NOT. netcdf_extend )  THEN
     
    895913                nc_stat = NF90_CLOSE( id_set_3d(av) )
    896914                CALL handle_netcdf_error( 'check_open', 36 )
    897                 CALL local_system('rm ' // TRIM( filename ) )
    898              ENDIF
    899 
    900           ENDIF         
     915                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
     916#if defined( __parallel ) && ! defined ( __check )
     917!
     918!--             Set a barrier in order to assure that PE0 deleted the old file
     919!--             before any other processor tries to open a new file
     920                CALL MPI_BARRIER( comm2d, ierr )
     921#endif
     922
     923             ENDIF
     924
     925          ENDIF
    901926
    902927          IF ( .NOT. netcdf_extend )  THEN
     
    9911016                nc_stat = NF90_CLOSE( id_set_prt )
    9921017                CALL handle_netcdf_error( 'check_open', 42 )
    993                 CALL local_system( 'rm ' // filename )
     1018                CALL local_system( 'rm ' // TRIM( filename ) )
    9941019             ENDIF
    9951020
Note: See TracChangeset for help on using the changeset viewer.