1
C @(#)gauss3d.for 19.1 (ES0-DMD) 02/25/03 13:17:39
2
C===========================================================================
3
C Copyright (C) 1995 European Southern Observatory (ESO)
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.
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.
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,
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
27
C===========================================================================
29
SUBROUTINE GAUSS3(X,NP,PARAM,Y1,DERIV)
30
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31
C.COPYRIGHT: Copyright (c) 1987 European Southern Observatory,
34
C.VERSION: 1.0 ESO-FORTRAN Conversion, AA 18:01 - 21 DEC 1987
36
C.LANGUAGE: F77+ESOext
40
C--------------------------------------------------------------
41
C**********************************************
44
C Three-dimensional Gaussian Distribution
46
C**********************************************
48
C Author: O.-G. Richter, ESO Garching
51
DOUBLE PRECISION Y1,PARAM(NP),DERIV(NP)
53
DOUBLE PRECISION R11,R22,R33,R12,R13,R23,R,R1
54
DOUBLE PRECISION A,B,C,D,E,F,O,P,Q
55
DOUBLE PRECISION B2,C2,D2,B22,C22,D22,E1,E2,E3
57
R11 = 1.0D0 - PARAM(10)*PARAM(10) ! > Diagonals
58
R22 = 1.0D0 - PARAM(9)*PARAM(9) ! /
59
R33 = 1.0D0 - PARAM(8)*PARAM(8)
60
C ! of correlation determ. ! \
61
R12 = PARAM(9)*PARAM(10) - PARAM(8) ! > Non-diagonals
62
R13 = PARAM(8)*PARAM(10) - PARAM(9) ! /
63
R23 = PARAM(8)*PARAM(9) - PARAM(10)
64
C ! Total residual dispersion
65
R = 2.0D0*R12*PARAM(8) + R11 + R22 - 1.0 ! and its inverse
70
B = (X(1)-PARAM(2))/PARAM(5)
71
C = (X(2)-PARAM(3))/PARAM(6)
72
D = (X(3)-PARAM(4))/PARAM(7)
80
DERIV(1) = DEXP(-A* (B22+C22+D22+2.0* (B*C*R12+B*D*R13+C*D*R23)))
82
Y1 = DERIV(1)*PARAM(1)
85
DERIV(2) = A* (B*R11+C*R12+D*R13)/PARAM(5)
86
DERIV(3) = A* (B*R12+C*R22+D*R23)/PARAM(6)
87
DERIV(4) = A* (B*R13+C*R23+D*R33)/PARAM(7)
101
DERIV(8) = A* (R12*F+D2*PARAM(8)*R+O* (2.0*R12*R12+R)+P*E3+Q*E2)
102
DERIV(9) = A* (R13*F+C2*PARAM(9)*R+O*E3+P* (2.0*R13*R13+R)+Q*E1)
103
DERIV(10) = A* (R23*F+B2*PARAM(10)*R+O*E2+P*E1+Q* (2.0*R23*R23+R))