file_io_status Subroutine

public subroutine file_io_status(istat_, iomsg_, channel_, op_, unit_)

check the status during various io operations on files

Arguments

Type IntentOptional Attributes Name
integer(kind=int32) :: istat_

result of iostat in open/read/write/close

character(len=*), intent(in) :: iomsg_

result of iomsg in open/read/write/close

integer(kind=int32), intent(in) :: channel_

name of the file

character(len=1), intent(in) :: op_

'o' for opening of the file, 'r' for reading, 'w' for writing, 'c' for closing

integer(kind=int32), intent(in), optional :: unit_

optional, unit where the message will be written


Calls

proc~~file_io_status~~CallsGraph proc~file_io_status file_io_status proc~integer_to_character integer_to_character proc~file_io_status->proc~integer_to_character proc~write_error write_error proc~file_io_status->proc~write_error proc~write_message write_message proc~write_error->proc~write_message

Called by

proc~~file_io_status~~CalledByGraph proc~file_io_status file_io_status proc~read_radial_coupling_terms read_radial_coupling_terms proc~read_radial_coupling_terms->proc~file_io_status proc~read_input_file read_input_file proc~read_input_file->proc~file_io_status proc~save_s_matrix_file_header save_s_matrix_file_header proc~save_s_matrix_file_header->proc~file_io_status proc~save_partial_xs_file_header save_partial_xs_file_header proc~save_partial_xs_file_header->proc~file_io_status program~scattering SCATTERING program~scattering->proc~read_radial_coupling_terms program~scattering->proc~read_input_file program~scattering->proc~save_s_matrix_file_header program~scattering->proc~save_partial_xs_file_header

Contents

Source Code


Variables

Type Visibility Attributes Name Initial
character(len=:), private, allocatable :: add_prefix_

Source Code

      subroutine file_io_status(istat_, iomsg_, channel_, op_, unit_)
         !! check the status during various io operations on files
         !---------------------------------------------------------------------!
         integer(int32)                       :: istat_
            !! result of iostat in open/read/write/close
         character(len = *), intent(in)       :: iomsg_
            !! result of iomsg in open/read/write/close
         integer(int32), intent(in)           :: channel_
            !! name of the file
         character(len = 1), intent(in)       :: op_
            !! 'o' for opening of the file, 'r' for reading, 'w' for writing,
            !! 'c' for closing
         integer(int32), optional, intent(in) :: unit_
            !! optional, unit where the message will be written
         !---------------------------------------------------------------------!
         character(len = :), allocatable :: add_prefix_
         !---------------------------------------------------------------------!
         add_prefix_ = ''
         if (istat_ /= 0) then
            select case(op_)
               case('o')
                  add_prefix_ = 'opening file on channel: '//                  &
                     integer_to_character(channel_)
               case('r')
                  add_prefix_ = 'reading file on channel: '//                  &
                     integer_to_character(channel_)
               case('w')
                  add_prefix_ = 'writing to file on channel: '//               &
                     integer_to_character(channel_)
               case('c')
                  add_prefix_ = 'closing file on channel: '//                  &
                     integer_to_character(channel_)
               case default
                  call write_error                                             &
                       ('Incorrect op_ argument in file_io_status subroutine ('&
                          //trim(op_)//')')
            end select
            call write_error(trim(add_prefix_) // " with message: " //         &
               iomsg_, unit_)
         endif
         !---------------------------------------------------------------------!
      end subroutine file_io_status