NCEPLIBS-bufr  12.1.0
x4884.F90
Go to the documentation of this file.
1 
5 
17 subroutine x48(iin4,iout8,nval)
18 
19  implicit none
20 
21  integer, intent(in) :: iin4(*), nval
22  integer, intent(out) :: iout8(*)
23 
24  integer, parameter :: zero = 0, ones = -1
25 
26  integer k, l, itmp, ilo, ihi
27 
28  ! ihi points to the first byte of the high-order (i.e. most significant) 4-byte integer word within an 8-byte integer word.
29  ! ilo points to the first byte of the low-order (i.e. least significant) 4-byte integer word within an 8-byte integer word.
30 
31 #ifdef BIG_ENDIAN
32  ihi=1
33  ilo=5
34 #else
35  ihi=5
36  ilo=1
37 #endif
38 
39  ! Re-encode the 4-byte values as 8-byte values.
40 
41  do k = nval,1,-1
42  l=2*k-1
43  call mvb(iin4(k),1,itmp,ilo,4)
44  iout8(l)=itmp
45  if(iout8(l)<0) then
46  call mvb(ones,1,iout8(l),ihi,4)
47  else
48  call mvb(zero,1,iout8(l),ihi,4)
49  endif
50  enddo
51 
52  return
53 end subroutine x48
54 
64 subroutine x84(iin8,iout4,nval)
65  implicit none
66 
67  integer, intent(in) :: iin8(*), nval
68  integer, intent(out) :: iout4(*)
69 
70  integer k, l, itmp, ilo
71 
72  ! ilo points to the first byte of the low-order (i.e. least significant) 4-byte integer word within an 8-byte integer word.
73 
74 #ifdef BIG_ENDIAN
75  ilo=5
76 #else
77  ilo=1
78 #endif
79 
80  ! Re-encode the 8-byte values as 4-byte values.
81 
82  do k = 1, nval
83  l=2*k-1
84  call mvb(iin8(l),ilo,itmp,1,4)
85  iout4(k)=itmp
86  enddo
87 
88  return
89 end subroutine x84
90 
106 subroutine setim8b ( int8b )
107 
108  use modv_vars, only: im8b
109 
110  implicit none
111 
112  logical, intent(in) :: int8b
113 
114  im8b = int8b
115 
116 return
117 end subroutine setim8b
subroutine mvb(ib1, nb1, ib2, nb2, nbm)
Copy a specified number of bytes from one packed binary array to another.
Definition: copydata.F90:731
subroutine setim8b(int8b)
Specify whether all integer arguments to NCEPLIBS-bufr subprograms from Fortran will use 8-byte integ...
Definition: x4884.F90:107
subroutine x48(iin4, iout8, nval)
Encode one or more 4-byte integer values as 8-byte integer values.
Definition: x4884.F90:18
subroutine x84(iin8, iout4, nval)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x4884.F90:65