stdlib_io Module

Provides a support for file handling (Specification)


Uses

  • module~~stdlib_io~~UsesGraph module~stdlib_io stdlib_io module~stdlib_ascii stdlib_ascii module~stdlib_io->module~stdlib_ascii module~stdlib_kinds stdlib_kinds module~stdlib_io->module~stdlib_kinds module~stdlib_optval stdlib_optval module~stdlib_io->module~stdlib_optval module~stdlib_error stdlib_error module~stdlib_io->module~stdlib_error module~stdlib_ascii->module~stdlib_kinds iso_fortran_env iso_fortran_env module~stdlib_kinds->iso_fortran_env module~stdlib_optval->module~stdlib_kinds module~stdlib_error->module~stdlib_optval module~stdlib_error->iso_fortran_env

Contents


Interfaces

public interface loadtxt

Loads a 2D array from a text file (Specification)

  • private subroutine loadtxt_rsp(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    real(kind=sp), intent(out), allocatable:: d(:,:)

    Example


     real(sp), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_rdp(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    real(kind=dp), intent(out), allocatable:: d(:,:)

    Example


     real(dp), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_rqp(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    real(kind=qp), intent(out), allocatable:: d(:,:)

    Example


     real(qp), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_iint8(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    integer(kind=int8), intent(out), allocatable:: d(:,:)

    Example


     integer(int8), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_iint16(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    integer(kind=int16), intent(out), allocatable:: d(:,:)

    Example


     integer(int16), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_iint32(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    integer(kind=int32), intent(out), allocatable:: d(:,:)

    Example


     integer(int32), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_iint64(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    integer(kind=int64), intent(out), allocatable:: d(:,:)

    Example


     integer(int64), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_csp(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    complex(kind=sp), intent(out), allocatable:: d(:,:)

    Example


     complex(sp), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_cdp(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    complex(kind=dp), intent(out), allocatable:: d(:,:)

    Example


     complex(dp), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    
  • private subroutine loadtxt_cqp(filename, d)

    Loads a 2D array from a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename

    The array 'd' will be automatically allocated with the correct dimensions

    complex(kind=qp), intent(out), allocatable:: d(:,:)

    Example


     complex(qp), allocatable :: data(:, :)
     call loadtxt("log.txt", data)  ! 'data' will be automatically allocated
    

    Where 'log.txt' contains for example::

     1 2 3
     2 4 6
     8 9 10
     11 12 13
     ...
    

public interface savetxt

Saves a 2D array into a text file (Specification)

  • private subroutine savetxt_rsp(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    real(kind=sp), intent(in) :: d(:,:)

    Example


     real(sp) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_rdp(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    real(kind=dp), intent(in) :: d(:,:)

    Example


     real(dp) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_rqp(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    real(kind=qp), intent(in) :: d(:,:)

    Example


     real(qp) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_iint8(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    integer(kind=int8), intent(in) :: d(:,:)

    Example


     integer(int8) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_iint16(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    integer(kind=int16), intent(in) :: d(:,:)

    Example


     integer(int16) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_iint32(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    integer(kind=int32), intent(in) :: d(:,:)

    Example


     integer(int32) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_iint64(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    integer(kind=int64), intent(in) :: d(:,:)

    Example


     integer(int64) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_csp(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    complex(kind=sp), intent(in) :: d(:,:)

    Example


     complex(sp) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_cdp(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    complex(kind=dp), intent(in) :: d(:,:)

    Example


     complex(dp) :: data(3, 2)
     call savetxt("log.txt", data)
    
  • private subroutine savetxt_cqp(filename, d)

    Saves a 2D array into a text file.

    Read more…

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: filename
    complex(kind=qp), intent(in) :: d(:,:)

    Example


     complex(qp) :: data(3, 2)
     call savetxt("log.txt", data)
    

Functions

public function open(filename, mode, iostat) result(u)

Version
experimental

Opens a file (Specification)

Read more…

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: filename
character(len=*), intent(in), optional :: mode
integer, intent(out), optional :: iostat

Return Value integer

public function parse_mode(mode) result(mode_)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: mode

Return Value character(len=3)