1 subroutine da_togrid_new (x, ib, ie, i, dx, dxm)
3 !-----------------------------------------------------------------------
4 ! Purpose: Transfer obs. x to grid i and calculate its
5 ! distance to grid i and i+1
6 !-----------------------------------------------------------------------
10 real, intent(in) :: x(:,:)
11 integer, intent(in) :: ib, ie
12 real, intent(out) :: dx(:,:), dxm(:,:)
13 integer, intent(out) :: i(:,:)
15 if (trace_use) call da_trace_entry("da_togrid_new")
20 where(i(:,:) < ib) i(:,:) = ib
21 where(i(:,:) >= ie) i(:,:) = ie-1
23 dx(:,:) = x(:,:) - real(i(:,:))
24 dxm(:,:)= 1.0 - dx(:,:)
31 if (trace_use) call da_trace_exit("da_togrid_new")
33 end subroutine da_togrid_new