c c .... This subroutine is to read OMPS NP v6 ozone daily bufr file, and c output some data in an array (B) which will be used in OMPS c analysis. In version 6 PMF format 207 record format though most were c not used. Here only those usable record such as lat, lon, total ozone c and ozone mixing ratios and layer ozone are output. The rest of array c B is filled with -9999. C===================================================== SUBROUTINE READBUFR(B, TODAY, JREC, FLG) C===================================================== character(8) subset character(51) ozstr character(8) today character(14) prostr character(27) mixstr C integer idate,jdate,ksatid,kk,iret,norbit integer syear,smonth,sday,shour,sminute,ssec,dofyr,isaa integer idate5(5),md1(12),md2(12) integer nlayr C real*8 slons0,slats0,rsat,solzen,orbitn,totpro,saa real*8 to3,toq,poq real*8 poz(12),ozmr(19) real*8 hdroz(10) real*8 arr(3,12),vrr(5,31) real*8 playr, ozlyr, ozm C dimension b(207,2000) C data md1/0,31,59,90,120,151,181,212,243,273,304,334/ data md2/0,31,60,91,121,152,182,213,244,274,305,335/ data ozstr /'SAID CLATH CLONH YEAR MNTH DAYS HOUR MINU SECO SOZA'/ data prostr /'NRLY PRES OZOP'/ data mixstr /'NRLY PRES DSFTV MIXRV DSFTV'/ C C************************************************************************** C C ... Open files C open(56,file= & '/gpfs/gd2/cpc/noscrub/Craig.Long/omps/'//today//'.out', & form='formatted',status='replace') c open(18,file= &'/gpfs/gd2/cpc/noscrub/Craig.Long/omps/data/xx014.'//today//'.b6', & form='unformatted',status='old') C jrec=0 C call openbf(18,'IN',18) call datelen(10) call readmg(18,subset,idate,iret) write(56,910) subset 910 format(1x,'subset=',a8) C if (iret .ne. 0) goto 160 C 110 continue C call readsb(18,iret) C if (iret .ne. 0) then call readmg(18,subset,jdate,iret) c write(6,*) n,subset,jdate,iret if (iret .ne. 0) goto 160 goto 110 endif C C...Extract 10 header information C call ufbint(18,hdroz,10,1,iret,ozstr) rsat = hdroz(1)-191.0 ksatid=rsat C slats0 = hdroz(2) slons0 = hdroz(3) syear = hdroz(4) smonth = hdroz(5) sday = hdroz(6) shour = hdroz(7) sminute = hdroz(8) ssec = hdroz(9) solzen = hdroz(10) C C calculate day of year C if (mod(syear,4) .ne. 0) then dofyr = md1(smonth)+sday else dofyr = md2(smonth)+sday endif C C Extract best total ozone, total ozone flag and profile ozone flag C For descending data subtract 10 from the flag C call ufbint(18,orbitn,1,1,iret,'ORBN') norbit = int(orbitn) call ufbint(18,saa,1,1,iret,'XSAA') isaa = int(saa) C call ufbint(18,to3,1,1,iret,'OZON') C call ufbint(18,toq,1,1,iret,'SBUVTOQ') C call ufbint(18,poq,1,1,iret,'SBUVPOQ') C c if (toq .ge. 10) toq=toq-10 c if (poq .ge. 10) poq=poq-10 c c Extract 12 layer ozone values c c call ufbseq(18,arr,3,12,iret,'OMPSPRO') call ufbrep(18,arr,3,12,iret,prostr) C write(56,905) 905 format(1x,'Layer Ozone') do k=1,12 poz(k)=arr(3,k) ozlyr = arr(3,k) nlayr = arr(1,k) playr = arr(2,k)/100. c write(56,903) nlayr, playr, ozlyr enddo 903 format(i3,2f8.2) C C Extract level ozone mixing ratio (ppmv) values and change to ppm C C call ufbseq(18,vrr,5,19,iret,'OMPSMIX') call ufbrep(18,vrr,5,31,iret,mixstr) C write(56,906) 906 format(1x,'Ozone Mixing Ratio') do k=13,31 ozmr(k-12) = vrr(4,k)*48./29. ozm = vrr(4,k)*48./29. nlayr = vrr(1,k) playr = vrr(2,k)/100. c write(56,904) nlayr, playr, ozm enddo 904 format(i3,2f8.2) C if (to3 .lt. 700) then C C write(56,933) toq, poq C C if (toq .ne. 0 .or. poq .ne. 0) goto 90 jrec = jrec+1 C...initialize b array do i=1,207 b(i,jrec)=-9999. enddo C isec = shour*3600 + sminute*60 + ssec C b(3,jrec) = orbitn b(4,jrec) = syear*1000.+dofyr b(5,jrec) = isec b(6,jrec) = slats0 b(7,jrec) = slons0 b(8,jrec) = slats0 b(9,jrec) = slons0 b(10,jrec) = solzen b(11,jrec) = isaa b(35,jrec) = to3 b(40,jrec) = toq C C...12 Layer bottoms: 132-143 C 0.25,0.49,0.99,1.98,3.96,7.92,15.83,31.66,63.33,126.66,253.31,1013.25 b(132,jrec)=poz(1) b(133,jrec)=poz(2) b(134,jrec)=poz(3) b(135,jrec)=poz(4) b(136,jrec)=poz(5) b(137,jrec)=poz(6) b(138,jrec)=poz(7) b(139,jrec)=poz(8) b(140,jrec)=poz(9) b(141,jrec)=poz(10) b(142,jrec)=poz(11) b(143,jrec)=poz(12) C totpro = 0.0 do i = 1, 12 totpro = totpro + poz(i) enddo C b(156,jrec) = totpro b(157,jrec) = poq C C Below are 0.4, 1, 2, 5, 10, 30 hPa ozone mixing ratio (ppm) C 161,164,166,169,171,174 C...Ozone Mixing Ratio levels (ppm):160-178 C 0.3, 0.4, 0.5, 0.7, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0, 15.0, 20.0, C 30.0, 40.0, 50.0,70.0,100.0 C b(160,jrec)=ozmr(1) b(161,jrec)=ozmr(2) b(162,jrec)=ozmr(3) b(163,jrec)=ozmr(4) b(164,jrec)=ozmr(5) b(165,jrec)=ozmr(6) b(166,jrec)=ozmr(7) b(167,jrec)=ozmr(8) b(168,jrec)=ozmr(9) b(169,jrec)=ozmr(10) b(170,jrec)=ozmr(11) b(171,jrec)=ozmr(12) b(172,jrec)=ozmr(13) b(173,jrec)=ozmr(14) b(174,jrec)=ozmr(15) b(175,jrec)=ozmr(16) b(176,jrec)=ozmr(17) b(177,jrec)=ozmr(18) b(178,jrec)=ozmr(19) C write(56,932) norbit,syear,dofyr,isec,slats0,slons0,to3, > totpro, solzen, int(toq), int(poq) endif 90 continue C goto 110 call closbf(18) 160 continue close(18) C 932 format(4i6,f7.2,f8.2,3f7.2,2i10) 933 format(1x, 'toz errflg=', f6.1,', protoz errflg =', f6.1) C return end