subroutine ioqi
use modglobal, only: ib, ie, jb, je, ih, jh, kb, ke, kh, dxhi, rk3step, dt
use modfields, only: qt0, qtm, qtprof, uouttot
use modinletdata, only: ubulk
integer k,j
real rk3coef
rk3coef = dt/(4.-dble(rk3step))
do k = kb, ke
do j = jb, je
qt0(ib - 1, j, k) = 2*qtprof(k) - qt0(ib, j, k) !watch!
qtm(ib - 1, j, k) = 2*qtprof(k) - qtm(ib, j, k)
end do
end do
!uouttot is zero unless lmassflowr
qt0(ie + 1, :, :) = qt0(ie, :, :) - (qt0(ie + 1, :, :) - qt0(ie, :, :))*dxhi(ie + 1)*rk3coef*uouttot ! tg3315 should be uouttot and will have to change depending on forcing
qtm(ie + 1, :, :) = qtm(ie, :, :) - (qtm(ie + 1, :, :) - qtm(ie, :, :))*dxhi(ie + 1)*rk3coef*uouttot
end subroutine ioqi