Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm backward compatibility for PIO reads on non-parallel files #966

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,14 @@ subroutine ice_pio_init(mode, filename, File, clobber, fformat, &
write(nu_diag,*) subname//' opening file for reading '//trim(filename)
endif
status = pio_openfile(ice_pio_subsystem, File, pio_iotype, trim(filename), pio_nowrite)
call ice_pio_check( status, subname//' ERROR: Failed to open file '//trim(filename), &
file=__FILE__,line=__LINE__)
if (status /= PIO_NOERR) then
if (my_task == master_task) then
write(nu_diag,*) subname//' opening '//trim(filename)//' as type '//trim(fformat)//' failed, retrying as type cdf1'
endif
status = pio_openfile(ice_pio_subsystem, File, PIO_IOTYPE_NETCDF, trim(filename), pio_nowrite)
call ice_pio_check( status, subname//' ERROR: Failed to open file '//trim(filename), &
file=__FILE__,line=__LINE__)
endif
else
if(my_task==master_task) then
write(nu_diag,*) subname//' ERROR: file not found '//trim(filename)
Expand Down
7 changes: 1 addition & 6 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,8 @@ subroutine init_restart_read(ice_ic)
end if

File%fh=-1
! tcraig, including fformat here causes some problems when restart_format=hdf5
! and reading non hdf5 files with spack built PIO. Excluding the fformat
! argument here defaults the PIO format to cdf1 which then reads
! any netcdf format file fine.
call ice_pio_init(mode='read', filename=trim(filename), File=File, &
! fformat=trim(restart_format), rearr=trim(restart_rearranger), &
rearr=trim(restart_rearranger), &
fformat=trim(restart_format), rearr=trim(restart_rearranger), &
iotasks=restart_iotasks, root=restart_root, stride=restart_stride, &
debug=first_call)

Expand Down
Loading