cloudy trunk
|
00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 /*lines_hydro put H-like iso sequence into line intensity stack */ 00004 #include "cddefines.h" 00005 #include "atmdat.h" 00006 #include "dense.h" 00007 #include "hydrogenic.h" 00008 #include "iso.h" 00009 #include "rfield.h" 00010 #include "geometry.h" 00011 #include "lines.h" 00012 #include "lines_service.h" 00013 #include "phycon.h" 00014 #include "radius.h" 00015 #include "secondaries.h" 00016 #include "taulines.h" 00017 #include "trace.h" 00018 00019 void lines_hydro(void) 00020 { 00021 long ipISO = ipH_LIKE; 00022 long int i, nelem, ipHi, ipLo; 00023 char chLabel[5]=" "; 00024 00025 double hbetab, 00026 em , 00027 pump , 00028 caseb; 00029 00030 DEBUG_ENTRY( "lines_hydro()" ); 00031 00032 if( trace.lgTrace ) 00033 { 00034 fprintf( ioQQQ, " lines_hydro called\n" ); 00035 } 00036 00037 i = StuffComment( "H-like iso-sequence" ); 00038 linadd( 0., (realnum)i , "####", 'i', 00039 " start H -like iso sequence "); 00040 00041 linadd(MAX2(0.,iso.xLineTotCool[ipH_LIKE][ipHYDROGEN]),912,"Clin",'c', 00042 " total collisional cooling due to all hydrogen lines "); 00043 00044 linadd(MAX2(0.,-iso.xLineTotCool[ipH_LIKE][ipHYDROGEN]),912,"Hlin",'h' , 00045 " total collisional heating due to all hydrogen lines "); 00046 /*fprintf(ioQQQ," debugg\t%.2e\t%.2e\t%.2e\n", 00047 radius.drad, 00048 iso.xLineTotCool[ipH_LIKE][ipHYDROGEN] , 00049 iso.cLya_cool[ipH_LIKE][ipHYDROGEN]);*/ 00050 00051 /* >>chng 95 jun 25 changed from info to cooling to pick this up in primal.in */ 00052 linadd(MAX2(0.,iso.cLya_cool[ipH_LIKE][ipHYDROGEN]),1216,"Cool",'i', 00053 "collisionally excited La cooling "); 00054 00055 linadd(MAX2(0.,-iso.cLya_cool[ipH_LIKE][ipHYDROGEN]),1216,"Heat",'i', 00056 " collisionally de-excited La heating "); 00057 00058 linadd(MAX2(0.,iso.cLyrest_cool[ipH_LIKE][ipHYDROGEN]),960,"Crst",'i', 00059 " cooling due to n>2 Lyman lines "); 00060 00061 linadd(MAX2(0.,-iso.cLyrest_cool[ipH_LIKE][ipHYDROGEN]),960,"Hrst",'i', 00062 " heating due to n>2 Lyman lines "); 00063 00064 linadd(MAX2(0.,iso.cBal_cool[ipH_LIKE][ipHYDROGEN]),4861,"Crst",'i', 00065 " cooling due to n>3 Balmer lines "); 00066 00067 linadd(MAX2(0.,-iso.cBal_cool[ipH_LIKE][ipHYDROGEN]),4861,"Hrst",'i', 00068 " heating due to n>3 Balmer lines "); 00069 00070 linadd(MAX2(0.,iso.cRest_cool[ipH_LIKE][ipHYDROGEN]),0,"Crst",'i', 00071 " cooling due to higher Paschen lines "); 00072 00073 linadd(MAX2(0.,-iso.cRest_cool[ipH_LIKE][ipHYDROGEN]),0,"Hrst",'i', 00074 " heating due to higher Paschen lines "); 00075 00076 /* remember largest fractional ionization of H due to secondaries */ 00077 secondaries.SecHIonMax = MAX2( secondaries.SecHIonMax , secondaries.sec2total ); 00078 00079 /* remember fraction of H ionizations due to ct */ 00080 atmdat.HIonFracMax = MAX2( atmdat.HIonFracMax, atmdat.HIonFrac); 00081 00082 /* remember largest fraction of thermal collisional ionization of H ground state */ 00083 hydro.HCollIonMax = 00084 (realnum)MAX2( hydro.HCollIonMax , hydro.H_ion_frac_collis ); 00085 00086 linadd(secondaries.x12tot*dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH1s].Pop*1.634e-11,1216,"LA X" ,'i', 00087 "Lyaa contribution from suprathermal secondaries from ground "); 00088 00089 /* factor of 0.4836 is ratio of A(4-2)/(A(4-3)+A(4-2)) 00090 * the IPLNPUMP is the actual pumping rate per atom */ 00091 /* H-beta produced by continuum pumping in optically thin ld limit */ 00092 pump = (double)(Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH1s].Emis->pump*StatesElem[ipH_LIKE][ipHYDROGEN][ipH1s].Pop* 00093 dense.xIonDense[ipHYDROGEN][1]*4.09e-12*0.4836); 00094 linadd(pump,4861,"Pump",'r', 00095 "part of Hbeta formed by continuum pumping"); 00096 00097 linadd(MAX2(0.,iso.coll_ion[ipH_LIKE][ipHYDROGEN]),0,"CION",'c', 00098 "collision ionization cooling of hydrogen "); 00099 00100 linadd(MAX2(-iso.coll_ion[ipH_LIKE][ipHYDROGEN],0.),0,"3bHt",'h', 00101 " this is the heating due to 3-body recombination "); 00102 00103 fixit(); //why is there a zero here? 00104 linadd(dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH2p].Pop*0.*iso.pestrk[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s]*1.634e-11,1216,"Strk",'i', 00105 " Stark broadening contribution to line "); 00106 00107 linadd(dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH3s].Pop*iso.pestrk[ipH_LIKE][ipHYDROGEN][ipH3s][ipH2p]*3.025e-12, 00108 6563,"Strk",'i', 00109 " Stark broadening contribution to line "); 00110 00111 linadd(dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH4s].Pop*iso.pestrk[ipH_LIKE][ipHYDROGEN][ipH4s][ipH2p]*4.084e-12, 00112 4861,"Strk",'i', 00113 "Stark broadening contribution to line "); 00114 00115 linadd(dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH4p].Pop*iso.pestrk[ipH_LIKE][ipHYDROGEN][ipH4p][ipH3s]*1.059e-12, 00116 18751,"Strk",'i', 00117 " Stark broadening contribution to line "); 00118 00119 /* pestrk[5,4] is A[4,5]*pest[4,5] 00120 * Stark broadening contribution to line */ 00121 /* 06 aug 28, from numLevels_max to _local. */ 00122 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00123 if( iso.numLevels_max[ipH_LIKE][ipHYDROGEN] > 5 ) 00124 linadd(dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH5p].Pop*iso.pestrk[ipH_LIKE][ipHYDROGEN][ipH5p][ipH4s]*4.900e-13,40512,"Strk",'i', 00125 "Stark broadening part of line"); 00126 00127 /* this can fail if RT_line_all never updates the ots rates, a logic error, 00128 * but only assert this during actual calculation (ipass>0), */ 00129 ASSERT( LineSave.ipass <1 || 00130 Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].Emis->ots>= 0.); 00131 00132 linadd(Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].Emis->ots*Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].EnergyErg, 1216,"Dest",'i', 00133 " portion of line lost due to absorp by background opacity "); 00134 00135 /* portion of line lost due to absorb by background opacity */ 00136 /* 06 aug 28, from numLevels_max to _local. */ 00137 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00138 if( iso.numLevels_max[ipH_LIKE][ipHYDROGEN] > ipH3p ) 00139 linadd(Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH2s].Emis->ots*Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH2s].EnergyErg, 6563,"Dest",'i', 00140 "Ha destroyed by background opacity"); 00141 00142 /* portion of line lost due to absorp by background opacity */ 00143 /* 06 aug 28, from numLevels_max to _local. */ 00144 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00145 if( iso.numLevels_max[ipH_LIKE][ipHYDROGEN] > ipH5p ) 00146 linadd(Transitions[ipH_LIKE][ipHYDROGEN][ipH5p][ipH4s].Emis->ots*Transitions[ipH_LIKE][ipHYDROGEN][ipH5p][ipH4s].EnergyErg,40516, "Dest",'i', 00147 "portion of line lost due to absorb by background opacity"); 00148 00149 /* portion of line lost due to absorb by background opacity */ 00150 /* 06 aug 28, from numLevels_max to _local. */ 00151 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00152 if( iso.numLevels_max[ipH_LIKE][ipHYDROGEN] > ipH4p ) 00153 linadd(Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH2s].Emis->ots*Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH2s].EnergyErg, 4861,"Dest",'i', 00154 "portion of line lost due to absorb by background opacity"); 00155 00156 /* portion of line lost due to absorb by background opacity */ 00157 /* 06 aug 28, from numLevels_max to _local. */ 00158 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00159 if( iso.numLevels_max[ipH_LIKE][ipHYDROGEN] > ipH4p ) 00160 linadd(Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH3s].Emis->ots*Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH3s].EnergyErg ,18751, "Dest",'i', 00161 "portion of line lost due to absorb by background opacity"); 00162 00163 linadd(StatesElem[ipH_LIKE][ipHYDROGEN][ipH2p].Pop*dense.xIonDense[ipHYDROGEN][1]*Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].Emis->Aul* 00164 hydro.dstfe2lya*Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].EnergyErg , 1216 , "Fe 2" , 'i', 00165 "Ly-alpha destroyed by overlap with FeII " ); 00166 00167 linadd(iso.RadRec_caseB[ipH_LIKE][ipHYDROGEN]*dense.xIonDense[ipHYDROGEN][1]*dense.eden * 1.64e-11,1216,"Ca B",'i', 00168 " simple high-density case b intensity of Ly-alpha, no two photon "); 00169 00170 /* H-beta computed from Q(H) and specified covering factor */ 00171 if( nzone == 1 ) 00172 { 00173 /* evaluate the case b emissivity by interpolating on the hummer & storey tables */ 00174 caseb = rfield.qhtot* 00175 atmdat_HS_caseB( 4 , 2 , 1 , phycon.te , dense.eden, 'b' ) / iso.RadRec_caseB[ipH_LIKE][ipHYDROGEN]; 00176 /* the atmdat_HS_caseB returned -1 if the physical conditions were outside range of validity. 00177 * In this case use simple approximation with no temperature or density dependence */ 00178 if( caseb < 0 ) 00179 { 00180 caseb = rfield.qhtot*4.75e-13; 00181 } 00182 LineSv[LineSave.nsum].sumlin[LineSave.lgLineEmergent] = 0.; 00183 } 00184 else 00185 { 00186 caseb = 0.; 00187 } 00188 /* >>chng 02 nov 05, better approximation for Lya for temperature of first zone */ 00189 /* H-beta computed from Q(H) and specified covering factor */ 00190 linadd( caseb/radius.dVeff*geometry.covgeo , 4861 , "Q(H)" , 'i' , 00191 "Case B H-beta computed from Q(H) and specified covering factor"); 00192 00193 if( nzone == 1 ) 00194 { 00195 caseb = rfield.qhtot*Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].EnergyErg; 00196 LineSv[LineSave.nsum].sumlin[LineSave.lgLineEmergent] = 0.; 00197 } 00198 else 00199 { 00200 caseb = 0.; 00201 } 00202 /* >>chng 02 nov 05, better approximation for Lya for temperature of first zone */ 00203 linadd( caseb/radius.dVeff*geometry.covgeo , 1216 , "Q(H)" , 'i', 00204 "Ly-alpha from Q(H), high-dens lim, specified covering factor" ); 00205 00206 /* this is the main printout, where line intensities are entered into the stack */ 00207 for( nelem=ipISO; nelem < LIMELM; nelem++ ) 00208 { 00209 if( dense.lgElmtOn[nelem] ) 00210 { 00211 for( ipHi=1; ipHi < iso.numLevels_max[ipISO][nelem]; ipHi++ ) 00212 { 00213 for( ipLo=0; ipLo < ipHi; ipLo++ ) 00214 { 00215 if( Transitions[ipISO][nelem][ipHi][ipLo].Emis->Aul <= iso.SmallA ) 00216 continue; 00217 00218 /* this is in real units not emissivity*/ 00219 Transitions[ipISO][nelem][ipHi][ipLo].Emis->phots = 00220 Transitions[ipISO][nelem][ipHi][ipLo].Emis->Aul* 00221 StatesElem[ipISO][nelem][ipHi].Pop* 00222 Transitions[ipISO][nelem][ipHi][ipLo].Emis->Pesc* 00223 dense.xIonDense[nelem][nelem+1-ipISO]; 00224 00225 /* now find line intensity */ 00226 Transitions[ipISO][nelem][ipHi][ipLo].Emis->xIntensity = 00227 Transitions[ipISO][nelem][ipHi][ipLo].Emis->phots* 00228 Transitions[ipISO][nelem][ipHi][ipLo].EnergyErg; 00229 } 00230 } 00231 } 00232 } 00233 00234 /* create emissivity or intensity for hydrogenic species, 00235 * first combine/bring balmer series together */ 00236 for( nelem=0; nelem < LIMELM; nelem++ ) 00237 { 00238 if( dense.IonHigh[nelem] == nelem + 1 ) 00239 { 00240 /* bring nL - n'L' emission together as n-n' emission. */ 00241 for( ipHi=3; ipHi < iso.numLevels_max[ipH_LIKE][nelem]; ipHi++ ) 00242 { 00243 long index_of_nHi_P; 00244 00245 /* is ipHi is collapsed level, index_of_nHi_P is ipHi */ 00246 if( N_(ipHi) > iso.n_HighestResolved_max[ipH_LIKE][nelem] ) 00247 index_of_nHi_P = ipHi; 00248 else 00249 index_of_nHi_P = iso.QuantumNumbers2Index[ipH_LIKE][nelem][ N_(ipHi) ][1][2]; 00250 00251 /* only need to consider resolved lower level here */ 00252 for( ipLo=0; ipLo < ipHi; ipLo++ ) 00253 { 00254 long index_of_nLo_S = iso.QuantumNumbers2Index[ipH_LIKE][nelem][ N_(ipLo) ][0][2]; 00255 00256 /* jump out if ipLo is collapsed 00257 * NB this must be up to n_HighestResolved_local and not n_HighestResolved_max */ 00258 if( N_(ipLo) > iso.n_HighestResolved_local[ipH_LIKE][nelem] || N_(ipLo) == N_(ipHi) ) 00259 break; 00260 00261 if( Transitions[ipH_LIKE][nelem][ipHi][ipLo].Emis->Aul <= iso.SmallA ) 00262 continue; 00263 00264 /* add everything into nP - n'S, skip if current indices are those levels. */ 00265 if( ipHi == index_of_nHi_P && ipLo == index_of_nLo_S ) 00266 continue; 00267 else 00268 { 00269 /* add resolved line to nP - n'S */ 00270 Transitions[ipH_LIKE][nelem][index_of_nHi_P][index_of_nLo_S].Emis->xIntensity += 00271 Transitions[ipH_LIKE][nelem][ipHi][ipLo].Emis->xIntensity; 00272 /* kill the resolved line */ 00273 Transitions[ipH_LIKE][nelem][ipHi][ipLo].Emis->xIntensity = 0.; 00274 //ASSERT( Transitions[ipH_LIKE][nelem][index_of_nHi_P][index_of_nLo_S].Emis->xIntensity > 0. ); 00275 } 00276 } 00277 } 00278 } 00279 } 00280 00281 /* H beta recombination, assuming old case B */ 00282 hbetab = (double)((pow(10.,-20.89 - 0.10612*POW2(phycon.alogte - 4.4)))/ 00283 phycon.te); 00284 /* need to pass this assert if CaBo is to have valid array indices for ipCont */ 00285 /* 06 aug 28, from numLevels_max to _local. */ 00286 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00287 ASSERT( iso.numLevels_max[ipH_LIKE][ipHYDROGEN] > 4 ); 00288 hbetab *= dense.xIonDense[ipHYDROGEN][1]*dense.eden; 00289 00290 lindst(hbetab,4861,"CaBo",Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH2s].ipCont,'i',false, 00291 " this is old case b, had been in code for very long time"); 00292 00293 if( dense.lgElmtOn[ipHELIUM] ) 00294 { 00295 /* need to pass this assert if CaBo is to have valid array indices for ipCont */ 00296 /* 06 aug 28, from numLevels_max to _local. */ 00297 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00298 ASSERT( iso.numLevels_max[ipH_LIKE][ipHELIUM] > 4 ); 00299 /* 1640 1640 1640 */ 00300 em = 2.03e-20/(phycon.te70*phycon.te10*phycon.te03); 00301 em *= dense.xIonDense[ipHELIUM][2]*dense.eden; 00302 00303 lindst(em,1640,"CaBo",Transitions[ipH_LIKE][ipHELIUM][ipH3p][ipH2s].ipCont,'i',false, 00304 " old prediction of He II 1640, case B at low densities"); 00305 00306 /* hydrogenic helium */ 00307 /* old prediction of He II 4686, case B */ 00308 em = 2.52e-20/(pow(phycon.te,1.05881)); 00309 em *= dense.xIonDense[ipHELIUM][2]*dense.eden; 00310 00311 lindst(em,4686,"CaBo",Transitions[ipH_LIKE][ipHELIUM][ipH4p][ipH3s].ipCont,'i',false, 00312 " "); 00313 } 00314 00315 /* predict case b intensities of hydrogen lines */ 00316 00317 if( LineSave.ipass <= 0 ) 00318 { 00319 for(nelem=0; nelem<HS_NZ; ++nelem ) 00320 { 00321 atmdat.lgHCaseBOK[0][nelem] = true; 00322 atmdat.lgHCaseBOK[1][nelem] = true; 00323 } 00324 } 00325 /* this is the main printout, where line intensities are entered into the stack */ 00326 for( nelem=0; nelem < LIMELM; nelem++ ) 00327 { 00328 if( dense.lgElmtOn[nelem] ) 00329 { 00330 /* HS_NZ is limit to charge of elements in HS predictions, now 8 == oxygen */ 00331 /* but don't do the minor elements - these were not read in and so should not be 00332 * printed - remove equivalent if statement in createdata to read them in */ 00333 if( nelem < HS_NZ && (nelem<2 || nelem>4) ) 00334 { 00335 int iCase; 00336 for( iCase=0; iCase<2; ++iCase ) 00337 { 00338 char chAB[2]={'A','B'}; 00339 char chLab[5]="Ca "; 00340 00341 /* adding iCase means start from n=1 for case A, n=2 for Case B, 00342 * note that principal quantum number is on physics scale, not C */ 00343 /* 06 aug 28, both of these from numLevels_max to _local. */ 00344 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00345 for( ipLo=1+iCase; ipLo<MIN2(10,iso.n_HighestResolved_max[ipH_LIKE][nelem] + iso.nCollapsed_max[ipH_LIKE][nelem]); ++ipLo ) 00346 { 00347 for( ipHi=ipLo+1; ipHi< MIN2(25,iso.n_HighestResolved_max[ipH_LIKE][nelem] + iso.nCollapsed_max[ipH_LIKE][nelem]+1); ++ipHi ) 00348 { 00349 realnum wl; 00350 double case_b_Intensity; 00351 long int ipCHi , ipCLo; 00352 /* Put case b predictions into line stack 00353 * NB NB NB each Hummer & Storey case b line must be 00354 * explicitly clobbered by hand in routine final if 00355 * atmdat.lgHCaseBOK[iCase][nelem] flag is set false 00356 * since this indicates that we exceeded bounds of table, 00357 * DO NOT want to print lines in that case */ 00358 00359 /* first do case b emissivity of balmer lines */ 00360 00361 /* get HS predictions */ 00362 case_b_Intensity = atmdat_HS_caseB( ipHi,ipLo , nelem+1, phycon.te , dense.eden, chAB[iCase] ); 00363 if( case_b_Intensity<=0. ) 00364 { 00365 atmdat.lgHCaseBOK[iCase][nelem] = false; 00366 case_b_Intensity = 0.; 00367 } 00368 00369 case_b_Intensity *= dense.xIonDense[nelem][nelem+1-ipISO]*dense.eden; 00370 00371 if( iCase==0 && ipLo==1 ) 00372 { 00373 /* get physical scal prin quant numbers onto cloudy c scale */ 00374 ipCHi = ipHi; 00375 ipCLo = 0; 00376 } 00377 else 00378 { 00379 /* get physical scal prin quant numbers onto cloudy c scale */ 00380 ipCHi = ipHi; 00381 ipCLo = ipLo; 00382 } 00383 00384 /* make label either Ca A or Ca B */ 00385 chLab[3] = chAB[iCase]; 00386 00387 /* new treatment is different from old for indices greater than 2. */ 00388 if( ipCHi > 2 ) 00389 { 00390 if( ipCLo > 2 ) 00391 { 00392 /* if both indices above two, just treat as nP to n'S transition. */ 00393 ipCHi = iso.QuantumNumbers2Index[ipH_LIKE][nelem][ipCHi][1][2]; 00394 ipCLo = iso.QuantumNumbers2Index[ipH_LIKE][nelem][ipCLo][0][2]; 00395 } 00396 else if( ipCLo == 2 ) 00397 { 00398 /* treat as nS to 2P transition. */ 00399 ipCHi = iso.QuantumNumbers2Index[ipH_LIKE][nelem][ipCHi][0][2]; 00400 } 00401 else if( ipCLo == 1 || ipCLo == 0 ) 00402 { 00403 /* treat as nP to n'S transition. */ 00404 ipCHi = iso.QuantumNumbers2Index[ipH_LIKE][nelem][ipCHi][1][2]; 00405 } 00406 } 00407 00408 /* this is wavelength of interpolated case b from HS tables */ 00409 wl = Transitions[ipH_LIKE][nelem][ipCHi][ipCLo].WLAng; 00410 atmdat.WaveLengthCaseB[nelem][ipHi][ipLo] = wl; 00411 00412 lindst(case_b_Intensity,wl,chLab,Transitions[ipH_LIKE][nelem][ipCHi][ipCLo].ipCont,'i',false, 00413 " case a or case b from Hummer & Storey tables" ); 00414 } 00415 } 00416 } 00417 } 00418 00419 /* NB NB - low and high must be in this order so that all balmer, paschen, 00420 * etc series line up correctly in final printout */ 00421 00422 /* >>chng 01 sep 10, do two-photon here */ 00423 if( LineSave.ipass == 0 ) 00424 { 00425 /* chIonLbl is function that generates a null terminated 4 char string, of form "C 2" 00426 * the result, chLable, is only used when ipass == 0, can be undefined otherwise */ 00427 /* two photon emission */ 00428 chIonLbl(chLabel, &Transitions[ipH_LIKE][nelem][ipH2s][ipH1s]); 00429 } 00430 linadd( Transitions[ipH_LIKE][nelem][ipH2s][ipH1s].Emis->xIntensity , 0,chLabel,'r', 00431 "two-photon emission"); 00432 00433 linadd( 00434 StatesElem[ipH_LIKE][nelem][ipH2s].Pop* 00435 dense.xIonDense[nelem][nelem+1-ipISO]* 00436 iso.TwoNu_induc_dn[ipH_LIKE][nelem]* 00437 Transitions[ipH_LIKE][nelem][ipH2s][ipH1s].EnergyErg, 00438 22, chLabel ,'i', 00439 "induced two-photon emission "); 00440 00441 /* 06 aug 28, from numLevels_max to _local. */ 00442 /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */ 00443 for( ipLo=ipH1s; ipLo < iso.numLevels_max[ipH_LIKE][nelem]-1; ipLo++ ) 00444 { 00445 /* don't bother with decays to 2p since we set them to zero above */ 00446 if( ipLo==ipH2p ) 00447 continue; 00448 00449 for( ipHi=ipLo+1; ipHi < iso.numPrintLevels[ipH_LIKE][nelem]; ipHi++ ) 00450 { 00451 /* skip the 2s-2p and two photon transitions */ 00452 /* >>chng 02 feb 10, had been explicit levels, change to general ipCont */ 00453 if( Transitions[ipH_LIKE][nelem][ipHi][ipLo].ipCont < 1 ) 00454 continue; 00455 00456 #if 0 00457 char chCommentTemp[23]; 00458 strcpy( chCommentTemp, StatesElem[ipH_LIKE][nelem][ipLo].chConfig ); 00459 strcat( chCommentTemp, " - " ); 00460 strcat( chCommentTemp, StatesElem[ipH_LIKE][nelem][ipHi].chConfig ); 00461 const char* chComment = chCommentTemp; 00462 PutLine(&Transitions[ipH_LIKE][nelem][ipHi][ipLo], chComment ); 00463 #else 00464 PutLine(&Transitions[ipH_LIKE][nelem][ipHi][ipLo], 00465 "predicted line, all processes included"); 00466 #endif 00467 00468 } 00469 } 00470 } 00471 } 00472 00473 if( trace.lgTrace ) 00474 { 00475 fprintf( ioQQQ, " lines_helium returns\n" ); 00476 } 00477 return; 00478 }