NCEPLIBS-bufr  12.0.0
uptdd.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Get the WMO bit-wise representation of the FXY value
3 C> corresponding to a child mnemonic in a Table D sequence.
4 C>
5 C> @author J. Woollen @date 1994-01-06
6 
7 C> Returns the WMO bit-wise representation of the FXY value corresponding
8 C> to a child mnemonic of a Table D sequence parent mnemonic.
9 C>
10 C> For a description of the WMO bit-wise representation of the FXY
11 C> value, see ifxy().
12 C>
13 C> @param[in] ID - integer: Positional index of parent mnemonic
14 C> within internal BUFR Table D array tabd.
15 C> @param[in] LUN - integer: File ID.
16 C> @param[in] IENT - integer: Ordinal indicator of child mnemonic to
17 C> return from within tabd(id,lun) sequence. 0 indicates that a count
18 C> of the total number of child mnemonics within the sequence will be
19 C> returned.
20 C> @param[out] IRET - integer: Return value:
21 C> - WMO bit-wise representation of FXY value corresponding to IENT'th
22 C> child mnemonic, if input IENT was > 0.
23 C> - Total number of child mnemonics, if input IENT was 0.
24 C>
25 C> @author J. Woollen @date 1994-01-06
26 
27  SUBROUTINE uptdd(ID,LUN,IENT,IRET)
28 
29  USE moda_tababd
30 
31  COMMON /dxtab / maxdx,idxv,nxstr(10),ldxa(10),ldxb(10),ldxd(10),
32  . ld30(10),dxstr(10)
33 
34  CHARACTER*128 BORT_STR
35  CHARACTER*56 DXSTR
36 
37 C-----------------------------------------------------------------------
38 C-----------------------------------------------------------------------
39 
40  ldd = ldxd(idxv+1)+1
41 
42 C CHECK IF IENT IS IN BOUNDS
43 C --------------------------
44 
45  ndsc = iupm(tabd(id,lun)(ldd:ldd),8)
46 
47  IF(ient.EQ.0) THEN
48  iret = ndsc
49  GOTO 100
50  ELSEIF(ient.LT.0 .OR. ient.GT.ndsc) THEN
51  GOTO 900
52  ENDIF
53 
54 C RETURN THE DESCRIPTOR INDICATED BY IENT
55 C ---------------------------------------
56 
57  idsc = ldd+1 + (ient-1)*2
58  iret = iupm(tabd(id,lun)(idsc:idsc),16)
59 
60 C EXITS
61 C -----
62 
63 100 RETURN
64 900 WRITE(bort_str,'("BUFRLIB: UPTDD - VALUE OF THIRD ARGUMENT IENT'//
65  . ' (INPUT) IS OUT OF RANGE (IENT =",I4,")")') ient
66  CALL bort(bort_str)
67  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
recursive function iupm(CBAY, NBITS)
Decode an integer value from a character string.
Definition: iupm.f:20
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
character *600, dimension(:,:), allocatable tabd
Table D entries for each internal I/O stream.
subroutine uptdd(ID, LUN, IENT, IRET)
Returns the WMO bit-wise representation of the FXY value corresponding to a child mnemonic of a Table...
Definition: uptdd.f:28