File: nextsep.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 (101 lines) | stat: -rwxr-xr-x 2,148 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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 NEXTSEP(KBUFL,YBUFF,I,J,KERR)
C
C**** *NEXTSEP*
C
C
C     PURPOSE.
C     --------
C         LOCATE THE NEXT SEPARATOR
C         CHARACTER WHICH IS 'CR' OR 'LF' OR 'SPACE' OR '+'
C
C
C**   INTERFACE.
C     ----------
C
C         *CALL* *NEXTSEP(KBUFL,YBUFF,I,J,KERR)*
C         INPUT     : KBUFL - size if ybuff
C                     YBUFF - character string
C                     I     - SCAN STARTS AT byte 'I' OF YBUFF
C                     J     - SCAN ENDS AT byte 'J' OF YBUFF
C
C         OUTPUT    : I     - POSITION OF NEXT 'CR' OR 'LF' OR 'SPACE'
C                             OR '+'

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
C
C     MODIFICATIONS.
C     --------------
C
C          MILAN DRAGOSAVAC    *ECMWF*       15/02/2003.
C
C
      IMPLICIT LOGICAL(O,G), CHARACTER*8(C,H,Y)
C
      CHARACTER*(*) YBUFF
      CHARACTER*1 cr,lf,space,plus,minus 
C
      COMMON /CREXWORK/ NBPT,NGS,NVIND,NBPTSEC2,RVIND,EPS,NE,IEOLD,
     1                  NC07YYY
      REAL*8 RVIND,EPS
C
C     ------------------------------------------------------------------
C
C*          1.   SCAN BULLETIN.
C                --------------
 100  CONTINUE
C
C     'CR' = 13 , 'LF' = 10 , 'SPACE' = 32 'PLUS' = 43,
C
      cr=char(13)
      lf=char(10)
      space=char(32)
      plus=char(43)
      minus='-'
C
      i=iabs(i)
      k = i
      do 101 i=k,j
       if(NE.eq.0) then
         if(ybuff(I:I).eq.cr.or.
     1      ybuff(I:I).eq.lf.or.
     2      ybuff(I:I).eq.space.or.
     3      ybuff(I:I).eq.minus.or.
     3      ybuff(I:I).eq.plus) return
       else
         if(ybuff(I:I).eq.cr.or.
     1      ybuff(I:I).eq.lf.or.
     2      ybuff(I:I).eq.space.or.
     3      ybuff(I:I).eq.plus) return
       end if
  101 continue
C
      return
      end