NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
uptdd.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS SUBROUTINE RETURNS THE BIT-WISE REPRESENTATION OF THE
5 C> FXY VALUE CORRESPONDING TO, SEQUENTIALLY, A PARTICULAR (IENT'th)
6 C> "CHILD" MNEMONIC OF A TABLE D SEQUENCE ("PARENT") MNEMONIC.
7 C>
8 C> PROGRAM HISTORY LOG:
9 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
10 C> 1995-06-28 J. WOOLLEN -- INCREASED THE SIZE OF INTERNAL BUFR TABLE
11 C> ARRAYS IN ORDER TO HANDLE BIGGER FILES
12 C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
13 C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
14 C> ROUTINE "BORT"
15 C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
16 C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
17 C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
18 C> BUFR FILES UNDER THE MPI)
19 C> 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
20 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
21 C> INTERDEPENDENCIES
22 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
23 C> DOCUMENTATION; OUTPUTS MORE COMPLETE
24 C> DIAGNOSTIC INFO WHEN ROUTINE TERMINATES
25 C> ABNORMALLY
26 C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
27 C>
28 C> USAGE: CALL UPTDD (ID, LUN, IENT, IRET)
29 C> INPUT ARGUMENT LIST:
30 C> ID - INTEGER: POSITIONAL INDEX OF PARENT MNEMONIC WITHIN
31 C> INTERNAL BUFR TABLE D ARRAY TABD
32 C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
33 C> IENT - INTEGER: ORDINAL INDICATOR OF CHILD MNEMONIC TO RETURN
34 C> FROM WITHIN TABD(ID,LUN) SEQUENCE:
35 C> 0 = return a count of the total number of child
36 C> mnemonics within TABD(ID,LUN)
37 C>
38 C> OUTPUT ARGUMENT LIST:
39 C> IRET - INTEGER: RETURN VALUE (SEE REMARKS)
40 C>
41 C> REMARKS:
42 C> THE INTERPRETATION OF THE RETURN VALUE IRET DEPENDS UPON THE INPUT
43 C> VALUE IENT, AS FOLLOWS:
44 C>
45 C> IF ( IENT = 0 ) THEN
46 C> IRET = a count of the total number of child mnemonics within
47 C> TABD(ID,LUN)
48 C> ELSE
49 C> IRET = the bit-wise representation of the FXY value
50 C> corresponding to the IENT'th child mnemonic of
51 C> TABD(ID,LUN)
52 C> END IF
53 C>
54 C>
55 C> THIS ROUTINE CALLS: BORT IUPM
56 C> THIS ROUTINE IS CALLED BY: NEMTBD RESTD
57 C> Normally not called by any application
58 C> programs.
59 C>
60  SUBROUTINE uptdd(ID,LUN,IENT,IRET)
61 
62  USE moda_tababd
63 
64  COMMON /dxtab / maxdx,idxv,nxstr(10),ldxa(10),ldxb(10),ldxd(10),
65  . ld30(10),dxstr(10)
66 
67  CHARACTER*128 bort_str
68  CHARACTER*56 dxstr
69 
70 C-----------------------------------------------------------------------
71 C-----------------------------------------------------------------------
72 
73  ldd = ldxd(idxv+1)+1
74 
75 C CHECK IF IENT IS IN BOUNDS
76 C --------------------------
77 
78  ndsc = iupm(tabd(id,lun)(ldd:ldd),8)
79 
80  IF(ient.EQ.0) THEN
81  iret = ndsc
82  goto 100
83  ELSEIF(ient.LT.0 .OR. ient.GT.ndsc) THEN
84  goto 900
85  ENDIF
86 
87 C RETURN THE DESCRIPTOR INDICATED BY IENT
88 C ---------------------------------------
89 
90  idsc = ldd+1 + (ient-1)*2
91  iret = iupm(tabd(id,lun)(idsc:idsc),16)
92 
93 C EXITS
94 C -----
95 
96 100 RETURN
97 900 WRITE(bort_str,'("BUFRLIB: UPTDD - VALUE OF THIRD ARGUMENT IENT'//
98  . ' (INPUT) IS OUT OF RANGE (IENT =",I4,")")') ient
99  CALL bort(bort_str)
100  END
function iupm(CBAY, NBITS)
THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD CONTAINED WITHIN NBITS BITS OF A CHARACTER ST...
Definition: iupm.f:40
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22
subroutine uptdd(ID, LUN, IENT, IRET)
THIS SUBROUTINE RETURNS THE BIT-WISE REPRESENTATION OF THE FXY VALUE CORRESPONDING TO...
Definition: uptdd.f:60