1 subroutine da_calculate_grady_tamdar(iv, re, jo_grad_y)
3 !-------------------------------------------------------------------------
4 ! Purpose: Applies obs inverse on re-vector
5 !-------------------------------------------------------------------------
9 type (iv_type), intent(in) :: iv ! Innovation vector.
10 type (y_type), intent(inout) :: re ! Residual vector.
11 type (y_type), intent(inout) :: jo_grad_y ! Grad_y(Jo)
15 if (trace_use_dull) call da_trace_entry("da_calculate_grady_tamdar")
17 do n=1, iv%info(tamdar)%nlocal
18 do k=1, iv%info(tamdar)%levels(n)
19 if (iv%tamdar(n)%u(k)%qc < obs_qc_pointer) re%tamdar(n)%u(k) = 0.0
20 if (iv%tamdar(n)%v(k)%qc < obs_qc_pointer) re%tamdar(n)%v(k) = 0.0
21 if (iv%tamdar(n)%t(k)%qc < obs_qc_pointer) re%tamdar(n)%t(k) = 0.0
22 if (iv%tamdar(n)%q(k)%qc < obs_qc_pointer) re%tamdar(n)%q(k) = 0.0
24 jo_grad_y%tamdar(n)%u(k) = -re%tamdar(n)%u(k) / (iv%tamdar(n)%u(k)%error * iv%tamdar(n)%u(k)%error)
25 jo_grad_y%tamdar(n)%v(k) = -re%tamdar(n)%v(k) / (iv%tamdar(n)%v(k)%error * iv%tamdar(n)%v(k)%error)
26 jo_grad_y%tamdar(n)%t(k) = -re%tamdar(n)%t(k) / (iv%tamdar(n)%t(k)%error * iv%tamdar(n)%t(k)%error)
27 jo_grad_y%tamdar(n)%q(k) = -re%tamdar(n)%q(k) / (iv%tamdar(n)%q(k)%error * iv%tamdar(n)%q(k)%error)
31 if (trace_use_dull) call da_trace_exit("da_calculate_grady_tamdar")
33 end subroutine da_calculate_grady_tamdar