SUBROUTINE CX_CDLY ( mxdatv, nmdesc, expdesc, iret ) C************************************************************************ C* CX_CDLY * C* * C* This subroutine goes through the current descriptor list to locate * C* delayed replication descriptors. When one is found, unique markers * C* from the arrays stdrlp and endrly are added to the beginning and end * C* of the set of descriptors associated with the delayed replication * C* descriptor. The markers are necessary because the associated list may* C* be further expanded if it contains more sequence and/or replication * c* descriptors. * C* * C* CX_CDLY ( 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; on output, number of* C* descriptors in expdesc plus the * C* number of markers added to list * C* EXPDESC (MXDATV) * C* CHAR* On input, current list of * C* descriptors. On output, the list* C* plus any markers. * C* * C* Output parameters: * C* * 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, jdc*6 CHARACTER expdesc ( mxdatv)*6, iwork ( mxdatv )*6 CHARACTER endrlp ( 12 )*6, stdrlp ( 12 )*6 C* LOGICAL more, more1 C* DATA endrlp / 'END001', 'END002', 'END003', + 'END004', 'END005', 'END006', + 'END007', 'END008', 'END009', + 'END010', 'END011', 'END012'/ C* DATA stdrlp / 'STR001', 'STR002', 'STR003', + 'STR004', 'STR005', 'STR006', + 'STR007', 'STR008', 'STR009', + 'STR010', 'STR011', 'STR012'/ C* DATA nc / 0 / C* SAVE nc C----------------------------------------------------------------------- iret = 0 i = 0 j = 0 more = .true. C DO k = 1, nmdesc iwork ( k ) = expdesc ( k ) END DO C DO WHILE ( more ) i = i + 1 j = j + 1 C idc = expdesc ( i ) iwork ( j ) = expdesc ( i ) C C IF ( idc (1:1) .eq. 'R' .AND. idc (4:6) .eq. '000' ) THEN C C C* Check if markers have been set for this delayed C* replication descriptor. C IF ( expdesc ( i+1 )(1:3) .ne. 'STR' ) then C nc = nc + 1 C* Get the replication parameters. C CALL CX_REPL ( idc, ixx, iyyy, iret ) C IF ( iret .ne. 0 ) RETURN C C* Mark location where this delayed replication set C* of descriptors begins. C j = j + 1 iwork ( j ) = stdrlp ( nc ) C DO n1 = 1,ixx i = i + 1 j = j + 1 iwork ( j ) = expdesc ( i ) END DO C C* Mark the end of the set of descriptors for this C* delayed replication. C j = j + 1 iwork ( j ) = endrlp ( nc ) C END IF END IF C IF ( expdesc ( i ) .eq. 'ENDDSC' ) more = .false. C END DO C nmdesc = j C DO i = 1, nmdesc expdesc ( i ) = iwork ( i ) END DO C* RETURN END