SCORPIO  2.0.4
Error Handling

By default, SCORPIO handles errors internally by printing a string describing the error and then calling mpi_abort. Application developers can change this behaivior with a call to PIO_seterrorhandling

 call pio_seterrorhandling(File, PIO_BCAST_ERROR)
 ierr =  pio_inq_varid(File, 'U', uid)
 call pio_seterrorhandling(File, PIO_INTERNAL_ERROR)
 if(ierr/= PIO_NOERR) then
   write(stderr,*) 'Variable U not found on input file, setting to 0'
   U=0
 else
   ...
 endif

The four types of error handling methods are:

  • PIO_INTERNAL_ERROR : abort on error from any task
  • PIO_BCAST_ERROR : broadcast an error from io_rank 0 to all tasks in comm
  • PIO_REDUCE_ERROR : Reduce error across all tasks in comm
  • PIO_RETURN_ERROR : do nothing - allow the user to handle it

Use this instead of ios to set error handling for the library.