SUBROUTINE AX_BUFR ( iunbfo, irundt, seqnum, buhd, cborg, + bulldt, bbb, idate, itime, rlat, rlon, + ichnm, acid, lacid, stid, lstid, + ptid, lptid, rdep, rtemp, rtempe, nlev, + iret ) C************************************************************************ C* AX_BUFR * C* * C* This subroutine converts decoded AXBT data into BUFR and writes it * C* to the BUFR output stream. * C* * C* AX_BUFR ( IUNBFO, IRUNDT, SEQNUM, BUHD, CBORG, * C* BULLDT, BBB, IDATE, ITIME, RLAT, RLON, * C* ICHNM, ACID, LACID, STID, LSTID, * C* PTID, LPTID, RDEP, RTEMP, RTEMPE, NLEV, * C* IRET ) * C* * C* Input parameters: * C* IUNBFO INTEGER BUFR output file unit number * C* IRUNDT (5) INTEGER Run date-time * C* (YYYY, MM, DD, HH, MM ) * C* SEQNUM CHAR* Bulletin sequence number * C* BUHD CHAR* Bulletin header * C* CBORG CHAR* Bulletin originator * C* BULLDT CHAR* Bulletin date-time * C* BBB CHAR* Bulletin BBB indicator * C* IDATE INTEGER Report date (YYYYMMDD) * C* ITIME INTEGER Report time (HHMMSS) * C* RLAT REAL Report latitude * C* RLON REAL Report longitude * C* ICHNM INTEGER Report channel number * C* ACID CHAR* Aircraft identifier * C* LACID INTEGER Length of ACID * C* STID CHAR* Storm identifier * C* LSTID INTEGER Length of STID * C* PTID CHAR* Platform transmission identifier* C* LPTID INTEGER Length of PTID * C* RDEP (NLEV) REAL Reported depths in meters * C* RTEMP (NLEV) REAL Reported temperatures in deg C * C* RTEMPE (NLEV) REAL Reported temperature precisions * C* in deg C * C* NLEV INTEGER Number of reported levels * C* * C* Output parameters: * C* IRET INTEGER Return code * C* 0 = normal return * C** * C* Log: * C* J. Ator/NCEP 11/10 * C* J. Ator/NCEP 09/12 Use ABS() to convert rdep values to BUFR* C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'axcmn.cmn' C* INTEGER irundt (*) C* CHARACTER*(*) seqnum, buhd, cborg, bulldt, bbb, + acid, stid, ptid C* REAL rdep (*), rtemp (*), rtempe (*) C* REAL*8 r8lev ( 3, MXNLEV ), UT_RIBM C----------------------------------------------------------------------- iret = 0 C C* Set the BUFR message date-time. C ibfdt = ( idate * 100 ) + MOD ( itime, 10000 ) C C* Open a BUFR message for output. C CALL OPENMB ( iunbfo, 'NC031004', ibfdt ) C C* Bulletin ID information. C CALL UT_CIBF ( iunbfo, 'SEQNUM', seqnum, 8, iercbf ) CALL UT_CIBF ( iunbfo, 'BUHD', buhd, 8, iercbf ) CALL UT_CIBF ( iunbfo, 'BORG', cborg, 8, iercbf ) CALL UT_CIBF ( iunbfo, 'BULTIM', bulldt, 8, iercbf ) CALL UT_CIBF ( iunbfo, 'BBB', bbb, 8, iercbf ) C C* Report date-time. C CALL UT_RIBF ( iunbfo, 'YEAR', + FLOAT ( idate / 10000 ), ierrbf ) CALL UT_RIBF ( iunbfo, 'MNTH', + FLOAT ( MOD ( idate, 10000 ) / 100 ), ierrbf ) CALL UT_RIBF ( iunbfo, 'DAYS', + FLOAT ( MOD ( idate, 100 ) ), ierrbf ) CALL UT_RIBF ( iunbfo, 'HOUR', + FLOAT ( itime / 10000 ), ierrbf ) CALL UT_RIBF ( iunbfo, 'MINU', + FLOAT ( MOD ( itime, 10000 ) / 100 ), ierrbf ) CALL UT_RIBF ( iunbfo, 'SECO', + FLOAT ( MOD ( itime, 100 ) ), ierrbf ) C C* Receipt date-time. C CALL UT_RIBF ( iunbfo, 'RCYR', FLOAT ( irundt (1) ), ierrbf ) CALL UT_RIBF ( iunbfo, 'RCMO', FLOAT ( irundt (2) ), ierrbf ) CALL UT_RIBF ( iunbfo, 'RCDY', FLOAT ( irundt (3) ), ierrbf ) CALL UT_RIBF ( iunbfo, 'RCHR', FLOAT ( irundt (4) ), ierrbf ) CALL UT_RIBF ( iunbfo, 'RCMI', FLOAT ( irundt (5) ), ierrbf ) CALL UT_RIBF ( iunbfo, 'RCTS', FLOAT ( 0 ), ierrbf ) C C* Aircraft identifier. C CALL UT_CIBF ( iunbfo, 'ACID', acid, lacid, iercbf) C C* Storm identifier. C CALL UT_CIBF ( iunbfo, 'STMID', stid, lstid, iercbf) C C* Latitude. C CALL UT_RIBF ( iunbfo, 'CLATH', rlat, ierrbf ) C C* Longitude. C CALL UT_RIBF ( iunbfo, 'CLONH', rlon, ierrbf ) C C* Channel number. C CALL UT_RIBF ( iunbfo, 'CHNM', FLOAT ( ichnm ), ierrbf ) C C* Level data. C DO jj = 1, nlev r8lev ( 1, jj ) = UT_RIBM ( ABS ( rdep (jj) ) ) r8lev ( 2, jj ) = UT_RIBM ( PR_TMCK ( rtemp (jj) ) ) IF ( rtempe (jj) .ge. 0 ) THEN r8lev ( 3, jj ) = UT_RIBM ( rtempe (jj) ) ELSE r8lev ( 3, jj ) = UT_RIBM ( RMISSD ) END IF END DO CALL UFBINT ( iunbfo, r8lev, 3, nlev, ierufb, + 'DBSS STMP PCAT' ) C C* Store all of the above values into the BUFR message. C CALL UT_WBFR ( iunbfo, 'axbt', 0, ierwbf ) C C* Platform transmitter ID. C CALL WRITLC ( iunbfo, ptid(1:lptid), 'PTIDC' ) C C* Write the BUFR message to the output stream. C CALL UT_WBFR ( iunbfo, 'axbt', 1, ierwbf ) C* RETURN END