aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/fitsio/ftarch.f
blob: 25d9525c7564c1062febc5ed3375817a66b906f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
C------------------------------------------------------------------------------
        subroutine ftarch(compid)

C       This routine looks at how integers and reals are internally
C       stored, to figure out what kind of machine it is running on.

C       compid = 1  -  VAX or Alpha VMS system
C                2  -  Decstation or Alpha OSF/1, or IBM PC
C                3  -  SUN workstation 
C                4  -  IBM mainframe

        integer compid
        real rword
        integer*2 iword(2)
        equivalence (rword, iword)

C       set rword to some arbitrary value
        rword=1.1111111111

C       Then look at the equivalent integer, to distinquish the machine type.
C       The machine type is needed when testing for NaNs.

        if (iword(1) .eq. 16270)then
C               looks like a SUN workstation (uses IEEE word format)
                compid=3
        else if (iword(1) .eq. 14564)then
C               looks like a Decstation, alpha OSF/1, or IBM PC (byte swapped)
                compid=2
        else if (iword(1) .eq. 16526)then
C               looks like a VAX or ALPHA VMS system
                compid=1
        else if (iword(1) .eq. 16657)then
C               an IBM main frame (the test for NaNs is the same as on SUNs)
                compid=4
        else
C               unknown machine
                compid=0
                return
        end if
        end