Skip to content

Commit

Permalink
Remove debugging prints per Rusty Benson
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Kokron authored and Dan Kokron committed Nov 8, 2023
1 parent 43838ac commit b875ecc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions fms2_io/include/netcdf_read_data.inc
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,15 @@ 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))
err = nf90_get_var(fileobj%ncid, varid, buf, start=c, count=e)
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))
Expand Down Expand Up @@ -450,14 +451,15 @@ 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))
err = nf90_get_var(fileobj%ncid, varid, buf, start=c, count=e)
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))
Expand Down
5 changes: 4 additions & 1 deletion fms2_io/netcdf_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b875ecc

Please sign in to comment.