diff --git a/src/3d/parcels/parcel_diagnostics_netcdf.f90 b/src/3d/parcels/parcel_diagnostics_netcdf.f90 index abf21329..07ad02a3 100644 --- a/src/3d/parcels/parcel_diagnostics_netcdf.f90 +++ b/src/3d/parcels/parcel_diagnostics_netcdf.f90 @@ -337,7 +337,12 @@ subroutine write_netcdf_parcel_stats(t) call start_timer(parcel_stats_io_timer) + ! reset counters for parcel operations + n_parcel_splits = 0 + n_parcel_merges = 0 + if (world%rank /= world%root) then + call stop_timer(parcel_stats_io_timer) return endif @@ -383,10 +388,6 @@ subroutine write_netcdf_parcel_stats(t) ! increment counter n_writes = n_writes + 1 - ! reset counters for parcel operations - n_parcel_splits = 0 - n_parcel_merges = 0 - call close_netcdf_file(ncid, l_serial=.true.) call stop_timer(parcel_stats_io_timer)