Search:

Return to previous page

Contents of file 'ccubsolvdrv.f':



    1   C...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+
    2   C     File:        CCUBSOLVDRV.F (Fortran 77 source)
    3   C     Author:      Fredrik Jonsson <fj@phys.soton.ac.uk>
    4   C     Date:        December 29, 2005
    5   C     Last change: December 29, 2006
    6   C     Description: Driver for the CCUBSOLV soutine for solving complex-
    7   C                  valued cubic polynomial equations of the form
    8   C
    9   C                        z^3+c[2]*z^2+c[1]*z^2+c[0]=0
   10   C
   11   C                  for general complex coefficients c[k], which here taken
   12   C                  as conforming to the convention
   13   C
   14   C                        A(1)=c[0],  A(2)=c[1],  A(3)=c[2].
   15   C
   16   C                  See the documentation of the CCUBSOLV routine, enclosed
   17   C                  in file CCUBSOLV.F, for further information.
   18   C
   19   C     Copyright (C) 2006, Fredrik Jonsson
   20   C...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+
   21   C     PROGRAM MAIN
   22         IMPLICIT LOGICAL (A-Z)
   23         EXTERNAL ccubsolv
   24         INTEGER K
   25         COMPLEX*8 A(3),Z(3)
   26   
   27         A(1)=CMPLX(1.23d0,-1.44d0)
   28         A(2)=CMPLX(-2.18d0,3.97d0)
   29         A(3)=CMPLX(1.91d0,0.97d0)
   30   
   31         CALL ccubsolv(A,Z)
   32   
   33         DO 10,K=1,3
   34            WRITE(6,20) 'Z(',K,'): ',Z(K)
   35    10   CONTINUE
   36    20   FORMAT(2X,A2,I1,A3,'(',F12.9,',',F12.9,')')
   37   
   38         DO 30,K=1,3
   39            WRITE(6,40) 'P(Z(',K,')): ',((Z(K)+A(3))*Z(K)+A(2))*Z(K)+A(1)
   40    30   CONTINUE
   41    40   FORMAT(2X,A4,I1,A4,'(',F12.9,',',F12.9,')')
   42   
   43         STOP
   44         END
   45   

Return to previous page

Generated by ::viewsrc::

Last modified Wednesday 15 Feb 2023