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

« back to all changes in this revision

Viewing changes to applic/fit/libsrc/poly3d.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 @(#)poly3d.for        19.1 (ES0-DMD) 02/25/03 13:17:43
 
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 POLY3D(X,NP,PARAM,Y1,DERIV)                                    
 
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  18:01 - 21 DEC 1987                 
 
35
C                                                                               
 
36
C.LANGUAGE: F77+ESOext                                                          
 
37
C                                                                               
 
38
C.AUTHOR: J.D.PONZ                                                              
 
39
C                                                                               
 
40
C--------------------------------------------------------------                 
 
41
C*********************************************                                  
 
42
C                                                                               
 
43
C      IMPLICIT NONE                                                            
 
44
C  FIT WITH A THREE-DIMENSIONAL POLYNOMIAL                                      
 
45
C                                                                               
 
46
C*********************************************                                  
 
47
C                                                                               
 
48
C Author: O.-G. Richter, ESO Garching                                           
 
49
C                                                                               
 
50
      INTEGER I,J,K,L,NP,MAX
 
51
      REAL X(3),A                                                            
 
52
      DOUBLE PRECISION Y1,PARAM(NP),DERIV(NP)                                   
 
53
C                                                                               
 
54
      PARAMETER (MAX=4)                                                         
 
55
      DOUBLE PRECISION B(MAX,MAX,MAX),C(MAX*MAX*MAX)                            
 
56
C                                                                               
 
57
      A      = 1.0D0                                                            
 
58
      DO 10 I = 1,MAX                                                           
 
59
          B(1,1,I) = A                                                          
 
60
          A      = A*X(1)                                                       
 
61
   10 CONTINUE                                                                  
 
62
      DO 30 I = 2,MAX                                                           
 
63
          DO 20 J = 1,MAX                                                       
 
64
              B(1,I,J) = B(1,I-1,J)*X(2)                                        
 
65
   20     CONTINUE                                                              
 
66
   30 CONTINUE                                                                  
 
67
      DO 60 I = 2,MAX                                                           
 
68
          DO 50 J = 1,MAX                                                       
 
69
              DO 40 K = 1,MAX                                                   
 
70
                  B(I,J,K) = B(I-1,J,K)*X(3)                                    
 
71
   40         CONTINUE                                                          
 
72
   50     CONTINUE                                                              
 
73
   60 CONTINUE                                                                  
 
74
      L      = 0                                                                
 
75
      DO 90 I = 1,MAX                                                           
 
76
          DO 80 J = 1,I                                                         
 
77
              DO 70 K = 1,J                                                     
 
78
                  L      = L + 1                                                
 
79
                  C(L)   = B(K,J-K+1,I-J+1)                                     
 
80
   70         CONTINUE                                                          
 
81
   80     CONTINUE                                                              
 
82
   90 CONTINUE                                                                  
 
83
      Y1     = 0.0D0                                                            
 
84
      DO 100 I = 1,NP                                                           
 
85
          DERIV(I) = C(I)                                                       
 
86
          Y1     = Y1 + C(I)*PARAM(I)                                           
 
87
  100 CONTINUE                                                                  
 
88
      RETURN                                                                    
 
89
                                                                                
 
90
      END