SUBROUTINE CX_RPL2 ( nmdesc, mxdatv, expdesc, iret ) C************************************************************************ C* CX_RPL2 * C* * C* This subroutine searchs through the list of descriptors for delayed * C* replication descriptors. When one is found, the number of descriptors* C* associated with the delayed replication descriptor is calculated * C* using the location of the starting and ending markers for the delayed* C* repliction descriptor. The calculated value is then inserted into the* C* XX part of the RXX000 delayed replication descriptor. * C* * C* CX_RPL2 ( NMDESC, MXDATV, EXPDESC, IRET ) * C* * C* * C* Input parameters: * C* NMDESC INTEGER Number of descriptors in expdesc* C* MXDATV INTEGER Maximum number of data values * C* expected * C* Input and output parameters: * C* EXPDESC (MXDATV) * C* CHAR* On input, the current list of * C* descriptors. On output, the * C* current list with any * C* modifications to the XX in the * C* delayed replication descriptors.* C* * C* Output parameters: * C* IRET INTEGER Return code * C* 0 = normal return * C* * C** * C* Log: * C* R. Hollern/NCEP 8/03 * C************************************************************************ INCLUDE 'cxcmn.cmn' C* CHARACTER idc*6, jdc*6, kchr*2 CHARACTER expdesc ( mxdatv )*6 CHARACTER endrlp ( 12 )*6, stdrlp ( 12 )*6 C* LOGICAL more1, more 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----------------------------------------------------------------------- iret = 0 ndly = 0 j = 0 more1 = .true. C C* Search list for delayed replication descriptors. C DO WHILE ( more1 ) C j = j + 1 idc = expdesc ( j ) C IF ( idc(1:1) .eq. 'R' .AND. idc(4:6) .eq. '000' ) THEN ndly = ndly + 1 i = j isav = j more = .true. k = 0 C C* Find where this delayed replication set ends. C j = j + 1 C jdc = expdesc ( j ) C na = 0 C DO ma = 1,12 IF ( jdc .eq. stdrlp ( ma ) ) na = ma END DO C C* The first time the routine sees the delayed replication C* descriptor, the starting and ending markers will not C* yet have been inserted. C IF ( na .eq. 0 ) RETURN C m = j + 1 C C* Count the number of descriptors in the delayed C* replication set. C kcnt = 0 C DO WHILE ( more ) C IF ( expdesc ( m ) .eq. endrlp ( na ) ) THEN more = .false. C C* Convert from integer to character. C WRITE ( kchr, 100 ) kcnt 100 FORMAT ( I2.2 ) C C* New number of descriptors to be replicated. C expdesc ( isav )(2:3) = kchr ELSE C C* Don't count the end markers for delayed C* replication descriptors. C IF ( .NOT.(expdesc( m )(1:3) .eq. 'END' .OR. + expdesc( m )(1:3) .eq. 'STR') ) THEN kcnt = kcnt + 1 END IF C m = m + 1 C END IF C END DO C END IF C IF ( expdesc(j+1) .eq. 'ENDDSC' ) more1 = .false. END DO C* RETURN END