da_calculate_grady_ssmi.inc

References to this file elsewhere.
1 subroutine da_calculate_grady_ssmi(oi, re, jo_grad_y)
2 
3    !-------------------------------------------------------------------------
4    ! Purpose: Applies obs inverse on re-vector
5    !-------------------------------------------------------------------------
6 
7    implicit none
8 
9    type (ob_type), intent(in)   :: oi          ! Ob Inc. structure.
10    type (y_type), intent(inout) :: re          ! Residual structure.
11    type (y_type), intent(inout) :: jo_grad_y   ! Grad_y(Jo)
12 
13    integer                      :: n
14 
15    if (oi%num_ssmi_tb .gt. 0) then
16       do n=1, oi%num_ssmi_tb
17 
18          if (oi%ssmi_tb(n)%tb19v%qc < obs_qc_pointer) re%ssmi_tb(n)%tb19v = 0.0
19          jo_grad_y%ssmi_tb(n)%tb19v = - re%ssmi_tb(n)%tb19v / &
20                                       (oi%ssmi_tb(n)%tb19v%error * &
21                                         oi%ssmi_tb(n)%tb19v%error)
22 
23          if (oi%ssmi_tb(n)%tb19h%qc < obs_qc_pointer) re%ssmi_tb(n)%tb19h = 0.0
24          jo_grad_y%ssmi_tb(n)%tb19h = - re%ssmi_tb(n)%tb19h / &
25                                       (oi%ssmi_tb(n)%tb19h%error * &
26                                         oi%ssmi_tb(n)%tb19h%error)
27 
28          if (oi%ssmi_tb(n)%tb22v%qc < obs_qc_pointer) re%ssmi_tb(n)%tb22v = 0.0
29          jo_grad_y%ssmi_tb(n)%tb22v = - re%ssmi_tb(n)%tb22v / &
30                                       (oi%ssmi_tb(n)%tb22v%error * &
31                                         oi%ssmi_tb(n)%tb22v%error)
32 
33          if (oi%ssmi_tb(n)%tb37v%qc < obs_qc_pointer) re%ssmi_tb(n)%tb37v = 0.0
34          jo_grad_y%ssmi_tb(n)%tb37v = - re%ssmi_tb(n)%tb37v / &
35                                       (oi%ssmi_tb(n)%tb37v%error * &
36                                         oi%ssmi_tb(n)%tb37v%error)
37 
38          if (oi%ssmi_tb(n)%tb37h%qc < obs_qc_pointer) re%ssmi_tb(n)%tb37h = 0.0
39          jo_grad_y%ssmi_tb(n)%tb37h = - re%ssmi_tb(n)%tb37h / &
40                                       (oi%ssmi_tb(n)%tb37h%error * &
41                                         oi%ssmi_tb(n)%tb37h%error)
42 
43          if (oi%ssmi_tb(n)%tb85v%qc < obs_qc_pointer) re%ssmi_tb(n)%tb85v = 0.0
44          jo_grad_y%ssmi_tb(n)%tb85v = - re%ssmi_tb(n)%tb85v / &
45                                       (oi%ssmi_tb(n)%tb85v%error * &
46                                         oi%ssmi_tb(n)%tb85v%error)
47 
48          if (oi%ssmi_tb(n)%tb85h%qc < obs_qc_pointer) re%ssmi_tb(n)%tb85h = 0.0
49          jo_grad_y%ssmi_tb(n)%tb85h = - re%ssmi_tb(n)%tb85h / &
50                                       (oi%ssmi_tb(n)%tb85h%error * &
51                                         oi%ssmi_tb(n)%tb85h%error)
52       end do
53    else if (oi%num_ssmi_retrieval .gt. 0) then
54       do n=1, oi%num_ssmi_retrieval
55         if (oi%ssmi_retrieval(n)%speed%qc < obs_qc_pointer) then
56             re%ssmi_retrieval(n)%speed = 0.0
57         end if
58         jo_grad_y%ssmi_retrieval(n)%Speed = - re%ssmi_retrieval(n)%Speed / &
59             (oi%ssmi_retrieval(n)%Speed%error * &
60               oi%ssmi_retrieval(n)%Speed%error)
61 
62         if (oi%ssmi_retrieval(n)%tpw%qc < obs_qc_pointer) then
63            re%ssmi_retrieval(n)%tpw = 0.0
64         end if
65         jo_grad_y%ssmi_retrieval(n)%tpw = -re%ssmi_retrieval(n)%tpw / &
66                                          (oi%ssmi_retrieval(n)%tpw%error * &
67                                            oi%ssmi_retrieval(n)%tpw%error)
68       end do  
69    end if
70 
71 end subroutine da_calculate_grady_ssmi
72 
73