Index: /palm/trunk/SOURCE/check_open.f90
===================================================================
--- /palm/trunk/SOURCE/check_open.f90	(revision 1744)
+++ /palm/trunk/SOURCE/check_open.f90	(revision 1745)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix: added MPI barrier after deleting existing non-extendable file by PE0
 ! 
 ! Former revisions:
@@ -647,7 +647,13 @@
                 CALL handle_netcdf_error( 'check_open', 21 )
                 IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
-             ENDIF
-
-          ENDIF          
+#if defined( __parallel ) && ! defined ( __check )
+!
+!--             Set a barrier in order to assure that PE0 deleted the old file
+!--             before any other processor tries to open a new file
+                CALL MPI_BARRIER( comm2d, ierr )
+#endif
+             ENDIF
+
+          ENDIF
 
           IF ( .NOT. netcdf_extend )  THEN
@@ -703,7 +709,13 @@
                 CALL handle_netcdf_error( 'check_open', 24 )
                 IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
-             ENDIF
-
-          ENDIF          
+#if defined( __parallel ) && ! defined ( __check )
+!
+!--             Set a barrier in order to assure that PE0 deleted the old file
+!--             before any other processor tries to open a new file
+                CALL MPI_BARRIER( comm2d, ierr )
+#endif
+             ENDIF
+
+          ENDIF
 
           IF ( .NOT. netcdf_extend )  THEN
@@ -759,7 +771,13 @@
                 CALL handle_netcdf_error( 'check_open', 27 )
                 IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
-             ENDIF
-
-          ENDIF          
+#if defined( __parallel ) && ! defined ( __check )
+!
+!--             Set a barrier in order to assure that PE0 deleted the old file
+!--             before any other processor tries to open a new file
+                CALL MPI_BARRIER( comm2d, ierr )
+#endif
+             ENDIF
+
+          ENDIF
 
           IF ( .NOT. netcdf_extend )  THEN
@@ -895,8 +913,15 @@
                 nc_stat = NF90_CLOSE( id_set_3d(av) )
                 CALL handle_netcdf_error( 'check_open', 36 )
-                CALL local_system('rm ' // TRIM( filename ) )
-             ENDIF
-
-          ENDIF          
+                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
+#if defined( __parallel ) && ! defined ( __check )
+!
+!--             Set a barrier in order to assure that PE0 deleted the old file
+!--             before any other processor tries to open a new file
+                CALL MPI_BARRIER( comm2d, ierr )
+#endif
+
+             ENDIF
+
+          ENDIF
 
           IF ( .NOT. netcdf_extend )  THEN
@@ -991,5 +1016,5 @@
                 nc_stat = NF90_CLOSE( id_set_prt )
                 CALL handle_netcdf_error( 'check_open', 42 )
-                CALL local_system( 'rm ' // filename )
+                CALL local_system( 'rm ' // TRIM( filename ) )
              ENDIF
 
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 1744)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 1745)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix: check data output intervals to be /= 0.0 in case of parallel NetCDF4
 ! 
 ! Former revisions:
@@ -3835,4 +3835,12 @@
     IF ( netcdf_data_format > 4 )  THEN
 
+!
+!--    Check if any of the follwoing data output interval is 0.0s, which is
+!--    not allowed for parallel output.
+       CALL check_dt_do( dt_do3d,    'dt_do3d'    )
+       CALL check_dt_do( dt_do2d_xy, 'dt_do2d_xy' )
+       CALL check_dt_do( dt_do2d_xz, 'dt_do2d_xz' )
+       CALL check_dt_do( dt_do2d_yz, 'dt_do2d_yz' )
+
        ntdim_3d(0)    = INT( ( end_time - skip_time_do3d ) / dt_do3d )
        IF ( do3d_at_begin ) ntdim_3d(0) = ntdim_3d(0) + 1
@@ -3850,5 +3858,6 @@
        ntdim_2d_xz(1) = ntdim_3d(1)
        ntdim_2d_yz(1) = ntdim_3d(1)
-
+             write(9,*) "ntdim_3d(av)=",ntdim_3d(0)
+             CALL local_flush(9)
     ENDIF
 
@@ -4333,4 +4342,40 @@
     CALL user_check_parameters
 
+ CONTAINS
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Check the length of data output intervals. In case of parallel NetCDF output
+!> the time levels of the output files need to be fixed. Therefore setting the
+!> output interval to 0.0s (usually used to output each timestep) is not 
+!> possible as long as a non-fixed timestep is used.
+!------------------------------------------------------------------------------!
+
+    SUBROUTINE check_dt_do( dt_do, dt_do_name )
+
+       IMPLICIT NONE
+
+       CHARACTER (LEN=*), INTENT (IN) :: dt_do_name !< parin variable name
+
+       REAL(wp), INTENT (INOUT)       :: dt_do      !< data output interval
+
+       IF ( dt_do == 0.0_wp )  THEN
+          IF ( dt_fixed )  THEN
+             WRITE( message_string, '(A,F9.4,A)' )  'Output at every '  //  &
+                    'timestep is desired (' // dt_do_name // ' = 0.0).&'//  &
+                    'Setting the output interval to the fixed timestep '//  &
+                    'dt = ', dt, 's.'
+             CALL message( 'check_parameters', 'PA0060', 0, 0, 0, 6, 0 )
+             dt_do = dt
+          ELSE
+             message_string = dt_do_name // ' = 0.0 while using a ' //      &
+                              'variable timestep and parallel netCDF4 ' //  &
+                              'is not allowed.'
+             CALL message( 'check_parameters', 'PA0081', 1, 2, 0, 6, 0 )
+          ENDIF
+       ENDIF
+
+    END SUBROUTINE check_dt_do
 
  END SUBROUTINE check_parameters
Index: /palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- /palm/trunk/SOURCE/data_output_2d.f90	(revision 1744)
+++ /palm/trunk/SOURCE/data_output_2d.f90	(revision 1745)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix: test if time axis limit exceeds moved to point after call of check_open
 !
 ! Former revisions:
@@ -234,34 +234,4 @@
     IF ( mode == 'xz'  .AND.  .NOT. data_output_xz(av) )  RETURN
     IF ( mode == 'yz'  .AND.  .NOT. data_output_yz(av) )  RETURN
-!
-!-- For parallel netcdf output the time axis must be limited. Return, if this
-!-- limit is exceeded. This could be the case, if the simulated time exceeds 
-!-- the given end time by the length of the given output interval.
-    IF ( netcdf_data_format > 4 )  THEN
-       IF ( mode == 'xy'  .AND.  do2d_xy_time_count(av) + 1 >                  &
-            ntdim_2d_xy(av) )  THEN
-          WRITE ( message_string, * ) 'Output of xy cross-sections is not ',   &
-                          'given at t=', simulated_time, '&because the',       & 
-                          ' maximum number of output time levels is exceeded.'
-          CALL message( 'data_output_2d', 'PA0384', 0, 1, 0, 6, 0 )          
-          RETURN
-       ENDIF
-       IF ( mode == 'xz'  .AND.  do2d_xz_time_count(av) + 1 >                  &
-            ntdim_2d_xz(av) )  THEN
-          WRITE ( message_string, * ) 'Output of xz cross-sections is not ',   &
-                          'given at t=', simulated_time, '&because the',       & 
-                          ' maximum number of output time levels is exceeded.'
-          CALL message( 'data_output_2d', 'PA0385', 0, 1, 0, 6, 0 )          
-          RETURN
-       ENDIF
-       IF ( mode == 'yz'  .AND.  do2d_yz_time_count(av) + 1 >                  &
-            ntdim_2d_yz(av) )  THEN
-          WRITE ( message_string, * ) 'Output of yz cross-sections is not ',   &
-                          'given at t=', simulated_time, '&because the',       & 
-                          ' maximum number of output time levels is exceeded.'
-          CALL message( 'data_output_2d', 'PA0386', 0, 1, 0, 6, 0 )          
-          RETURN
-       ENDIF
-    ENDIF
 
     CALL cpu_log (log_point(3),'data_output_2d','start')
@@ -372,4 +342,38 @@
 
     END SELECT
+
+!
+!-- For parallel netcdf output the time axis must be limited. Return, if this
+!-- limit is exceeded. This could be the case, if the simulated time exceeds 
+!-- the given end time by the length of the given output interval.
+    IF ( netcdf_data_format > 4 )  THEN
+       IF ( mode == 'xy'  .AND.  do2d_xy_time_count(av) + 1 >                  &
+            ntdim_2d_xy(av) )  THEN
+          WRITE ( message_string, * ) 'Output of xy cross-sections is not ',   &
+                          'given at t=', simulated_time, '&because the',       & 
+                          ' maximum number of output time levels is exceeded.'
+          CALL message( 'data_output_2d', 'PA0384', 0, 1, 0, 6, 0 )
+          CALL cpu_log( log_point(3), 'data_output_2d', 'stop' )
+          RETURN
+       ENDIF
+       IF ( mode == 'xz'  .AND.  do2d_xz_time_count(av) + 1 >                  &
+            ntdim_2d_xz(av) )  THEN
+          WRITE ( message_string, * ) 'Output of xz cross-sections is not ',   &
+                          'given at t=', simulated_time, '&because the',       & 
+                          ' maximum number of output time levels is exceeded.'
+          CALL message( 'data_output_2d', 'PA0385', 0, 1, 0, 6, 0 )
+          CALL cpu_log( log_point(3), 'data_output_2d', 'stop' )
+          RETURN
+       ENDIF
+       IF ( mode == 'yz'  .AND.  do2d_yz_time_count(av) + 1 >                  &
+            ntdim_2d_yz(av) )  THEN
+          WRITE ( message_string, * ) 'Output of yz cross-sections is not ',   &
+                          'given at t=', simulated_time, '&because the',       & 
+                          ' maximum number of output time levels is exceeded.'
+          CALL message( 'data_output_2d', 'PA0386', 0, 1, 0, 6, 0 )
+          CALL cpu_log( log_point(3), 'data_output_2d', 'stop' )
+          RETURN
+       ENDIF
+    ENDIF
 
 !
Index: /palm/trunk/SOURCE/data_output_3d.f90
===================================================================
--- /palm/trunk/SOURCE/data_output_3d.f90	(revision 1744)
+++ /palm/trunk/SOURCE/data_output_3d.f90	(revision 1745)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Bugfix: test if time axis limit exceeds moved to point after call of check_open
 ! 
 ! Former revisions:
@@ -176,18 +176,4 @@
 !-- Return, if nothing to output
     IF ( do3d_no(av) == 0 )  RETURN
-!
-!-- For parallel netcdf output the time axis must be limited. Return, if this
-!-- limit is exceeded. This could be the case, if the simulated time exceeds 
-!-- the given end time by the length of the given output interval.
-    IF ( netcdf_data_format > 4 )  THEN
-       IF ( do3d_time_count(av) + 1 > ntdim_3d(av) )  THEN
-          WRITE ( message_string, * ) 'Output of 3d data is not given at t=',  &
-                                      simulated_time, '&because the maximum ', & 
-                                      'number of output time levels is ',      &
-                                      'exceeded.'
-          CALL message( 'data_output_3d', 'PA0387', 0, 1, 0, 6, 0 )          
-          RETURN
-       ENDIF
-    ENDIF
 
     CALL cpu_log (log_point(14),'data_output_3d','start')
@@ -209,4 +195,22 @@
        CALL check_open( 106+av*10 )
     ENDIF
+
+!
+!-- For parallel netcdf output the time axis must be limited. Return, if this
+!-- limit is exceeded. This could be the case, if the simulated time exceeds 
+!-- the given end time by the length of the given output interval.
+    IF ( netcdf_data_format > 4 )  THEN
+       IF ( do3d_time_count(av) + 1 > ntdim_3d(av) )  THEN
+          WRITE ( message_string, * ) 'Output of 3d data is not given at t=',  &
+                                      simulated_time, '&because the maximum ', & 
+                                      'number of output time levels is ',      &
+                                      'exceeded.'
+          CALL message( 'data_output_3d', 'PA0387', 0, 1, 0, 6, 0 )
+          CALL cpu_log( log_point(14), 'data_output_3d', 'stop' )
+          RETURN
+       ENDIF
+    ENDIF
+    WRITE(9,*) '___hier4'
+    CALL local_flush(9)
 
 !
Index: /palm/trunk/SOURCE/netcdf.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf.f90	(revision 1744)
+++ /palm/trunk/SOURCE/netcdf.f90	(revision 1745)
@@ -19,5 +19,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Bugfix: recalculating ntdim_3d, ntdim_2d_xy/xz/yz when checking the
+!         extensibility of an existing file (only when using parallel NetCDF). 
 ! 
 ! Former revisions:
@@ -112,4 +113,7 @@
 !> Parameter av can assume values 0 (non-averaged data) and 1 (time averaged
 !> data)
+!>
+!> @todo calculation of output time levels for parallel NetCDF still does not
+!>       cover every exception (change of dt_do, end_time in restart)
 !------------------------------------------------------------------------------!
 #if defined( __ibmy_special )
@@ -131,10 +135,14 @@
                dopr_time_count, dopts_time_count, dots_time_count,             &
                dosp_time_count, do2d, do2d_xz_time_count, do3d,                &
-               do2d_yz_time_count, mask_size, do2d_xy_time_count,              &
-               do3d_time_count, domask_time_count, mask_i_global,              &
+               do2d_yz_time_count, dt_data_output_av, dt_do2d_xy, dt_do2d_xz,  &
+               dt_do2d_yz, dt_do3d, mask_size, do2d_xy_time_count,             &
+               do3d_time_count, domask_time_count, end_time, mask_i_global,    &
                mask_j_global, mask_k_global, message_string, mid,              &
                netcdf_data_format, netcdf_precision, ntdim_2d_xy,              &
                ntdim_2d_xz, ntdim_2d_yz, ntdim_3d, nz_do3d, prt_time_count,    &
-              run_description_header, section, simulated_time, topography
+               run_description_header, section, simulated_time,                &
+               simulated_time_at_begin, skip_time_data_output_av,              &
+               skip_time_do2d_xy, skip_time_do2d_xz, skip_time_do2d_yz,        &
+               skip_time_do3d, topography
 
     USE grid_variables,                                                        &
@@ -211,5 +219,5 @@
     INTEGER(iwp) ::  ns_do                                   !< actual value of ns for soil model data
     INTEGER(iwp) ::  ns_old                                  !<
-    INTEGER(iwp) ::  ntime_count                             !<
+    INTEGER(iwp) ::  ntime_count                             !< number of time levels found in file
     INTEGER(iwp) ::  nz_old                                  !<
 
@@ -233,5 +241,5 @@
     LOGICAL, SAVE ::  init_netcdf = .FALSE.                  !<
 
-    REAL(wp), DIMENSION(1) ::  last_time_coordinate          !<
+    REAL(wp), DIMENSION(1) ::  last_time_coordinate          !< last time value in file
 
     REAL(wp), DIMENSION(:), ALLOCATABLE   ::  netcdf_data    !<
@@ -1460,4 +1468,22 @@
 
           IF ( netcdf_data_format > 4 )  THEN
+!
+!--          Set needed time levels (ntdim) to 
+!--          saved time levels + to be saved time levels.
+             IF ( av == 0 )  THEN 
+                ntdim_3d(0) = do3d_time_count(0) + CEILING(                &
+                              ( end_time - MAX( skip_time_do3d,            &
+                                                simulated_time_at_begin )  &
+                              ) / dt_do3d )
+             ELSE
+                ntdim_3d(1) = do3d_time_count(1) + CEILING(                &
+                              ( end_time - MAX( skip_time_data_output_av,  &
+                                                simulated_time_at_begin )  &
+                              ) / dt_data_output_av )
+             ENDIF
+
+!
+!--          Check if the needed number of output time levels is increased
+!--          compared to the number of time levels in the existing file.
              IF ( ntdim_3d(av) > ntime_count )  THEN
                 message_string = 'netCDF file for volume data ' // &
@@ -1466,9 +1492,22 @@
                                  'e the number of output time levels&has b' // &
                                  'een increased compared to the previous s' // &
-                                 'imulation.' //                                &
+                                 'imulation.' //                               &
                                  '&New file is created instead.'
                 CALL message( 'define_netcdf_header', 'PA0388', 0, 1, 0, 6, 0 )
                 do3d_time_count(av) = 0
                 extend = .FALSE.
+!
+!--             Recalculate the needed time levels for the new file.
+                IF ( av == 0 )  THEN
+                   ntdim_3d(0) = CEILING(                               &
+                           ( end_time - MAX( skip_time_do3d,            &
+                                             simulated_time_at_begin )  &
+                           ) / dt_do3d )
+                ELSE
+                   ntdim_3d(1) = CEILING(                               &
+                           ( end_time - MAX( skip_time_data_output_av,  &
+                                             simulated_time_at_begin )  &
+                           ) / dt_data_output_av )
+                ENDIF
                 RETURN
              ENDIF
@@ -2219,4 +2258,22 @@
 
           IF ( netcdf_data_format > 4 )  THEN
+!
+!--          Set needed time levels (ntdim) to 
+!--          saved time levels + to be saved time levels.
+             IF ( av == 0 )  THEN 
+                ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING(             &
+                                 ( end_time - MAX( skip_time_do2d_xy,         &
+                                                   simulated_time_at_begin )  &
+                                 ) / dt_do2d_xy )
+             ELSE
+                ntdim_2d_xy(1) = do2d_xy_time_count(1) + CEILING(             &
+                                 ( end_time - MAX( skip_time_data_output_av,  &
+                                                   simulated_time_at_begin )  &
+                                 ) / dt_data_output_av )
+             ENDIF
+
+!
+!--          Check if the needed number of output time levels is increased
+!--          compared to the number of time levels in the existing file.
              IF ( ntdim_2d_xy(av) > ntime_count )  THEN
                 message_string = 'netCDF file for cross sections ' //          &
@@ -2225,9 +2282,22 @@
                                  'e the number of output time levels&has b' // &
                                  'een increased compared to the previous s' // &
-                                 'imulation.' //                                &
+                                 'imulation.' //                               &
                                  '&New file is created instead.'
                 CALL message( 'define_netcdf_header', 'PA0389', 0, 1, 0, 6, 0 )
                 do2d_xy_time_count(av) = 0
                 extend = .FALSE.
+!
+!--             Recalculate the needed time levels for the new file.
+                IF ( av == 0 )  THEN
+                   ntdim_2d_xy(0) = CEILING(                            &
+                           ( end_time - MAX( skip_time_do2d_xy,         &
+                                             simulated_time_at_begin )  &
+                           ) / dt_do2d_xy )
+                ELSE
+                   ntdim_2d_xy(1) = CEILING(                            &
+                           ( end_time - MAX( skip_time_data_output_av,  &
+                                             simulated_time_at_begin )  &
+                           ) / dt_data_output_av )
+                ENDIF
                 RETURN
              ENDIF
@@ -2879,6 +2949,24 @@
              RETURN
           ENDIF
-          
+
           IF ( netcdf_data_format > 4 )  THEN
+!
+!--          Set needed time levels (ntdim) to 
+!--          saved time levels + to be saved time levels.
+             IF ( av == 0 )  THEN 
+                ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING(             &
+                                 ( end_time - MAX( skip_time_do2d_xz,         &
+                                                   simulated_time_at_begin )  &
+                                 ) / dt_do2d_xz )
+             ELSE
+                ntdim_2d_xz(1) = do2d_xz_time_count(1) + CEILING(             &
+                                 ( end_time - MAX( skip_time_data_output_av,  &
+                                                   simulated_time_at_begin )  &
+                                 ) / dt_data_output_av )
+             ENDIF
+
+!
+!--          Check if the needed number of output time levels is increased
+!--          compared to the number of time levels in the existing file.
              IF ( ntdim_2d_xz(av) > ntime_count )  THEN
                 message_string = 'netCDF file for cross sections ' // &
@@ -2887,9 +2975,22 @@
                                  'e the number of output time levels&has b' // &
                                  'een increased compared to the previous s' // &
-                                 'imulation.' //                                &
+                                 'imulation.' //                               &
                                  '&New file is created instead.'
                 CALL message( 'define_netcdf_header', 'PA0390', 0, 1, 0, 6, 0 )
                 do2d_xz_time_count(av) = 0
                 extend = .FALSE.
+!
+!--             Recalculate the needed time levels for the new file.
+                IF ( av == 0 )  THEN
+                   ntdim_2d_xz(0) = CEILING(                            &
+                           ( end_time - MAX( skip_time_do2d_xz,         &
+                                             simulated_time_at_begin )  &
+                           ) / dt_do2d_xz )
+                ELSE
+                   ntdim_2d_xz(1) = CEILING(                            &
+                           ( end_time - MAX( skip_time_data_output_av,  &
+                                             simulated_time_at_begin )  &
+                           ) / dt_data_output_av )
+                ENDIF
                 RETURN
              ENDIF
@@ -3546,4 +3647,22 @@
 
           IF ( netcdf_data_format > 4 )  THEN
+!
+!--          Set needed time levels (ntdim) to 
+!--          saved time levels + to be saved time levels.
+             IF ( av == 0 )  THEN 
+                ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING(             &
+                                 ( end_time - MAX( skip_time_do2d_yz,         &
+                                                   simulated_time_at_begin )  &
+                                 ) / dt_do2d_yz )
+             ELSE
+                ntdim_2d_yz(1) = do2d_yz_time_count(1) + CEILING(             &
+                                 ( end_time - MAX( skip_time_data_output_av,  &
+                                                   simulated_time_at_begin )  &
+                                 ) / dt_data_output_av )
+             ENDIF
+
+!
+!--          Check if the needed number of output time levels is increased
+!--          compared to the number of time levels in the existing file.
              IF ( ntdim_2d_yz(av) > ntime_count )  THEN
                 message_string = 'netCDF file for cross sections ' //          &
@@ -3557,4 +3676,17 @@
                 do2d_yz_time_count(av) = 0
                 extend = .FALSE.
+!
+!--             Recalculate the needed time levels for the new file.
+                IF ( av == 0 )  THEN
+                   ntdim_2d_yz(0) = CEILING(                            &
+                           ( end_time - MAX( skip_time_do2d_yz,         &
+                                             simulated_time_at_begin )  &
+                           ) / dt_do2d_yz )
+                ELSE
+                   ntdim_2d_yz(1) = CEILING(                            &
+                           ( end_time - MAX( skip_time_data_output_av,  &
+                                             simulated_time_at_begin )  &
+                           ) / dt_data_output_av )
+                ENDIF
                 RETURN
              ENDIF
@@ -5103,6 +5235,6 @@
     IF ( netcdf_data_format == 1 )  THEN
 !
-!-- Classic netCDF format
-    nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id )
+!--    Classic netCDF format
+       nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id )
 
     ELSEIF ( netcdf_data_format == 2 )  THEN
@@ -5124,5 +5256,5 @@
 !--    netCDF4/HDF5 format with classic model flag
        nc_stat = NF90_CREATE( filename,                                        &
-                              IOR( NF90_NOCLOBBER,                              &
+                              IOR( NF90_NOCLOBBER,                             &
                               IOR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ), id )
 
@@ -5132,6 +5264,6 @@
 !--    netCDF4/HDF5 format, parallel
        nc_stat = NF90_CREATE( filename,                                        &
-                              IOR( NF90_NOCLOBBER,                              &
-                              IOR( NF90_NETCDF4, NF90_MPIIO ) ),                &
+                              IOR( NF90_NOCLOBBER,                             &
+                              IOR( NF90_NETCDF4, NF90_MPIIO ) ),               &
                               id, COMM = comm2d, INFO = MPI_INFO_NULL )
 
@@ -5140,7 +5272,7 @@
 !--    netCDF4/HDF5 format with classic model flag, parallel
        nc_stat = NF90_CREATE( filename,                                        &
-                              IOR( NF90_NOCLOBBER,                              &
-                              IOR( NF90_MPIIO,                                  &
-                              IOR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ) ),         &
+                              IOR( NF90_NOCLOBBER,                             &
+                              IOR( NF90_MPIIO,                                 &
+                              IOR( NF90_CLASSIC_MODEL, NF90_HDF5 ) ) ),        &
                               id, COMM = comm2d, INFO = MPI_INFO_NULL )
 
