Merge remote-tracking branch 'origin/release-v4.5.2'
[WRF.git] / var / da / da_synop / da_calculate_grady_synop.inc
blob2963fb5a97204def672052fcc5c0005f7d716c64
1 subroutine da_calculate_grady_synop(iv, re, jo_grad_y)
3    !-------------------------------------------------------------------------
4    ! Purpose: Applies obs inverse on re-vector
5    !-------------------------------------------------------------------------
7    implicit none
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)
13    integer                      :: n
15    if (trace_use_dull) call da_trace_entry("da_calculate_grady_synop")
17    do n=1, iv%info(synop)%nlocal
18       if (iv%synop(n)%u%qc < obs_qc_pointer) re%synop(n)%u = 0.0
19       if (iv%synop(n)%v%qc < obs_qc_pointer) re%synop(n)%v = 0.0
20       if (iv%synop(n)%t%qc < obs_qc_pointer) re%synop(n)%t = 0.0
21       if (iv%synop(n)%p%qc < obs_qc_pointer) re%synop(n)%p = 0.0
22       if (iv%synop(n)%q%qc < obs_qc_pointer) re%synop(n)%q = 0.0
24       if (iv%synop(n)%u%qc < obs_qc_pointer) re%synop(n)%u = 0.0
25       if (iv%synop(n)%v%qc < obs_qc_pointer) re%synop(n)%v = 0.0
26       if (iv%synop(n)%t%qc < obs_qc_pointer) re%synop(n)%t = 0.0
27       if (iv%synop(n)%p%qc < obs_qc_pointer) re%synop(n)%p = 0.0
28       if (iv%synop(n)%q%qc < obs_qc_pointer) re%synop(n)%q = 0.0
30       jo_grad_y%synop(n)%u = -re%synop(n)%u / (iv%synop(n)%u%error * iv%synop(n)%u%error)
31       jo_grad_y%synop(n)%v = -re%synop(n)%v / (iv%synop(n)%v%error * iv%synop(n)%v%error)
32       jo_grad_y%synop(n)%t = -re%synop(n)%t / (iv%synop(n)%t%error * iv%synop(n)%t%error)
33       jo_grad_y%synop(n)%p = -re%synop(n)%p / (iv%synop(n)%p%error * iv%synop(n)%p%error)
34       jo_grad_y%synop(n)%q = -re%synop(n)%q / (iv%synop(n)%q%error * iv%synop(n)%q%error)
35    end do
37    if (trace_use_dull) call da_trace_exit("da_calculate_grady_synop")
38      
39 end subroutine da_calculate_grady_synop