diff --git a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 index 9028fa9b7..94331edf1 100644 --- a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 @@ -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) diff --git a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 index fdb9330d2..b487c243d 100644 --- a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 @@ -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)