SUBROUTINE CX_GETV( cxrpt, nsdcr, sortdesc, mxdatv, mxrpt, + nmrpts, nmdesc, expdesc, chkdge, + nmdatval, dataval, iret ) C************************************************************************ C* CX_GETV * C* * C* This subroutine decodes the section 2 data groups. A decoded value * C* will be saved in the dataval array either as a character string or * C* a real*8 value, depending on the units gotten from Table B for the * C* descriptor associated with the data value. * C* * C* CX_GETV ( CXRPT, NSDCR, SORTDESC, MXDATV, MXRPT, NMRPTS, NMDESC, * C* EXPDESC, CHKDGE, NMDATVAL, DATAVAL, IRET ) * C* * C* Input parameters: * C* CXRPT CHAR* Current report * C* NSDCR INTEGER Number of sorted descriptors in * C* array sortdesc * C* SORTDESC CHAR* List of unique descriptors in * C* expdesc sorted in ascending * C* order * C* MXDATV INTEGER Maximum number of data values * C* expected in a report * 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* CHKDGE INTEGER Check digit indicator * C* * C* Output parameters: * C* IST INTEGER Pointer to location in cxrpt of * C* where to get the next data item * C* ODESCR CHAR* Current descriptor in expdesc * C* which corresponds to the data * C* item in Section 2 being decoded * C* NMDATVAL INTEGER Number of data values 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 C----------------------------------------------------------------------- iret = 0 ii = 1 nn = 0 ist = 0 ic01flg = 0 jdatwth = 0 jscale = 0 C IF ( chkdge .eq. 1 ) THEN C C* Report contains check digits. Chdigt is used to indicate C* if positioned at the first check digit in report. C ckdigt = -1 ELSE ckdigt = 0 END IF C DO WHILE ( ii .le. nmdesc ) C odescr = expdesc ( ii ) C IF ( expdesc(ii)(1:1) .eq. 'C' ) THEN C C* Operator descriptor. C odescr = expdesc ( ii ) CALL CX_OPER ( mxrpt, mxdatv, odescr, nmrpts, cxrpt, + ist, ic01flg, jdatwth, ic02lfg, jscale, + nn, dataval, iret ) C IF ( iret .eq. 1 ) RETURN C ELSE IF ( expdesc(ii)(1:1) .eq. 'R' ) THEN C C* Delayed replication. C C* Location of start of data value in Section 2. C ist = ist + 1 C CALL CX_DLYR ( ist, cxrpt, nmrpts, mxrpt, mxdatv, nn, + numrpl, dataval, iret ) C IF ( iret .eq. 1 ) RETURN C C* Location of start of data item in cxrpt. C CALL CX_GTV2 ( ii, ist, odescr, numrpl, cxrpt, chkdge, + ckdigt, nsdcr, mxdatv, sortdesc, mxrpt, + nmrpts, nmdesc, expdesc, nmdatval, nn, + dataval, iret ) C IF ( iret .eq. 1 ) RETURN C ELSE IF ( expdesc(ii)(1:1) .eq. 'B' ) THEN C C* Location of start of data item in cxrpt. 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 ) THEN nmdatval = nn RETURN END IF C END IF C ii = ii + 1 C END DO C C* Number of data values. C nmdatval = nn C* RETURN END