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