program bufr_encode_amsub ! ! Encode AMSUB TMBR(brightness temperature) to bufr file. ! implicit none integer, parameter :: mxmn=35, mxlv=250 ! define mnemonic of AMSUB (Coming from GSI read_bufrtovs.f90) character(80):: hdstr= & 'SAID FOVN YEAR MNTH DAYS HOUR MINU SECO CLAT CLON CLATH CLONH HOLS' character(80):: hdr2b='SAZA SOZA BEARAZ SOLAZI' character(80):: obstr='TMBR' character(8) msgtype real(8) :: hdr(mxmn),hdr2(mxmn),obs(mxlv) integer :: unit_in=10,unit_table=24,idate,iret,nchanl ! set data values hdr(1)=208.; hdr(2)=36. hdr(3)=2012; hdr(4)=5; hdr(5)=1; hdr(6)=21; hdr(7)=0; hdr(8)=0 hdr(9)=11.6; hdr(10)=-26.1; hdr(13)=0 hdr2(1)=11.8; hdr2(2)=105.3; hdr2(3)=81.2; hdr2(4)=289.7 obs(1)=231.6; obs(2)=277.4 idate=2012050200 ! YYYYMMDDHH msgtype='NC021024' ! AMSUB message type nchanl=5 ! TMBR has fixed 5 replication in AMSUB type open(unit_table,file='radiance.bufrtable') open(unit_in,file='amsub.bufr',action='write',form='unformatted') call datelen(10) call openbf(unit_in,'OUT',unit_table) call openmb(unit_in,msgtype,idate) call ufbint(unit_in,hdr,mxmn,1,iret,hdstr) call ufbint(unit_in,hdr2,mxmn,1,iret,hdr2b) call ufbrep(unit_in,obs,1,nchanl,iret,obstr) call writsb(unit_in) call closmg(unit_in) call closbf(unit_in) end program