39 RECURSIVE SUBROUTINE writlc(LUNIT,CHR,STR)
53 CHARACTER*128 bort_str
68 CALL x84(lunit,my_lunit,1)
69 CALL writlc(my_lunit,chr,str)
77 CALL status(lunit,lun,il,im)
84 CALL parstr(str,tgs,maxtg,ntg,
' ',.true.)
90 CALL parutg(lun,1,tgs(1),nnod,kon,roid)
93 IF(ioid.LE.0) ioid = 1
96 DO WHILE((ii.LE.10).AND.(tgs(1)(ii:ii).NE.
'#'))
97 ctag(ii:ii)=tgs(1)(ii:ii)
112 DO WHILE (n+1.LE.
nval(lun))
115 IF(
itp(node).EQ.1)
THEN
118 ELSEIF(ctag.EQ.
tag(node))
THEN
120 IF(itagct.EQ.ioid)
THEN
121 IF(
itp(node).NE.3)
GOTO 904
141 CALL getlens(
mbay(1,lun),3,len0,len1,len2,len3,l4,l5)
142 mbyte = len0 + len1 + len2 + len3 + 4
147 DO WHILE(nsubs.LT.
nsub(lun))
154 IF(nsubs.NE.
nsub(lun))
THEN
156 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
157 errstr =
'BUFRLIB: WRITLC - COULDN''T WRITE VALUE FOR ' // ctag
158 . //
' INTO SUBSET, BECAUSE NO SUBSET WAS OPEN FOR WRITING'
160 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
173 DO WHILE (n+1.LE.
nval(lun))
178 IF(
itp(node).EQ.1)
THEN
179 CALL upbb(ival,nbit,mbit,
mbay(1,lun))
181 ELSEIF(ctag.EQ.
tag(node))
THEN
183 IF(itagct.EQ.ioid)
THEN
184 IF(
itp(node).NE.3)
GOTO 904
190 CALL pkc(chr,nchr,
mbay(1,lun),mbit)
199 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
200 errstr =
'BUFRLIB: WRITLC - COULDN''T WRITE VALUE FOR ' // ctag
201 . //
' INTO SUBSET, BECAUSE IT WASN''T FOUND IN THE SUBSET'
204 errstr =
'(' // ctag //
' MAY NOT BE IN THE BUFR TABLE(?))'
206 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
214 900
CALL bort(
'BUFRLIB: WRITLC - OUTPUT BUFR FILE IS CLOSED, IT '//
215 .
'MUST BE OPEN FOR OUTPUT')
216 901
CALL bort(
'BUFRLIB: WRITLC - OUTPUT BUFR FILE IS OPEN FOR '//
217 .
'INPUT, IT MUST BE OPEN FOR OUTPUT')
218 902
CALL bort(
'BUFRLIB: WRITLC - A MESSAGE MUST BE OPEN IN OUTPUT '//
219 .
'BUFR FILE, NONE ARE')
220 903
WRITE(bort_str,
'("BUFRLIB: WRITLC - THERE CANNOT BE MORE THAN '//
221 .
' ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE",I4'//
224 904
WRITE(bort_str,
'("BUFRLIB: WRITLC - MNEMONIC ",A," DOES NOT '//
225 .
'REPRESENT A CHARACTER ELEMENT (TYP=",A,")")') ctag,
typ(node)
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 getlens(MBAY, LL, LEN0, LEN1, LEN2, LEN3, LEN4, LEN5)
This subroutine reads the lengths of all of the individual sections of a given BUFR message,...
recursive function iupbs3(MBAY, S3MNEM)
This function returns a specified value from within Section 3 of a BUFR message.
This module contains array and variable declarations used to store BUFR messages internally for multi...
integer ibit
Bit pointer within IBAY.
integer, dimension(:,:), allocatable mbay
Current BUFR message for each internal I/O stream.
This module contains arrays and variable declarations for the storage of data values needed when writ...
integer ncol
Number of data subsets in message.
integer(8), dimension(:,:), allocatable matx
Non-character data values for all data subsets in message.
character *(:), dimension(:,:), allocatable catx
Character data values for all data subsets in message.
This module contains declarations for arrays used to store information about the current BUFR message...
integer, dimension(:), allocatable nsub
Current subset pointer within message.
This module contains array and variable declarations used to store the internal jump/link table.
integer, dimension(:), allocatable ibt
Bit widths corresponding to tag and typ:
character *3, dimension(:), allocatable typ
Type indicators corresponding to tag:
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
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 ...
This module declares and initializes the MXLCC variable.
integer mxlcc
Maximum length (in bytes) of a character string that can be written into a data subset of a compresse...
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.
subroutine pkc(CHR, NCHR, IBAY, IBIT)
Encode a character string within an integer array.
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
subroutine upb(NVAL, NBITS, IBAY, IBIT)
This subroutine decodes an integer value from within a specified number of bits of an integer array,...
subroutine upbb(NVAL, NBITS, IBIT, IBAY)
This subroutine decodes an integer value from within a specified number of bits of an integer array,...
subroutine usrtpl(LUN, INVN, NBMP)
Store the subset template into internal arrays.
recursive subroutine writlc(LUNIT, CHR, STR)
Write a long character string (greater than 8 bytes) to a data subset.
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.