cloudy  trunk
prt_lines_hydro.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*lines_hydro put H-like iso sequence into line intensity stack */
4 #include "cddefines.h"
5 #include "atmdat.h"
6 #include "dense.h"
7 #include "prt.h"
8 #include "hydrogenic.h"
9 #include "iso.h"
10 #include "rfield.h"
11 #include "geometry.h"
12 #include "lines.h"
13 #include "lines_service.h"
14 #include "phycon.h"
15 #include "radius.h"
16 #include "secondaries.h"
17 #include "taulines.h"
18 #include "trace.h"
19 
20 void lines_hydro(void)
21 {
22  long ipISO = ipH_LIKE;
23  long int i, nelem, ipHi, ipLo;
24  char chLabel[5]=" ";
25 
26  double hbetab,
27  em ,
28  pump ,
29  caseb;
30 
31  DEBUG_ENTRY( "lines_hydro()" );
32 
33  if( trace.lgTrace )
34  fprintf( ioQQQ, " lines_hydro called\n" );
35 
36  // this can be changed with the atom levels command but must be at least 3
37  ASSERT( iso_sp[ipH_LIKE][ipHYDROGEN].n_HighestResolved_max >= 3 );
38  ASSERT( iso_sp[ipH_LIKE][ipHELIUM].n_HighestResolved_max >= 3 );
39 
40  i = StuffComment( "H-like iso-sequence" );
41  linadd( 0., (realnum)i , "####", 'i',
42  " start H -like iso sequence ");
43 
44  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHYDROGEN].xLineTotCool),0,"H1 c",'c',
45  " total collisional cooling due to all hydrogen lines ");
46 
47  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHYDROGEN].xLineTotCool),0,"H1 h",'h' ,
48  " total collisional heating due to all hydrogen lines ");
49 
50  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHELIUM].xLineTotCool),0,"He2c",'c',
51  " total collisional cooling due to all HeII lines ");
52 
53  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHELIUM].xLineTotCool),0,"He2h",'h' ,
54  " total collisional heating due to all HeII lines ");
55 
56  /*fprintf(ioQQQ," debugg\t%.2e\t%.2e\t%.2e\n",
57  radius.drad,
58  iso_sp[ipH_LIKE][ipHYDROGEN].xLineTotCool ,
59  iso_sp[ipH_LIKE][ipHYDROGEN].cLya_cool);*/
60 
61  /* >>chng 95 jun 25 changed from info to cooling to pick this up in primal.in */
62  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHYDROGEN].cLya_cool),1216,"Cool",'i',
63  "collisionally excited La cooling ");
64 
65  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHYDROGEN].cLya_cool),1216,"Heat",'i',
66  " collisionally de-excited La heating ");
67 
68  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHYDROGEN].cLyrest_cool),960,"Crst",'i',
69  " cooling due to n>2 Lyman lines ");
70 
71  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHYDROGEN].cLyrest_cool),960,"Hrst",'i',
72  " heating due to n>2 Lyman lines ");
73 
74  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHYDROGEN].cBal_cool),4861,"Crst",'i',
75  " cooling due to n>3 Balmer lines ");
76 
77  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHYDROGEN].cBal_cool),4861,"Hrst",'i',
78  " heating due to n>3 Balmer lines ");
79 
80  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHYDROGEN].cRest_cool),0,"Crst",'i',
81  " cooling due to higher Paschen lines ");
82 
83  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHYDROGEN].cRest_cool),0,"Hrst",'i',
84  " heating due to higher Paschen lines ");
85 
86  /* remember largest fractional ionization of H due to secondaries */
88 
89  /* remember fraction of H ionizations due to ct */
91 
92  /* remember largest fraction of thermal collisional ionization of H ground state */
95 
96  linadd(secondaries.x12tot*iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH1s].Pop()*1.634e-11,1216,"LA X" ,'i',
97  "Lyaa contribution from suprathermal secondaries from ground ");
98 
99  /* factor of 0.4836 is ratio of A(4-2)/(A(4-3)+A(4-2))
100  * the IPLNPUMP is the actual pumping rate per atom */
101  /* H-beta produced by continuum pumping in optically thin ld limit */
102  pump = (double)(iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH4p,ipH1s).Emis().pump()*iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH1s].Pop()*4.09e-12*0.4836);
103  linadd(pump,4861,"Pump",'r',
104  "part of Hbeta formed by continuum pumping");
105 
106  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHYDROGEN].coll_ion),0,"CION",'c',
107  "collision ionization cooling of hydrogen ");
108 
109  linadd(MAX2(-iso_sp[ipH_LIKE][ipHYDROGEN].coll_ion,0.),0,"3bHt",'h',
110  " this is the heating due to 3-body recombination ");
111 
112  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHELIUM].coll_ion),0,"He2C",'c',
113  "collision ionization cooling of He+ ");
114 
115  linadd(MAX2(-iso_sp[ipH_LIKE][ipHELIUM].coll_ion,0.),0,"He2H",'h',
116  " this is the heating due to 3-body recombination onto He+");
117 
118  fixit(); //why is there a zero here?
119  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH2p].Pop()*0.*iso_sp[ipH_LIKE][ipHYDROGEN].ex[ipH2p][ipH1s].pestrk*1.634e-11,1216,"Strk",'i',
120  " Stark broadening contribution to line ");
121 
122  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH3s].Pop()*iso_sp[ipH_LIKE][ipHYDROGEN].ex[ipH3s][ipH2p].pestrk*3.025e-12,
123  6563,"Strk",'i',
124  " Stark broadening contribution to line ");
125 
126  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH4s].Pop()*iso_sp[ipH_LIKE][ipHYDROGEN].ex[ipH4s][ipH2p].pestrk*4.084e-12,
127  4861,"Strk",'i',
128  "Stark broadening contribution to line ");
129 
130  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH4p].Pop()*iso_sp[ipH_LIKE][ipHYDROGEN].ex[ipH4p][ipH3s].pestrk*1.059e-12,
131  18751,"Strk",'i',
132  " Stark broadening contribution to line ");
133 
134  /* pestrk[5,4] is A[4,5]*pest[4,5]
135  * Stark broadening contribution to line */
136  if( iso_sp[ipH_LIKE][ipHYDROGEN].n_HighestResolved_max >= 5 )
137  {
138  long ip5p = iso_sp[ipH_LIKE][ipHYDROGEN].QuantumNumbers2Index[5][1][2];
139  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].st[ip5p].Pop()*iso_sp[ipH_LIKE][ipHYDROGEN].ex[ip5p][ipH4s].pestrk*4.900e-13,40512,"Strk",'i',
140  "Stark broadening part of line");
141  }
142  /* this can fail if RT_line_all never updates the ots rates, a logic error,
143  * but only assert this during actual calculation (ipass>0), */
144  ASSERT( LineSave.ipass <1 ||
146 
147  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH2p,ipH1s).Emis().ots()*iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH2p,ipH1s).EnergyErg(), 1216,"Dest",'i',
148  " portion of line lost due to absorp by background opacity ");
149 
150  /* portion of line lost due to absorb by background opacity */
151  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH3p,ipH2s).Emis().ots()*iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH3p,ipH2s).EnergyErg(), 6563,"Dest",'i',
152  "Ha destroyed by background opacity");
153 
154  /* portion of line lost due to absorp by background opacity */
155  if( iso_sp[ipH_LIKE][ipHYDROGEN].n_HighestResolved_max >= 5 )
156  {
157  long ip5p = iso_sp[ipH_LIKE][ipHYDROGEN].QuantumNumbers2Index[5][1][2];
158  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].trans(ip5p,ipH4s).Emis().ots()*iso_sp[ipH_LIKE][ipHYDROGEN].trans(ip5p,ipH4s).EnergyErg(),40516, "Dest",'i',
159  "portion of line lost due to absorb by background opacity");
160  }
161 
162  /* portion of line lost due to absorb by background opacity */
163  if( iso_sp[ipH_LIKE][ipHYDROGEN].numLevels_max > ipH4p )
164  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH4p,ipH2s).Emis().ots()*iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH4p,ipH2s).EnergyErg(), 4861,"Dest",'i',
165  "portion of line lost due to absorb by background opacity");
166 
167  /* portion of line lost due to absorb by background opacity */
168  if( iso_sp[ipH_LIKE][ipHYDROGEN].numLevels_max > ipH4p )
169  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH4p,ipH3s).Emis().ots()*iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH4p,ipH3s).EnergyErg() ,18751, "Dest",'i',
170  "portion of line lost due to absorb by background opacity");
171 
172  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].st[ipH2p].Pop()*iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH2p,ipH1s).Emis().Aul()*
173  hydro.dstfe2lya*iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH2p,ipH1s).EnergyErg() , 1216 , "Fe 2" , 'i',
174  "Ly-alpha destroyed by overlap with FeII " );
175 
176  linadd(iso_sp[ipH_LIKE][ipHYDROGEN].RadRec_caseB*dense.xIonDense[ipHYDROGEN][1]*dense.eden * 1.64e-11,1216,"Ca B",'i',
177  " simple high-density case b intensity of Ly-alpha, no two photon ");
178 
179  /* these entries only work correctly if the APERTURE command is not in effect */
180  if( geometry.iEmissPower == 2 )
181  {
182  /* H-beta computed from Q(H) and specified covering factor */
183  if( nzone == 1 )
184  {
185  /* evaluate the case b emissivity by interpolating on the hummer & storey tables */
186  caseb = rfield.qhtot*
188  /* the atmdat_HS_caseB returned -1 if the physical conditions were outside range of validity.
189  * In this case use simple approximation with no temperature or density dependence */
190  if( caseb < 0 )
191  {
192  caseb = rfield.qhtot*4.75e-13;
193  }
194  LineSv[LineSave.nsum].SumLine[0] = 0.;
195  LineSv[LineSave.nsum].SumLine[1] = 0.;
196  }
197  else
198  {
199  caseb = 0.;
200  }
201  /* H-beta computed from Q(H) and specified covering factor */
202  linadd( caseb/radius.dVeffAper*geometry.covgeo , 4861 , "Q(H)" , 'i' ,
203  "Case B H-beta computed from Q(H) and specified covering factor");
204 
205  if( nzone == 1 )
206  {
207  // the cast to double prevents an FPE with Solaris Studio 12.4 (limit_compton_hi_t.in)
208  caseb = rfield.qhtot*double(iso_sp[ipH_LIKE][ipHYDROGEN].trans(ipH2p,ipH1s).EnergyErg());
209  LineSv[LineSave.nsum].SumLine[0] = 0.;
210  LineSv[LineSave.nsum].SumLine[1] = 0.;
211  }
212  else
213  {
214  caseb = 0.;
215  }
216  /* >>chng 02 nov 05, better approximation for Lya for temperature of first zone */
217  linadd( caseb/radius.dVeffAper*geometry.covgeo , 1216 , "Q(H)" , 'i',
218  "Ly-alpha from Q(H), high-dens lim, specified covering factor" );
219  }
220 
221  /* this is the main printout, where line intensities are entered into the stack */
222  for( nelem=ipISO; nelem < LIMELM; nelem++ )
223  {
224  if( dense.lgElmtOn[nelem] )
225  {
226  ASSERT( iso_sp[ipH_LIKE][nelem].n_HighestResolved_max >= 3 );
227 
228  for( ipHi=1; ipHi < iso_sp[ipISO][nelem].numLevels_max; ipHi++ )
229  {
230  for( ipLo=0; ipLo < ipHi; ipLo++ )
231  {
232  if( iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul() <= iso_ctrl.SmallA )
233  continue;
234 
235  /* this is in real units not emissivity*/
236  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().phots() =
237  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul()*
238  iso_sp[ipISO][nelem].st[ipHi].Pop()*
239  (iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Pesc() +
240  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Pelec_esc() );
241 
242  /* now find line intensity */
243  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().xIntensity() =
244  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().phots()*
245  iso_sp[ipISO][nelem].trans(ipHi,ipLo).EnergyErg();
246  }
247  }
248  }
249  }
250 
251  /* create emissivity or intensity for hydrogenic species,
252  * first combine/bring balmer series together */
253  for( nelem=0; nelem < LIMELM; nelem++ )
254  {
255  if( dense.IonHigh[nelem] == nelem + 1 )
256  {
257  /* bring nL - n'L' emission together as n-n' emission. */
258  for( ipHi=1; ipHi < iso_sp[ipH_LIKE][nelem].numLevels_max; ipHi++ )
259  {
260  long index_of_nHi_P;
261 
262  /* is ipHi is collapsed level, index_of_nHi_P is ipHi */
263  if( N_(ipHi) > iso_sp[ipH_LIKE][nelem].n_HighestResolved_max )
264  index_of_nHi_P = ipHi;
265  else
266  index_of_nHi_P = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ N_(ipHi) ][1][2];
267 
268  /* only need to consider resolved lower level here */
269  for( ipLo=0; ipLo < ipHi; ipLo++ )
270  {
271  long index_of_nLo_S = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ N_(ipLo) ][0][2];
272 
273  /* jump out if ipLo is collapsed
274  * NB this must be up to n_HighestResolved_local and not n_HighestResolved_max */
275  if( N_(ipLo) > iso_sp[ipH_LIKE][nelem].n_HighestResolved_local || N_(ipLo) == N_(ipHi) )
276  break;
277 
278  if( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().Aul() <= iso_ctrl.SmallA )
279  continue;
280 
281  /* add everything into nP - n'S, skip if current indices are those levels. */
282  if( ipHi == index_of_nHi_P && ipLo == index_of_nLo_S )
283  continue;
284  else
285  {
286  /* add resolved line to nP - n'S */
287  iso_sp[ipH_LIKE][nelem].trans(index_of_nHi_P,index_of_nLo_S).Emis().xIntensity() +=
288  iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().xIntensity();
289  /* zero out the resolved line */
290  iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().xIntensity() = 0;
291  //ASSERT( iso_sp[ipH_LIKE][nelem].trans(index_of_nHi_P,index_of_nLo_S).Emis().xIntensity() > 0. );
292  }
293  }
294  }
295  }
296  }
297 
298  /* H beta recombination, assuming old case B */
299  hbetab = (double)((pow(10.,-20.89 - 0.10612*POW2(phycon.alogte - 4.4)))/
300  phycon.te);
301  /* need to pass this assert if CaBo is to have valid array indices for ipCont */
302  /* 06 aug 28, from numLevels_max to _local. */
303  /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */
304  ASSERT( iso_sp[ipH_LIKE][ipHYDROGEN].numLevels_max > 4 );
305  hbetab *= dense.xIonDense[ipHYDROGEN][1]*dense.eden;
306 
307  lindst(hbetab, -4861 ,"CaBo",
308  1 ,'i',false,
309  " this is old case b based on Ferland (1980) PASP ");
310 
311  if( dense.lgElmtOn[ipHELIUM] )
312  {
313  /* need to pass this assert if CaBo is to have valid array indices for ipCont */
314  /* 06 aug 28, from numLevels_max to _local. */
315  /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */
316  ASSERT( iso_sp[ipH_LIKE][ipHELIUM].numLevels_max > 4 );
317  /* 1640 1640 1640 */
318  em = 2.03e-20/(phycon.te70*phycon.te10*phycon.te03);
319  em *= dense.xIonDense[ipHELIUM][2]*dense.eden;
320 
321  lindst(em,-1640,"CaBo",
322  1,'i',false,
323  " old prediction of He II 1640, Case B at low densities");
324 
325  /* hydrogenic helium */
326  /* old prediction of He II 4686, case B */
327  em = 2.52e-20/(pow(phycon.te,1.05881));
328  em *= dense.xIonDense[ipHELIUM][2]*dense.eden;
329 
330  lindst(em,-4686,"CaBo", 1,'i',false,
331  " old prediction of He II 4686, Case B at low densities");
332  }
333 
334  /* predict case b intensities of hydrogen lines */
335  if( LineSave.ipass <= 0 )
336  {
337  for(nelem=0; nelem<HS_NZ; ++nelem )
338  {
339  atmdat.lgHCaseBOK[0][nelem] = true;
340  atmdat.lgHCaseBOK[1][nelem] = true;
341  }
342  }
343  /* this is the main printout, where line intensities are entered into the stack */
344  for( nelem=0; nelem < LIMELM; nelem++ )
345  {
346  if( dense.lgElmtOn[nelem] )
347  {
348  /* HS_NZ is limit to charge of elements in HS predictions, now 8 == oxygen */
349  /* but don't do the minor elements - these were not read in and so should not be
350  * printed - remove equivalent if statement in createdata to read them in */
351  if( nelem < HS_NZ && (nelem<2 || nelem>4) )
352  {
353  int iCase;
354  for( iCase=0; iCase<2; ++iCase )
355  {
356  char chAB[2]={'A','B'};
357  char chLab[5]="Ca ";
358 
359  /* adding iCase means start from n=1 for case A, n=2 for Case B,
360  * note that principal quantum number is on physics scale, not C */
361  /* 06 aug 28, both of these from numLevels_max to _local. */
362  /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */
363  for( ipLo=1+iCase; ipLo<MIN2(10,iso_sp[ipH_LIKE][nelem].n_HighestResolved_max + iso_sp[ipH_LIKE][nelem].nCollapsed_max); ++ipLo )
364  {
365  for( ipHi=ipLo+1; ipHi< MIN2(25,iso_sp[ipH_LIKE][nelem].n_HighestResolved_max + iso_sp[ipH_LIKE][nelem].nCollapsed_max+1); ++ipHi )
366  {
367  realnum wl;
368  double case_b_Intensity;
369  long int ipCHi , ipCLo;
370  /* Put case b predictions into line stack
371  * NB NB NB each Hummer & Storey case b line must be
372  * explicitly clobbered by hand in routine final if
373  * atmdat.lgHCaseBOK[iCase][nelem] flag is set false
374  * since this indicates that we exceeded bounds of table,
375  * DO NOT want to print lines in that case */
376 
377  /* first do case b emissivity of balmer lines */
378 
379  /* get HS predictions */
380  case_b_Intensity = atmdat_HS_caseB( ipHi,ipLo , nelem+1, phycon.te , dense.eden, chAB[iCase] );
381  if( case_b_Intensity<=0. )
382  {
383  atmdat.lgHCaseBOK[iCase][nelem] = false;
384  case_b_Intensity = 0.;
385  }
386 
387  case_b_Intensity *= dense.xIonDense[nelem][nelem+1-ipISO]*dense.eden;
388 
389  if( iCase==0 && ipLo==1 )
390  {
391  /* get physical scal prin quant numbers onto cloudy c scale */
392  ipCHi = ipHi;
393  ipCLo = 0;
394  }
395  else
396  {
397  /* get physical scal prin quant numbers onto cloudy c scale */
398  ipCHi = ipHi;
399  ipCLo = ipLo;
400  }
401 
402  /* make label either Ca A or Ca B */
403  chLab[3] = chAB[iCase];
404 
405  /* new treatment is different from old for indices greater than 2. */
406  if( ipCHi > 2 )
407  {
408  if( ipCLo > 2 )
409  {
410  /* if both indices above two, just treat as nP to n'S transition. */
411  ipCHi = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCHi][1][2];
412  ipCLo = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCLo][0][2];
413  }
414  else if( ipCLo == 2 )
415  {
416  /* treat as nS to 2P transition. */
417  ipCHi = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCHi][0][2];
418  }
419  else if( ipCLo == 1 || ipCLo == 0 )
420  {
421  /* treat as nP to n'S transition. */
422  ipCHi = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCHi][1][2];
423  }
424  }
425 
426  /* this is wavelength of interpolated case b from HS tables */
427  wl = iso_sp[ipH_LIKE][nelem].trans(ipCHi,ipCLo).WLAng();
428  atmdat.WaveLengthCaseB[nelem][ipHi][ipLo] = wl;
429 
430  lindst(case_b_Intensity,wl,chLab,iso_sp[ipH_LIKE][nelem].trans(ipCHi,ipCLo).ipCont(),'i',false,
431  " case a or case b from Hummer & Storey tables" );
432  }
433  }
434  }
435  }
436 
437  // add two-photon details here
438  if( LineSave.ipass == 0 )
439  {
440  /* chIonLbl is function that generates a null terminated 4 char string, of form "C 2"
441  * the result, chLable, is only used when ipass == 0, can be undefined otherwise */
442  chIonLbl(chLabel, nelem+1, nelem+1-ipISO);
443  }
444  for( vector<two_photon>::iterator tnu = iso_sp[ipH_LIKE][nelem].TwoNu.begin(); tnu != iso_sp[ipH_LIKE][nelem].TwoNu.end(); ++tnu )
445  {
446  fixit(); // This was multiplied by Pesc when treated as a line, now what? Only used for printout?
447  fixit(); // below should be 'i' instead of 'r' ?
448  linadd( tnu->AulTotal * tnu->E2nu * EN1RYD * (*tnu->Pop),
449  0, chLabel, 'r',
450  " two photon continuum ");
451 
452  linadd( tnu->induc_dn * tnu->E2nu * EN1RYD * (*tnu->Pop),
453  22, chLabel ,'i',
454  " induced two photon emission ");
455  }
456 
457  /* NB NB - low and high must be in this order so that all balmer, paschen,
458  * etc series line up correctly in final printout */
459  for( ipLo=ipH1s; ipLo < iso_sp[ipH_LIKE][nelem].numLevels_max-1; ipLo++ )
460  {
461  /* don't bother with decays to 2p since we set them to zero above */
462  if( ipLo==ipH2p )
463  continue;
464 
465  /* set number of levels we want to print, first is default,
466  * only print real levels, second is set with "print line
467  * iso collapsed" command */
468  long int nLoop = iso_sp[ipH_LIKE][nelem].numLevels_max - iso_sp[ipH_LIKE][nelem].nCollapsed_max;
469  if( prt.lgPrnIsoCollapsed )
470  nLoop = iso_sp[ipH_LIKE][nelem].numLevels_max;
471 
472  for( ipHi=ipLo+1; ipHi < nLoop; ipHi++ )
473  {
474  // skip non-radiative transitions
475  if( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).ipCont() < 1 )
476  continue;
477 
478  // skip 2s-1s, so that 2p-1s comes first and cdLine finds LyA instead of the M2 transition.
479  if( ipHi==1 && ipLo==0 )
480  continue;
481 
482  char chComment[23];
483  GenerateTransitionConfiguration( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo), chComment);
484  fixit(); // put chComment instead of the below, cant just punt chComment there.
485  PutLine(iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo),
486  "predicted line, all processes included");
487  }
488 
489  // now add 2s-1s M2 transition
490  if( ipLo==0 )
491  {
492  ipHi=1;
493  char chComment[23];
494  GenerateTransitionConfiguration( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo), chComment);
495  fixit(); // put chComment instead of the below, cant just punt chComment there.
496  PutLine(iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo),
497  "predicted line, all processes included");
498  }
499  }
500  }
501  }
502 
503  if( trace.lgTrace )
504  {
505  fprintf( ioQQQ, " lines_hydro returns\n" );
506  }
507  return;
508 }
TransitionProxy::EnergyErg
realnum EnergyErg() const
Definition: transition.h:78
lines.h
t_geometry::covgeo
realnum covgeo
Definition: geometry.h:35
t_dense::eden
double eden
Definition: dense.h:190
dense
t_dense dense
Definition: dense.cpp:24
t_secondaries::SecHIonMax
realnum SecHIonMax
Definition: secondaries.h:30
t_iso_sp::n_HighestResolved_max
long int n_HighestResolved_max
Definition: iso.h:505
secondaries.h
rfield
t_rfield rfield
Definition: rfield.cpp:8
ioQQQ
FILE * ioQQQ
Definition: cddefines.cpp:7
geometry.h
EmissionProxy::xIntensity
double & xIntensity() const
Definition: emission.h:483
t_hydro::dstfe2lya
realnum dstfe2lya
Definition: hydrogenic.h:60
realnum
float realnum
Definition: cddefines.h:103
t_radius::dVeffAper
double dVeffAper
Definition: radius.h:87
TransitionProxy::WLAng
realnum & WLAng() const
Definition: transition.h:429
rfield.h
t_atmdat::lgHCaseBOK
bool lgHCaseBOK[2][HS_NZ]
Definition: atmdat.h:193
t_dense::lgElmtOn
bool lgElmtOn[LIMELM]
Definition: dense.h:146
ipH3s
const int ipH3s
Definition: iso.h:30
t_phycon::te03
double te03
Definition: phycon.h:59
phycon
t_phycon phycon
Definition: phycon.cpp:6
trace.h
t_rfield::qhtot
realnum qhtot
Definition: rfield.h:356
ex
static double * ex
Definition: species2.cpp:28
t_iso_sp::TwoNu
vector< two_photon > TwoNu
Definition: iso.h:586
lines_service.h
t_atmdat::HIonFracMax
double HIonFracMax
Definition: atmdat.h:169
t_secondaries::x12tot
realnum x12tot
Definition: secondaries.h:53
t_LineSave::nsum
long int nsum
Definition: lines.h:62
ASSERT
#define ASSERT(exp)
Definition: cddefines.h:578
iso.h
ipHYDROGEN
const int ipHYDROGEN
Definition: cddefines.h:305
atmdat.h
atmdat_HS_caseB
double atmdat_HS_caseB(long int iHi, long int iLo, long int iZ, double TempIn, double DenIn, char chCase)
Definition: atmdat_HS_caseb.cpp:7
HS_NZ
#define HS_NZ
Definition: atmdat.h:125
POW2
#define POW2
Definition: cddefines.h:929
MIN2
#define MIN2
Definition: cddefines.h:761
lindst
void lindst(double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment)
Definition: lines_service.cpp:468
ipH4p
const int ipH4p
Definition: iso.h:34
t_secondaries::sec2total
realnum sec2total
Definition: secondaries.h:27
nzone
long int nzone
Definition: cddefines.cpp:14
LineSave
t_LineSave LineSave
Definition: lines.cpp:5
radius
t_radius radius
Definition: radius.cpp:5
TransitionProxy::Emis
EmissionList::reference Emis() const
Definition: transition.h:408
linadd
void linadd(double xInten, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
Definition: lines_service.cpp:316
dense.h
t_atmdat::HIonFrac
double HIonFrac
Definition: atmdat.h:166
t_isoCTRL::SmallA
realnum SmallA
Definition: iso.h:371
trace
t_trace trace
Definition: trace.cpp:5
EmissionProxy::phots
double & phots() const
Definition: emission.h:503
prt
t_prt prt
Definition: prt.cpp:10
cddefines.h
ipH2s
const int ipH2s
Definition: iso.h:28
chIonLbl
void chIonLbl(char *chIonLbl_v, const TransitionProxy &t)
Definition: transition.cpp:195
t_LineSave::ipass
long int ipass
Definition: lines.h:75
t_iso_sp::numLevels_max
long int numLevels_max
Definition: iso.h:493
t_tag_LineSv::SumLine
double SumLine[4]
Definition: lines.h:125
EmissionProxy::ots
double & ots() const
Definition: emission.h:623
radius.h
t_prt::lgPrnIsoCollapsed
bool lgPrnIsoCollapsed
Definition: prt.h:154
MAX2
#define MAX2
Definition: cddefines.h:782
LIMELM
const int LIMELM
Definition: cddefines.h:258
t_geometry::iEmissPower
long int iEmissPower
Definition: geometry.h:61
t_iso_sp::st
qList st
Definition: iso.h:453
t_iso_sp::nCollapsed_max
long int nCollapsed_max
Definition: iso.h:487
hydro
t_hydro hydro
Definition: hydrogenic.cpp:5
t_dense::IonHigh
long int IonHigh[LIMELM+1]
Definition: dense.h:120
GenerateTransitionConfiguration
void GenerateTransitionConfiguration(const TransitionProxy &t, char *chComment)
Definition: transition.cpp:330
t_dense::xIonDense
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:125
prt.h
hydrogenic.h
EmissionProxy::Pelec_esc
realnum & Pelec_esc() const
Definition: emission.h:533
t_iso_sp::RadRec_caseB
double RadRec_caseB
Definition: iso.h:513
ipH2p
const int ipH2p
Definition: iso.h:29
PutLine
void PutLine(const TransitionProxy &t, const char *chComment, const char *chLabelTemp)
Definition: transition.cpp:449
ipH3p
const int ipH3p
Definition: iso.h:31
t_phycon::te10
double te10
Definition: phycon.h:55
EmissionProxy::Pesc
realnum & Pesc() const
Definition: emission.h:523
t_hydro::HCollIonMax
realnum HCollIonMax
Definition: hydrogenic.h:86
secondaries
t_secondaries secondaries
Definition: secondaries.cpp:5
t_phycon::te70
double te70
Definition: phycon.h:51
lines_hydro
void lines_hydro(void)
Definition: prt_lines_hydro.cpp:20
iso_ctrl
t_isoCTRL iso_ctrl
Definition: iso.cpp:6
fixit
void fixit(void)
Definition: service.cpp:991
t_phycon::alogte
double alogte
Definition: phycon.h:82
ipHELIUM
const int ipHELIUM
Definition: cddefines.h:306
t_iso_sp::trans
TransitionProxy trans(const long ipHi, const long ipLo)
Definition: iso.h:444
taulines.h
StuffComment
long int StuffComment(const char *chComment)
Definition: prt_final.cpp:1932
ipH4s
const int ipH4s
Definition: iso.h:33
phycon.h
geometry
t_geometry geometry
Definition: geometry.cpp:5
atmdat
t_atmdat atmdat
Definition: atmdat.cpp:6
ipH1s
const int ipH1s
Definition: iso.h:27
t_hydro::H_ion_frac_collis
realnum H_ion_frac_collis
Definition: hydrogenic.h:89
iso_sp
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:8
LineSv
LinSv * LineSv
Definition: cdinit.cpp:70
EmissionProxy::Aul
realnum & Aul() const
Definition: emission.h:613
t_atmdat::WaveLengthCaseB
realnum WaveLengthCaseB[8][25][24]
Definition: atmdat.h:206
t_phycon::te
double te
Definition: phycon.h:11
EN1RYD
const UNUSED double EN1RYD
Definition: physconst.h:179
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:684
ipH_LIKE
const int ipH_LIKE
Definition: iso.h:62
t_iso_sp::QuantumNumbers2Index
multi_arr< long, 3 > QuantumNumbers2Index
Definition: iso.h:461
t_trace::lgTrace
bool lgTrace
Definition: trace.h:12
N_
#define N_(A_)
Definition: iso.h:20