NCEPLIBS-bacio  2.6.0
chk_endianc.F90
Go to the documentation of this file.
1 
4 
10 subroutine chk_endianc(mendian)
11  implicit none
12  character(16),intent(out) :: mendian
13  INTEGER,PARAMETER :: ASCII_0 = 48,ascii_1 = 49,ascii_2 = 50, &
14  ascii_3 = 51
15  INTEGER(4) :: I
16  common// i
17 
18  i = ascii_0 + ascii_1*256 + ascii_2*(256**2) + ascii_3*(256**3)
19  call findendian(mendian)
20 end subroutine chk_endianc
21 
27 subroutine findendian(mendian)
28  implicit none
29  character(16),intent(out) :: mendian
30  character :: i*4
31  common// i
32 
33  if(i .eq. '0123') then
34  mendian='little_endian'
35  return
36  elseif (i .eq. '3210') then
37  mendian='big_endian'
38  return
39  else
40  mendian='mixed_endian'
41  return
42  endif
43 end subroutine findendian
findendian
subroutine findendian(mendian)
Obtain machine endianness.
Definition: chk_endianc.F90:28
chk_endianc
subroutine chk_endianc(mendian)
Obtain machine endianness.
Definition: chk_endianc.F90:11