60c60,63
<   use kinds, only: i_kind,i_llong
---
>   use kinds, only: i_kind,i_llong,r_kind,r_double
>   use gsi_4dvar, only: iadatebgn,iadateend
>   use obsmod, only: offtime_data
>   use convinfo, only: nconvtype,ictype,ioctype,icuse
125a129
> !   2013-11-01  pagowski - make code compatible with ncep/mhu airnow bufr  
148,149c152,153
<        code_pm25_bufr,code_pm25_prepbufr
<   use mpimod, only : mype
---
>        code_pm25_ncbufr,code_pm25_anowbufr,&
>        code_pm10_ncbufr,code_pm10_anowbufr
172,174d175
< !      write(6,*)'dtype',trim(dtype)
< !      write(6,*)'open lnbuf file',trim(filename)
< !      call flush(6)
176,177d176
< !      write(6,*)mype,'openbf',lnbufr
< !      call flush(6)
181d179
<       call closbf(lnbufr)
196c194
<       if(lexist)then
---
>       IF(lexist)THEN
285,289c283
<        open(lnbufr,file=trim(filename),form='unformatted',status ='unknown')
<        call openbf(lnbufr,'IN',lnbufr)
<        call datelen(10)
< 
<        if(kidsat /= 0)then
---
>        IF(kidsat /= 0)THEN
314,342d307
<        else if(trim(filename) == 'prepbufr_profl')then  
<          lexist = .false.
<          airploop: do while(ireadmg(lnbufr,subset,idate2) >= 0)
<           do while(ireadsb(lnbufr)>=0)
<            call ufbint(lnbufr,rtype,1,1,iret,'TYP')
<            kx=nint(rtype)
<            if (trim(dtype)=='uv') then
<               if (kx==330 .or. kx==430 .or. kx==530) kx=230
<               if (kx==331 .or. kx==431 .or. kx==531) kx=231
<               if (kx==332 .or. kx==432 .or. kx==532) kx=232
<               if (kx==333 .or. kx==433 .or. kx==533) kx=233
<               if (kx==334 .or. kx==434 .or. kx==534) kx=234
<               if (kx==335 .or. kx==435 .or. kx==535) kx=235
<            else
<               if (kx==330 .or. kx==430 .or. kx==530) kx=130
<               if (kx==331 .or. kx==431 .or. kx==531) kx=131
<               if (kx==332 .or. kx==432 .or. kx==532) kx=132
<               if (kx==333 .or. kx==433 .or. kx==533) kx=133
<               if (kx==334 .or. kx==434 .or. kx==534) kx=134
<               if (kx==335 .or. kx==435 .or. kx==535) kx=135
<            end if
<            do nc=1,nconvtype
<              if(trim(ioctype(nc)) == trim(dtype) .and. kx == ictype(nc) .and. icuse(nc) > minuse)then
<                lexist = .true.
<                exit airploop
<              end if
<            end do
<           end do
<          end do airploop
376c341
<              fileloopanow:do while(ireadmg(lnbufr,subset,idate2) >= 0)
---
>              fileloopanow_pm2_5:do while(ireadmg(lnbufr,subset,idate2) >= 0)
385c350
<                       if (kx/=code_pm25_bufr) then
---
>                       if (kx/=code_pm25_ncbufr) then
388c353
<                          kx=code_pm25_prepbufr
---
>                          kx=code_pm25_anowbufr
398c363
<                          exit fileloopanow
---
>                          exit fileloopanow_pm2_5
402c367
<              enddo fileloopanow
---
>              enddo fileloopanow_pm2_5
410a376,396
>        else if(trim(dtype) == 'pm10')then
>           lexist = .false.
>           fileloopanow_pm10:do while(ireadmg(lnbufr,subset,idate2) >= 0)
>              do while(ireadsb(lnbufr)>=0)
>                 if (subset == 'NC008033') then
>                    call ufbint(lnbufr,rtype,1,1,iret,'TYPO')
>                    kx=nint(rtype)
>                    if (kx/=code_pm10_ncbufr) then
>                       cycle
>                    else
>                       kx=code_pm10_anowbufr
>                    endif
>                 else
>                    cycle
>                 endif
>                 
>                 do nc=1,nconvtype
>                    if(trim(ioctype(nc)) == trim(dtype) .and. &
>                         kx == ictype(nc) .and. icuse(nc) > minuse)then
>                       lexist = .true.
>                       exit fileloopanow_pm10
411a398,409
>                 end do
>              end do
>           enddo fileloopanow_pm10
> 
>           if (lexist) then
>              write(6,*)'found pm10 in anow bufr'
>           else
>              write(6,*)'did not find pm10 in anow bufr'
>           endif
>           
>        endif
>        
498,499d495
< !   2013-06-01  zhu     - add mype_airobst to handle aircraft temperature bias correction 
< !   2013-08-08  s.liu     - add read NASA_LaRC_cloud product
514c510
<     use kinds, only: r_kind,i_kind,i_llong,r_double
---
>     use kinds, only: r_kind,i_kind,i_llong
531d526
<     use no2info, only: nusis_no2,iuse_no2,jpch_no2,diag_no2
535,536d529
<     use aircraftinfo, only: aircraft_t_bc,aircraft_t_bc_pof,mype_airobst
<     use omimod, only : no2pe,sendpresscatwt
552d544
<     logical :: acft_profl_file
554,555c546
<     character(15):: string,infile
<     character(15):: infilen
---
>     character(13):: string,infile
635,636d625
< !       write(6,*)mype,'ajl new3 obstype',obstype
< !       call flush(6)
652a642
>            obstype == 'pm10' .or. &
670,671d659
<        else if (obstype == 'omino2')then
<           ditype(i)='no2'
707,714d694
<        else if(ditype(i) == 'no2')then
< !          write(6,*)'ajl 44 ditype',ditype(i),'jpch_no2',jpch_no2
<           if(diag_no2 .and. .not. reduce_diag)minuse=-2
<           do j=1,jpch_no2
< !             write(6,*)'ajl dsis',trim(dsis(i)),'nusis_no2',trim(nusis_no2(j)),'iuse_no2',iuse_no2(j)
< !             call flush(6)
<              if(trim(dsis(i)) == trim(nusis_no2(j)) .and. iuse_no2(j) > minuse)nuse=.true.
<           end do
917d896
<     mype_airobst = mype_root
922,926d900
< 
<        acft_profl_file = index(dfile(i),'_profl')/=0
<        if ((aircraft_t_bc_pof .or. (aircraft_t_bc .and. acft_profl_file)) .and. dtype(i) == 't') &
<                    mype_airobst = mype_root_sub(i)
< 
1018,1021d991
< !          write(6,*)'obstype',obstype,'infile',infile,'i',i,'ii',ii
< !          call flush(6)
< 
< !         write(6,*)'sliu in read_obs.F90::',obstype
1030c1000,1002
<               if(obstype == 't' .or. obstype == 'q'  .or. obstype == 'ps' .or. &
---
> !             if (obstype == 't'  .or. obstype == 'uv' .or. &
>              if (obstype == 't'  .or. &
>                  obstype == 'q'  .or. obstype == 'ps' .or. &
1090,1092c1062
< !               write(6,*)'sliu :: NASA cld', infile, 'READ_NASA_LaRC'
< !               call read_NASA_LaRC(nread,npuse,infile,obstype,lunout,twind,sis)
<                 call read_NASA_LaRC_cloud(nread,npuse,nouse,infile,obstype,lunout,twind,sis)
---
>                 call read_NASA_LaRC(nread,npuse,infile,obstype,lunout,twind,sis)
1123c1093
<              else if (obstype == 'pm2_5') then
---
>              else if (obstype == 'pm2_5' .or. obstype == 'pm10') then
1254d1223
< !             write(6,*)mype,'call read_ozone'
1258,1265d1226
< !         Process no2 data
<           else if (ditype(i) == 'no2')then
< !             write(6,*)mype,'call read_no2'
< !             call flush(6)
<              call read_no2(nread,npuse,nouse,&
<                   platid,infile,gstime,lunout,obstype,twind,sis,ithin,rmesh)
<              string='READ_NO2'
< !             write(6,*)mype,'did call read_no2'
1288,1289c1249,1250
<                   platid,infile,gstime,lunout,obstype,twind,sis,ithin,rmesh)   ! ?????, &
<              !    mype,mype_root,mype_sub(mm1,i),npe_sub(i),mpi_comm_sub(i))      !??? extra args???
---
>                   platid,infile,gstime,lunout,obstype,twind,sis,ithin,rmesh, &
>                   mype,mype_root,mype_sub(mm1,i),npe_sub(i),mpi_comm_sub(i))
1305c1266
< 8000         format(1x,a15,': file=',a15,&
---
> 8000         format(1x,a13,': file=',a10,&
1317,1325d1277
< !   Broadcast aircraft new tail numbers for aircraft
< !   temperature bias correction
< !   if (aircraft_t_bc) then
< !      call mpi_barrier(mpi_comm_world,ierror)
< !      call mpi_bcast(ntail_update,1,mpi_itype,mype_airobst,mpi_comm_world,ierror)
< !      call mpi_bcast(idx_tail,max_tail,mpi_itype,mype_airobst,mpi_comm_world,ierror)
< !      call mpi_bcast(taillist,max_tail,MPI_CHARACTER,mype_airobst,mpi_comm_world,ierror)
< !   end if
< 
1351,1357d1302
< !    write(6,*)mype,'bottom of read_obs ndata',ndata,'ditype',ditype,'file',trim(obs_input_common)
< !    call flush(6)
< !    !write(840+mype,*)'bottom of read_obs',no2pe
< !    call flush(840+mype)
<     call sendpresscatwt
< !    write(840+mype,*)'bottom2 of read_obs',no2pe
< !    call flush(840+mype)
