NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
upds3.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Read data descriptors from Section 3 of a BUFR message.
3 
4 C> This subroutine returns the sequence of data descriptors
5 C> contained within Section 3 of a BUFR message.
6 C>
7 C> @author J. Ator
8 C> @date 2003-11-04
9 C>
10 C> @param[in] MBAY -- integer(*): BUFR message
11 C> @param[in] LCDS3 -- integer: Dimensioned size of CDS3;
12 C> used by the subroutine to ensure that
13 C> it doesn't overflow the CDS3 array
14 C> @param[out] CDS3 -- character*6(*): Data descriptor sequence
15 C> within Section 3 of MBAY
16 C> @param[out] NDS3 -- integer: Number of data descriptors in CDS3
17 C>
18 C> @remarks
19 C> - The start of the BUFR message (i.e. the string 'BUFR') must be
20 C> aligned on the first 4 bytes of MBAY.
21 C> - This subroutine does not recursively resolve any Table D
22 C> descriptors from within Section 3; rather, what is returned in
23 C> CDS3 is the exact list of data descriptors as it appears within
24 C> Section 3 of MBAY.
25 C>
26 C> <b>Program history log:</b>
27 C> | Date | Programmer | Comments |
28 C> | -----|------------|----------|
29 C> | 2003-11-04 | J. Ator | Original author |
30 C> | 2004-08-18 | J. Ator | Removed IFIRST check, since wrdlen() now keeps track of whether it has been called |
31 C> | 2005-11-29 | J. Ator | Use getlens() |
32 C> | 2009-03-23 | J. Ator | Added LCDS3 argument and check |
33 C>
34  SUBROUTINE upds3(MBAY,LCDS3,CDS3,NDS3)
35 
36  dimension mbay(*)
37 
38  CHARACTER*6 cds3(*), adn30
39 
40 C-----------------------------------------------------------------------
41 C-----------------------------------------------------------------------
42 
43 C Call subroutine WRDLEN to initialize some important information
44 C about the local machine, just in case subroutine OPENBF hasn't
45 C been called yet.
46 
47  CALL wrdlen
48 
49 C 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 
54 C 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
64 900 CALL bort('BUFRLIB: UPDS3 - OVERFLOW OF OUTPUT DESCRIPTOR '//
65  . 'ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
66  END
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:36
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:39
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:34
character *(*) function adn30(IDN, L30)
This function converts an FXY value from its bit-wise (integer) representation to its 5 or 6 characte...
Definition: adn30.f:28
subroutine wrdlen
This subroutine figures out some important information about the local machine on which the BUFRLIB s...
Definition: wrdlen.F:35
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22