SUBROUTINE TRANSFORM_5BYTE_SCALER( SCALER ) C---------------------------------------------------------------------- C- C- Purpose and Methods : Takes a five byte scaler which is stored with C- the lowest 3 bytes in the first element of an C- array and the highest 2 bytes in the second C- element and transforms it into UNITS,GIGAS C- format. That is, the lowest 30 bits in the first C- array element, and the remaining ten bits in the C- second element. C- C- Inputs : SCALER, the two element array of the five byte scaler C- SCALER (1) lowest 24 bits C- SCALER (2) highest 16 bits C- C- Outputs : SCALER, with SCALER (1) lowest 30 bits C- SCALER (2) highest 10 bits C- C- Controls: C- C- Created 21-JUN-1994 Philippe Laurens, Freddie Landry C- C---------------------------------------------------------------------- IMPLICIT NONE INTEGER SCALER(2) C INTEGER UNITS, GIGAS PARAMETER( UNITS = 1, GIGAS = 2 ) INTEGER LOW_THREE_BYTES, HIGH_TWO_BYTES PARAMETER( LOW_THREE_BYTES = 1, HIGH_TWO_BYTES = 2 ) INTEGER MOVE_SIX_BITS, MOVE_TEN_BITS PARAMETER ( MOVE_SIX_BITS = 6, MOVE_TEN_BITS = 10 ) INTEGER FIRST_BYTE, FOURTH_BYTE PARAMETER ( FIRST_BYTE = 0, FOURTH_BYTE = 24 ) INTEGER SEVENTH_BIT PARAMETER ( SEVENTH_BIT = 6 ) C First move low 3 bytes = 24 bits, C But this is not necessary since input and output are identical C SCALER(UNITS) = SCALER(LOW_THREE_BYTES) C Move the last 6 bits of the Units portion CALL MVBITS ( SCALER(HIGH_TWO_BYTES), FIRST_BYTE, MOVE_SIX_BITS, & SCALER(UNITS), FOURTH_BYTE ) C Move the 10 bits of the Gigas portion SCALER(GIGAS) = IBITS( SCALER(HIGH_TWO_BYTES), SEVENTH_BIT, & MOVE_TEN_BITS ) 999 RETURN END