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