NCEPLIBS-bufr 11.7.1
stntbia.f
Go to the documentation of this file.
1C> @file
2C> @author ATOR @date 2009-03-23
3
4C> THIS SUBROUTINE STORES A NEW ENTRY WITHIN INTERNAL BUFR
5C> TABLE A.
6C>
7C> PROGRAM HISTORY LOG:
8C> 2009-03-23 J. ATOR -- ORIGINAL AUTHOR
9C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
10C>
11C> USAGE: CALL STNTBIA ( N, LUN, NUMB, NEMO, CELSQ )
12C> INPUT ARGUMENT LIST:
13C> N - INTEGER: STORAGE INDEX INTO INTERNAL TABLE A
14C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL TABLE A
15C> NUMB - CHARACTER*6: FXY NUMBER FOR NEW TABLE A ENTRY (IN
16C> FORMAT FXXYYY)
17C> NEMO - CHARACTER*8: MNEMONIC CORRESPONDING TO NUMB
18C> CELSQ - CHARACTER*55: SEQUENCE DESCRIPTION CORRESPONDING
19C> TO NUMB
20C>
21C> REMARKS:
22C> THIS ROUTINE CALLS: BORT DIGIT
23C> THIS ROUTINE IS CALLED BY: RDUSDX READS3 STBFDX
24C> Not normally called by application
25C> programs.
26C>
27 SUBROUTINE stntbia ( N, LUN, NUMB, NEMO, CELSQ )
28
29 USE moda_tababd
30
31 CHARACTER*128 BORT_STR
32
33 CHARACTER*(*) NUMB, NEMO, CELSQ
34
35 LOGICAL DIGIT
36
37C-----------------------------------------------------------------------
38C-----------------------------------------------------------------------
39
40C Confirm that neither NEMO nor NUMB has already been defined
41C within the internal BUFR Table A (in COMMON /TABABD/) for
42C the given LUN.
43
44 DO n=1,ntba(lun)
45 IF(numb(4:6).EQ.taba(n,lun)(1: 3)) GOTO 900
46 IF(nemo(1:8).EQ.taba(n,lun)(4:11)) GOTO 901
47 ENDDO
48
49C Store the values within the internal BUFR Table A.
50
51 taba(n,lun)( 1: 3) = numb(4:6)
52 taba(n,lun)( 4:11) = nemo(1:8)
53 taba(n,lun)(13:67) = celsq(1:55)
54
55C Decode and store the message type and subtype.
56
57 IF ( digit( nemo(3:8) ) ) THEN
58c .... Message type & subtype obtained directly from Table A mnemonic
59 READ ( nemo,'(2X,2I3)') mtyp, msbt
60 idna(n,lun,1) = mtyp
61 idna(n,lun,2) = msbt
62 ELSE
63c .... Message type obtained from Y value of Table A seq. descriptor
64 READ ( numb(4:6),'(I3)') idna(n,lun,1)
65c .... Message subtype hardwired to ZERO
66 idna(n,lun,2) = 0
67 ENDIF
68
69C Update the count of internal Table A entries.
70
71 ntba(lun) = n
72
73 RETURN
74900 WRITE(bort_str,'("BUFRLIB: STNTBIA - TABLE A FXY VALUE (",A,") '
75 . //'HAS ALREADY BEEN DEFINED (DUPLICATE)")') numb
76 CALL bort(bort_str)
77901 WRITE(bort_str,'("BUFRLIB: STNTBIA - TABLE A MNEMONIC (",A,") '
78 . //'HAS ALREADY BEEN DEFINED (DUPLICATE)")') nemo
79 CALL bort(bort_str)
80 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
Definition: moda_tababd.F:10
character *128, dimension(:,:), allocatable taba
Table A entries for each internal I/O stream.
Definition: moda_tababd.F:58
integer, dimension(:), allocatable ntba
Number of Table A entries for each internal I/O stream (up to a maximum of MAXTBA,...
Definition: moda_tababd.F:51
integer, dimension(:,:,:), allocatable idna
Message types (in array element 1) and subtypes (in array element 2) corresponding to taba.
Definition: moda_tababd.F:55
subroutine stntbia(N, LUN, NUMB, NEMO, CELSQ)
THIS SUBROUTINE STORES A NEW ENTRY WITHIN INTERNAL BUFR TABLE A.
Definition: stntbia.f:28