SUBROUTINE TG_DCD2 ( mxrpt, mxrptsz, mxdatv, expdesc, nmrpts, + lenrpts, nmdatval, dataval, nr, iret ) C************************************************************************ C* TG_DCD2 * C* * C* This subroutine calls the routines to store the current decoded * C* Section 2 data into the interface arrays. * C* * C* * C* TG_DCD2 ( MXRPT, MXRPTSZ, MXDATV, EXPDESC, NMRPTS, LENRPTS, * C* NMDATVAL, DATAVAL, NR, IRET ) * C* * C* INPUT PARAMETERS: * C* MXRPTSZ INTEGER Maximum report size expected * C* MXRPT INTEGER Maximum number of reports * C* expected in message * C* MXDATV REAL Maximum number of data values * C* expected in report * C* EXPDESC (MXDATV) * C* CHAR* List of descriptors which are * C* close to a one-to-one * C* correspondece with the data * C* values in dataval array * C* * C* NMRPTS INTEGER Number of reports in CREX msg * C* * C* LENRPTS (NMRPTS) * C* INTEGER Array to store the length of * C* each report * C* * C* NMDATVAL INTEGER Number of data values in * C* Section 2 of CREX message * C* * C* DATAVAL (MXRPT,MXDATV) * C* INTEGER Array holding the Section 2 * C* decoded data values * C* NR INTEGER Pointer to where to get the data* C* in arrays for current report * C* * C* Output parameters: * C* IRET INTEGER Return code * C* 0 = Normal return * C* 1 = Problems * C* * C** * C* Log: * C* R. Hollern/NCEP 8/00 * C* J. Ator/NCEP 8/13 Move TG_STBD call to inside of TG_SC2A * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'BRIDGE.PRM' INCLUDE 'tgcmn.cmn' INCLUDE 'tgcmn_stntbl.cmn' C* REAL*8 dataval ( mxrpt, mxdatv ) C* INTEGER lenrpts ( mxrpt ) INTEGER kray ( mxdatv ) C* LOGICAL more C* CHARACTER expdesc ( mxdatv )*6 C----------------------------------------------------------------------- iret = 0 more = .true. C C* Determine if these are meteorological or tidal elevation C* reports. C irptyp = 0 C C* kray will be used to indicate which descriptors in expdesc C* have already been processed. C DO i = 1,mxdatv kray(i) = 0 END DO C ii = 1 C DO WHILE ( ii .le. nmdatval ) IF ( expdesc ( ii ) .eq. 'B22038' .OR. + expdesc ( ii ) .eq. 'B22039' ) THEN C C* Set flag to indicate this is a tidal elevation report. C irptyp = 1 C jtd = ii ii = nmdatval + 1 END IF ii = ii + 1 END DO C C* Get the station ID and report time data. C CALL TG_SC2A ( kray, mxrpt, mxrptsz, mxdatv, expdesc, + nmrpts, lenrpts, nmdatval, dataval, nr, iret ) C* IF ( iret .eq. 1 ) RETURN C IF ( irptyp .eq. 1 ) THEN C C* Get the sea temperature, data check flags, and the time C* increment and displacement data. C CALL TG_SC2B ( kray, mxrpt, mxrptsz, mxdatv, expdesc, + nmrpts, lenrpts, nmdatval, dataval, + nr, iret ) C C* Get the tide gauge water level data. C CALL TG_SC2D ( kray, mxrpt, mxrptsz, mxdatv, expdesc, + nmrpts, lenrpts, nmdatval, dataval, + nr, iret ) C ELSE C C* Get the data check flags and the meteorological data. C CALL TG_SC2C ( kray, mxrpt, mxrptsz, mxdatv, expdesc, + nmrpts, lenrpts, nmdatval, dataval, + nr, iret ) END IF C* RETURN END