43 subroutine match_wfs_file(ipfile1,ipfile2, ln, dt,dh, hmax,hsum1,hsum2, rdh,lnr)
44 use sufr_kinds
, only: double
45 use sufr_system
, only: find_free_io_unit, quit_program_error
48 character,
intent(in) :: ipfile1*(*), ipfile2*(*)
49 integer,
intent(out) :: ln, lnr
50 real(double),
intent(out) :: dt,dh, hmax,hsum1,hsum2, rdh
52 integer :: ip1,ip2, status
53 real(double) :: t1,t2, h1,h2
55 call find_free_io_unit(ip1)
56 open(unit=ip1,form=
'formatted',status=
'old',action=
'read',position=
'rewind',file=trim(ipfile1),iostat=status)
57 if(status.ne.0) call quit_program_error(
'Error opening '//trim(ipfile1)//
', aborting...', 0)
59 call find_free_io_unit(ip2)
60 open(unit=ip2,form=
'formatted',status=
'old',action=
'read',position=
'rewind',file=trim(ipfile2),iostat=status)
61 if(status.ne.0) call quit_program_error(
'Error opening '//trim(ipfile2)//
', aborting...', 0)
75 read(ip1,*, iostat=status) t1, h1
78 write(0,
'(A,I4,A,/)')
' Error reading '//trim(ipfile1)//
', line',ln,
' aborting...'
82 read(ip2,*, iostat=status) t2, h2
85 write(0,
'(A,I4,A,/)')
' Error reading '//trim(ipfile2)//
', line',ln,
' aborting...'
91 hmax = maxval( (/hmax, abs(h1), abs(h2)/) )
92 hsum1 = hsum1 + abs(h1)
93 hsum2 = hsum2 + abs(h2)
94 if(min(abs(h1),abs(h2)).gt.1.d-23)
then
95 rdh = rdh + abs((h2-h1)/h1)
subroutine match_wfs_file(ipfile1, ipfile2, ln, dt, dh, hmax, hsum1, hsum2, rdh, lnr)
Match the time-domain waveforms in two specified files.