program ltest2 implicit none integer(4), parameter :: novol = 4759135 ! number of volumes integer(4), parameter :: noq = 18647560 ! total number of flows real (4), parameter :: dt = 900.0 ! time step size real (4) volume0(novol) ! volume start of time step real (4) volume1(novol) ! volume end of time step real (4) flow ( noq) ! number of flows integer(4) ipnt(4,noq) ! exchange pointer real (4) dif ! time step size integer itim1, itim2 ! times in the files integer ierr ! eof indicator integer iq, ivol ! loop variables integer ifrom, ito ! from and to volume numbers integer i, j ! loop variables open ( 20, file='report.out' ) open ( 21, file='stacks_355-355.vol', form='binary' ) open ( 22, file='stacks_355-355.flo', form='binary' ) open ( 23, file='stacks_355-355.poi', form='binary' ) open ( 31, file='volume_3.out', recl=200 ) read ( 23 ) ipnt read ( 21, iostat=ierr ) itim1, volume1 write ( 31, * ) itim1, volume1(3) read ( 22 ) itim2, flow write ( 20, * ) 'Time = ',itim1 do j = 1, 3 do iq = 1, noq if ( ipnt(1,iq) .gt. 0 ) volume1(ipnt(1,iq)) = volume1(ipnt(1,iq)) - flow(iq)*dt if ( ipnt(2,iq) .gt. 0 ) volume1(ipnt(2,iq)) = volume1(ipnt(2,iq)) + flow(iq)*dt if ( ipnt(1,iq) .eq. 3 .or. ipnt(2,iq) .eq. 3 ) then write ( 31, '(3i8,3e16.7)' ) iq, ipnt(1,iq), ipnt(2,iq) , flow(iq), flow(iq)*dt, volume1(3) endif enddo read ( 21, iostat=ierr ) itim1, volume0 write ( 31, * ) itim1, volume0(3) do ivol = 1, novol if ( abs(volume0(ivol)-volume1(ivol)) .gt. 1.0E-4*volume1(ivol) ) & & write ( 20, '(i8,3e15.6)' ) ivol, volume0(ivol), volume1(ivol), abs(volume0(ivol)-volume1(ivol))/volume1(ivol) enddo write ( 31, '(i8,3e15.6)' ) 3, volume0(3), volume1(3), abs(volume0(3)-volume1(3))/volume1(3) write ( 20, * ) 'Time = ',itim1 read ( 22 ) itim2, flow volume1 = volume0 enddo stop end