36 SUBROUTINE stndrd(LUNIT,MSGIN,LMSGOT,MSGOT)
42 COMMON /hrdwrd/ nbytw,nbitw,iord(8)
44 dimension msgin(*),msgot(*)
46 CHARACTER*128 BORT_STR
59 CALL status(lunit,lun,il,im)
65 CALL getlens(msgin,5,len0,len1,len2,len3,len4,len5)
70 lenn = len0+len1+len2+len3+len4+len5
74 IF(lenn.NE.lenm)
GOTO 901
77 CALL upc(sevn,4,msgin,mbit,.true.)
78 IF(sevn.NE.
'7777')
GOTO 902
83 mxbyto = (lmsgot*nbytw) - 8
86 IF(lbyto.GT.mxbyto)
GOTO 905
87 CALL mvb(msgin,1,msgot,1,lbyto)
96 DO WHILE ((.NOT.found).AND.(ii.GE.8))
97 isub =
iupb(msgin,iad3+ii,16)
98 CALL numtab(lun,isub,subset,tab,itab)
99 IF((itab.NE.0).AND.(tab.EQ.
'D'))
THEN
100 CALL nemtbax(lun,subset,mtyp,msbt,inod)
101 IF(inod.NE.0) found = .true.
105 IF(.NOT.found)
GOTO 903
112 CALL restd(lun,isub,ncd,icd)
131 lbyto = lbyto + len3 - 7
132 IF(lbyto.GT.mxbyto)
GOTO 905
138 CALL pkb(icd(n),16,msgot,ibit)
145 CALL pkb(0,8,msgot,ibit)
151 CALL pkb(len3,24,msgot,ibit)
156 IF(
iupbs3(msgin,
'ICMP').EQ.1)
THEN
161 IF((lbyto+len4+4).GT.mxbyto)
GOTO 905
163 CALL mvb(msgin,iad4+1,msgot,lbyto+1,len4)
165 jbit = (lbyto+len4)*8
179 nsub =
iupbs3(msgin,
'NSUB')
182 CALL upb(lsub,16,msgin,ibit)
195 islen = iad4+len4-(ibit/8)
196 IF (mod(len4,2).EQ.0) islen = islen - 1
199 CALL upb(nval,8,msgin,ibit)
201 IF(lbyto.GT.mxbyto)
GOTO 905
202 CALL pkb(nval,8,msgot,jbit)
206 CALL upb(kval,8,msgin,kbit)
221 IF(lbyto+6.GT.mxbyto)
GOTO 905
226 DO WHILE(.NOT.(mod(jbit,8).EQ.0))
227 CALL pkb(0,1,msgot,jbit)
234 IF( (iben.LT.4) .AND. (mod(jbit/8,2).NE.0) )
THEN
235 CALL pkb(0,8,msgot,jbit)
240 CALL pkb(len4,24,msgot,ibit)
241 CALL pkb(0,8,msgot,ibit)
248 lenn = len0+len1+len2+len3+len4+len5
249 CALL pkb(lenn,24,msgot,ibit)
251 CALL pkc(
'7777',4,msgot,jbit)
257900
CALL bort(
'BUFRLIB: STNDRD - BUFR FILE IS CLOSED, IT MUST BE'//
259901
WRITE(bort_str,
'("BUFRLIB: STNDRD - INPUT MESSAGE LENGTH FROM'//
260 .
' SECTION 0",I6," DOES NOT EQUAL SUM OF ALL INDIVIDUAL SECTION'//
261 .
' LENGTHS (",I6,")")') lenm,lenn
263902
WRITE(bort_str,
'("BUFRLIB: STNDRD - INPUT MESSAGE DOES NOT '//
264 .
'END WITH ""7777"" (ENDS WITH ",A)') sevn
266903
CALL bort(
'BUFRLIB: STNDRD - TABLE A SUBSET DESCRIPTOR '//
268904
CALL bort(
'BUFRLIB: STNDRD - BIT MISMATCH COPYING SECTION 4 '//
269 .
'FROM INPUT TO OUTPUT (STANDARD) MESSAGE')
270905
CALL bort(
'BUFRLIB: STNDRD - OVERFLOW OF OUTPUT (STANDARD) '//
271 .
'MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
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,...
function istdesc(IDN)
Given the bit-wise (integer) representation of a descriptor, this function determines whether the des...
function iupb(MBAY, NBYT, NBIT)
THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD CONTAINED WITHIN NBIT BITS OF A BUFR MESSAGE ...
function iupbs01(MBAY, S01MNEM)
This function returns a specified value from within Section 0 or Section 1 of a BUFR message.
function iupbs3(MBAY, S3MNEM)
This function returns a specified value from within Section 3 of a BUFR message.
subroutine mvb(IB1, NB1, IB2, NB2, NBM)
THIS SUBROUTINE COPIES A SPECIFIED NUMBER OF BYTES FROM ONE PACKED BINARY ARRAY TO ANOTHER.
This module declares and initializes the MAXNC variable.
integer, parameter, public maxnc
Maximum number of descriptors within Section 3 of a BUFR message.
subroutine nemtbax(LUN, NEMO, MTYP, MSBT, INOD)
This subroutine searches for a descriptor within Table A of the internal DX BUFR tables.
subroutine numtab(LUN, IDN, NEMO, TAB, IRET)
This subroutine returns information about a descriptor from the internal DX BUFR tables,...
subroutine pkb(NVAL, NBITS, IBAY, IBIT)
This subroutine encodes an integer value within a specified number of bits of an integer array,...
subroutine pkc(CHR, NCHR, IBAY, IBIT)
This subroutine encodes a character string within a specified number of bits of an integer array,...
void restd(f77int *lun, f77int *tddesc, f77int *nctddesc, f77int ctddesc[])
Given the bit-wise (integer) representation of a local (not WMO-standard) Table D descriptor,...
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
subroutine stndrd(LUNIT, MSGIN, LMSGOT, MSGOT)
This subroutine performs the same function as subroutine stdmsg(), except that it operates on a BUFR ...
subroutine upb(NVAL, NBITS, IBAY, IBIT)
THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER CONTAINED WITHIN NBITS BITS OF IBAY,...
subroutine upc(CHR, NCHR, IBAY, IBIT, CNVNULL)
THIS SUBROUTINE UNPACKS AND RETURNS A CHARACTER STRING OF LENGTH NCHR CONTAINED WITHIN NCHR BYTES OF ...