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

« back to all changes in this revision

Viewing changes to applic/fit/libsrc/funct4.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 @(#)funct4.for        19.1 (ES0-DMD) 02/25/03 13:17:38
 
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 FUNCT4(IFLAG,NRPRM,PRM,FCT,GRD,IWRK,LIW,WRK,LW)                
 
30
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        
 
31
C                                                                               
 
32
C.MODULE                                                                        
 
33
C       FIT                                                                     
 
34
C                                                                               
 
35
C.NAME                                                                          
 
36
C       FUNCT4                                                                  
 
37
C                                                                               
 
38
C.PURPOSE                                                                       
 
39
C       Function to compute the sum of residuals and the gredient.              
 
40
C        Pass the control to different routines according                       
 
41
C        to IMAGE or TABLE.                                                     
 
42
C       Used by E04KBF,E04KDF.                                                  
 
43
C                                                                               
 
44
C.KEYWORDS                                                                      
 
45
C       Approximating Function.                                                 
 
46
C                                                                               
 
47
C.DESCRIPTION                                                                   
 
48
C       Test the type of FIT and go to respective routines                      
 
49
C                                                                               
 
50
C.LANGUAGE                                                                      
 
51
C       FORTRAN                                                                 
 
52
C                                                                               
 
53
C.CALLING SEQUENCE                                                              
 
54
C      CALL  FUNCT4(IFLAG,NRPRM,PRM,FCT,GRD,                                    
 
55
C     +                  IWRK,LIW,WRK,LW)                                       
 
56
C                                                                               
 
57
C.INPUT PARAMETERS                                                              
 
58
C       IFLAG               INTEGER  unused                                     
 
59
C       NRPRM               INTEGER  Number of parameters                       
 
60
C       PRM (NRPRM)         DOUBLE   Parameters                                 
 
61
C       GRD (NRPRM)         DOUBLE   unused                                     
 
62
C       IWRK (LIW)          INTEGER  unused                                     
 
63
C       LIW                 INTEGER                                             
 
64
C       WRK (LW)            DOUBLE                                              
 
65
C       LW                  INTEGER                                             
 
66
C                                                                               
 
67
C.MODIFIED PARAMETERS                                                           
 
68
C       none                                                                    
 
69
C                                                                               
 
70
C.OUTPUT PARAMETERS                                                             
 
71
C       FCT                 DOUBLE   Sum of residuals                           
 
72
C                                                                               
 
73
C.FILES                                                                         
 
74
C       FIT_NAG.INC/NOLIST                                                      
 
75
C                                                                               
 
76
C.MODULES CALLED                                                                
 
77
C       FUNCT2_T                                                                
 
78
C       FUNCT2_I                                                                
 
79
C                                                                               
 
80
C.AUTHOR                                                                        
 
81
C       Ph. DEFERT,      Feb 1986                                               
 
82
C                                                                               
 
83
C.MODIFICATIONS                                                                 
 
84
C                                                                               
 
85
C                                                                               
 
86
C-----------------------------------------------------------------------        
 
87
C      IMPLICIT NONE                                                            
 
88
C     ..                                                                        
 
89
C     .. Scalar Arguments ..                                                    
 
90
      INTEGER IFLAG,NRPRM,LIW,LW,MADRID(1)                                                
 
91
      DOUBLE PRECISION FCT                                                      
 
92
C     ..                                                                        
 
93
C     .. Array Arguments ..                                                     
 
94
      INTEGER IWRK(LIW)                                                         
 
95
      DOUBLE PRECISION PRM(NRPRM),GRD(NRPRM),WRK(LW)                            
 
96
C     ..                                                                        
 
97
C     .. External Files ..                                                      
 
98
       INCLUDE 'MID_INCLUDE:FITNAGI.INC/NOLIST'                                 
 
99
      COMMON /VMR/MADRID                                                     
 
100
       INCLUDE 'MID_INCLUDE:FITNAGC.INC/NOLIST'                                 
 
101
C     ..                                                                        
 
102
C     .. Executable Statements ..                                               
 
103
      IF (FILTYP(1:1).EQ.'T') THEN                                              
 
104
          CALL FUNC2T(NRPRM,PRM,FCT,GRD)                                      
 
105
                                                                                
 
106
      ELSE                                                                      
 
107
          CALL FUNC2I(NRPRM,PRM,FCT,GRD,MADRID(PTRI),MADRID(PTRM),            
 
108
     +                  NRPIX(1),NRPIX(2),NRPIX(3))                             
 
109
      END IF                                                                    
 
110
                                                                                
 
111
      RETURN                                                                    
 
112
                                                                                
 
113
      END