NCEPLIBS-bufr 11.7.1
rdmsgw.f
Go to the documentation of this file.
1C> @file
2C> @author ATOR @date 2005-11-29
3
4C> THIS SUBROUTINE READS THE NEXT BUFR MESSAGE FROM LOGICAL
5C> UNIT LUNIT AS AN ARRAY OF INTEGER WORDS.
6C>
7C> PROGRAM HISTORY LOG:
8C> 2005-11-29 J. ATOR -- ORIGINAL AUTHOR
9C> 2009-03-23 D. KEYSER -- CALL BORT IN CASE OF MESG OVERFLOW
10C> 2012-09-15 J. WOOLLEN -- CONVERT TO C LANGUAGE I/O INTERFACE;
11C> USE C ROUTINE CRDBUFR TO OBTAIN BUFR
12C> MESSAGE; REMOVE CODE WHICH CHECKS SEC0
13C> AND MESSAGE LENGTH AS CRDBUFR DOES THAT
14C>
15C> USAGE: CALL RDMSGW (LUNIT, MESG, IRET)
16C> INPUT ARGUMENT LIST:
17C> LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE
18C>
19C> OUTPUT ARGUMENT LIST:
20C> MESG - *-WORD ARRAY CONTAINING BUFR MESSAGE READ FROM LUNIT
21C> IRET - INTEGER: RETURN CODE:
22C> 0 = normal return
23C> -1 = end-of-file encountered while reading
24C> from LUNIT
25C>
26C> INPUT FILES:
27C> UNIT "LUNIT" - BUFR FILE
28C>
29C> REMARKS:
30C> THIS ROUTINE CALLS: CRDBUFR ERRWRT STATUS
31C> THIS ROUTINE IS CALLED BY: COPYBF CPDXMM DATEBF DUMPBF
32C> MESGBC MESGBF POSAPX RDBFDX
33C> READMG UFBMEM UFBMEX
34C> Normally not called by any application
35C> programs.
36C>
37 SUBROUTINE rdmsgw(LUNIT,MESG,IRET)
38
39 USE modv_mxmsgl
40
41 COMMON /hrdwrd/ nbytw,nbitw,iord(8)
42
43 dimension mesg(*)
44
45 CHARACTER*128 BORT_STR
46 INTEGER CRDBUFR
47
48C-----------------------------------------------------------------------
49C-----------------------------------------------------------------------
50
51 CALL status(lunit,lun,il,im)
521 iret=crdbufr(lun,mesg,mxmsgl)
53 IF(iret.eq.-3)
54 + CALL errwrt('BUFRLIB: RDMSGW - SKIPPING OVERLARGE MESSAGE')
55 IF(iret.eq.-2)
56 + CALL errwrt('BUFRLIB: RDMSGW - SKIPPING CORRUPTED MESSAGE')
57 IF(iret.LT.-1) GOTO 1
58 RETURN
59 END
60
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
Definition: errwrt.f:42
This module declares and initializes the MXMSGL variable.
Definition: modv_MXMSGL.f:13
integer mxmsgl
Maximum length (in bytes) of a BUFR message that can be read or written by the BUFRLIB software.
Definition: modv_MXMSGL.f:22
subroutine rdmsgw(LUNIT, MESG, IRET)
THIS SUBROUTINE READS THE NEXT BUFR MESSAGE FROM LOGICAL UNIT LUNIT AS AN ARRAY OF INTEGER WORDS.
Definition: rdmsgw.f:38
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:56