Changeset 2034 for branches/c08_branch/source/iso_solve.cpp
- Timestamp:
- 05/10/08 09:03:02 (2 months ago)
- Files:
-
- branches/c08_branch/source/iso_solve.cpp (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/c08_branch/source/iso_solve.cpp
r1822 r2034 8 8 #include "conv.h" 9 9 #include "dense.h" 10 #include "opacity.h" 10 11 #include "elementnames.h" 11 12 #include "h2.h" … … 21 22 #include "thermal.h" 22 23 #include "trace.h" 23 24 /*lint -e662 creation of out of bound pointer */25 /*lint -e661 creation of out of bound pointer */26 24 27 25 /* iso_solve main routine to call iso_level and determine iso level balances */ … … 39 37 error; 40 38 static bool lgFinitePop[LIMELM]; 41 static bool lgMustInit =true;39 static bool lgMustInit[NISO]={true, true}; 42 40 bool lgH_chem_conv; 43 41 int loop_H_chem; … … 47 45 DEBUG_ENTRY( "iso_solve()" ); 48 46 49 if( lgMustInit )47 if( lgMustInit[ipISO] ) 50 48 { 51 49 for( nelem=ipHELIUM; nelem<LIMELM; ++nelem ) 52 50 lgFinitePop[nelem] = true; 53 lgMustInit = false;54 51 } 55 52 … … 83 80 /** \todo 2 remove this when this routine really controls helium itself */ 84 81 fixit(); /* why does this routine not control helium? Shouldn't it? */ 82 // can just remove these entirely?, only applies to helium itself anyway. 85 83 lowsav = dense.IonLow[ipHELIUM]; 86 84 ihisav = dense.IonHigh[ipHELIUM]; … … 111 109 if( iso.lgRandErrGen[ipISO] && nzone==0 && !iso.lgErrGenDone[ipISO][nelem] ) 112 110 { 113 iso_error_generation(ipISO, nelem );111 iso_error_generation(ipISO, nelem ); 114 112 } 115 113 116 114 /* evaluate recombination rates */ 117 115 iso_radiative_recomb( ipISO , nelem ); 116 117 if( opac.lgRedoStatic ) 118 { 119 if( nelem<=ipHELIUM ) 120 { 121 iso_collapsed_bnl_set( ipISO, nelem ); 122 123 //iso_collapsed_bnl_print( ipISO, nelem ); 124 125 iso_collapsed_Aul_update( ipISO, nelem ); 126 127 iso_collapsed_lifetimes_update( ipISO, nelem ); 128 129 iso_cascade( ipISO, nelem ); 130 131 iso_radiative_recomb_effective( ipISO, nelem ); 132 } 133 else 134 { 135 iso_cascade( ipISO, nelem ); 136 137 iso_radiative_recomb_effective( ipISO, nelem ); 138 } 139 } 118 140 119 141 /* evaluate state specific creation and destruction processes, … … 140 162 141 163 iso.pop_ion_ov_neut[ipISO][nelem] = 0.; 142 if( ipISO==ipHE_LIKE ) 143 iso.xIonSimple[ipISO][nelem] = 0.; 164 iso.xIonSimple[ipISO][nelem] = 0.; 144 165 145 166 /* zero it out since no population*/ … … 175 196 } 176 197 } 198 199 /* setting this flag false means that we have been through this loop at least once already. */ 200 lgMustInit[ipISO] = false; 177 201 178 202 if( ipISO == ipHE_LIKE ) … … 473 497 /* first dimension is multiplicity */ 474 498 char chSpin[3][9]= {"singlets", "doublets", "triplets"}; 475 char chISO[2][8]= {"H-like", "He-like"};476 499 477 500 #define ITEM_TO_PRINT(A_) ( lgPrtDeparCoef ? iso.DepartCoef[ipISO][nelem][A_] : StatesElem[ipISO][nelem][A_].Pop ) … … 495 518 /* give element number and spin */ 496 519 fprintf(ioQQQ," %s %s %s %s\n", 497 chISO[ipISO],520 iso.chISO[ipISO], 498 521 elementnames.chElementSym[nelem], 499 522 chSpin[is-1], … … 501 524 502 525 /* header with the l states */ 503 fprintf(ioQQQ," n\\l=> ");526 fprintf(ioQQQ," n\\l=> "); 504 527 for( i =0; i < nResolved; ++i) 505 528 { 506 fprintf(ioQQQ,"%2ld ",i);529 fprintf(ioQQQ,"%2ld ",i); 507 530 } 508 531 fprintf(ioQQQ,"\n"); … … 514 537 continue; 515 538 516 fprintf(ioQQQ," %2ld ",in);539 fprintf(ioQQQ," %2ld ",in); 517 540 518 541 for( il = 0; il < in; ++il) … … 520 543 if( ipISO==ipHE_LIKE && (in==2) && (il==1) && (is==3) ) 521 544 { 522 fprintf( ioQQQ, PrintEfmt("%9.2e", ITEM_TO_PRINT(ipHe2p3P0) ));523 fprintf( ioQQQ, PrintEfmt("%9.2e", ITEM_TO_PRINT(ipHe2p3P1) ));524 fprintf( ioQQQ, PrintEfmt("%9.2e", ITEM_TO_PRINT(ipHe2p3P2) ));545 fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipHe2p3P0) ); 546 fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipHe2p3P1) ); 547 fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipHe2p3P2) ); 525 548 } 526 549 else 527 550 { 528 551 ipLo = iso.QuantumNumbers2Index[ipISO][nelem][in][il][is]; 529 fprintf( ioQQQ, PrintEfmt("%9.2e", ITEM_TO_PRINT(ipLo) ));552 fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(ipLo) ); 530 553 } 531 554 } … … 538 561 in = StatesElem[ipISO][nelem][il].n; 539 562 /* prin quan number of collapsed levels */ 540 fprintf(ioQQQ," %2ld ",in);541 fprintf( ioQQQ, PrintEfmt("%9.2e", ITEM_TO_PRINT(il) ));563 fprintf(ioQQQ," %2ld ",in); 564 fprintf( ioQQQ, "%9.3e ", ITEM_TO_PRINT(il) ); 542 565 fprintf(ioQQQ,"\n"); 543 566 } … … 589 612 return; 590 613 } 591 592 593 /*lint +e662 creation of out of bound pointer */594 /*lint +e661 creation of out of bound pointer */
