NCEPLIBS-bufr  12.0.0
x84.F
Go to the documentation of this file.
1 C> @file
2 C> @brief Encode one or more 8-byte integer values as 4-byte integer
3 C> values.
4 C>
5 C> @author J. Woollen @date 2022-10-12
6 
7 C> Encode one or more 8-byte integer values as 4-byte integer
8 C> values.
9 C>
10 C> @note IIN8 and IOUT4 may be the same array.
11 C>
12 C> @param[in] IIN8 - integer(*): Value(s) encoded as 8-byte integers
13 C> @param[out] IOUT4 - integer(*): Value(s) from IIN8 now re-encoded as 4-byte integers
14 C> @param[in] NVAL - integer: Number of values in IIN8 to be re-encoded
15 C>
16 C> @author J. Woollen @date 2022-10-12
17 
18  SUBROUTINE x84(IIN8,IOUT4,NVAL)
19 
20  INTEGER IIN8(*),IOUT4(*)
21 
22 C Call subroutine WRDLEN, in case it hasn't already been called.
23 
24  CALL wrdlen
25 
26 C ILO points to the first byte of the low-order (i.e. least
27 C significant) 4-byte integer word within an 8-byte integer word.
28 
29 #ifdef BIG_ENDIAN
30  ilo=5
31 #else
32  ilo=1
33 #endif
34 
35 C Re-encode the 8-byte values as 4-byte values.
36 
37  DO k = 1, nval
38  l=2*k-1
39  CALL mvb(iin8(l),ilo,itmp,1,4)
40  iout4(k)=itmp
41  END DO
42 
43  RETURN
44  END
subroutine mvb(IB1, NB1, IB2, NB2, NBM)
This subroutine copies a specified number of bytes from one packed binary array to another.
Definition: mvb.f:18
subroutine wrdlen
Determine important information about the local machine.
Definition: wrdlen.F:25
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19