From 6d3c46483c9536e00f9f8f81f2af74671848a514 Mon Sep 17 00:00:00 2001 From: uramirez8707 <49168881+uramirez8707@users.noreply.github.com> Date: Thu, 14 Apr 2022 08:44:17 -0400 Subject: [PATCH] fix: root pe bug with fms2_io::flush_file (#958) --- fms2_io/netcdf_io.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fms2_io/netcdf_io.F90 b/fms2_io/netcdf_io.F90 index fc64fdd2a2..c6984bb237 100644 --- a/fms2_io/netcdf_io.F90 +++ b/fms2_io/netcdf_io.F90 @@ -2283,8 +2283,10 @@ subroutine flush_file(fileobj) integer :: err !< Netcdf error code - err = nf90_sync(fileobj%ncid) - call check_netcdf_code(err, "Flush_file: File:"//trim(fileobj%path)) + if (fileobj%is_root) then + err = nf90_sync(fileobj%ncid) + call check_netcdf_code(err, "Flush_file: File:"//trim(fileobj%path)) + endif end subroutine flush_file end module netcdf_io_mod