Skip to content

Commit

Permalink
Added a catch for NC_EINVAL errors on file opening (in this case, try…
Browse files Browse the repository at this point in the history
… plain netcdf before giving up and throwing a total error). This addresses the runtime error in test ERP_Ln9.f19_f19.FW5.yellowstone_intel.cam-outfrq9s
  • Loading branch information
Katetc committed Apr 15, 2016
1 parent 467cb31 commit 17da322
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/clib/pio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int PIOc_openfile(const int iosysid, int *ncidp, int *iotype,
mpierr = MPI_Bcast(&(file->iotype), 1, MPI_INT, ios->compmaster, ios->intercomm);
mpierr = MPI_Bcast(&(file->mode), 1, MPI_INT, ios->compmaster, ios->intercomm);
}

if(ios->ioproc){

switch(file->iotype){
Expand Down Expand Up @@ -113,7 +113,7 @@ int PIOc_openfile(const int iosysid, int *ncidp, int *iotype,
// If we failed to open a file due to an incompatible type of NetCDF, try it
// once with just plain old basic NetCDF
#ifdef _NETCDF
if(ierr == NC_ENOTNC && (file->iotype != PIO_IOTYPE_NETCDF)) {
if((ierr == NC_ENOTNC || ierr == NC_EINVAL) && (file->iotype != PIO_IOTYPE_NETCDF)) {
if(ios->iomaster) printf("PIO2 pio_file.c retry NETCDF\n");
// reset ierr on all tasks
ierr = PIO_NOERR;
Expand Down

0 comments on commit 17da322

Please sign in to comment.