!<
!dix
!
!Usage:
!dix <in.H >out.H
!
!Description
! Converts from interval to RMS velocity
!>
!%end of self-documentation
program dix
implicit none
integer i1,i2,i3,n1,n2,n3
real,allocatable,dimension(:,:) :: array
real time,val,dt,dx
integer hetch, putch
call initpar()
call doc('/homes/sep/bob/papers/ratfor90/dix.rs90')
if (0==hetch('n1','d',n1)) then
call seperr('Could not obtain n1 from history')
end if
if (0/=putch('From history: n1','d',n1)) then
call seperr('trouble writing n1 to history file')
end if
if (0==hetch('n2','d',n2)) then
call seperr('Could not obtain n2 from history')
end if
if (0/=putch('From history: n2','d',n2)) then
call seperr('trouble writing n2 to history file')
end if
if (0==hetch('n2','d',n2)) then
call seperr('Could not obtain n2 from history')
end if
if (0/=putch('From history: n2','d',n2)) then
call seperr('trouble writing n2 to history file')
end if
!from the history file
if (0==hetch('','f',)) then
call seperr('Could not obtain from history')
end if
if (0/=putch('From history: ','f',)) then
call seperr('trouble writing to history file')
end if
if (0==hetch('','f',)) then
call seperr('Could not obtain from history')
end if
if (0/=putch('From history: ','f',)) then
call seperr('trouble writing to history file')
end if
allocate(array(n1,n2))
do i3=1,n3
call sreed("in",array,n1*n2*4)
array=1./array !Fortran90 array manipulation
do i2=1,n2
time=0.
val=0.
do i1=1,n1
dt=dx/array(i1,i2)
val = val + dt*array(i1,i2)**2 !add sum Ratfor90 feature
time = time + dt
array(i1,i2)=sqrt(val/time)
end do
end do
call srite("out",array,n1*n2*4)
end do
end program
!bracketed programs
B