readline Interface

public interface readline

Read in multiple items from a line

Example usage

use variableKind
use m_readline
character(len=:),allocatable :: s
real(r64) :: a,b,c
real(r64) :: a1D(3)
s = '1.0 2.0 3.0'
call readline(a, b, c, 'No File Name', 0, s) ! Read 3 scalars from a string
write(*,*) 'a should equal 1.0 ',a == 1.d0
write(*,*) 'b should equal 2.0 ',b == 2.d0
write(*,*) 'c should equal 3.0 ',c == 3.d0
call readline(a1D, 'No File Name', 0, s) ! Read a length 3 1D array from a string
write(*,*) 'a1D should equal [1.0,2.0,3.0] ',all(a == [1.d0,2.d0,3.d0])


Module Procedures

private subroutine readLine_a(a, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_ab(a, b, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abc(a, b, c, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcd(a, b, c, d, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

real(kind=r64), intent(out) :: d

Number

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcde(a, b, c, d, e, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

real(kind=r64), intent(out) :: d

Number

real(kind=r64), intent(out) :: e

Number

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_av(a, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_avbv(a, b, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a(:)

Vector

real(kind=r64), intent(out) :: b(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_avbvcv(a, b, c, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a(:)

Vector

real(kind=r64), intent(out) :: b(:)

Vector

real(kind=r64), intent(out) :: c(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abv(a, b, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abvcv(a, b, c, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b(:)

Vector

real(kind=r64), intent(out) :: c(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcdev(a, b, c, d, e, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

real(kind=r64), intent(out) :: d

Number

real(kind=r64), intent(out) :: e(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcdv(a, b, c, d, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

real(kind=r64), intent(out) :: d(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcdvev(a, b, c, d, e, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

real(kind=r64), intent(out) :: d(:)

Vector

real(kind=r64), intent(out) :: e(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcv(a, b, c, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcvdv(a, b, c, d, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c(:)

Vector

real(kind=r64), intent(out) :: d(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcdefv(a, b, c, d, e, f, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

real(kind=r64), intent(out) :: d

Number

real(kind=r64), intent(out) :: e

Number

real(kind=r64), intent(out) :: f(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file

private subroutine readLine_abcdefvgv(a, b, c, d, e, f, g, fname, iunit, buf)

Interfaced with readLine()

Arguments

Type IntentOptional AttributesName
real(kind=r64), intent(out) :: a

Number

real(kind=r64), intent(out) :: b

Number

real(kind=r64), intent(out) :: c

Number

real(kind=r64), intent(out) :: d

Number

real(kind=r64), intent(out) :: e

Number

real(kind=r64), intent(out) :: f(:)

Vector

real(kind=r64), intent(out) :: g(:)

Vector

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

File name

integer(kind=i32), intent(in) :: iunit

File id number to read from

character(len=*), intent(in), optional :: buf

Character string to read from instead of the line in the file


allocate allocate_test appendString arange argInsertionsort argMedianOf3 argPartition argSelect argSort array1D_test binarySearch checkIsOpen closeFile compact compare compare_d1 copy copy_test countEntries crossproduct cumprod cumsum dArgDynamicArray dArgDynamicArray_test daysInMonth daysInYear dDynamicArray dDynamicArray_test deallocate debug debug_s deleteFile diff eMsg fastTwoDiff fastTwoSum fErr fileExists fileIO_test geometricMean getExtension getFileSize getNFileLines getRandomSeed hasExtension hasNentries iachar1D iArgDynamicArray iArgDynamicArray_test idArgDynamicArray idArgDynamicArray_test idDynamicArray idDynamicArray_test iDynamicArray iDynamicArray_test ind2sub indexing_test insertionsort integerBin intervalSearch isLeapYear isOpen isSorted isString KdTree KdTree_test lowerCase maths_test mean median medianOf3 mErr msg norm1 normI openBinaryFile openFile partition partition3way partition3way_d1D prependString Prng Prng_test ProgressBar project random_test rArgDynamicArray rArgDynamicArray_test rDynamicArray rDynamicArray_test read1Dble read1Integer readline readline reallocate reallocate_test removeComments repeat replacedelim rngExponential rngExponential_d1 rngExponential_d1D rngExponential_d2D rngExponential_d3D rngExponential_unscaled_d1 rngInteger rngInteger_i1 rngInteger_i1D rngInteger_i2D rngInteger_i3D rngNormal rngNormal_d1 rngNormal_d1D rngNormal_d2D rngNormal_d3D rngUniform rngUniform_d1 rngUniform_d1D rngUniform_d2D rngUniform_d3D rngUniform_xorshift rngWeibull rngWeibull_d1 rngWeibull_d1D rngWeibull_d2D rngWeibull_d3D secondsToHMS select select_test setPrng setPrng_withSeed setPrng_WOseed shuffle simpleSearch skipFileLines sort sorting_test std str strings_test sub2ind swap test tester time_test timeInSeconds timeToInteger trimExtension trimmedmean twoDiff twoSum upperCase variance wMsg writeline