4
1
mirror of https://github.com/pfloos/quack synced 2024-09-27 03:51:04 +02:00

few modifs in QuAck tests

This commit is contained in:
Abdallah Ammar 2024-08-29 15:19:16 +02:00
parent 0b28512edc
commit 8d7fb2a292
4 changed files with 20 additions and 19 deletions

View File

@ -9,12 +9,12 @@ subroutine check_test_value(branch)
! Local variables
character(len=30) :: description
double precision :: value
double precision :: val
double precision :: reference
character(len=15) :: answer
logical :: failed
double precision,parameter :: cutoff = 1d-10
double precision,parameter :: thresh = 1d-10
! Output variables
@ -45,19 +45,19 @@ subroutine check_test_value(branch)
do
read(11,'(A30)',end=11) description
read(11,'(F20.15)',end=11) value
read(11,'(F20.15)',end=11) val
read(12,*,end=12)
read(12,'(F20.15)',end=12) reference
if(abs(value-reference) < cutoff) then
if(dabs(val-reference)/(1d-15+dabs(reference)) < thresh) then
answer = '.......... :-)'
else
answer = '.......... :-( '
failed = .true.
end if
write(*,'(1X,A1,1X,A30,1X,A1,1X,3F15.10,1X,A1,1X,A15,1X,A1)') &
'|',description,'|',value,reference,abs(value-reference),'|',answer,'|'
'|',description,'|',val,reference,abs(val-reference),'|',answer,'|'
end do

View File

@ -1,4 +1,4 @@
subroutine dump_test_value(branch,description,value)
subroutine dump_test_value(branch, description, val)
implicit none
@ -7,7 +7,7 @@ subroutine dump_test_value(branch,description,value)
character(len=1),intent(in) :: branch
character(len=*),intent(in) :: description
double precision,intent(in) :: value
double precision,intent(in) :: val
! Local variables
@ -15,18 +15,19 @@ subroutine dump_test_value(branch,description,value)
if(branch == 'R') then
write(11,*) trim(description)
write(11,'(F20.15)') value
!write(1231597, '(A, ": ", F20.15)') '"' // trim(description) // '"', val
write(1231597, *) trim(description)
write(1231597, '(F20.15)') val
elseif(branch == 'U') then
write(12,*) trim(description)
write(12,'(F20.15)') value
write(1232584,*) trim(description)
write(1232584,'(F20.15)') val
elseif(branch == 'G') then
write(13,*) trim(description)
write(13,'(F20.15)') value
write(1234181,*) trim(description)
write(1234181,'(F20.15)') val
else

View File

@ -12,10 +12,10 @@ subroutine init_test(doRtest,doUtest,doGtest)
! Output variables
if(doRtest) open(unit=11,file='test/Rtest.dat')
if(doRtest) open(unit=1231597, file='test/Rtest.dat')
if(doUtest) open(unit=12,file='test/Utest.dat')
if(doUtest) open(unit=1232584, file='test/Utest.dat')
if(doGtest) open(unit=13,file='test/Gtest.dat')
if(doGtest) open(unit=1234181, file='test/Gtest.dat')
end subroutine

View File

@ -12,10 +12,10 @@ subroutine stop_test(doRtest,doUtest,doGtest)
! Output variables
if(doRtest) close(unit=11)
if(doRtest) close(unit=1231597)
if(doUtest) close(unit=12)
if(doUtest) close(unit=1231597)
if(doGtest) close(unit=13)
if(doGtest) close(unit=1234181)
end subroutine