49 RECURSIVE SUBROUTINE readlc(LUNIT,CHR,STR)
62 CHARACTER*128 bort_str,errstr
76 CALL x84(lunit,my_lunit,1)
77 CALL readlc(my_lunit,chr,str)
89 CALL status(lunit,lun,il,im)
97 CALL parstr(str,tgs,maxtg,ntg,
' ',.true.)
103 CALL parutg(lun,0,tgs(1),nnod,kon,roid)
106 IF(ioid.LE.0) ioid = 1
109 DO WHILE((ii.LE.10).AND.(tgs(1)(ii:ii).NE.
'#'))
110 ctag(ii:ii)=tgs(1)(ii:ii)
128 IF(ctag.EQ.
tag(nod))
THEN
130 IF(itagct.EQ.ioid)
THEN
131 IF(
itp(nod).NE.3)
GOTO 904
133 IF(nchr.GT.lchr)
GOTO 905
135 CALL upc(chr,nchr,
mbay(1,lun),kbit,.true.)
140 ELSEIF(
msgunp(lun).EQ.2)
THEN
147 IF(ctag.EQ.
crtag(ii))
THEN
149 IF(itagct.EQ.ioid)
THEN
151 IF(nchr.GT.lchr)
GOTO 905
153 CALL upc(chr,nchr,
mbay(1,lun),kbit,.true.)
166 CALL errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
167 errstr =
'BUFRLIB: READLC - MNEMONIC ' // tgs(1) //
168 .
' NOT LOCATED IN REPORT SUBSET - RETURN WITH MISSING' //
169 .
' STRING FOR CHARACTER DATA ELEMENT'
171 CALL errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
175 CALL ipkm(chr(ii:ii),1,255)
182 900
CALL bort(
'BUFRLIB: READLC - INPUT BUFR FILE IS CLOSED, IT MUST'//
183 .
' BE OPEN FOR INPUT')
184 901
CALL bort(
'BUFRLIB: READLC - INPUT BUFR FILE IS OPEN FOR '//
185 .
'OUTPUT, IT MUST BE OPEN FOR INPUT')
186 902
CALL bort(
'BUFRLIB: READLC - A MESSAGE MUST BE OPEN IN INPUT '//
187 .
'BUFR FILE, NONE ARE')
188 903
WRITE(bort_str,
'("BUFRLIB: READLC - THERE CANNOT BE MORE THAN '//
189 .
'ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE ",'//
192 904
WRITE(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," DOES NOT '//
193 .
'REPRESENT A CHARACTER ELEMENT (ITP=",I2,")")') tgs(1),
itp(nod)
195 905
WRITE(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," IS A '//
196 .
'CHARACTER STRING OF LENGTH",I4," BUT SPACE WAS PROVIDED '//
197 .
'FOR ONLY",I4, " CHARACTERS")') tgs(1),nchr,lchr
199 906
WRITE(bort_str,
'("BUFRLIB: READLC - MESSAGE UNPACK TYPE",I3,'//
200 .
'" IS NOT RECOGNIZED")')
msgunp
subroutine bort(STR)
Log one error message and abort application program.
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
recursive subroutine ipkm(CBAY, NBYT, N)
Encode an integer value within a character string.
This module contains array and variable declarations used to store BUFR messages internally for multi...
integer, dimension(:,:), allocatable mbay
Current BUFR message for each internal I/O stream.
This module contains array and variable declarations needed to store information about long character...
integer nrst
Number of long character strings in data subset.
integer, dimension(:), allocatable irnch
Lengths (in bytes) of long character strings.
integer, dimension(:), allocatable irbit
Pointers in data subset to first bits of long character strings.
character *10, dimension(:), allocatable crtag
Table B mnemonics associated with long character strings.
This module contains array and variable declarations used to store the internal jump/link table.
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
This module contains an array declaration used to store, for each I/O stream index from which a BUFR ...
integer, dimension(:), allocatable msgunp
Flag indicating how to unpack data subsets from BUFR message:
This module contains array declarations for internal storage of pointers to BUFR data subset values.
integer, dimension(:), allocatable nbit
Length (in bits) of each packed data value in data subset.
integer, dimension(:), allocatable mbit
Pointer in data subset to first bit of each packed data value.
This module contains declarations for arrays used to store data values and associated metadata for th...
integer, dimension(:), allocatable nval
Number of data values in BUFR data subset.
integer, dimension(:,:), allocatable, target inv
Inventory pointer which links each data value to its corresponding node in the internal jump/link tab...
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 parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
Parse a string containing one or more substrings into an array of substrings.
subroutine parutg(LUN, IO, UTG, NOD, KON, VAL)
Parse a mnemonic from a character string.
recursive subroutine readlc(LUNIT, CHR, STR)
Read a long character string (greater than 8 bytes) from a data subset.
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
subroutine upc(CHR, NCHR, IBAY, IBIT, CNVNULL)
Decode a character string from an integer array.
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.