SUBROUTINE CX_SEQD ( mxdatv, nmdesc, expdesc, iret ) C************************************************************************ C* CX_SEQD * C* * C* This subroutine goes through the list of descriptors in the expdesc * C* array and replaces the sequence descriptors in the list with the set * C* of descriptors they correspond to in CREX Table D. Only one pass is * C* is made through the list. If the expanded sequence descriptor list * C* contain sequence descriptors, they will be expanded on the next call * C* to the subroutine. * C* * C* CX_SEQD ( MXDATV, NMDESC, EXPDESC, IRET ) * C* * C* * C* Input parameters: * C* MXDATV INTEGER Maximum number of data values * C* expected * C* * C* Input and output parameters: * C* NMDESC INTEGER On input, number of descriptors * C* in expdesc array; on output, the* C* number of descriptors in expdesc* C* after expanding the sequence * C* descriptors * C* EXPDESC (MXDATV) * C* CHAR* On input, contains current list * C* of descriptors; on output, the * C* list after expanding current * C* sequence descriptors * C* * C* Output parameters: * C* IRET INTEGER Return code * C* 0 = normal return * C* 1 = fatal error * C* * C** * C* Log: * C* R. Hollern/NCEP 8/03 * C************************************************************************ INCLUDE 'cxcmn.cmn' C* CHARACTER idc*6 CHARACTER iwork (100)*6 CHARACTER expdesc (100)*6 C----------------------------------------------------------------------- iret = 0 j = 0 C DO i = 1, nmdesc C idc = expdesc ( i ) C IF ( idc(1:1) .eq. 'D' ) THEN C C* Find sequence descriptor in CREX Table D. C CALL DC_BSRC ( idc, jseqd, ntbldrc, ipos, iret ) C IF ( ipos .eq. 0 ) THEN C C* Sequence descriptor not found in table. C iret = 1 loglvl = 2 logmsg = ' ' logmsg(1:20) = 'Sequence descriptor ' logmsg(21:26) = idc logmsg(27:48) = ' not found in Table D ' CALL DC_WLOG( loglvl, 'CX', 2, logmsg, ierwlg ) logmsg = ' ' logmsg(1:12) = 'FATAL ERROR ' CALL DC_WLOG( loglvl, 'CX', 2, logmsg, ierwlg ) RETURN END IF C C* Expand the current sequence descriptor and get the C* number of sequence descriptors it expands to. C nd = ntbld(ipos) C DO m = 2, nd C j = j + 1 iwork(j) = itbld(ipos,m) C END DO C ELSE j = j + 1 iwork(j) = idc END IF C END DO C nmdesc = j C DO mm = 1, nmdesc expdesc (mm) = iwork(mm) END DO C* RETURN END