PIO  1.7.1
 All Classes Files Functions Groups Pages
Functions/Subroutines
PIO_seterrorhandling

sets the form of error handling for pio. More...

Functions/Subroutines

subroutine piolib_mod::seterrorhandlingf (file, method)
 set the pio error handling method for a file More...
 
subroutine piolib_mod::seterrorhandlingi (ios, method)
 set the pio error handling method for the iosystem More...
 

Detailed Description

sets the form of error handling for pio.

By default pio handles errors internally by printing a string describing the error and calling mpi_abort. Application developers can change this behavior for calls to the underlying netcdf libraries with a call to PIO_seterrorhandling. For example if a developer wanted to see if an input netcdf format file contained the variable 'u' they might write the following

 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

Function/Subroutine Documentation

subroutine piolib_mod::seterrorhandlingf ( type(file_desc_t), intent(inout)  file,
integer, intent(in)  method 
)

set the pio error handling method for a file

Parameters
file\copybrieffile_desc_t
Parameters
method:

The three 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_RETURN_ERROR : do nothing - allow the user to handle it
subroutine piolib_mod::seterrorhandlingi ( type(iosystem_desc_t), intent(inout)  ios,
integer, intent(in)  method 
)

set the pio error handling method for the iosystem

Parameters
iosystem: a defined pio system descriptor, see PIO_types
method:

The three 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_RETURN_ERROR : do nothing - allow the user to handle it