NCEPLIBS-bufr 11.7.1
upds3.f
Go to the documentation of this file.
1C> @file
2C> @brief Read data descriptors from Section 3 of a BUFR message.
3
4C> This subroutine returns the sequence of data descriptors
5C> contained within Section 3 of a BUFR message.
6C>
7C> @author J. Ator
8C> @date 2003-11-04
9C>
10C> @param[in] MBAY -- integer(*): BUFR message
11C> @param[in] LCDS3 -- integer: Dimensioned size of CDS3;
12C> used by the subroutine to ensure that
13C> it doesn't overflow the CDS3 array
14C> @param[out] CDS3 -- character*6(*): Data descriptor sequence
15C> within Section 3 of MBAY
16C> @param[out] NDS3 -- integer: Number of data descriptors in CDS3
17C>
18C> @remarks
19C> - The start of the BUFR message (i.e. the string 'BUFR') must be
20C> aligned on the first 4 bytes of MBAY.
21C> - This subroutine does not recursively resolve any Table D
22C> descriptors from within Section 3; rather, what is returned in
23C> CDS3 is the exact list of data descriptors as it appears within
24C> Section 3 of MBAY.
25C>
26C> <b>Program history log:</b>
27C> | Date | Programmer | Comments |
28C> | -----|------------|----------|
29C> | 2003-11-04 | J. Ator | Original author |
30C> | 2004-08-18 | J. Ator | Removed IFIRST check, since wrdlen() now keeps track of whether it has been called |
31C> | 2005-11-29 | J. Ator | Use getlens() |
32C> | 2009-03-23 | J. Ator | Added LCDS3 argument and check |
33C>
34 SUBROUTINE upds3(MBAY,LCDS3,CDS3,NDS3)
35
36 dimension mbay(*)
37
38 CHARACTER*6 CDS3(*), ADN30
39
40C-----------------------------------------------------------------------
41C-----------------------------------------------------------------------
42
43C Call subroutine WRDLEN to initialize some important information
44C about the local machine, just in case subroutine OPENBF hasn't
45C been called yet.
46
47 CALL wrdlen
48
49C Skip to the beginning of Section 3.
50
51 CALL getlens(mbay,3,len0,len1,len2,len3,l4,l5)
52 ipt = len0 + len1 + len2
53
54C Unpack the Section 3 descriptors.
55
56 nds3 = 0
57 DO jj = 8,(len3-1),2
58 nds3 = nds3 + 1
59 IF(nds3.GT.lcds3) GOTO 900
60 cds3(nds3) = adn30(iupb(mbay,ipt+jj,16),6)
61 ENDDO
62
63 RETURN
64900 CALL bort('BUFRLIB: UPDS3 - OVERFLOW OF OUTPUT DESCRIPTOR '//
65 . 'ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
66 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine getlens(MBAY, LL, LEN0, LEN1, LEN2, LEN3, LEN4, LEN5)
This subroutine reads the lengths of all of the individual sections of a given BUFR message,...
Definition: getlens.f:40
function iupb(MBAY, NBYT, NBIT)
THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD CONTAINED WITHIN NBIT BITS OF A BUFR MESSAGE ...
Definition: iupb.f:37
subroutine upds3(MBAY, LCDS3, CDS3, NDS3)
This subroutine returns the sequence of data descriptors contained within Section 3 of a BUFR message...
Definition: upds3.f:35
subroutine wrdlen
This subroutine figures out some important information about the local machine on which the BUFRLIB s...
Definition: wrdlen.F:36