Show
Ignore:
Timestamp:
05/10/08 09:03:02 (6 months ago)
Author:
peter
Message:

Merging all changes from mainline upto r2033, except r1902.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/c08_branch/source/hydro_bauman.cpp

    r1771 r2034  
    99/* In this version, quantities that would normally cause a 64-bit floating point processor      */ 
    1010/* to either underflow or overflow are evaluated using logs instead of floating point math.     */ 
    11 /* This allows us to use an upper principle quantum number `n' greater than  which the          */ 
     11/* This allows us to use an upper principal quantum number `n' greater than  which the          */ 
    1212/* other version begins to fail. The trade-off is, of course, lower accuracy                    */ 
    1313/* ( or is it precision ). We use LOG_10 for convenience.                                       */ 
     
    3434typedef struct t_mxq mxq; 
    3535 
    36 /*lint -e790 integral to float */ 
    3736/************************************************************************************************/ 
    3837/*    these routines were written by Robert Bauman                                              */ 
     
    4342/*    The recombination coefficient is obtained from the                                        */ 
    4443/*    photoionization cross-section (see Burgess 1965).                                         */ 
    45 /*    We have,                                                                                  */ 
     44/*    We have:                                                                                  */ 
    4645/*                                                                                              */ 
    4746/*                  -                           -               l'=l+1                          */ 
     
    124123/*                                               r^2                                            */ 
    125124/*                                                                                              */ 
    126 /*      Similiarly, the recombination co-efficient satisfies                                    */ 
     125/*      Similiarly, the recombination coefficient satisfies                                    */ 
    127126/************************************************************************************************/ 
    128127 
     
    144143/** \verbatim 
    145144************************* for LOG version of the file  *************************************** 
    146  In this version, quantites that would normal cause a 64-bit floating point processor         
     145 In this version, quantities that would normal cause a 64-bit floating point processor         
    147146 to underflowed or overflow on intermediate values (ones internal to the calculation)          
    148  are evaluated using logs. This allows us to use an upper principle quantum number `n'         
     147 are evaluated using logs. This allows us to use an upper principal quantum number `n'         
    149148 greater than 50 which is where the other version begins to fail. The trade-off is,            
    150149 of course, lower accuracy( or is it precision ) and perhaps speed.                            
     
    352351 
    353352/** \verbatim 
    354      This routine, hri(), calculates the hydrogen radial intergral,   
     353     This routine, hri(), calculates the hydrogen radial integral,   
    355354      for the transition n,l --> n',l'                                 
    356355      It is, of course, dimensionless.                                 
     
    373372 
    374373/**\verbatim 
    375   This routine, hri_log10(), calculates the hydrogen radial intergral,   
     374  This routine, hri_log10(), calculates the hydrogen radial integral,   
    376375  for the transition n,l --> n',l'                                       
    377376  It is, of course, dimensionless.                                       
     
    539538 
    540539/************************************************************************/ 
    541 /* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BORHRADIUS * BORHRADIUS   */ 
     540/* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BOHRRADIUS * BOHRRADIUS   */ 
    542541/*                                                                      */ 
    543542/*                                                                      */ 
     
    742741        /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd)    */ 
    743742        double K, 
    744         /* principle quantum number                             */ 
     743        /* principal quantum number                             */ 
    745744        long int n, 
    746745        /* angular  momentum quantum number                     */ 
    747746        long int l, 
    748         /* Temperary storage for intermediate                   */ 
     747        /* Temporary storage for intermediate                   */ 
    749748        /*  results of the recursive routine                    */ 
    750749        double *rcsvV 
     
    754753 
    755754        long int lp = 0; /* l' */ 
    756         double sigma = 0.; /*      Sum in brocklehurst eq. 3.13 */ 
     755        double sigma = 0.; /*      Sum in Brocklehurst eq. 3.13 */ 
    757756 
    758757        ASSERT( n > 0 ); 
     
    779778        /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd)    */ 
    780779        double K, 
    781         /* principle quantum number                             */ 
     780        /* principal quantum number                             */ 
    782781        long int n, 
    783782        /* angular  momentum quantum number                     */ 
    784783        long int l, 
    785         /* Temperary storage for intermediate                   */ 
     784        /* Temporary storage for intermediate                   */ 
    786785        mxq *rcsvV_mxq 
    787786        /*   results of the recursive routine                   */ 
     
    791790 
    792791        long int lp = 0; /* l' */ 
    793         double sigma = 0.; /*      Sum in brocklehurst eq. 3.13 */ 
     792        double sigma = 0.; /*      Sum in Brocklehurst eq. 3.13 */ 
    794793 
    795794        ASSERT( n > 0 ); 
     
    835834        long int l, 
    836835        long int lp, 
    837         /* Temperary storage for intermediate         */ 
     836        /* Temporary storage for intermediate         */ 
    838837        /*  results of the recursive routine          */ 
    839838        double *rcsvV 
     
    913912        long int l, 
    914913        long int lp, 
    915         /* Temperary storage for intermediate         */ 
     914        /* Temporary storage for intermediate         */ 
    916915        /* results of the recursive routine           */ 
    917916        mxq *rcsvV_mxq 
     
    10101009        long int l, 
    10111010        long int lp, 
    1012         /* Temperary storage for intermediate         */ 
     1011        /* Temporary storage for intermediate         */ 
    10131012        /* results of the recursive routine           */ 
    10141013        double *rcsvV 
     
    11041103        long int l, 
    11051104        long int lp, 
    1106         /* Temperary storage for intermediate        */ 
     1105        /* Temporary storage for intermediate        */ 
    11071106        /* results of the recursive routine          */ 
    11081107        mxq *rcsvV_mxq 
     
    13041303/*                                                                                              */ 
    13051304/*    from the reference                                                                        */ 
    1306 /*    M. BrocKlehurst                                                                           */ 
     1305/*    M. Brocklehurst                                                                           */ 
    13071306/*    Mon. Note. R. astr. Soc. (1971) 153, 471-490                                              */ 
    13081307/*                                                                                              */ 
     
    13201319        long int l, 
    13211320        long int lp, 
    1322         /* Temperary storage for intermediate        */ 
     1321        /* Temporary storage for intermediate        */ 
    13231322        /*  results of the recursive routine         */ 
    13241323        double *rcsvV, 
     
    14711470        long int l, 
    14721471        long int lp, 
    1473         /* Temperary storage for intermediate       */ 
     1472        /* Temporary storage for intermediate       */ 
    14741473        /* results of the recursive routine         */ 
    14751474        mxq *rcsvV_mxq, 
     
    16801679/*                                                                                              */ 
    16811680/*    from the reference                                                                        */ 
    1682 /*    M. BrocKlehurst                                                                           */ 
     1681/*    M. Brocklehurst                                                                           */ 
    16831682/*    Mon. Note. R. astr. Soc. (1971) 153, 471-490                                              */ 
    16841683/*                                                                                              */ 
     
    19941993/*                                                                                      */ 
    19951994/*      From reference;                                                                 */ 
    1996 /*      M. BrocKlehurst                                                                 */ 
     1995/*      M. Brocklehurst                                                                 */ 
    19971996/*      Mon. Note. R. astr. Soc. (1971) 153, 471-490                                    */ 
    19981997/*                                                                                      */ 
     
    20222021/*                                                                                      */ 
    20232022/*                                                                                      */ 
    2024 /*    the starting point for the recursion relations are;                               */ 
     2023/*    the starting point for the recursion relations are:                               */ 
    20252024/*                                                                                      */ 
    20262025/*                                                                                      */ 
    2027 /*    equation: (3.18)                                                                  */ 
     2026/*    equation (3.18):                                                                  */ 
    20282027/*                                                                                      */ 
    20292028/*                     | pi |(1/2)   8n                                                 */ 
     
    20312030/*                     | 2  |      (2n-1)!                                              */ 
    20322031/*                                                                                      */ 
    2033 /*     equation: (3.20)                                                                 */ 
     2032/*     equation (3.20):                                                                 */ 
    20342033/*                                                                                      */ 
    20352034/*                          exp(2n-2/K tan^(-1)(n K)                                    */ 
     
    20392038/*                                                                                      */ 
    20402039/*                                                                                      */ 
    2041 /*     equation: (3.20)                                                                 */ 
     2040/*     equation (3.20):                                                                 */ 
    20422041/*     G(n,n-2; K,n-1) = (2n-2)(1+(n K)^2) n G(n,n-1; K,n)                              */ 
    20432042/*                                                                                      */ 
    20442043/*                                                                                      */ 
    2045 /*     equation: (3.21)                                                                 */ 
     2044/*     equation (3.21):                                                                 */ 
    20462045/*                                                                                      */ 
    20472046/*                       (1+(n K)^2)                                                    */ 
     
    20552054        long int l, 
    20562055        long int lp, 
    2057         /* Temperary storage for intermediate      */ 
     2056        /* Temporary storage for intermediate      */ 
    20582057        /*   results of the recursive routine      */ 
    20592058        double *rcsvV 
     
    21152114        long int l, 
    21162115        long int lp, 
    2117         /* Temperary storage for intermediate      */ 
     2116        /* Temporary storage for intermediate      */ 
    21182117        /*   results of the recursive routine      */ 
    21192118        mxq *rcsvV_mxq 
     
    23842383        if( n >= 70 ) 
    23852384        { 
    2386                 fprintf(ioQQQ,"Principle Quantum Number `n' too large.\n"); 
     2385                fprintf(ioQQQ,"Principal Quantum Number `n' too large.\n"); 
    23872386                cdEXIT(EXIT_FAILURE); 
    23882387        } 
     
    23992398        if( n <= np  ) 
    24002399        { 
    2401                 fprintf(ioQQQ," The principle quantum numbers are such that n <= n'.\n"); 
     2400                fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 
    24022401                cdEXIT(EXIT_FAILURE); 
    24032402        } 
     
    24402439        if( n <= np  ) 
    24412440        { 
    2442                 fprintf(ioQQQ," The principle quantum numbers are such that n <= n'.\n"); 
     2441                fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 
    24432442                cdEXIT(EXIT_FAILURE); 
    24442443        } 
     
    25212520        if( n <= nprime  ) 
    25222521        { 
    2523                 fprintf(ioQQQ," The principle quantum numbers are such that n <= n'.\n"); 
     2522                fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 
    25242523                cdEXIT(EXIT_FAILURE); 
    25252524        } 
     
    25302529/************************************************************************/ 
    25312530/*   hri()                                                              */ 
    2532 /*   Calculate the hydrogen radial wavefunction intergral               */ 
     2531/*   Calculate the hydrogen radial wavefunction integral                */ 
    25332532/*   for the dipole transition  l'=l-1  or  l'=l+1                      */ 
    25342533/*   for the higher energy state n,l  to the lower energy state n',l'   */ 
     
    25512550 
    25522551/************************************************************************/ 
    2553 /*      This routine, hri(), calculates the hydrogen radial intergral,  */ 
     2552/*      This routine, hri(), calculates the hydrogen radial integral,   */ 
    25542553/*      for the transition n,l --> n',l'                                */ 
    25552554/*      It is, of course, dimensionless.                                */ 
     
    26282627/************************************************************************/ 
    26292628/*   hri_log10()                                                        */ 
    2630 /*   Calculate the hydrogen radial wavefunction intergral               */ 
     2629/*   Calculate the hydrogen radial wavefunction integral                */ 
    26312630/*   for the dipole transition  l'=l-1  or  l'=l+1                      */ 
    26322631/*   for the higher energy state n,l  to the lower energy state n',l'   */ 
     
    44454444        return partsum; 
    44464445} 
    4447 /*lint +e790 integral to float */