1 subroutine da_write_obs(it,ob, iv, re)
3 !-------------------------------------------------------------------------
4 ! Purpose: Writes out components of iv=O-B structure.
5 !-------------------------------------------------------------------------
9 integer, intent(in) :: it
10 type (y_type), intent(in) :: ob ! Observation structure.
11 type (iv_type), intent(in) :: iv ! O-B structure.
12 type (y_type), intent(inout) :: re ! residual vector.
14 integer :: n, k, num_obs, ios
15 integer :: ounit ! Output unit
16 character(len=filename_len) :: filename
17 integer :: itime, ifgat
19 if (trace_use) call da_trace_entry("da_write_obs")
21 !-------------------------------------------------------------------------
23 !-------------------------------------------------------------------------
25 call da_get_unit(ounit)
28 write(unit=filename, fmt='(a,i2.2,a,i4.4)') 'gts_omb_oma_',it,'.', myproc
30 write(unit=filename, fmt='(a,i2.2,a)') 'gts_omb_oma_',it,'.0000'
33 open (unit=ounit,file=trim(filename),form='formatted',status='replace', &
36 call da_error(__FILE__,__LINE__, &
37 (/"Cannot open conventional observation omb and oma file"//filename/))
41 do n = 1, iv%info(synop)%nlocal
42 if (iv%info(synop)%proc_domain(1,n)) num_obs = num_obs + 1
45 write(ounit,'(a20,i8)')'synop', num_obs
47 do n = 1, iv%info(synop)%nlocal
48 do itime = 1, num_fgat_time
49 if ( n >= iv%info(synop)%plocal(itime-1)+1 .and. &
50 n <= iv%info(synop)%plocal(itime) ) then
55 if (iv%info(synop)%proc_domain(1,n)) then
57 write(ounit,'(2i8)') 1, ifgat
58 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
59 num_obs , 1, iv%info(synop)%id(n), & ! Station
60 iv%info(synop)%lat(1,n), & ! Latitude
61 iv%info(synop)%lon(1,n), & ! Longitude
62 ob%synop(n)%p, & ! Obs Pressure
64 iv%synop(n)%u%inv, iv%synop(n)%u%qc, iv%synop(n)%u%error, &
67 iv%synop(n)%v%inv, iv%synop(n)%v%qc, iv%synop(n)%v%error, &
70 iv%synop(n)%t%inv, iv%synop(n)%t%qc, iv%synop(n)%t%error, &
73 iv%synop(n)%p%inv, iv%synop(n)%p%qc, iv%synop(n)%p%error, &
76 iv%synop(n)%q%inv, iv%synop(n)%q%qc, iv%synop(n)%q%error, &
83 do n = 1, iv%info(metar)%nlocal
84 if (iv%info(metar)%proc_domain(1,n)) num_obs = num_obs + 1
87 write(ounit,'(a20,i8)')'metar', num_obs
89 do n = 1, iv%info(metar)%nlocal
90 do itime = 1, num_fgat_time
91 if ( n >= iv%info(metar)%plocal(itime-1)+1 .and. &
92 n <= iv%info(metar)%plocal(itime) ) then
97 if (iv%info(metar)%proc_domain(1,n)) then
99 write(ounit,'(2i8)') 1, ifgat
100 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
101 num_obs , 1, iv%info(metar)%id(n), & ! Station
102 iv%info(metar)%lat(1,n), & ! Latitude
103 iv%info(metar)%lon(1,n), & ! Longitude
104 ob%metar(n)%p, & ! Obs Pressure
106 iv%metar(n)%u%inv, iv%metar(n)%u%qc, iv%metar(n)%u%error, &
109 iv%metar(n)%v%inv, iv%metar(n)%v%qc, iv%metar(n)%v%error, &
112 iv%metar(n)%t%inv, iv%metar(n)%t%qc, iv%metar(n)%t%error, &
115 iv%metar(n)%p%inv, iv%metar(n)%p%qc, iv%metar(n)%p%error, &
118 iv%metar(n)%q%inv, iv%metar(n)%q%qc, iv%metar(n)%q%error, &
125 do n = 1, iv%info(ships)%nlocal
126 if (iv%info(ships)%proc_domain(1,n)) num_obs = num_obs + 1
128 if (num_obs > 0) then
129 write(ounit,'(a20,i8)')'ships', num_obs
131 do n = 1, iv%info(ships)%nlocal
132 do itime = 1, num_fgat_time
133 if ( n >= iv%info(ships)%plocal(itime-1)+1 .and. &
134 n <= iv%info(ships)%plocal(itime) ) then
139 if (iv%info(ships)%proc_domain(1,n)) then
140 write(ounit,'(2i8)') 1, ifgat
141 num_obs = num_obs + 1
142 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
143 num_obs,1, iv%info(ships)%id(n), & ! Station
144 iv%info(ships)%lat(1,n), & ! Latitude
145 iv%info(ships)%lon(1,n), & ! Longitude
146 ob%ships(n)%p, & ! Obs Pressure
148 iv%ships(n)%u%inv, iv%ships(n)%u%qc, iv%ships(n)%u%error, &
151 iv%ships(n)%v%inv, iv%ships(n)%v%qc, iv%ships(n)%v%error, &
154 iv%ships(n)%t%inv, iv%ships(n)%t%qc, iv%ships(n)%t%error, &
157 iv%ships(n)%p%inv, iv%ships(n)%p%qc, iv%ships(n)%p%error, &
160 iv%ships(n)%q%inv, iv%ships(n)%q%qc, iv%ships(n)%q%error, &
167 do n = 1, iv%info(geoamv)%nlocal
168 if (iv%info(geoamv)%proc_domain(1,n)) num_obs = num_obs + 1
170 if (num_obs > 0) then
171 write(ounit,'(a20,i8)')'geoamv', num_obs
173 do n = 1, iv%info(geoamv)%nlocal
174 do itime = 1, num_fgat_time
175 if ( n >= iv%info(geoamv)%plocal(itime-1)+1 .and. &
176 n <= iv%info(geoamv)%plocal(itime) ) then
181 if (iv%info(geoamv)%proc_domain(1,n)) then
182 num_obs = num_obs + 1
183 write(ounit,'(2i8)')iv%info(geoamv)%levels(n), ifgat
184 do k = 1, iv%info(geoamv)%levels(n)
185 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
186 num_obs, 1, iv%info(geoamv)%id(n), & ! Station
187 iv%info(geoamv)%lat(k,n), & ! Latitude
188 iv%info(geoamv)%lon(k,n), & ! Longitude
189 iv%geoamv(n)%p(k), & ! Obs Pressure
191 iv%geoamv(n)%u(k)%inv, iv%geoamv(n)%u(k)%qc, iv%geoamv(n)%u(k)%error, &
194 iv%geoamv(n)%v(k)%inv, iv%geoamv(n)%v(k)%qc, iv%geoamv(n)%v(k)%error, &
202 do n = 1, iv%info(polaramv)%nlocal
203 if (iv%info(polaramv)%proc_domain(1,n)) num_obs = num_obs + 1
205 if (num_obs > 0) then
206 write(ounit,'(a20,i8)')'polaramv', num_obs
208 do n = 1, iv%info(polaramv)%nlocal
209 do itime = 1, num_fgat_time
210 if ( n >= iv%info(polaramv)%plocal(itime-1)+1 .and. &
211 n <= iv%info(polaramv)%plocal(itime) ) then
216 if (iv%info(polaramv)%proc_domain(1,n)) then
217 num_obs = num_obs + 1
218 write(ounit,'(2i8)')iv%info(polaramv)%levels(n), ifgat
219 do k = 1, iv%info(polaramv)%levels(n)
220 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
221 num_obs, 1, iv%info(polaramv)%id(n), & ! Station
222 iv%info(polaramv)%lat(k,n), & ! Latitude
223 iv%info(polaramv)%lon(k,n), & ! Longitude
224 iv%polaramv(n)%p(k), & ! Obs Pressure
225 ob%polaramv(n)%u(k), &
226 iv%polaramv(n)%u(k)%inv, iv%polaramv(n)%u(k)%qc, iv%polaramv(n)%u(k)%error, &
227 re%polaramv(n)%u(k), &
228 ob%polaramv(n)%v(k), &
229 iv%polaramv(n)%v(k)%inv, iv%polaramv(n)%v(k)%qc, iv%polaramv(n)%v(k)%error, &
237 do n = 1, iv%info(gpspw)%nlocal
238 if (iv%info(gpspw)%proc_domain(1,n)) num_obs = num_obs + 1
240 if (num_obs > 0) then
241 write(ounit,'(a20,i8)')'gpspw', num_obs
243 do n = 1, iv%info(gpspw)%nlocal
244 do itime = 1, num_fgat_time
245 if ( n >= iv%info(gpspw)%plocal(itime-1)+1 .and. &
246 n <= iv%info(gpspw)%plocal(itime) ) then
251 if (iv%info(gpspw)%proc_domain(1,n)) then
252 num_obs = num_obs + 1
253 write(ounit,'(2i8)') 1, ifgat
254 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
255 num_obs, 1, iv%info(gpspw)%id(n), & ! Station
256 iv%info(gpspw)%lat(1,n), & ! Latitude
257 iv%info(gpspw)%lon(1,n), & ! Longitude
258 iv%info(gpspw)%elv(n) , &
260 iv%gpspw(n)%tpw%inv, iv%gpspw(n)%tpw%qc, iv%gpspw(n)%tpw%error, &
267 do n = 1, iv%info(sound)%nlocal
268 if (iv%info(sound)%proc_domain(1,n)) num_obs = num_obs + 1
270 if (num_obs > 0) then
271 write(ounit,'(a20,i8)')'sound', num_obs
273 do n = 1, iv%info(sound)%nlocal
274 do itime = 1, num_fgat_time
275 if ( n >= iv%info(sound)%plocal(itime-1)+1 .and. &
276 n <= iv%info(sound)%plocal(itime) ) then
281 if (iv%info(sound)%proc_domain(1,n)) then
282 num_obs = num_obs + 1
283 write(ounit,'(2i8)')iv%info(sound)%levels(n), ifgat
284 do k = 1, iv%info(sound)%levels(n)
285 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
286 num_obs,k, iv%info(sound)%id(n), & ! Station
287 iv%info(sound)%lat(k,n), & ! Latitude
288 iv%info(sound)%lon(k,n), & ! Longitude
289 iv%sound(n)%p(k), & ! Obs Pressure
291 iv%sound(n)%u(k)%inv, iv%sound(n)%u(k)%qc, iv%sound(n)%u(k)%error, &
294 iv%sound(n)%v(k)%inv, iv%sound(n)%v(k)%qc, iv%sound(n)%v(k)%error, &
297 iv%sound(n)%t(k)%inv, iv%sound(n)%t(k)%qc, iv%sound(n)%t(k)%error, &
300 iv%sound(n)%q(k)%inv, iv%sound(n)%q(k)%qc, iv%sound(n)%q(k)%error, &
307 if (num_obs > 0) then
308 write(ounit,'(a20,i8)')'sonde_sfc', num_obs
310 do n = 1, iv%info(sonde_sfc)%nlocal
311 do itime = 1, num_fgat_time
312 if ( n >= iv%info(sonde_sfc)%plocal(itime-1)+1 .and. &
313 n <= iv%info(sonde_sfc)%plocal(itime) ) then
318 if (iv%info(sound)%proc_domain(1,n)) then
319 num_obs = num_obs + 1
320 write(ounit,'(2i8)') 1, ifgat
321 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
322 num_obs , 1, iv%info(sonde_sfc)%id(n), & ! Station
323 iv%info(sonde_sfc)%lat(1,n), & ! Latitude
324 iv%info(sonde_sfc)%lon(1,n), & ! Longitude
325 ob%sonde_sfc(n)%p, & ! Obs Pressure
327 iv%sonde_sfc(n)%u%inv, iv%sonde_sfc(n)%u%qc, iv%sonde_sfc(n)%u%error, &
330 iv%sonde_sfc(n)%v%inv, iv%sonde_sfc(n)%v%qc, iv%sonde_sfc(n)%v%error, &
333 iv%sonde_sfc(n)%t%inv, iv%sonde_sfc(n)%t%qc, iv%sonde_sfc(n)%t%error, &
336 iv%sonde_sfc(n)%p%inv, iv%sonde_sfc(n)%p%qc, iv%sonde_sfc(n)%p%error, &
339 iv%sonde_sfc(n)%q%inv, iv%sonde_sfc(n)%q%qc, iv%sonde_sfc(n)%q%error, &
346 do n = 1, iv%info(airep)%nlocal
347 if (iv%info(airep)%proc_domain(1,n)) num_obs = num_obs + 1
349 if (num_obs > 0) then
350 write(ounit,'(a20,i8)')'airep', num_obs
352 do n = 1, iv%info(airep)%nlocal
353 do itime = 1, num_fgat_time
354 if ( n >= iv%info(airep)%plocal(itime-1)+1 .and. &
355 n <= iv%info(airep)%plocal(itime) ) then
360 if (iv%info(airep)%proc_domain(1,n)) then
361 num_obs = num_obs + 1
362 write(ounit,'(2i8)')iv%info(airep)%levels(n), ifgat
363 do k = 1, iv%info(airep)%levels(n)
364 write(ounit,'(2i8,a5,2f9.2,f17.7,4(2f17.7,i8,2f17.7),f12.2)')&
365 num_obs, k, iv%info(airep)%id(n), & ! Station
366 iv%info(airep)%lat(k,n), & ! Latitude
367 iv%info(airep)%lon(k,n), & ! Longitude
368 iv%airep(n)%p(k), & ! Obs pressure
370 iv%airep(n)%u(k)%inv, iv%airep(n)%u(k)%qc, iv%airep(n)%u(k)%error, &
373 iv%airep(n)%v(k)%inv, iv%airep(n)%v(k)%qc, iv%airep(n)%v(k)%error, &
376 iv%airep(n)%t(k)%inv, iv%airep(n)%t(k)%qc, iv%airep(n)%t(k)%error, &
379 iv%airep(n)%q(k)%inv, iv%airep(n)%q(k)%qc, iv%airep(n)%q(k)%error, &
380 re%airep(n)%q(k), iv%info(airep)%zk(k,n)
387 do n = 1, iv%info(pilot)%nlocal
388 if (iv%info(pilot)%proc_domain(1,n)) num_obs = num_obs + 1
390 if (num_obs > 0) then
391 write(ounit,'(a20,i8)')'pilot', num_obs
393 do n = 1, iv%info(pilot)%nlocal
394 do itime = 1, num_fgat_time
395 if ( n >= iv%info(pilot)%plocal(itime-1)+1 .and. &
396 n <= iv%info(pilot)%plocal(itime) ) then
401 if (iv%info(pilot)%proc_domain(1,n)) then
402 num_obs = num_obs + 1
403 write(ounit,'(2i8)')iv%info(pilot)%levels(n), ifgat
404 do k = 1, iv%info(pilot)%levels(n)
405 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
406 num_obs, k, iv%info(pilot)%id(n), & ! Station
407 iv%info(pilot)%lat(1,n), & ! Latitude
408 iv%info(pilot)%lon(1,n), & ! Longitude
409 iv%pilot(n)%h(k), & ! Obs Height
411 iv%pilot(n)%u(k)%inv, iv%pilot(n)%u(k)%qc, iv%pilot(n)%u(k)%error, &
414 iv%pilot(n)%v(k)%inv, iv%pilot(n)%v(k)%qc, iv%pilot(n)%v(k)%error, &
422 do n = 1, iv%info(ssmi_rv)%nlocal
423 if (iv%info(ssmi_rv)%proc_domain(1,n)) num_obs = num_obs + 1
425 if (num_obs > 0) then
426 write(ounit,'(a20,i8)')'ssmir', num_obs
428 do n = 1, iv%info(ssmi_rv)%nlocal
429 if (iv%info(ssmi_rv)%proc_domain(1,n)) then
430 num_obs = num_obs + 1
431 write(ounit,'(i8)') 1
432 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
433 num_obs, 1, 'SSMIR', & ! Station
434 iv%info(ssmi_rv)%lat(1,n), &! Latitude
435 iv%info(ssmi_rv)%lon(1,n), &! Longitude
436 missing_r, & ! Obs height
437 ob%ssmi_rv(n)%speed, &
438 iv%ssmi_rv(n)%speed%inv, iv%ssmi_rv(n)%speed%qc, iv%ssmi_rv(n)%speed%error, &
439 re%ssmi_rv(n)%speed, &
441 iv%ssmi_rv(n)%tpw%inv, iv%ssmi_rv(n)%tpw%qc, iv%ssmi_rv(n)%tpw%error, &
448 do n = 1, iv%info(ssmi_tb)%nlocal
449 if (iv%info(ssmi_tb)%proc_domain(1,n)) num_obs = num_obs + 1
451 if (num_obs > 0) then
452 write(ounit,'(a20,i8)')'ssmiT', num_obs
454 do n = 1, iv%info(ssmi_tb)%nlocal
455 ! write(ounit,*)' SSMI radiance output not yet coded.'
456 if (iv%info(ssmi_tb)%proc_domain(1,n)) then
457 num_obs = num_obs + 1
458 write(ounit,'(i8)') 1
459 write(ounit,'(2i8,a5,2f9.2,f17.7,7(2f17.7,i8,2f17.7))')&
460 num_obs, 1, 'SSMIT', & ! Station
461 iv%info(ssmi_tb)%lat(1,n), &! Latitude
462 iv%info(ssmi_tb)%lon(1,n), &! Longitude
463 missing_r, & ! Obs height
464 ob%ssmi_tb(n)%tb19h, &
465 iv%ssmi_tb(n)%tb19h%inv, iv%ssmi_tb(n)%tb19h%qc, iv%ssmi_tb(n)%tb19h%error, &
466 re%ssmi_tb(n)%tb19h, &
467 ob%ssmi_tb(n)%tb19v, &
468 iv%ssmi_tb(n)%tb19v%inv, iv%ssmi_tb(n)%tb19v%qc, iv%ssmi_tb(n)%tb19v%error, &
469 re%ssmi_tb(n)%tb19v, &
470 ob%ssmi_tb(n)%tb22v, &
471 iv%ssmi_tb(n)%tb22v%inv, iv%ssmi_tb(n)%tb22v%qc, iv%ssmi_tb(n)%tb22v%error, &
472 re%ssmi_tb(n)%tb22v, &
473 ob%ssmi_tb(n)%tb37h, &
474 iv%ssmi_tb(n)%tb37h%inv, iv%ssmi_tb(n)%tb37h%qc, iv%ssmi_tb(n)%tb37h%error, &
475 re%ssmi_tb(n)%tb37h, &
476 ob%ssmi_tb(n)%tb37v, &
477 iv%ssmi_tb(n)%tb37v%inv, iv%ssmi_tb(n)%tb37v%qc, iv%ssmi_tb(n)%tb37v%error, &
478 re%ssmi_tb(n)%tb37v, &
479 ob%ssmi_tb(n)%tb85h, &
480 iv%ssmi_tb(n)%tb85h%inv, iv%ssmi_tb(n)%tb85h%qc, iv%ssmi_tb(n)%tb85h%error, &
481 re%ssmi_tb(n)%tb85h, &
482 ob%ssmi_tb(n)%tb85v, &
483 iv%ssmi_tb(n)%tb85v%inv, iv%ssmi_tb(n)%tb85v%qc, iv%ssmi_tb(n)%tb85v%error, &
490 do n = 1, iv%info(satem)%nlocal
491 if (iv%info(satem)%proc_domain(1,n)) num_obs = num_obs + 1
493 if (num_obs > 0) then
494 write(ounit,'(a20,i8)')'satem', num_obs
496 do n = 1, iv%info(satem)%nlocal
497 if (iv%info(satem)%proc_domain(1,n)) then
498 num_obs = num_obs + 1
499 write(ounit,'(i8)')iv%info(satem)%levels(n)
500 do k = 1, iv%info(satem)%levels(n)
501 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
502 num_obs , k, iv%info(satem)%id(n), & ! Station
503 iv%info(satem)%lat(1,n), & ! Latitude
504 iv%info(satem)%lon(1,n), & ! Longitude
505 iv%satem(n)%p(k), & ! Obs Pressure
506 ob%satem(n)%thickness(k), &
507 iv%satem(n)%thickness(k)%inv, &
508 iv%satem(n)%thickness(k)%qc, &
509 iv%satem(n)%thickness(k)%error, &
510 re%satem(n)%thickness(k)
517 do n = 1, iv%info(ssmt1)%nlocal
518 if (iv%info(ssmt1)%proc_domain(1,n)) num_obs = num_obs + 1
520 if (num_obs > 0) then
521 write(ounit,'(a20,i8)')'ssmt1', num_obs
523 do n = 1, iv%info(ssmt1)%nlocal
524 if (iv%info(ssmt1)%proc_domain(1,n)) then
525 num_obs = num_obs + 1
526 write(ounit,'(i8)')iv%info(ssmt1)%levels(n)
527 do k = 1, iv%info(ssmt1)%levels(n)
528 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
529 num_obs , k, iv%info(ssmt1)%id(n), & ! Station
530 iv%info(ssmt1)%lat(1,n), & ! Latitude
531 iv%info(ssmt1)%lon(1,n), & ! Longitude
532 iv%ssmt1(n)%h(k), & ! Obs height
534 iv%ssmt1(n)%t(k)%inv, &
535 iv%ssmt1(n)%t(k)%qc, &
536 iv%ssmt1(n)%t(k)%error, &
544 do n = 1, iv%info(ssmt2)%nlocal
545 if (iv%info(ssmt2)%proc_domain(1,n)) num_obs = num_obs + 1
547 if (num_obs > 0) then
548 write(ounit,'(a20,i8)')'ssmt2', num_obs
550 do n = 1, iv%info(ssmt2)%nlocal
551 if (iv%info(ssmt2)%proc_domain(1,n)) then
552 num_obs = num_obs + 1
553 write(ounit,'(i8)')iv%info(ssmt2)%levels(n)
554 do k = 1, iv%info(ssmt2)%levels(n)
555 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
556 num_obs , k, iv%info(ssmt2)%id(n), & ! Station
557 iv%info(ssmt2)%lat(1,n), & ! Latitude
558 iv%info(ssmt2)%lon(1,n), & ! Longitude
559 iv%ssmt2(n)%h(k), & ! Obs height
561 iv%ssmt2(n)%rh(k)%inv, &
562 iv%ssmt2(n)%rh(k)%qc, &
563 iv%ssmt2(n)%rh(k)%error, &
571 do n = 1, iv%info(qscat)%nlocal
572 if (iv%info(qscat)%proc_domain(1,n)) num_obs = num_obs + 1
574 if (num_obs > 0) then
575 write(ounit,'(a20,i8)')'qscat', num_obs
577 do n = 1, iv%info(qscat)%nlocal
578 do itime = 1, num_fgat_time
579 if ( n >= iv%info(qscat)%plocal(itime-1)+1 .and. &
580 n <= iv%info(qscat)%plocal(itime) ) then
585 if (iv%info(qscat)%proc_domain(1,n)) then
586 num_obs = num_obs + 1
587 write(ounit,'(2i8)') 1, ifgat
588 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
589 num_obs, 1, iv%info(qscat)%id(n), & ! Station
590 iv%info(qscat)%lat(1,n), & ! Latitude
591 iv%info(qscat)%lon(1,n), & ! Longitude
592 iv%qscat(n)%h, & ! Obs height
594 iv%qscat(n)%u%inv, iv%qscat(n)%u%qc, iv%qscat(n)%u%error, &
597 iv%qscat(n)%v%inv, iv%qscat(n)%v%qc, iv%qscat(n)%v%error, &
604 do n = 1, iv%info(profiler)%nlocal
605 if (iv%info(profiler)%proc_domain(1,n)) num_obs = num_obs + 1
607 if (num_obs > 0) then
608 write(ounit,'(a20,i8)')'profiler', num_obs
610 do n = 1, iv%info(profiler)%nlocal
611 do itime = 1, num_fgat_time
612 if ( n >= iv%info(profiler)%plocal(itime-1)+1 .and. &
613 n <= iv%info(profiler)%plocal(itime) ) then
618 if (iv%info(profiler)%proc_domain(1,n)) then
619 num_obs = num_obs + 1
620 write(ounit,'(2i8)')iv%info(profiler)%levels(n), ifgat
621 do k = 1, iv%info(profiler)%levels(n)
622 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
623 num_obs, k, iv%info(profiler)%id(n), & ! Station
624 iv%info(profiler)%lat(1,n), & ! Latitude
625 iv%info(profiler)%lon(1,n), & ! Longitude
626 iv%profiler(n)%h(k), & ! Obs Height
627 ob%profiler(n)%u(k), &
628 iv%profiler(n)%u(k)%inv, iv%profiler(n)%u(k)%qc, iv%profiler(n)%u(k)%error, &
629 re%profiler(n)%u(k), &
630 ob%profiler(n)%v(k), &
631 iv%profiler(n)%v(k)%inv, iv%profiler(n)%v(k)%qc, iv%profiler(n)%v(k)%error, &
639 do n = 1, iv%info(buoy)%nlocal
640 if (iv%info(buoy)%proc_domain(1,n)) num_obs = num_obs + 1
642 if (num_obs > 0) then
643 write(ounit,'(a20,i8)')'buoy', num_obs
645 do n = 1, iv%info(buoy)%nlocal
646 do itime = 1, num_fgat_time
647 if ( n >= iv%info(buoy)%plocal(itime-1)+1 .and. &
648 n <= iv%info(buoy)%plocal(itime) ) then
653 if (iv%info(buoy)%proc_domain(1,n)) then
654 num_obs = num_obs + 1
655 write(ounit,'(2i8)') 1, ifgat
656 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
657 num_obs,1, iv%info(buoy)%id(n), & ! Station
658 iv%info(buoy)%lat(1,n), & ! Latitude
659 iv%info(buoy)%lon(1,n), & ! Longitude
660 ob%buoy(n)%p, & ! Obs Pressure
662 iv%buoy(n)%u%inv, iv%buoy(n)%u%qc, iv%buoy(n)%u%error, &
665 iv%buoy(n)%v%inv, iv%buoy(n)%v%qc, iv%buoy(n)%v%error, &
668 iv%buoy(n)%t%inv, iv%buoy(n)%t%qc, iv%buoy(n)%t%error, &
671 iv%buoy(n)%p%inv, iv%buoy(n)%p%qc, iv%buoy(n)%p%error, &
674 iv%buoy(n)%q%inv, iv%buoy(n)%q%qc, iv%buoy(n)%q%error, &
681 do n = 1, iv%info(bogus)%nlocal
682 if (iv%info(bogus)%proc_domain(1,n)) num_obs = num_obs + 1
684 if (num_obs > 0) then
685 write(ounit,'(a20,i8)')'bogus', num_obs
687 do n = 1, iv%info(bogus)%nlocal
688 if (iv%info(bogus)%proc_domain(1,n)) then
689 num_obs = num_obs + 1
690 write(ounit,'(i8)') 1
691 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
692 num_obs, 1, iv%info(bogus)%id(n), & ! Station
693 iv%info(bogus)%lat(1,n), & ! Latitude
694 iv%info(bogus)%lon(1,n), & ! Longitude
697 iv%bogus(n)%slp%inv, iv%bogus(n)%slp%qc, iv%bogus(n)%slp%error, &
698 re%bogus(n)%slp ! O, O-B, O-A p
699 write(ounit,'(i8)')iv%info(bogus)%levels(n)
700 do k = 1, iv%info(bogus)%levels(n)
701 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
702 num_obs , k, iv%info(bogus)%id(n), & ! Station
703 iv%info(bogus)%lat(1,n), & ! Latitude
704 iv%info(bogus)%lon(1,n), & ! Longitude
705 iv%bogus(n)%p(k), & ! Obs Pressure
707 iv%bogus(n)%u(k)%inv, iv%bogus(n)%u(k)%qc, iv%bogus(n)%u(k)%error, &
710 iv%bogus(n)%v(k)%inv, iv%bogus(n)%v(k)%qc, iv%bogus(n)%v(k)%error, &
713 iv%bogus(n)%t(k)%inv, iv%bogus(n)%t(k)%qc, iv%bogus(n)%t(k)%error, &
716 iv%bogus(n)%q(k)%inv, iv%bogus(n)%q(k)%qc, iv%bogus(n)%q(k)%error, &
724 do n = 1, iv%info(airsr)%nlocal
725 if (iv%info(airsr)%proc_domain(1,n)) num_obs = num_obs + 1
727 if (num_obs > 0) then
728 write(ounit,'(a20,i8)')'airsr', num_obs
730 do n = 1, iv%info(airsr)%nlocal
731 do itime = 1, num_fgat_time
732 if ( n >= iv%info(airsr)%plocal(itime-1)+1 .and. &
733 n <= iv%info(airsr)%plocal(itime) ) then
738 if (iv%info(airsr)%proc_domain(1,n)) then
739 num_obs = num_obs + 1
740 write(ounit,'(2i8)')iv%info(airsr)%levels(n), ifgat
741 do k = 1, iv%info(airsr)%levels(n)
742 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
743 num_obs,k, iv%info(airsr)%id(n), & ! Station
744 iv%info(airsr)%lat(1,n), & ! Latitude
745 iv%info(airsr)%lon(1,n), & ! Longitude
746 iv%airsr(n)%p(k), & ! Obs Pressure
748 iv%airsr(n)%t(k)%inv, iv%airsr(n)%t(k)%qc, iv%airsr(n)%t(k)%error, &
751 iv%airsr(n)%q(k)%inv, iv%airsr(n)%q(k)%qc, iv%airsr(n)%q(k)%error, &
759 do n = 1, iv%info(gpsref)%nlocal
760 if (iv%info(gpsref)%proc_domain(1,n)) num_obs = num_obs + 1
762 if (num_obs > 0) then
763 write(ounit,'(a20,i8)')'gpsref', num_obs
765 do n = 1, iv%info(gpsref)%nlocal
766 do itime = 1, num_fgat_time
767 if ( n >= iv%info(gpsref)%plocal(itime-1)+1 .and. &
768 n <= iv%info(gpsref)%plocal(itime) ) then
773 if (iv%info(gpsref)%proc_domain(1,n)) then
774 num_obs = num_obs + 1
775 write(ounit,'(2i8)')iv%info(gpsref)%levels(n), ifgat
776 do k = 1, iv%info(gpsref)%levels(n)
777 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
778 num_obs,k, iv%info(gpsref)%id(n), & ! Station
779 iv%info(gpsref)%lat(1,n), & ! Latitude
780 iv%info(gpsref)%lon(1,n), & ! Longitude
781 iv%gpsref(n)%h(k), & ! Obs Height
782 ob%gpsref(n)%ref(k), &
783 iv%gpsref(n)%ref(k)%inv, iv%gpsref(n)%ref(k)%qc, iv%gpsref(n)%ref(k)%error, &
791 do n = 1, iv%info(gpseph)%nlocal
792 if (iv%info(gpseph)%proc_domain(1,n)) num_obs = num_obs + 1
794 if (num_obs > 0) then
795 write(ounit,'(a20,i8)')'gpseph', num_obs
797 do n = 1, iv%info(gpseph)%nlocal
798 do itime = 1, num_fgat_time
799 if ( n >= iv%info(gpseph)%plocal(itime-1)+1 .and. &
800 n <= iv%info(gpseph)%plocal(itime) ) then
805 if (iv%info(gpseph)%proc_domain(1,n)) then
806 num_obs = num_obs + 1
807 !write(ounit,'(i8)')iv%info(gpseph)%levels(n)
808 write(ounit,'(2i8)') iv%gpseph(n)%level2 - iv%gpseph(n)%level1 + 1, ifgat
809 !do k = 1, iv%info(gpseph)%levels(n)
810 do k = iv%gpseph(n)%level1, iv%gpseph(n)%level2
811 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
812 num_obs, k, iv%info(gpseph)%id(n), & ! Station
813 iv%gpseph(n)%lat(k), & ! Latitude
814 iv%gpseph(n)%lon(k), & ! Longitude
815 iv%gpseph(n)%h(k), & ! Obs Height
816 ob%gpseph(n)%eph(k), &
817 iv%gpseph(n)%eph(k)%inv, iv%gpseph(n)%eph(k)%qc, iv%gpseph(n)%eph(k)%error, &
825 do n = 1, iv%info(tamdar)%nlocal
826 if (iv%info(tamdar)%proc_domain(1,n)) num_obs = num_obs + 1
828 if (num_obs > 0) then
829 write(ounit,'(a20,i8)')'tamdar', num_obs
831 do n = 1, iv%info(tamdar)%nlocal
832 do itime = 1, num_fgat_time
833 if ( n >= iv%info(tamdar)%plocal(itime-1)+1 .and. &
834 n <= iv%info(tamdar)%plocal(itime) ) then
839 if (iv%info(tamdar)%proc_domain(1,n)) then
840 num_obs = num_obs + 1
841 write(ounit,'(2i8)')iv%info(tamdar)%levels(n), ifgat
842 do k = 1, iv%info(tamdar)%levels(n)
843 write(ounit,'(2i8,a5,2f9.2,f17.7,4(2f17.7,i8,2f17.7),f12.2)')&
844 num_obs,k, iv%info(tamdar)%id(n), & ! Station
845 iv%info(tamdar)%lat(k,n), & ! Latitude
846 iv%info(tamdar)%lon(k,n), & ! Longitude
847 iv%tamdar(n)%p(k), & ! Obs Pressure
849 iv%tamdar(n)%u(k)%inv, iv%tamdar(n)%u(k)%qc, iv%tamdar(n)%u(k)%error, &
852 iv%tamdar(n)%v(k)%inv, iv%tamdar(n)%v(k)%qc, iv%tamdar(n)%v(k)%error, &
855 iv%tamdar(n)%t(k)%inv, iv%tamdar(n)%t(k)%qc, iv%tamdar(n)%t(k)%error, &
858 iv%tamdar(n)%q(k)%inv, iv%tamdar(n)%q(k)%qc, iv%tamdar(n)%q(k)%error, &
859 re%tamdar(n)%q(k), iv%info(tamdar)%zk(k,n)
868 do n = 1, iv%info(tamdar_sfc)%nlocal
869 if (iv%info(tamdar_sfc)%proc_domain(1,n)) num_obs = num_obs + 1
871 if (num_obs > 0) then
872 write(ounit,'(a20,i8)')'tamdar_sfc', num_obs
874 do n = 1, iv%info(tamdar_sfc)%nlocal
875 do itime = 1, num_fgat_time
876 if ( n >= iv%info(tamdar_sfc)%plocal(itime-1)+1 .and. &
877 n <= iv%info(tamdar_sfc)%plocal(itime) ) then
882 if (iv%info(tamdar_sfc)%proc_domain(1,n)) then
883 num_obs = num_obs + 1
884 write(ounit,'(2i8)') 1, ifgat
885 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7),f12.2)')&
886 num_obs , 1, iv%info(tamdar_sfc)%id(n), & ! Station
887 iv%info(tamdar_sfc)%lat(1,n), & ! Latitude
888 iv%info(tamdar_sfc)%lon(1,n), & ! Longitude
889 ob%tamdar_sfc(n)%p, & ! Obs Pressure
890 ob%tamdar_sfc(n)%u, &
891 iv%tamdar_sfc(n)%u%inv, iv%tamdar_sfc(n)%u%qc, iv%tamdar_sfc(n)%u%error, &
892 re%tamdar_sfc(n)%u, &
893 ob%tamdar_sfc(n)%v, &
894 iv%tamdar_sfc(n)%v%inv, iv%tamdar_sfc(n)%v%qc, iv%tamdar_sfc(n)%v%error, &
895 re%tamdar_sfc(n)%v, &
896 ob%tamdar_sfc(n)%t, &
897 iv%tamdar_sfc(n)%t%inv, iv%tamdar_sfc(n)%t%qc, iv%tamdar_sfc(n)%t%error, &
898 re%tamdar_sfc(n)%t, &
899 ob%tamdar_sfc(n)%p, &
900 iv%tamdar_sfc(n)%p%inv, iv%tamdar_sfc(n)%p%qc, iv%tamdar_sfc(n)%p%error, &
901 re%tamdar_sfc(n)%p, &
902 ob%tamdar_sfc(n)%q, &
903 iv%tamdar_sfc(n)%q%inv, iv%tamdar_sfc(n)%q%qc, iv%tamdar_sfc(n)%q%error, &
904 re%tamdar_sfc(n)%q, iv%info(tamdar_sfc)%zk(1,n)
910 do n = 1, iv%info(rain)%nlocal
911 if (iv%info(rain)%proc_domain(1,n)) num_obs = num_obs + 1
913 if (num_obs > 0) then
914 write(ounit,'(a20,i8)')'rain', num_obs
916 do n = 1, iv%info(rain)%nlocal
917 do itime = 1, num_fgat_time
918 if ( n >= iv%info(rain)%plocal(itime-1)+1 .and. &
919 n <= iv%info(rain)%plocal(itime) ) then
924 if (iv%info(rain)%proc_domain(1,n)) then
925 num_obs = num_obs + 1
926 write(ounit,'(2i8)') 1, ifgat
927 write(ounit,'(2i8,a5,2f9.2,f17.7,5(2f17.7,i8,2f17.7))')&
928 num_obs,1, iv%info(rain)%id(n), & ! Station
929 iv%info(rain)%lat(1,n), & ! Latitude
930 iv%info(rain)%lon(1,n), & ! Longitude
931 iv%rain(n)%height, & ! Obs Pressure
933 iv%rain(n)%rain%inv, iv%rain(n)%rain%qc, iv%rain(n)%rain%error, &
941 do n = 1, iv%info(lightning)%nlocal
942 if (iv%info(lightning)%proc_domain(1,n)) num_obs = num_obs + 1
944 if (num_obs > 0) then
945 write(ounit,'(a20,i8)')'lightning', num_obs
947 do n = 1, iv%info(lightning)%nlocal
948 do itime = 1, num_fgat_time
949 if ( n >= iv%info(lightning)%plocal(itime-1)+1 .and. &
950 n <= iv%info(lightning)%plocal(itime) ) then
955 if (iv%info(lightning)%proc_domain(1,n)) then
956 num_obs = num_obs + 1
957 write(ounit,'(2i8)')iv%info(lightning)%levels(n), ifgat
958 do k = 1, iv%info(lightning)%levels(n)
959 write(ounit,'(2i8,a5,2f9.2,f17.7,3(2f17.7,i8,2f17.7))')&
960 num_obs , k, iv%info(lightning)%id(n), & ! Station
961 iv%info(lightning)%lat(1,n), & ! Latitude
962 iv%info(lightning)%lon(1,n), & ! Longitude
963 iv%lightning(n)%height(k), & ! Obs Height
964 ob%lightning(n)%w(k), &
965 iv%lightning(n)%w(k)%inv, &
966 iv%lightning(n)%w(k)%qc, &
967 iv%lightning(n)%w(k)%error, &
968 re%lightning(n)%w(k), &
969 ob%lightning(n)%div(k), &
970 iv%lightning(n)%div(k)%inv, &
971 iv%lightning(n)%div(k)%qc, &
972 iv%lightning(n)%div(k)%error,&
973 re%lightning(n)%div(k), &
974 ob%lightning(n)%qv(k), &
975 iv%lightning(n)%qv(k)%inv, &
976 iv%lightning(n)%qv(k)%qc, &
977 iv%lightning(n)%qv(k)%error, &
978 re%lightning(n)%qv(k)
985 call da_free_unit(ounit)
987 if (trace_use) call da_trace_exit("da_write_obs")
989 end subroutine da_write_obs