SUBROUTINE DecodeMonDayHrMin(Item,Month,Day,Hour,Minute)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN March 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine decodes the "packed" integer representation of
! the Month, Day, Hour, and Minute. Packed integers are used to
! save memory allocation. Original idea for this routine is contained
! in DECMDH, BLAST code, by Jean Baugh.
! METHODOLOGY EMPLOYED:
! Using maximum integer concept the original date can be decoded
! from the packed single word. This relies on 4 byte integer representation
! as a minimum (capable of representing up to 2,147,483,647).
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: Item ! word containing encoded month, day, hour, minute
! ((month*100 + day)*100 + hour)*100 + minute
INTEGER, INTENT(OUT) :: Month ! month in integer format (1-12)
INTEGER, INTENT(OUT) :: Day ! day in integer format (1-31)
INTEGER, INTENT(OUT) :: Hour ! hour in integer format (1-24)
INTEGER, INTENT(OUT) :: Minute ! minute in integer format (0:59)
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: DecMon=100*100*100
INTEGER, PARAMETER :: DecDay=100*100
INTEGER, PARAMETER :: DecHr =100
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER TmpItem
TmpItem=Item
Month=TmpItem/DecMon
TmpItem=(TmpItem-Month*DecMon)
Day=TmpItem/DecDay
TmpItem=TmpItem-Day*DecDay
Hour=TmpItem/DecHr
Minute=MOD(TmpItem,DecHr)
RETURN
END SUBROUTINE DecodeMonDayHrMin