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/iso_ionize_recombine.cpp

    r1822 r2034  
    143143                iso.RateLevel2Cont[ipISO][nelem][level] = iso.gamnc[ipISO][nelem][level] +  
    144144                  iso.ColIoniz[ipISO][nelem][level]* dense.EdenHCorr +  
    145                   /* >>chng 04 nov 30, also turn off cr ionization with atom h-like collisions off */ 
    146                   /* >>chng 05 aug 17, do not turn off cosmic rays with no collisional ionization  
    147                    * simply leave out crs if this is desired - this allows leiden hacks to work */ 
    148                   secondaries.csupra[nelem][nelem-ipISO]/* *iso.lgColl_ionize[ipISO]*/; 
     145                  secondaries.csupra[nelem][nelem-ipISO]*iso.lgColl_ionize[ipISO]; 
    149146 
    150147                /* all processes from continuum to level n, units s-1 */ 
     
    166163        } 
    167164 
    168         /* all following go into or out of ground state */ 
    169         level = 0; 
    170  
    171165        /* now charge transfer - all into/from ground, two cases, H and not H */ 
    172166        if( nelem==ipHYDROGEN ) 
     
    174168                /* charge transfer, hydrogen onto everything else */ 
    175169                /* charge exchange ionization, these come out of every level */ 
    176                 for( level=ipH1s; level< iso.numLevels_local[ipISO][nelem]; ++level) 
     170                for( level=0; level< iso.numLevels_local[ipISO][nelem]; ++level) 
    177171                { 
    178172                        iso.RateLevel2Cont[ipISO][nelem][level] += atmdat.HCharExcIonTotal; 
    179173                } 
    180174                /* charge exchange recombination */ 
    181                 iso.RateCont2Level[ipISO][nelem][ipH1s] += atmdat.HCharExcRecTotal; 
     175                iso.RateCont2Level[ipISO][nelem][0] += atmdat.HCharExcRecTotal; 
    182176        } 
    183177        else if( nelem==ipHELIUM && ipISO==ipHE_LIKE ) 
     
    228222        Recom3Body = 0.; 
    229223        /* >>chng 06 jul 20, level should go to numLevels_local instead of numLevels_max */ 
    230         for( level=ipH1s; level< iso.numLevels_local[ipISO][nelem]; ++level) 
     224        for( level=0; level< iso.numLevels_local[ipISO][nelem]; ++level) 
    231225        { 
    232226 
     
    238232                ionbal.RR_rate_coef_used[nelem][nelem-ipISO] += iso.RadRecomb[ipISO][nelem][level][ipRecRad]* 
    239233                        iso.RadRecomb[ipISO][nelem][level][ipRecNetEsc]; 
    240                 /*if( nelem==ipHELIUM && ipISO==ipH_LIKE ) 
    241                         fprintf(ioQQQ,"DEBUG rad rec %li %.4e %.4e\n", 
    242                                 level, 
    243                                 iso.RadRecomb[ipISO][nelem][level][ipRecRad], 
    244                                 iso.RadRecomb[ipISO][nelem][level][ipRecNetEsc]);*/ 
    245234 
    246235                /* >>chng 05 jul 11, from > to >=, some very opt thick sims did block escape to zero */ 
     
    251240                Recom3Body += iso.ColIoniz[ipISO][nelem][level]*dense.EdenHCorr*iso.PopLTE[ipISO][nelem][level]; 
    252241        } 
    253         /*if( nelem==ipHELIUM && ipISO==ipH_LIKE ) 
    254                 fprintf(ioQQQ,"DEBUG rad rec %.4e\n",ionbal.RR_rate_coef_used[nelem][nelem-ipISO]);*/ 
    255242 
    256243        /* fraction of total recombs due to three body - when most are due to this 
     
    262249        if( ionbal.RateRecomTot[nelem][nelem-ipISO] > 0. ) 
    263250        { 
    264 #               if 0 
    265                 /* >>chng 06 jul 23, this was a temporary hack to force the lot T solver, which forces the 
    266                  * atom to agree with iso.xIonSimple, to synch up with full solln from matrix - this caused 
    267                  * many problems since using ionbal.RateIonizTot includes excited level ionization processes 
    268                  * so matrix soln was called rather than simple.  this cause neg pops in ~half a dozen sims */ 
    269                 if( ionbal.RateIonizTot[nelem][nelem-ipISO] >= 0. ) 
    270                 { 
    271                         /* >>chng 06 jul 21, use effective rate, which includes ioniz from excited states, if defined */ 
    272                         iso.xIonSimple[ipISO][nelem] = ionbal.RateIonizTot[nelem][nelem-ipISO]/ionbal.RateRecomTot[nelem][nelem-ipISO]; 
    273                 } 
    274                 else 
    275 #               endif 
    276                 { 
    277                         iso.xIonSimple[ipISO][nelem] = iso.RateLevel2Cont[ipISO][nelem][ipH1s]/ionbal.RateRecomTot[nelem][nelem-ipISO]; 
    278                 } 
    279                 /*fprintf(ioQQQ,"DEBUG iso ion rec %li %li ion %.2e ioniztot %.2e \n" , 
    280                         ipISO, nelem , 
    281                         iso.RateLevel2Cont[ipISO][nelem][ipH1s] , 
    282                         ionbal.RateIonizTot[nelem][nelem-ipISO] );*/ 
     251                iso.xIonSimple[ipISO][nelem] = iso.RateLevel2Cont[ipISO][nelem][ipH1s]/ionbal.RateRecomTot[nelem][nelem-ipISO]; 
    283252        } 
    284253        else 
     
    290259        { 
    291260                fprintf( ioQQQ, "     iso_ionize_recombine iso=%2ld Z=%2ld Level2Cont[0] %10.2e RateRecomTot %10.2e xIonSimple %10.2e\n",  
    292                         ipISO, nelem, iso.RateLevel2Cont[ipISO][nelem][ipH1s], ionbal.RateRecomTot[nelem][nelem-ipISO], iso.xIonSimple[ipISO][nelem] ); 
     261                        ipISO, nelem, iso.RateLevel2Cont[ipISO][nelem][0], ionbal.RateRecomTot[nelem][nelem-ipISO], iso.xIonSimple[ipISO][nelem] ); 
    293262        } 
    294263