39 SUBROUTINE stndrd(LUNIT,MSGIN,LMSGOT,MSGOT)
45 COMMON /hrdwrd/ nbytw,nbitw,iord(8)
47 dimension msgin(*),msgot(*)
49 CHARACTER*128 bort_str
62 CALL
status(lunit,lun,il,im)
68 CALL
getlens(msgin,5,len0,len1,len2,len3,len4,len5)
73 lenn = len0+len1+len2+len3+len4+len5
77 IF(lenn.NE.lenm) goto 901
80 CALL
upc(sevn,4,msgin,mbit,.true.)
81 IF(sevn.NE.
'7777') goto 902
86 mxbyto = (lmsgot*nbytw) - 8
89 IF(lbyto.GT.mxbyto) goto 905
90 CALL
mvb(msgin,1,msgot,1,lbyto)
99 DO WHILE ((.NOT.found).AND.(ii.GE.8))
100 isub =
iupb(msgin,iad3+ii,16)
101 CALL
numtab(lun,isub,subset,tab,itab)
102 IF((itab.NE.0).AND.(tab.EQ.
'D'))
THEN
103 CALL
nemtbax(lun,subset,mtyp,msbt,inod)
104 IF(inod.NE.0) found = .true.
108 IF(.NOT.found) goto 903
115 CALL
restd(lun,isub,ncd,icd)
134 lbyto = lbyto + len3 - 7
135 IF(lbyto.GT.mxbyto) goto 905
141 CALL
pkb(icd(n),16,msgot,ibit)
148 CALL
pkb(0,8,msgot,ibit)
154 CALL
pkb(len3,24,msgot,ibit)
159 IF(
iupbs3(msgin,
'ICMP').EQ.1)
THEN
164 IF((lbyto+len4+4).GT.mxbyto) goto 905
166 CALL
mvb(msgin,iad4+1,msgot,lbyto+1,len4)
168 jbit = (lbyto+len4)*8
182 nsub =
iupbs3(msgin,
'NSUB')
185 CALL
upb(lsub,16,msgin,ibit)
198 islen = iad4+len4-(ibit/8)
199 IF (mod(len4,2).EQ.0) islen = islen - 1
202 CALL
upb(nval,8,msgin,ibit)
204 IF(lbyto.GT.mxbyto) goto 905
205 CALL
pkb(nval,8,msgot,jbit)
209 CALL
upb(kval,8,msgin,kbit)
224 IF(lbyto+6.GT.mxbyto) goto 905
229 DO WHILE(.NOT.(mod(jbit,8).EQ.0))
230 CALL
pkb(0,1,msgot,jbit)
237 IF( (iben.LT.4) .AND. (mod(jbit/8,2).NE.0) )
THEN
238 CALL
pkb(0,8,msgot,jbit)
243 CALL
pkb(len4,24,msgot,ibit)
244 CALL
pkb(0,8,msgot,ibit)
251 lenn = len0+len1+len2+len3+len4+len5
252 CALL
pkb(lenn,24,msgot,ibit)
254 CALL
pkc(
'7777',4,msgot,jbit)
260 900 CALL
bort(
'BUFRLIB: STNDRD - BUFR FILE IS CLOSED, IT MUST BE'//
262 901
WRITE(bort_str,
'("BUFRLIB: STNDRD - INPUT MESSAGE LENGTH FROM'//
263 .
' SECTION 0",I6," DOES NOT EQUAL SUM OF ALL INDIVIDUAL SECTION'//
264 .
' LENGTHS (",I6,")")') lenm,lenn
266 902
WRITE(bort_str,
'("BUFRLIB: STNDRD - INPUT MESSAGE DOES NOT '//
267 .
'END WITH ""7777"" (ENDS WITH ",A)') sevn
269 903 CALL
bort(
'BUFRLIB: STNDRD - TABLE A SUBSET DESCRIPTOR '//
271 904 CALL
bort(
'BUFRLIB: STNDRD - BIT MISMATCH COPYING SECTION 4 '//
272 .
'FROM INPUT TO OUTPUT (STANDARD) MESSAGE')
273 905 CALL
bort(
'BUFRLIB: STNDRD - OVERFLOW OF OUTPUT (STANDARD) '//
274 .
'MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
subroutine numtab(LUN, IDN, NEMO, TAB, IRET)
THIS SUBROUTINE FIRST SEARCHES FOR AN INTEGER IDN, CONTAINING THE BIT-WISE REPRESENTATION OF A DESCRI...
subroutine nemtbax(LUN, NEMO, MTYP, MSBT, INOD)
THIS SUBROUTINE SEARCHES FOR MNEMONIC NEMO WITHIN THE INTERNAL TABLE A ARRAYS HOLDING THE DICTIONARY ...
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...
subroutine upb(NVAL, NBITS, IBAY, IBIT)
THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER CONTAINED WITHIN NBITS BITS OF IBAY...
function iupb(MBAY, NBYT, NBIT)
THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD CONTAINED WITHIN NBIT BITS OF A BUFR MESSAGE ...
subroutine pkc(CHR, NCHR, IBAY, IBIT)
This subroutine encodes a character string within a specified number of bits of an integer array...
subroutine stndrd(LUNIT, MSGIN, LMSGOT, MSGOT)
This subroutine performs the same function as subroutine stdmsg(), except that it operates on a BUFR ...
void restd(f77int *lun, f77int *tddesc, f77int *nctddesc, f77int ctddesc[])
C C SUBPROGRAM: RESTD C PRGMMR: ATOR ORG: NP12 DATE: 2004-08-18 C C ABSTRACT: GIVEN THE BIT-WISE REPR...
function istdesc(IDN)
GIVEN THE BIT-WISE REPRESENTATION OF THE FXY VALUE FOR A DESCRIPTOR, THIS FUNCTION DETERMINES WHETHER...
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...
subroutine upc(CHR, NCHR, IBAY, IBIT, CNVNULL)
THIS SUBROUTINE UNPACKS AND RETURNS A CHARACTER STRING OF LENGTH NCHR CONTAINED WITHIN NCHR BYTES OF ...
This module declares and initializes the MAXNC variable.
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
subroutine pkb(NVAL, NBITS, IBAY, IBIT)
This subroutine encodes an integer value within a specified number of bits of an integer array...
function iupbs01(MBAY, S01MNEM)
This function returns a specified value from within Section 0 or Section 1 of a BUFR message...