104 . ( lunit, nemoi, ivali, nemod, ivald, cmeang, lnmng, iret )
113 CHARACTER*(*) nemoi, nemod, cmeang
115 CHARACTER*128 bort_str
116 CHARACTER*8 nemo, my_nemoi, my_nemod
117 CHARACTER*1 cdmf, tab
129 CALL x84(lunit,my_lunit,1)
130 CALL x84(ivali,my_ivali,1)
131 CALL x84(ivald,my_ivald,1)
132 CALL getcfmng(my_lunit,nemoi,my_ivali,nemod,my_ivald,cmeang,
134 CALL x48(lnmng,lnmng,1)
135 CALL x48(iret,iret,1)
141 CALL status ( lunit, lun, il, im )
142 IF ( il .EQ. 0 )
GOTO 900
143 IF ( il .GT. 0 )
GOTO 901
144 IF ( im .EQ. 0 )
GOTO 902
149 IF ( cdmf .NE.
'Y' )
GOTO 903
163 DO ii = 1, min( 8, len( nemoi ) )
164 my_nemoi(ii:ii) = nemoi(ii:ii)
167 DO ii = 1, min( 8, len( nemod ) )
168 my_nemod(ii:ii) = nemod(ii:ii)
170 IF ( my_nemoi(1:4) .EQ.
'GSES' )
THEN
171 IF ( ( my_nemod(1:6) .EQ.
'GCLONG' ) .OR.
172 . ( my_nemod(1:4) .EQ.
'OGCE' ) .OR.
173 . ( my_nemod(1:5) .EQ.
'ORIGC' ) )
THEN
174 ifxyi =
ifxy(
'001034' )
175 ifxyd(1) =
ifxy(
'001035' )
177 lnmng = min( 24, lcmg )
178 IF ( lnmng .EQ. 24 )
THEN
180 cmeang(1:24) =
'GCLONG OGCE ORIGC '
186 ELSE IF ( my_nemoi(1:6) .EQ.
'GCLONG' )
THEN
187 ifxyi =
ifxy(
'001031' )
189 ELSE IF ( my_nemoi(1:4) .EQ.
'OGCE' )
THEN
190 ifxyi =
ifxy(
'001033' )
192 ELSE IF ( my_nemoi(1:5) .EQ.
'ORIGC' )
THEN
193 ifxyi =
ifxy(
'001035' )
195 ELSE IF ( ( my_nemoi(1:7) .EQ.
'TABLASS' ) .OR.
196 + ( my_nemoi(1:7) .EQ.
'TABLASL' ) )
THEN
197 IF ( ( my_nemod(1:6) .EQ.
'TABLAT' ) )
THEN
198 IF ( my_nemoi(1:7) .EQ.
'TABLASS' )
THEN
199 ifxyi =
ifxy(
'055021' )
201 ifxyi =
ifxy(
'055022' )
203 ifxyd(1) =
ifxy(
'055020' )
205 lnmng = min( 8, lcmg )
206 IF ( lnmng .EQ. 8 )
THEN
208 cmeang(1:8) =
'TABLAT '
214 ELSE IF ( my_nemoi(1:6) .EQ.
'TABLAT' )
THEN
215 ifxyi =
ifxy(
'055020' )
218 CALL parstr ( my_nemoi, nemo, 1, ntg,
' ', .true. )
219 CALL nemtab ( lun, nemo, ifxyi, tab, n )
220 IF ( ( n .EQ. 0 ) .OR. ( tab .NE.
'B' ) )
GOTO 904
221 IF ( (
tabb( n, lun )(71:74) .NE.
'CODE' ) .AND.
222 . (
tabb( n, lun )(71:74) .NE.
'FLAG' ) )
GOTO 905
223 IF ( my_nemod(1:1) .NE.
' ' )
THEN
224 CALL parstr ( my_nemod, nemo, 1, ntg,
' ', .true. )
225 CALL nemtab ( lun, nemo, ifxyd(1), tab, n )
226 IF ( ( n .EQ. 0 ) .OR. ( tab .NE.
'B' ) )
GOTO 904
227 IF ( (
tabb( n, lun )(71:74) .NE.
'CODE' ) .AND.
228 . (
tabb( n, lun )(71:74) .NE.
'FLAG' ) )
GOTO 905
236 CALL srchtbf_c ( ifxyi, ivali, ifxyd(1), 10, ivald,
237 . cmeang, lcmg, lnmng, iret )
238 IF ( iret .LE. 0 )
RETURN
247 CALL numtbd ( lun, ifxyd(ii), nemo, tab, ierbd )
248 IF ( ( ierbd .GT. 0 ) .AND. ( tab .EQ.
'B' ) .AND.
249 . ( lcmg .GE. ( lnmng + 8 ) ) )
THEN
251 cmeang(lnmng+1:lnmng+8) = nemo
255 IF ( iret .EQ. 0 ) iret = -1
258 900
CALL bort(
'BUFRLIB: GETCFMNG - INPUT BUFR FILE IS CLOSED, IT '//
259 .
'MUST BE OPEN FOR INPUT')
260 901
CALL bort(
'BUFRLIB: GETCFMNG - INPUT BUFR FILE IS OPEN FOR '//
261 .
'OUTPUT, IT MUST BE OPEN FOR INPUT')
262 902
CALL bort(
'BUFRLIB: GETCFMNG - A MESSAGE MUST BE OPEN IN '//
263 .
'INPUT BUFR FILE, NONE ARE')
264 903
CALL bort(
'BUFRLIB: GETCFMNG - TO USE THIS SUBROUTINE, MUST '//
265 .
'FIRST CALL SUBROUTINE CODFLG WITH INPUT ARGUMENT SET TO Y')
266 904
WRITE(bort_str,
'("BUFRLIB: GETCFMNG - MNEMONIC ",A,'//
267 .
'" NOT FOUND IN TABLE B")') nemo
269 905
WRITE(bort_str,
'("BUFRLIB: GETCFMNG - MNEMONIC ",A,'//
270 .
'" IS NOT A CODE OR FLAG TABLE")') nemo
subroutine bort(STR)
Log one error message and abort application program.
recursive subroutine getcfmng(LUNIT, NEMOI, IVALI, NEMOD, IVALD, CMEANG, LNMNG, IRET)
This subroutine searches for a specified Table B mnemonic and associated value (code figure or bit nu...
function ifxy(ADSC)
Convert an FXY value from its 6 character representation to its WMO bit-wise representation.
integer function ireadmt(LUN)
Check whether master BUFR tables need to be read from the local file system.
Wrap C NCEPLIBS-bufr functions so they can be called from within the Fortran part of the library.
This module contains array and variable declarations used to store DX BUFR tables internally for mult...
character *128, dimension(:,:), allocatable tabb
Table B entries for each internal I/O stream.
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
Get information about a descriptor, based on the mnemonic.
subroutine numtbd(LUN, IDN, NEMO, TAB, IRET)
Search for a Table B or Table D descriptor within the internal DX BUFR tables.
subroutine parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
Parse a string containing one or more substrings into an array of substrings.
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
subroutine x48(IIN4, IOUT8, NVAL)
Encode one or more 4-byte integer values as 8-byte integer values.
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.