File: octal2dec.F

package info (click to toggle)
emoslib 000380%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 47,712 kB
  • ctags: 11,551
  • sloc: fortran: 89,643; ansic: 24,200; makefile: 370; sh: 355
file content (73 lines) | stat: -rwxr-xr-x 1,277 bytes parent folder | download | duplicates (2)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
C Copyright 1981-2007 ECMWF
C 
C Licensed under the GNU Lesser General Public License which
C incorporates the terms and conditions of version 3 of the GNU
C General Public License.
C See LICENSE and gpl-3.0.txt for details.
C

      SUBROUTINE OCTAL2DEC(KOCTAL,KDECIMAL,KERR)
C**** *DEC2OCTAL*
C
C
C     PURPOSE.
C     --------
C         Convert decomal integer into octal value
C
C
C**   INTERFACE.
C     ----------
C
C         *CALL* *DEC2OCTAL(KOCTAL,KDECIMAL,KERR)
C
C     METHOD.
C     -------
C
C          NONE.
C
C
C     EXTERNALS.
C     ----------
C
C          NONE.
C
C     REFERENCE.
C     ----------
C
C          NONE.
C
C     AUTHOR.
C     -------
C
C          MILAN DRAGOSAVAC    *ECMWF*       07/01/2004.
C
C
C     MODIFICATIONS.
C     --------------
C
C          NONE.
C
C
      IMPLICIT LOGICAL(L,O,G), CHARACTER*8(C,H,Y)

      INTEGER KOCTAL
      INTEGER KDECIMAL
      CHARACTER*10 C
c
      KERR=0
      WRITE(C,'(I10)',IOSTAT=IOS) KOCTAL
      IF(IOS.NE.0) then
        Print*,'OCTAL2DEC: internal write error ',ios
        KERR=33
        RETURN
      ENDIF

      READ(C, '(O10)',IOSTAT=IOS) KDECIMAL
      IF(IOS.NE.0) then
        Print*,'OCTAL2DEC: internal write error ',ios
        KERR=33
        RETURN
      ENDIF
c     
      RETURN
      END