NCEPLIBS-bufr  12.0.0
stntbia.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Store a new entry within the internal BUFR Table A.
3 C> @author Ator @date 2009-03-23
4 
5 C> This subroutine stores a new entry within internal BUFR Table A.
6 C>
7 C> @param[in] N - integer: storage index into internal Table A.
8 C> @param[in] LUN - integer: I/O stream index into internal Table A.
9 C> @param[in] NUMB - character*6: FXY number for new Table A entry (in format FXXYYY).
10 C> @param[in] NEMO - character*8: mnemonic corresponding to NUMB.
11 C> @param[in] CELSQ - character*55: sequence description corresponding to NUMB.
12 C>
13 C> @author Ator @date 2009-03-23
14  SUBROUTINE stntbia ( N, LUN, NUMB, NEMO, CELSQ )
15 
16  USE moda_tababd
17 
18  CHARACTER*128 BORT_STR
19 
20  CHARACTER*(*) NUMB, NEMO, CELSQ
21 
22  LOGICAL DIGIT
23 
24 C-----------------------------------------------------------------------
25 C-----------------------------------------------------------------------
26 
27 C Confirm that neither NEMO nor NUMB has already been defined
28 C within the internal BUFR Table A (in COMMON /TABABD/) for
29 C the given LUN.
30 
31  DO n=1,ntba(lun)
32  IF(numb(4:6).EQ.taba(n,lun)(1: 3)) GOTO 900
33  IF(nemo(1:8).EQ.taba(n,lun)(4:11)) GOTO 901
34  ENDDO
35 
36 C Store the values within the internal BUFR Table A.
37 
38  taba(n,lun)( 1: 3) = numb(4:6)
39  taba(n,lun)( 4:11) = nemo(1:8)
40  taba(n,lun)(13:67) = celsq(1:55)
41 
42 C Decode and store the message type and subtype.
43 
44  IF ( digit( nemo(3:8) ) ) THEN
45 c .... Message type & subtype obtained directly from Table A mnemonic
46  READ ( nemo,'(2X,2I3)') mtyp, msbt
47  idna(n,lun,1) = mtyp
48  idna(n,lun,2) = msbt
49  ELSE
50 c .... Message type obtained from Y value of Table A seq. descriptor
51  READ ( numb(4:6),'(I3)') idna(n,lun,1)
52 c .... Message subtype hardwired to ZERO
53  idna(n,lun,2) = 0
54  ENDIF
55 
56 C Update the count of internal Table A entries.
57 
58  ntba(lun) = n
59 
60  RETURN
61 900 WRITE(bort_str,'("BUFRLIB: STNTBIA - TABLE A FXY VALUE (",A,") '
62  . //'HAS ALREADY BEEN DEFINED (DUPLICATE)")') numb
63  CALL bort(bort_str)
64 901 WRITE(bort_str,'("BUFRLIB: STNTBIA - TABLE A MNEMONIC (",A,") '
65  . //'HAS ALREADY BEEN DEFINED (DUPLICATE)")') nemo
66  CALL bort(bort_str)
67  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
integer, dimension(:), allocatable ntba
Number of Table A entries for each internal I/O stream (up to a maximum of MAXTBA,...
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
integer, dimension(:,:,:), allocatable idna
Message types (in array element 1) and subtypes (in array element 2) corresponding to taba.
subroutine stntbia(N, LUN, NUMB, NEMO, CELSQ)
This subroutine stores a new entry within internal BUFR Table A.
Definition: stntbia.f:15