SUBROUTINE MT_OBST ( iret ) C************************************************************************ C* MT_OBST * C* * C* This subroutine gets the report observation which is to be stored * C* with the report data in the BUFR message. The report observation * C* is obtained by combining the GEMPAK observation time of the report * C* with the hour and minute observation time reported in the metar * C* report. * C* * C* MT_OBST ( IRET ) * C* * C* Input parameters: * C* IREPHR INTEGER Hour of observation of report * C* IREPMIN INTEGER Minute of hour of observation * C* of report * C* IRTARR (5) INTEGER Array holding the GEMPAK * C* observation report time. * C* * C* * C* Output parameters: * C* RIVALS(IRYEAR) REAL Report observation year * C* RIVALS(IRMNTH) REAL Report observation month * C* RIVALS(IRDAYS) REAL Report observation day * C* RIVALS(IRHOUR) REAL Report observation hour * C* RIVALS(IRMINU) REAL Report observation minute * C* IRET INTEGER Return code * C* 0 = normal return * C* 1 = problems * C* * C** * C* Log: * C* R. Hollern/NCEP 6/98 Based on LS_OBST * C* C. Caruso Magee/NCEP 6/00 Modify to use rivals instead of irptdt * C* for date/time handling. Add mtcmn.cmn. * C* Changed irhour to irephr and irmin to * C* irepmin to avoid conflict with rivals. * C* C. Caruso Magee/NCEP 8/00 Add ERMISS to check for missing hour. * C* J. Ator/NCEP 2/01 Fix ERMISS test for AIX compatibility * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'mtcmn.cmn' C* INTEGER jrptdt(5) C* INCLUDE 'ERMISS.FNC' C------------------------------------------------------------------------ iret = 0 C IF ( irephr .gt. irtarr ( 4 ) .and. + ( .not. ERMISS ( FLOAT ( irtarr ( 4 ) ) ) ) ) THEN C C* Observation occurred in previous day. Backdate 1 day. C CALL TI_SUBD ( irtarr, jrptdt, jret ) C rivals ( iryear ) = FLOAT ( jrptdt ( 1 ) ) rivals ( irmnth ) = FLOAT ( jrptdt ( 2 ) ) rivals ( irdays ) = FLOAT ( jrptdt ( 3 ) ) rivals ( irhour ) = FLOAT ( irephr ) rivals ( irminu ) = FLOAT ( irepmin ) ELSE rivals ( iryear ) = FLOAT ( irtarr ( 1 ) ) rivals ( irmnth ) = FLOAT ( irtarr ( 2 ) ) rivals ( irdays ) = FLOAT ( irtarr ( 3 ) ) rivals ( irhour ) = FLOAT ( irephr ) rivals ( irminu ) = FLOAT ( irepmin ) END IF C* RETURN END