~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to applic/fit/libsrc/fttokn.for

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
C @(#)fttokn.for        19.1 (ES0-DMD) 02/25/03 13:17:37
 
2
C===========================================================================
 
3
C Copyright (C) 1995 European Southern Observatory (ESO)
 
4
C
 
5
C This program is free software; you can redistribute it and/or 
 
6
C modify it under the terms of the GNU General Public License as 
 
7
C published by the Free Software Foundation; either version 2 of 
 
8
C the License, or (at your option) any later version.
 
9
C
 
10
C This program is distributed in the hope that it will be useful,
 
11
C but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
C GNU General Public License for more details.
 
14
C
 
15
C You should have received a copy of the GNU General Public 
 
16
C License along with this program; if not, write to the Free 
 
17
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
C MA 02139, USA.
 
19
C
 
20
C Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
C       Internet e-mail: midas@eso.org
 
22
C       Postal address: European Southern Observatory
 
23
C                       Data Management Division 
 
24
C                       Karl-Schwarzschild-Strasse 2
 
25
C                       D 85748 Garching bei Muenchen 
 
26
C                       GERMANY
 
27
C===========================================================================
 
28
C
 
29
      SUBROUTINE FTTOKN(LINE,EOFMRK,DELIM,TOKEN,LENGTH,EOF)                    
 
30
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                   
 
31
C.COPYRIGHT: Copyright (c) 1987 European Southern Observatory,                  
 
32
C                                         all rights reserved                   
 
33
C                                                                               
 
34
C.VERSION: 1.0  ESO-FORTRAN Conversion, AA  17:25 - 13 JAN 1988                 
 
35
C                                                                               
 
36
C.LANGUAGE: F77+ESOext                                                          
 
37
C                                                                               
 
38
C.AUTHOR: J.D.PONZ                                                              
 
39
C                                                                               
 
40
C.IDENTIFICATION                                                                
 
41
C                                                                               
 
42
C  FITLIB.FOR   VERSION 1.0  27 MAR 1984                                        
 
43
C                                                                               
 
44
C.PURPOSE                                                                       
 
45
C                                                                               
 
46
C  INTERFACE ROUTINES FOR THE FITTING STRUCTURES                                
 
47
C                                                                               
 
48
C.ALGORITHM                                                                     
 
49
C                                                                               
 
50
C  USE MIDAS I/O INTERFACES TO FRAMES AND TABLES                                
 
51
C                                                                               
 
52
C.KEYWORDS                                                                      
 
53
C                                                                               
 
54
C  NON LINEAR FITTING                                                           
 
55
C                                                                               
 
56
C                                                                               
 
57
C----------------------------------------------------------------               
 
58
C                                                                               
 
59
C FIND NEXT TOKEN                                                               
 
60
C      IMPLICIT NONE                                                            
 
61
C                                                                               
 
62
      INTEGER I,LENGTH
 
63
      CHARACTER*(*) LINE,TOKEN                                                  
 
64
      LOGICAL EOF
 
65
      CHARACTER*1 EOFMRK,DELIM,C                                               
 
66
C                                                                               
 
67
      EOF    = .FALSE.                                                          
 
68
      C      = ' '                                                              
 
69
      I      = 0                                                                
 
70
99    CONTINUE
 
71
          IF ( .NOT. (C.EQ.' ')) GO TO 20                                       
 
72
          I      = I + 1                                                        
 
73
          C      = LINE(I:I)                                                    
 
74
      GOTO 99
 
75
   20 CONTINUE                                                                  
 
76
      I      = I - 1                                                            
 
77
      LENGTH = 0                                                                
 
78
      TOKEN  = ' '                                                              
 
79
999   CONTINUE
 
80
          IF ( .NOT. (.NOT.EOF)) GO TO 40                                       
 
81
          I      = I + 1                                                        
 
82
          C      = LINE(I:I)                                                    
 
83
          EOF    = C .EQ. EOFMRK                                               
 
84
          IF (C.EQ.DELIM) THEN                                                  
 
85
              RETURN                                                            
 
86
                                                                                
 
87
          ELSE                                                                  
 
88
              LENGTH = LENGTH + 1                                               
 
89
              TOKEN(LENGTH:LENGTH) = C                                          
 
90
          END IF                                                                
 
91
                                                                                
 
92
      GOTO 999
 
93
   40 CONTINUE                                                                  
 
94
      IF (EOF) THEN                                                             
 
95
          LENGTH = LENGTH - 1                                                   
 
96
          IF (LENGTH.NE.0) EOF    = .FALSE.                                     
 
97
      END IF                                                                    
 
98
 
99
      RETURN                                                                    
 
100
      END