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])
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Interfaced with readLine()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |