1 subroutine da_print_qcstat(it, iv, num_qcstat_conv)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 type (iv_type), intent(inout) :: iv ! innovation vector.
10 integer, intent(in) :: it
11 integer, intent(inout) :: num_qcstat_conv(:,:,:,:)
13 integer :: ii, i, j, k ,n, num, ounit, ios
14 character(len=filename_len) :: file
15 character*4 :: ob_field ! Added by Soyoung (Aug-2021)
18 character(1),dimension(115):: cline
19 character(4),dimension(2):: typx
20 integer, allocatable :: count(:)
22 if (trace_use) call da_trace_entry("da_print_qcstat")
23 num = num_ob_indexes*num_ob_vars*(npres_print)
24 allocate (count(2*num))
35 do i = 1, num_ob_indexes
37 count(ii) = num_qcstat_conv(1,i,j,k)
38 count(num+ii) = num_qcstat_conv(2,i,j,k)
43 call da_proc_sum_ints(count)
46 call da_get_unit(ounit)
47 write(unit=file,fmt ='(a,i2.2)')'qcstat_conv_',it
48 open(unit=ounit,file=trim(file),form='formatted', status='replace', iostat=ios)
49 if (ios /= 0) call da_error(__FILE__,__LINE__, &
50 (/"Cannot open file "//file/))
55 do i = 1, num_ob_indexes
57 num_qcstat_conv(1,i,j,k) = count(ii)
58 num_qcstat_conv(2,i,j,k) = count(num+ii)
64 do i = 1, num_ob_indexes
65 num_qcstat_conv(1,i,j,npres_print+1) = sum( num_qcstat_conv(1,i,j,1:npres_print) )
66 num_qcstat_conv(2,i,j,npres_print+1) = sum( num_qcstat_conv(2,i,j,1:npres_print) )
70 do i = 1, num_ob_indexes
71 if (.not. write_head) then
74 50 format(20x,'WRF-Var data utilization statistics for outer iteration ',i3,/)
75 write(ounit,510)'ptop',(pptop(k),k=1,npres_print), 0.0
76 write(ounit,511)'obs type','var','pbot',(ppbot(k),k=1,npres_print), 2000.0
77 510 format(15x,a8,1x,13(1x,f6.1))
78 511 format(1x,a8,1x,a3,6x,a4,1x,13(1x,f6.1))
79 write(ounit,500) (cline(j),j=1,115)
84 ob_field = ob_vars(j) ! Added by Soyoung (Aug-2021)
86 if (i.eq.num_ob_indexes) ob_field = 'chem'
88 if( num_qcstat_conv(1,i,j,npres_print+1) > 0 ) then
89 write(ounit,700) obs_names(i),ob_field,typx(1),& ! Soyoung (Aug-2021)
90 ! write(ounit,700) obs_names(i),ob_vars(j),typx(1),&
91 ((num_qcstat_conv(1,i,j,k) - num_qcstat_conv(2,i,j,k)),k=1,npres_print+1)
92 write(ounit,701) typx(2), (num_qcstat_conv(2,i,j,k),k=1,npres_print+1)
93 700 format(1x,a12,a4,2x,a4,1x, 25(1x,i6) )
94 701 format(19x,a4,1x,25(1x,i6) )
98 write(ounit,500) (cline(j),j=1,115)
100 call da_free_unit(ounit)
104 if (trace_use) call da_trace_exit("da_print_qcstat")
106 end subroutine da_print_qcstat