better name
This commit is contained in:
parent
febbddd36a
commit
57ee7e86e4
|
@ -247,6 +247,7 @@ function IO_strValue(str,chunkPos,myChunk)
|
||||||
integer, intent(in) :: myChunk !< position number of desired chunk
|
integer, intent(in) :: myChunk !< position number of desired chunk
|
||||||
character(len=:), allocatable :: IO_strValue
|
character(len=:), allocatable :: IO_strValue
|
||||||
|
|
||||||
|
|
||||||
validChunk: if (myChunk > chunkPos(1) .or. myChunk < 1) then
|
validChunk: if (myChunk > chunkPos(1) .or. myChunk < 1) then
|
||||||
IO_strValue = ''
|
IO_strValue = ''
|
||||||
call IO_error(110,'IO_strValue: "'//trim(str)//'"',label1='chunk',ID1=myChunk)
|
call IO_error(110,'IO_strValue: "'//trim(str)//'"',label1='chunk',ID1=myChunk)
|
||||||
|
@ -266,6 +267,7 @@ integer function IO_intValue(str,chunkPos,myChunk)
|
||||||
integer, dimension(:), intent(in) :: chunkPos !< positions of start and end of each tag/chunk in given string
|
integer, dimension(:), intent(in) :: chunkPos !< positions of start and end of each tag/chunk in given string
|
||||||
integer, intent(in) :: myChunk !< position number of desired chunk
|
integer, intent(in) :: myChunk !< position number of desired chunk
|
||||||
|
|
||||||
|
|
||||||
IO_intValue = IO_strAsInt(IO_strValue(str,chunkPos,myChunk))
|
IO_intValue = IO_strAsInt(IO_strValue(str,chunkPos,myChunk))
|
||||||
|
|
||||||
end function IO_intValue
|
end function IO_intValue
|
||||||
|
@ -280,6 +282,7 @@ real(pREAL) function IO_realValue(str,chunkPos,myChunk)
|
||||||
integer, dimension(:), intent(in) :: chunkPos !< positions of start and end of each tag/chunk in given string
|
integer, dimension(:), intent(in) :: chunkPos !< positions of start and end of each tag/chunk in given string
|
||||||
integer, intent(in) :: myChunk !< position number of desired chunk
|
integer, intent(in) :: myChunk !< position number of desired chunk
|
||||||
|
|
||||||
|
|
||||||
IO_realValue = IO_strAsReal(IO_strValue(str,chunkPos,myChunk))
|
IO_realValue = IO_strAsReal(IO_strValue(str,chunkPos,myChunk))
|
||||||
|
|
||||||
end function IO_realValue
|
end function IO_realValue
|
||||||
|
@ -443,6 +446,7 @@ subroutine IO_error(error_ID,ext_msg,label1,ID1,label2,ID2)
|
||||||
external :: quit
|
external :: quit
|
||||||
character(len=:), allocatable :: msg
|
character(len=:), allocatable :: msg
|
||||||
|
|
||||||
|
|
||||||
select case (error_ID)
|
select case (error_ID)
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -25,13 +25,13 @@ subroutine test_IO_run()
|
||||||
do i = 1, size(rnd_real)
|
do i = 1, size(rnd_real)
|
||||||
rnd_str(i:i) = char(32 + int(rnd_real(i)*(127.-32.)))
|
rnd_str(i:i) = char(32 + int(rnd_real(i)*(127.-32.)))
|
||||||
end do
|
end do
|
||||||
open(newunit=u,file='results.out',status='replace',form='formatted')
|
open(newunit=u,file='test.txt',status='replace',form='formatted')
|
||||||
write(u,'(a)') rnd_str
|
write(u,'(a)') rnd_str
|
||||||
close(u)
|
close(u)
|
||||||
|
|
||||||
str_out = IO_read('results.out')
|
str_out = IO_read('test.txt')
|
||||||
if (rnd_str//IO_EOL /= str_out) error stop 'IO_read'
|
if (rnd_str//IO_EOL /= str_out) error stop 'IO_read'
|
||||||
strarray_out = IO_readlines('results.out')
|
strarray_out = IO_readlines('test.txt')
|
||||||
if (rnd_str /= strarray_out(1)) error stop 'IO_readlines'
|
if (rnd_str /= strarray_out(1)) error stop 'IO_readlines'
|
||||||
|
|
||||||
end subroutine test_IO_run
|
end subroutine test_IO_run
|
||||||
|
|
Loading…
Reference in New Issue