From 660dce0f092f335d77553b3ca8ff2b684c1b8d23 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 19 Jun 2009 07:09:39 +0000 Subject: [PATCH] now safe to request values from config-parsing which are not present. 3rd and up value of key "xyz" would return "0" or "0.0" in this example: xyz 1.234 4.321 --- trunk/IO.f90 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/trunk/IO.f90 b/trunk/IO.f90 index 35858b26d..031dc3e77 100644 --- a/trunk/IO.f90 +++ b/trunk/IO.f90 @@ -497,10 +497,12 @@ endfunction integer(pInt), intent(in) :: positions(*),pos real(pReal) IO_floatValue - if (positions(1) >= pos) then + if (positions(1) < pos) then + IO_floatValue = 0.0_pReal + else read(UNIT=line(positions(pos*2):positions(pos*2+1)),ERR=100,FMT=*) IO_floatValue - return endif + return 100 IO_floatValue = huge(1.0_pReal) return @@ -568,10 +570,12 @@ endfunction integer(pInt), intent(in) :: positions(*),pos integer(pInt) IO_intValue - if (positions(1) >= pos) then + if (positions(1) < pos) then + IO_intValue = 0_pInt + else read(UNIT=line(positions(pos*2):positions(pos*2+1)),ERR=100,FMT=*) IO_intValue - return endif + return 100 IO_intValue = huge(1_pInt) return