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

Merging all changes from mainline upto r2033, except r1902.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/c08_branch/source/ion_silic.cpp

    r1732 r2034  
    33/*IonSilic determine ionization balance of Silicon */ 
    44#include "cddefines.h" 
    5 #include "trace.h" 
    65#include "dense.h" 
    7 #include "sil.h" 
    86#include "ionbal.h" 
    97 
     
    3735 
    3836        bool lgPrtDebug=false; 
    39         static long nzUsed = -1; 
    40         static double OldRate = 0.; 
    41         double save_rec; 
    4237 
    4338        DEBUG_ENTRY( "IonSilic()" ); 
     
    4540        /* silicon, atomic number 14 */ 
    4641        if( !dense.lgElmtOn[ipSILICON] ) 
    47         { 
    48                 sil.p1895 = 0.; 
    4942                return; 
    50         } 
    5143 
    5244        ion_zero(ipSILICON); 
    5345 
    5446        ion_photo(ipSILICON,false); 
     47 
     48#       if 0 
     49        static long nzUsed = -1; 
     50        static double OldRate = 0.; 
     51 
     52        /* 2008 apr 18, this appears to try to damp out changes in the valence 
     53         * shell photo rate - perhaps due to Lya oscillations in dust free 
     54         * environments? */ 
    5555        if( nzone > 1 && OldRate > 0. ) 
    5656        { 
     
    6767        } 
    6868        OldRate = ionbal.PhotoRate_Shell[ipSILICON][0][4][0]; 
     69#       endif 
    6970 
    7071        /* find collisional ionization rates */ 
     
    7273 
    7374        /* get recombination coefficients */ 
    74         /*lint -e740 unusual pointer cast */ 
    7575        /*lint -e64 type mismatch */ 
    7676        ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipSILICON); 
    77         /*lint +e740 unusual pointer cast */ 
    7877        /*lint +e64 type mismatch */ 
    79  
    80         /* pumping to 3p of Si III */ 
    81         sil.p1895 = ionbal.PhotoRate_Shell[ipSILICON][1][2][0]; 
    82  
    83         /* >>chng 03 sep 29, synch up ion and co solvers. 
    84          * the co solver will have a different C/C+ balance that 
    85          * is strongly affected by the chemistryif we are in neutral gas 
    86          * in this case use co solver's C/C+ balance */ 
    87         save_rec = ionbal.RateRecomTot[ipSILICON][0]; 
    88         /*>>chng 04 apr 27, do not test for ionhigh being 1, 
    89          * no reason for test on upper stage of ionization, 
    90          * if codrive called but not evaluted then hevmol is all zero */ 
    91         /* >>chng 04 sep 10, rm check on search phase, no reason for it */ 
    92 #       if 0 
    93         if( dense.IonLow[ipSILICON]==0  && /*!conv.lgSearch &&*/ 
    94                 co.hevmol[ipSIP] > SMALLFLOAT &&  
    95                 ionbal.RateIonizTot[ipSILICON][0]*co.hevmol[ipATSI]>0.) 
    96         { 
    97                 /* >>chng 04 sep 11, use damped ratio, were Si+ oscillations deep in molecular cloud, 
    98                  * where Si+ is dominant electron donor */ 
    99                 ionbal.RateRecomTot[ipSILICON][0] =  
    100                         ionbal.RateIonizTot[ipSILICON][0]* 
    101                         co.hevmol[ipATSI]/co.hevmol[ipSIP]; 
    102                 /*fprintf(ioQQQ,"DEBUG sil atm\t%.2f\t%.3e\t%.3e\t%.3e\n", 
    103                         fnzone ,  
    104                         co.hevmol[ipATSI], 
    105                         co.hevmol[ipSIP], 
    106                         ionbal.RateIonizTot[ipSILICON][0]);*/ 
    107         } 
    108 #       endif 
    10978 
    11079        /* solve for ionization balance */ 
     
    11281        ion_solver(ipSILICON,lgPrtDebug); 
    11382 
    114         /* reset the var we just hosed */ 
    115         if( save_rec > 0. ) 
    116                 ionbal.RateRecomTot[ipSILICON][0] = save_rec;    
    117  
    118         /* get pmp rate cm-3 s-1 */ 
    119         sil.p1895 *= dense.xIonDense[ipSILICON][1]*0.85; 
    120  
     83#       if 0 
     84        /* 2008 apr 18, this is all dead code from when co network fed back from 
     85         * the ionization */ 
    12186        if( trace.lgTrace && trace.lgHeavyBug ) 
    12287        { 
     
    12893                fprintf( ioQQQ, "\n" ); 
    12994        } 
    130 #       if 0 
    13195        fprintf( ioQQQ, "DEBUG silicon\t%.2f",fnzone ); 
    13296        for( i=0; i < 2; i++ )