From b875ecc8d7277358249a6c32a2bdb3074defb554 Mon Sep 17 00:00:00 2001 From: Dan Kokron Date: Wed, 8 Nov 2023 15:10:23 +0000 Subject: [PATCH] Remove debugging prints per Rusty Benson --- fms2_io/include/netcdf_read_data.inc | 6 ++++-- fms2_io/netcdf_io.F90 | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fms2_io/include/netcdf_read_data.inc b/fms2_io/include/netcdf_read_data.inc index a36536559..1dee8ad8f 100644 --- a/fms2_io/include/netcdf_read_data.inc +++ b/fms2_io/include/netcdf_read_data.inc @@ -355,7 +355,6 @@ subroutine netcdf_read_data_2d(fileobj, variable_name, buf, unlim_dim_level, & c(unlim_dim_index) = unlim_dim_level endif if (fileobj%is_root) then - !write(6,'("netcdf_read_data_2d:"3A)') trim(fileobj%path), ' ', trim(variable_name) varid = get_variable_id(fileobj%ncid, trim(variable_name), msg=append_error_msg) select type(buf) type is (integer(kind=i4_kind)) @@ -363,6 +362,8 @@ subroutine netcdf_read_data_2d(fileobj, variable_name, buf, unlim_dim_level, & type is (integer(kind=i8_kind)) err = nf90_get_var(fileobj%ncid, varid, buf, start=c, count=e) type is (real(kind=r4_kind)) + ! NetCDF does not have the ability to specify collective I/O at the file basis + ! so we must activate at the variable level if(fileobj%use_collective) err = nf90_var_par_access(fileobj%ncid, varid, nf90_collective) err = nf90_get_var(fileobj%ncid, varid, buf, start=c, count=e) type is (real(kind=r8_kind)) @@ -450,7 +451,6 @@ subroutine netcdf_read_data_3d(fileobj, variable_name, buf, unlim_dim_level, & c(unlim_dim_index) = unlim_dim_level endif if (fileobj%is_root) then - !write(6,'("netcdf_read_data_3d:"3A)') trim(fileobj%path),' ',trim(variable_name) varid = get_variable_id(fileobj%ncid, trim(variable_name), msg=append_error_msg) select type(buf) type is (integer(kind=i4_kind)) @@ -458,6 +458,8 @@ subroutine netcdf_read_data_3d(fileobj, variable_name, buf, unlim_dim_level, & type is (integer(kind=i8_kind)) err = nf90_get_var(fileobj%ncid, varid, buf, start=c, count=e) type is (real(kind=r4_kind)) + ! NetCDF does not have the ability to specify collective I/O at the file basis + ! so we must activate at the variable level if(fileobj%use_collective) err = nf90_var_par_access(fileobj%ncid, varid, nf90_collective) err = nf90_get_var(fileobj%ncid, varid, buf, start=c, count=e) type is (real(kind=r8_kind)) diff --git a/fms2_io/netcdf_io.F90 b/fms2_io/netcdf_io.F90 index a78a52bd7..08d42159b 100644 --- a/fms2_io/netcdf_io.F90 +++ b/fms2_io/netcdf_io.F90 @@ -660,10 +660,13 @@ function netcdf_file_open(fileobj, path, mode, nc_format, pelist, is_restart, do endif if (string_compare(mode, "read", .true.)) then - !print*,'netcdf_file_open: ',trim(fileobj%path) + ! Compare the current file against the list provided by the user in the fms2_io_collective_nml section of input.nml do i=1,fms2_num_collective if(string_compare(trim(fileobj%path), trim(fn_collective(i)), .true.)) fileobj%use_collective = .true. enddo + ! Open the file for collective reads if the user requested that treatment + ! NetCDF does not have the ability to specify collective I/O at the file basis + ! so we must activate at the variable level in netcdf_read_data_2d() and netcdf_read_data_3d() if(fileobj%use_collective) then err = nf90_open(trim(fileobj%path), ior(NF90_NOWRITE, NF90_MPIIO), fileobj%ncid, comm=mpp_comm_private, info=MPI_INFO_NULL) else