SUBROUTINE CX_GTV2( ii, ist, odescr, numrpl, cxrpt, chkdge, + ckdigt, nsdcr, mxdatv, sortdesc, mxrpt, + nmrpts, nmdesc, expdesc, nmdatval, nn, + dataval, iret ) C************************************************************************ C* CX_GET2 * C* * C* This subroutine decodes the Section 2 data groups which correspond * C* to the set of descriptors associated with the current delayed * C* replication descriptor. The number of data groups associated with * C* the delayed replication descriptor is equal to the product of the * C* number of the descriptors in the set times the number of * C* replications. The routine calls CX_GTV1 to decode the current data * C* group. * C* * C* CX_GET2 ( II, IST, ODESCR, NUMRPL, CXRPT, CHKDGE, CKDIGT, NSDCR, * C* MXDATV, SORTDESC, MXRPT, NMRPTS, NMDESC, EXPDESC, * C* NMDATVAL, NN, DATAVAL, IRET ) * C* * C* Input parameters: * C* ODESCR CHAR* Delayed replication descriptor * C* NUMRPL INTEGER Data value from Section 2 which * C* is set to the number of * C* replications for the set of * C* descriptors xx referred to in * C* the current delayed replication * C* descriptor. * C* CXRPT CHAR* Current report * C* CHKDGE INTEGER Check digit indicator * C* NSDCR INTEGER Number of sorted descriptors in * C* array sortdesc * C* MXDATV INTEGER Maximum number of data values * C* expected in a report * C* SORTDESC CHAR* List of unique descriptors in * C* expdesc sorted in ascending * C* order * C* MXRPT INTEGER Maximum number of reports * C* expected in message * C* NMRPTS INTEGER Array index referring to the * C* current report in dataval. Will * C* also be used to get the total * C* number of reports in CREX msg. * C* NMDESC INTEGER Number of descriptors in expdesc* C* * C* EXPDESC (MXDATV) * C* CHAR* List of the expanded Section 1 * C* descriptors. The expansion * C* consists of replacing the * C* sequence and non-delayed * C* replication descriptors with the* C* list they correspond to. The * C* final list will be close to a * C* one-to-one correspondence with * C* the data values in Section 2. * C* * C* Input and Output parameters: * C* II INTEGER Pointer to the next descriptor * C* in expdesc * C* IST INTEGER Pointer to location in cxrpt of * C* where to get the next data item * C* CKDIGT INTEGER Flag set to -1 when ist points * C* to the first check digit in * C* report; otherwise, set to 0. * C* * C* Output parameters: * C* NMDATVAL INTEGER Number of data items in * C* Section 2 of CREX message * C* * C* DATAVAL (MXRPT,MXDATV) * C* REAL Array to hold the Section 2 * C* decoded data values * C* * C* IRET INTEGER Return code * C* 0 = normal return * C* 1 = problems * C* * C** * C* Log: * C* R. Hollern/NCEP 8/03 * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'cxcmn.cmn' C* REAL*8 dataval ( mxrpt, mxdatv ) C* INTEGER mxndesc, mxdatv, chkdge, ckdigt C* CHARACTER*(*) cxrpt CHARACTER sortdesc ( mxdatv )*6, odescr*6 CHARACTER expdesc ( mxdatv )*6, fld2*2 C----------------------------------------------------------------------- iret = 0 C C* Get the number of descriptors to be replicated. C fld2 = odescr (2:3) CALL ST_INTG ( fld2, ixx, ier ) C C* Point to next descriptor in expdesc. C ii = ii + 1 C DO n1 = 1,numrpl l = ii C DO jj = 1, ixx C odescr = expdesc ( l ) C IF ( odescr(1:1) .eq. 'B' ) THEN C C* Location of start of data value in Section 2. C ist = ist + 1 C CALL CX_GTV1( ist, odescr, cxrpt, chkdge, ckdigt, + nsdcr, sortdesc, mxrpt, mxdatv, nmrpts, + ic01flg, jdatwth, ic02flg, jscale, + expdesc, nn, dataval, iret ) C IF ( iret .ne. 0 ) RETURN C END IF C l = l + 1 C END DO C END DO C C* Number of data values. C nmdatval = nn C ii = ii + ixx - 1 C* RETURN END