1 subroutine da_deallocate_observations (iv)
3 !---------------------------------------------------------------------------
4 ! Purpose: Deallocate components of observation structure.
5 !---------------------------------------------------------------------------
9 type (iv_type), intent(inout) :: iv ! Observation structure.
12 if (trace_use) call da_trace_entry("da_deallocate_observations")
14 !---------------------------------------------------------------------------
16 !---------------------------------------------------------------------------
18 if (iv%info(sound)%nlocal > 0) then
19 do n = 1, iv%info(sound)%nlocal
20 if (iv%info(sound)%levels(n) > 0) then
21 deallocate (iv%sound (n) % h)
22 deallocate (iv%sound (n) % p)
23 deallocate (iv%sound (n) % u)
24 deallocate (iv%sound (n) % v)
25 deallocate (iv%sound (n) % t)
26 deallocate (iv%sound (n) % q)
33 if (iv%info(sonde_sfc)%nlocal > 0) deallocate (iv%sonde_sfc)
35 if (iv%info(mtgirs)%nlocal > 0) then
36 do n = 1, iv%info(mtgirs)%nlocal
37 if (iv%info(mtgirs)%levels(n) > 0) then
38 deallocate (iv%mtgirs (n) % h)
39 deallocate (iv%mtgirs (n) % p)
40 deallocate (iv%mtgirs (n) % u)
41 deallocate (iv%mtgirs (n) % v)
42 deallocate (iv%mtgirs (n) % t)
43 deallocate (iv%mtgirs (n) % q)
47 deallocate (iv%mtgirs)
51 if (iv%info(tamdar)%nlocal > 0) then
52 do n = 1, iv%info(tamdar)%nlocal
53 if (iv%info(tamdar)%levels(n) > 0) then
54 deallocate (iv%tamdar (n) % h)
55 deallocate (iv%tamdar (n) % p)
56 deallocate (iv%tamdar (n) % u)
57 deallocate (iv%tamdar (n) % v)
58 deallocate (iv%tamdar (n) % t)
59 deallocate (iv%tamdar (n) % q)
63 deallocate (iv%tamdar)
65 if (iv%info(tamdar_sfc)%nlocal > 0) deallocate (iv%tamdar_sfc)
66 if (iv%info(synop)%nlocal > 0) deallocate (iv%synop)
68 if (iv%info(airep)%nlocal > 0) then
69 do n = 1, iv%info(airep)%nlocal
70 deallocate (iv%airep (n) % h)
71 deallocate (iv%airep (n) % p)
72 deallocate (iv%airep (n) % u)
73 deallocate (iv%airep (n) % v)
74 deallocate (iv%airep (n) % t)
75 deallocate (iv%airep (n) % q)
81 if (iv%info(satem)%nlocal > 0) then
82 do n = 1, iv%info(satem)%nlocal
83 deallocate (iv%satem(n) % p)
84 deallocate (iv%satem(n) % thickness)
85 deallocate (iv%satem(n) % org_thickness)
90 if (iv%info(geoamv)%nlocal > 0) then
91 do n = 1, iv%info(geoamv)%nlocal
92 deallocate (iv%geoamv(n) % p)
93 deallocate (iv%geoamv(n) % u)
94 deallocate (iv%geoamv(n) % v)
96 deallocate (iv%geoamv)
100 if (iv%info(polaramv)%nlocal > 0) then
101 do n = 1, iv%info(polaramv)%nlocal
102 deallocate (iv%polaramv(n) % p)
103 deallocate (iv%polaramv(n) % u)
104 deallocate (iv%polaramv(n) % v)
106 deallocate (iv%polaramv)
109 if (iv%info(metar)%nlocal > 0) deallocate (iv%metar)
110 if (iv%info(ships)%nlocal > 0) deallocate (iv%ships)
112 if (iv%info(pilot)%nlocal > 0) then
113 do n = 1, iv%info(pilot)%nlocal
114 deallocate (iv%pilot (n) % h)
115 deallocate (iv%pilot (n) % p)
116 deallocate (iv%pilot (n) % u)
117 deallocate (iv%pilot (n) % v)
120 deallocate (iv%pilot)
123 if (iv%info(bogus)%nlocal > 0) then
124 do n = 1, iv%info(bogus)%nlocal
125 deallocate (iv%bogus (n) % h)
126 deallocate (iv%bogus (n) % p)
127 deallocate (iv%bogus (n) % u)
128 deallocate (iv%bogus (n) % v)
129 deallocate (iv%bogus (n) % t)
130 deallocate (iv%bogus (n) % q)
133 deallocate (iv%bogus)
136 if (iv%info(radar)%nlocal > 0) then
137 do n = 1, iv%info(radar)%nlocal
138 deallocate (iv%radar (n) % model_p)
139 deallocate (iv%radar (n) % model_rho)
140 deallocate (iv%radar (n) % model_qrn)
141 deallocate (iv%radar (n) % model_qsn)
142 deallocate (iv%radar (n) % model_qgr)
143 deallocate (iv%radar (n) % height )
144 deallocate (iv%radar (n) % height_qc)
145 deallocate (iv%radar (n) % rv )
146 deallocate (iv%radar (n) % rf )
147 if (associated(iv%radar(n)%rrn)) deallocate (iv%radar(n)%rrn)
148 if (associated(iv%radar(n)%rsn)) deallocate (iv%radar(n)%rsn)
149 if (associated(iv%radar(n)%rgr)) deallocate (iv%radar(n)%rgr)
150 if (associated(iv%radar(n)%rqv)) deallocate (iv%radar(n)%rqv)
151 if (associated(iv%radar(n)%rrno)) deallocate (iv%radar(n)%rrno)
152 if (associated(iv%radar(n)%rsno)) deallocate (iv%radar(n)%rsno)
153 if (associated(iv%radar(n)%rgro)) deallocate (iv%radar(n)%rgro)
154 if (associated(iv%radar(n)%rqvo)) deallocate (iv%radar(n)%rqvo)
157 deallocate (iv%radar)
160 if (iv%info(rain)%nlocal > 0) deallocate (iv%rain)
161 if (iv%info(gpspw)%nlocal > 0) deallocate (iv%gpspw)
163 if (iv%info(gpsref)%nlocal > 0) then
164 do n = 1, iv%info(gpsref)%nlocal
165 deallocate (iv%gpsref(n) % h)
166 deallocate (iv%gpsref(n) % ref)
167 deallocate (iv%gpsref(n) % p)
168 deallocate (iv%gpsref(n) % t)
169 deallocate (iv%gpsref(n) % q)
171 deallocate (iv%gpsref)
174 if (iv%info(gpseph)%nlocal > 0) then
175 do n = 1, iv%info(gpseph)%nlocal
176 if ( iv%info(gpseph)%levels(n) > 0 ) then
177 deallocate (iv%gpseph(n) % h)
178 deallocate (iv%gpseph(n) % eph)
179 deallocate (iv%gpseph(n) % ref)
180 deallocate (iv%gpseph(n) %azim)
181 deallocate (iv%gpseph(n) % lat)
182 deallocate (iv%gpseph(n) % lon)
185 deallocate (iv%gpseph)
188 if (iv%info(ssmi_tb)%nlocal > 0) deallocate (iv%ssmi_tb)
189 if (iv%info(ssmi_rv)%nlocal > 0) deallocate (iv%ssmi_rv)
191 if (iv%info(ssmt1)%nlocal > 0) then
192 do n = 1, iv%info(ssmt1)%nlocal
193 deallocate (iv%ssmt1(n) % h)
194 deallocate (iv%ssmt1(n) % p)
195 deallocate (iv%ssmt1(n) % t)
198 deallocate (iv%ssmt1)
201 if (iv%info(ssmt2)%nlocal > 0) then
202 do n = 1, iv%info(ssmt2)%nlocal
203 deallocate (iv%ssmt2(n) % h)
204 deallocate (iv%ssmt2(n) % p)
205 deallocate (iv%ssmt2(n) % rh)
208 deallocate (iv%ssmt2)
211 if (iv%info(qscat)%nlocal > 0) deallocate (iv%qscat)
213 if (iv%info(profiler)%nlocal > 0) then
214 do n = 1, iv%info(profiler)%nlocal
215 deallocate (iv%profiler(n)%h)
216 deallocate (iv%profiler(n)%p)
217 deallocate (iv%profiler(n)%u)
218 deallocate (iv%profiler(n)%v)
221 deallocate(iv%profiler)
224 if (iv%info(buoy)%nlocal > 0) deallocate(iv%buoy)
226 if (iv%info(airsr)%nlocal > 0) then
227 do n = 1, iv%info(airsr)%nlocal
228 deallocate (iv%airsr (n) % h)
229 deallocate (iv%airsr (n) % p)
230 deallocate (iv%airsr (n) % t)
231 deallocate (iv%airsr (n) % q)
234 deallocate (iv%airsr)
237 do n = 1, num_ob_indexes
238 if (n .ne. radiance .and. iv%info(n)%nlocal > 0) then
239 deallocate (iv%info(n)%name)
240 deallocate (iv%info(n)%platform)
241 deallocate (iv%info(n)%id)
242 deallocate (iv%info(n)%date_char)
243 deallocate (iv%info(n)%levels)
244 deallocate (iv%info(n)%lat)
245 deallocate (iv%info(n)%lon)
246 deallocate (iv%info(n)%elv)
247 if ( n /= radar ) then
248 deallocate (iv%info(n)%pstar)
249 deallocate (iv%info(n)%slp)
250 deallocate (iv%info(n)%pw)
252 deallocate (iv%info(n)%x)
253 deallocate (iv%info(n)%y)
254 deallocate (iv%info(n)%i)
255 deallocate (iv%info(n)%j)
256 deallocate (iv%info(n)%dx)
257 deallocate (iv%info(n)%dxm)
258 deallocate (iv%info(n)%dy)
259 deallocate (iv%info(n)%dym)
260 deallocate (iv%info(n)%k)
261 deallocate (iv%info(n)%dz)
262 deallocate (iv%info(n)%dzm)
263 deallocate (iv%info(n)%zk)
264 deallocate (iv%info(n)%proc_domain)
265 deallocate (iv%info(n)%thinned)
266 deallocate (iv%info(n)%obs_global_index)
270 if (trace_use) call da_trace_exit("da_deallocate_observations")
272 end subroutine da_deallocate_observations