da_oi.inc
References to this file elsewhere.
1 subroutine da_oi( str,line,y1,y2,iv1,iv2)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: quick way of showing location
5 !-----------------------------------------------------------------------
6
7 implicit none
8
9 character(len=*), intent(in) :: str
10 integer, intent(in) :: line
11 type(y_type), intent(in), optional :: y1
12 type(y_type), intent(in), optional :: y2
13 type(iv_type) , intent(in), optional :: iv1
14 type(iv_type), intent(in), optional :: iv2
15
16 integer :: i
17 real :: sum_y1
18 real :: sum_y2
19 real :: sum_iv1
20 real :: sum_iv2
21
22 sum_y1=-1.0
23 sum_y2=-1.0
24 sum_iv1=-1.0
25 sum_iv2=-1.0
26
27 if (.not. oi_use) return
28
29 if (.not. use_rad) goto 100
30
31 if (present(y1)) then
32 sum_y1=0.0
33 do i=1,y1%num_inst
34 if (associated(y1%instid(i)%tb)) &
35 sum_y1=sum_y1+sum(y1%instid(i)%tb(:,:))
36 end do
37 else
38 sum_y1=-1.0
39 end if
40
41 if (present(y2)) then
42 sum_y2=0.0
43 do i=1,y2%num_inst
44 if (associated(y2%instid(i)%tb)) &
45 sum_y2=sum_y2+sum(y2%instid(i)%tb(:,:))
46 end do
47 else
48 sum_y2=-1.0
49 end if
50
51 if (present(iv1)) then
52 sum_iv1=0.0
53 do i=1,iv1%num_inst
54 if (associated(iv1%instid(i)%tb_xb)) then
55 sum_iv1=sum_iv1+sum(iv1%instid(i)%tb_xb(:,:))
56 end if
57
58 if (associated(iv1%instid(i)%tb_inv)) then
59 sum_iv1=sum_iv1+sum(iv1%instid(i)%tb_inv(:,:))
60 end if
61
62 if (associated(iv1%instid(i)%tb_qc)) then
63 sum_iv1=sum_iv1+sum(iv1%instid(i)%tb_qc(:,:))
64 end if
65
66 if (associated(iv1%instid(i)%tb_error)) then
67 sum_iv1=sum_iv1+sum(iv1%instid(i)%tb_error(:,:))
68 end if
69
70 if (associated(iv1%instid(i)%t)) then
71 sum_iv1=sum_iv1+sum(iv1%instid(i)%t(:,:))
72 end if
73 if (associated(iv1%instid(i)%mr)) then
74 sum_iv1=sum_iv1+sum(iv1%instid(i)%mr(:,:))
75 end if
76 if (associated(iv1%instid(i)%t2m)) then
77 sum_iv1=sum_iv1+sum(iv1%instid(i)%t2m(:))
78 end if
79 if (associated(iv1%instid(i)%u10)) then
80 sum_iv1=sum_iv1+sum(iv1%instid(i)%u10(:))
81 end if
82 if (associated(iv1%instid(i)%v10)) then
83 sum_iv1=sum_iv1+sum(iv1%instid(i)%v10(:))
84 end if
85 if (associated(iv1%instid(i)%mr2m)) then
86 sum_iv1=sum_iv1+sum(iv1%instid(i)%mr2m(:))
87 end if
88 if (associated(iv1%instid(i)%ps)) then
89 sum_iv1=sum_iv1+sum(iv1%instid(i)%ps(:))
90 end if
91
92 if (associated(iv1%instid(i)%emiss)) then
93 sum_iv1=sum_iv1+sum(iv1%instid(i)%emiss(:,:))
94 end if
95
96 if (associated(iv1%instid(i)%ts)) then
97 sum_iv1=sum_iv1+sum(iv1%instid(i)%ts(:))
98 end if
99
100 if (associated(iv1%instid(i)%elevation)) then
101 sum_iv1=sum_iv1+sum(iv1%instid(i)%elevation(:))
102 end if
103
104 if (associated(iv1%instid(i)%clwp)) then
105 sum_iv1=sum_iv1+sum(iv1%instid(i)%clwp(:))
106 end if
107
108 if (associated(iv1%instid(i)%pm)) &
109 sum_iv1=sum_iv1+sum(iv1%instid(i)%pm(:,:))
110
111 if (associated(iv1%instid(i)%tm)) &
112 sum_iv1=sum_iv1+sum(iv1%instid(i)%tm(:,:))
113
114 if (associated(iv1%instid(i)%qm)) &
115 sum_iv1=sum_iv1+sum(iv1%instid(i)%qm(:,:))
116
117 if (associated(iv1%instid(i)%cloud_flag)) &
118 sum_iv1=sum_iv1+sum(iv1%instid(i)%cloud_flag(:,:))
119 end do
120 else
121 sum_iv1=-1.0
122 end if
123
124 if (present(iv2)) then
125 sum_iv2=0.0
126 do i=1,iv2%num_inst
127 if (associated(iv2%instid(i)%tb_xb)) then
128 sum_iv2=sum_iv2+sum(iv2%instid(i)%tb_xb(:,:))
129 end if
130
131 if (associated(iv2%instid(i)%tb_inv)) then
132 sum_iv2=sum_iv2+sum(iv2%instid(i)%tb_inv(:,:))
133 end if
134
135 if (associated(iv2%instid(i)%tb_qc)) then
136 sum_iv2=sum_iv2+sum(iv2%instid(i)%tb_qc(:,:))
137 end if
138
139 if (associated(iv2%instid(i)%tb_error)) then
140 sum_iv2=sum_iv2+sum(iv2%instid(i)%tb_error(:,:))
141 end if
142
143 if (associated(iv2%instid(i)%t)) then
144 sum_iv2=sum_iv2+sum(iv2%instid(i)%t(:,:))
145 end if
146 if (associated(iv2%instid(i)%mr)) then
147 sum_iv2=sum_iv2+sum(iv2%instid(i)%mr(:,:))
148 end if
149 if (associated(iv2%instid(i)%t2m)) then
150 sum_iv2=sum_iv2+sum(iv2%instid(i)%t2m(:))
151 end if
152 if (associated(iv2%instid(i)%u10)) then
153 sum_iv2=sum_iv2+sum(iv2%instid(i)%u10(:))
154 end if
155 if (associated(iv2%instid(i)%v10)) then
156 sum_iv2=sum_iv2+sum(iv2%instid(i)%v10(:))
157 end if
158 if (associated(iv2%instid(i)%mr2m)) then
159 sum_iv2=sum_iv2+sum(iv2%instid(i)%mr2m(:))
160 end if
161 if (associated(iv2%instid(i)%ps)) then
162 sum_iv2=sum_iv2+sum(iv2%instid(i)%ps(:))
163 end if
164
165 if (associated(iv2%instid(i)%emiss)) then
166 sum_iv2=sum_iv2+sum(iv2%instid(i)%emiss(:,:))
167 end if
168
169 if (associated(iv2%instid(i)%ts)) then
170 sum_iv2=sum_iv2+sum(iv2%instid(i)%ts(:))
171 end if
172
173 if (associated(iv2%instid(i)%elevation)) then
174 sum_iv2=sum_iv2+sum(iv2%instid(i)%elevation(:))
175 end if
176
177 if (associated(iv2%instid(i)%clwp)) then
178 sum_iv2=sum_iv2+sum(iv2%instid(i)%clwp(:))
179 end if
180
181 if (associated(iv2%instid(i)%pm)) &
182 sum_iv2=sum_iv2+sum(iv2%instid(i)%pm(:,:))
183
184 if (associated(iv2%instid(i)%tm)) &
185 sum_iv2=sum_iv2+sum(iv2%instid(i)%tm(:,:))
186
187 if (associated(iv2%instid(i)%qm)) &
188 sum_iv2=sum_iv2+sum(iv2%instid(i)%qm(:,:))
189
190 if (associated(iv2%instid(i)%cloud_flag)) &
191 sum_iv2=sum_iv2+sum(iv2%instid(i)%cloud_flag(:,:))
192 end do
193 else
194 sum_iv2=-1.0
195 end if
196
197 100 continue
198
199 write(unit=stderr,fmt='(A,3(E18.10,1X),A,I6)') "oi:", sum_y1, sum_y2, sum_iv1, str, line
200
201 end subroutine da_oi
202
203