Changeset 2027 for branches/newmole

Show
Ignore:
Timestamp:
05/06/08 14:47:46 (8 months ago)
Author:
rjrw
Message:

Add optional diagnostics for rate and chemical balance controlling
species update.

Remove logically dead code.

Location:
branches/newmole/source
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/newmole/source/mole_drive.cpp

    r1849 r2027  
    2929#include "co.h" 
    3030 
    31 /* says whether the co network is currently set to zero */ 
    32 static bool lgMoleZeroed=true; 
    33  
    3431/* this is the error tolerance for reporting non-convergence */ 
    3532static const double MOLETOLER = 0.10; 
     
    3835STATIC void MolecSetup (void); 
    3936STATIC void mole_effects(void); 
    40  
    41 STATIC void mole_null_results(void); 
    4237STATIC void mole_h_rate_diagnostics(void); 
    4338 
     
    5146 
    5247        DEBUG_ENTRY( "mole_drive()" ); 
    53  
    54         /* this branch we will not do the CO equilibrium, set some variables that 
    55          * would be calculated by the chemistry, zero others, and return */ 
    56         mole_null_results(); 
    5748 
    5849        MolecSetup(); 
     
    9586        /* >>chng 05 jul 15, do not init if we have never evaluated CO in this iteration 
    9687         * and we are below limit where it should be evaluated */ 
    97         if( mole.iteration < 0 || lgMoleZeroed ) 
     88        if( mole.iteration < 0 || true ) /* ???? */ 
    9889        { 
    9990 
     
    157148        } 
    158149         
    159         return; 
    160 } 
    161  
    162 STATIC void mole_null_results(void) 
    163 { 
    164         DEBUG_ENTRY( "mole_null_results()" ); 
    165         /* these are heavy - heavy charge transfer rate that will still be needed 
    166          * for recombination of Si+, S+, and C+ */ 
    167         long int nelem , ion, i; 
    168  
    169         /* heating due to CO photodissociation */ 
    170         /* do we need to zero out the arrays and vars? */ 
    171         if( !lgMoleZeroed ) 
    172         { 
    173                 lgMoleZeroed = true; 
    174                 for( i=0; i<mole.num_calc; ++i ) 
    175                 { 
    176                         mole.list[i]->den = 0.; 
    177                 } 
    178                 /* heating due to CO photodissociation */ 
    179                 thermal.heating[0][9] = 0.; 
    180                 /* CO cooling */ 
    181                 CoolHeavy.C12O16Rot = 0.; 
    182                 CoolHeavy.dC12O16Rot = 0.; 
    183                 CoolHeavy.C13O16Rot = 0.; 
    184                 CoolHeavy.dC13O16Rot = 0.; 
    185                 co.CODissHeat = 0.; 
    186  
    187                 /** \todo       2       use TransitionZero here? */ 
    188                 for( i=0; i < nCORotate; i++ ) 
    189                 { 
    190                         C12O16Rotate[i].Lo->Pop = 0.; 
    191                         C13O16Rotate[i].Lo->Pop = 0.; 
    192                         /* population of upper level */ 
    193                         C12O16Rotate[i].Hi->Pop = 0.; 
    194                         C13O16Rotate[i].Hi->Pop = 0.; 
    195                         /* population of lower level with correction for stimulated emission */ 
    196                         C12O16Rotate[i].Emis->PopOpc = 0.; 
    197                         C13O16Rotate[i].Emis->PopOpc = 0.; 
    198                         /* following two heat exchange excitation, deexcitation */ 
    199                         C12O16Rotate[i].Coll.cool = 0.; 
    200                         C12O16Rotate[i].Coll.heat = 0.; 
    201                         C13O16Rotate[i].Coll.cool = 0.; 
    202                         C13O16Rotate[i].Coll.heat = 0.; 
    203                         /* intensity of line */ 
    204                         C12O16Rotate[i].Emis->xIntensity = 0.; 
    205                         C13O16Rotate[i].Emis->xIntensity = 0.; 
    206                         /* number of photons emitted in line */ 
    207                         C12O16Rotate[i].Emis->phots = 0.; 
    208                         C13O16Rotate[i].Emis->phots = 0.; 
    209                 } 
    210                 for( nelem=ipLITHIUM; nelem<LIMELM; ++nelem ) 
    211                 { 
    212                         for( ion=0; ion<nelem+2; ++ion ) 
    213                         { 
    214                                 mole.source[nelem][ion] = 0.; 
    215                                 mole.sink[nelem][ion] = 0.; 
    216                         } 
    217                 } 
    218         } 
    219          
    220         if( trace.nTrConvg>=4 ) 
    221         { 
    222                 /* trace ionization  */ 
    223                 fprintf( ioQQQ,  
    224                                                  "    mole_drive4 do not evaluate CO chemistry.\n"); 
    225         } 
    226  
    227150        return; 
    228151} 
  • branches/newmole/source/mole_reactions.cpp

    r1846 r2027  
    18931893{ 
    18941894        struct mole_reaction_s *rate; 
     1895        enum { DEBUG_MOLE = false }; 
    18951896 
    18961897        DEBUG_ENTRY("mole_update_rks()"); 
     
    19061907        { 
    19071908                rate = p->second; 
     1909                realnum oldrk = rate->rk; 
    19081910                ASSERT(rate->fun != NULL); 
    19091911                rate->rk = rate->a*rate->fun(rate); 
     1912                if (DEBUG_MOLE) 
     1913                { 
     1914                        if (fabs(rate->rk-oldrk) > 0.1*rate->rk) 
     1915                                fprintf(ioQQQ,"%s: %15.8g => %15.8g\n", 
     1916                                                                rate->label,oldrk,rate->rk); 
     1917                } 
    19101918        }        
    19111919} 
  • branches/newmole/source/mole_species.cpp

    r1938 r2027  
    616616        DEBUG_ENTRY("mole_update_species_cache()"); 
    617617 
     618        enum { DEBUG_MOLE = false }; 
     619 
    618620        mole.eden_f = (realnum)dense.eden;  /* Need floating point version for compatibility with all other values */ 
    619621 
     
    621623        { 
    622624                if(mole.list[i]->location != NULL)  
     625                { 
    623626                        mole.list[i]->den = *(mole.list[i]->location); 
     627                        if (DEBUG_MOLE) 
     628                                fprintf(ioQQQ,"%s: %f\n",mole.list[i]->label,mole.list[i]->den); 
     629                } 
    624630        } 
    625631  
     
    665671                mole.grain_saturation = 1.0; 
    666672        } 
     673        if (DEBUG_MOLE) 
     674                fprintf(ioQQQ,"Dust: %f %f %f\n", 
     675                                                mole.grain_area,mole.grain_density,mole.grain_saturation); 
    667676 
    668677}