cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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),912,"Clin",'c',
45  " total collisional cooling due to all hydrogen lines ");
46 
47  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHYDROGEN].xLineTotCool),912,"Hlin",'h' ,
48  " total collisional heating due to all hydrogen lines ");
49 
50  linadd(MAX2(0.,iso_sp[ipH_LIKE][ipHELIUM].xLineTotCool),228,"Clin",'c',
51  " total collisional cooling due to all HeII lines ");
52 
53  linadd(MAX2(0.,-iso_sp[ipH_LIKE][ipHELIUM].xLineTotCool),228,"Hlin",'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  {
208  LineSv[LineSave.nsum].SumLine[0] = 0.;
209  LineSv[LineSave.nsum].SumLine[1] = 0.;
210  }
211  else
212  {
213  caseb = 0.;
214  }
215  /* >>chng 02 nov 05, better approximation for Lya for temperature of first zone */
216  linadd( caseb/radius.dVeffAper*geometry.covgeo , 1216 , "Q(H)" , 'i',
217  "Ly-alpha from Q(H), high-dens lim, specified covering factor" );
218  }
219 
220  /* this is the main printout, where line intensities are entered into the stack */
221  for( nelem=ipISO; nelem < LIMELM; nelem++ )
222  {
223  if( dense.lgElmtOn[nelem] )
224  {
225  ASSERT( iso_sp[ipH_LIKE][nelem].n_HighestResolved_max >= 3 );
226 
227  for( ipHi=1; ipHi < iso_sp[ipISO][nelem].numLevels_max; ipHi++ )
228  {
229  for( ipLo=0; ipLo < ipHi; ipLo++ )
230  {
231  if( iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul() <= iso_ctrl.SmallA )
232  continue;
233 
234  /* this is in real units not emissivity*/
235  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().phots() =
236  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul()*
237  iso_sp[ipISO][nelem].st[ipHi].Pop()*
238  (iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Pesc() +
239  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Pelec_esc() );
240 
241  /* now find line intensity */
242  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().xIntensity() =
243  iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().phots()*
244  iso_sp[ipISO][nelem].trans(ipHi,ipLo).EnergyErg();
245  }
246  }
247  }
248  }
249 
250  /* create emissivity or intensity for hydrogenic species,
251  * first combine/bring balmer series together */
252  for( nelem=0; nelem < LIMELM; nelem++ )
253  {
254  if( dense.IonHigh[nelem] == nelem + 1 )
255  {
256  /* bring nL - n'L' emission together as n-n' emission. */
257  for( ipHi=1; ipHi < iso_sp[ipH_LIKE][nelem].numLevels_max; ipHi++ )
258  {
259  long index_of_nHi_P;
260 
261  /* is ipHi is collapsed level, index_of_nHi_P is ipHi */
262  if( N_(ipHi) > iso_sp[ipH_LIKE][nelem].n_HighestResolved_max )
263  index_of_nHi_P = ipHi;
264  else
265  index_of_nHi_P = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ N_(ipHi) ][1][2];
266 
267  /* only need to consider resolved lower level here */
268  for( ipLo=0; ipLo < ipHi; ipLo++ )
269  {
270  long index_of_nLo_S = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ N_(ipLo) ][0][2];
271 
272  /* jump out if ipLo is collapsed
273  * NB this must be up to n_HighestResolved_local and not n_HighestResolved_max */
274  if( N_(ipLo) > iso_sp[ipH_LIKE][nelem].n_HighestResolved_local || N_(ipLo) == N_(ipHi) )
275  break;
276 
277  if( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().Aul() <= iso_ctrl.SmallA )
278  continue;
279 
280  /* add everything into nP - n'S, skip if current indices are those levels. */
281  if( ipHi == index_of_nHi_P && ipLo == index_of_nLo_S )
282  continue;
283  else
284  {
285  /* add resolved line to nP - n'S */
286  iso_sp[ipH_LIKE][nelem].trans(index_of_nHi_P,index_of_nLo_S).Emis().xIntensity() +=
287  iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().xIntensity();
288  /* zero out the resolved line */
289  iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).Emis().xIntensity() = 0;
290  //ASSERT( iso_sp[ipH_LIKE][nelem].trans(index_of_nHi_P,index_of_nLo_S).Emis().xIntensity() > 0. );
291  }
292  }
293  }
294  }
295  }
296 
297  /* H beta recombination, assuming old case B */
298  hbetab = (double)((pow(10.,-20.89 - 0.10612*POW2(phycon.alogte - 4.4)))/
299  phycon.te);
300  /* need to pass this assert if CaBo is to have valid array indices for ipCont */
301  /* 06 aug 28, from numLevels_max to _local. */
302  /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */
303  ASSERT( iso_sp[ipH_LIKE][ipHYDROGEN].numLevels_max > 4 );
304  hbetab *= dense.xIonDense[ipHYDROGEN][1]*dense.eden;
305 
306  lindst(hbetab, -4861 ,"CaBo",
307  1 ,'i',false,
308  " this is old case b based on Ferland (1980) PASP ");
309 
310  if( dense.lgElmtOn[ipHELIUM] )
311  {
312  /* need to pass this assert if CaBo is to have valid array indices for ipCont */
313  /* 06 aug 28, from numLevels_max to _local. */
314  /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */
315  ASSERT( iso_sp[ipH_LIKE][ipHELIUM].numLevels_max > 4 );
316  /* 1640 1640 1640 */
317  em = 2.03e-20/(phycon.te70*phycon.te10*phycon.te03);
318  em *= dense.xIonDense[ipHELIUM][2]*dense.eden;
319 
320  lindst(em,-1640,"CaBo",
321  1,'i',false,
322  " old prediction of He II 1640, Case B at low densities");
323 
324  /* hydrogenic helium */
325  /* old prediction of He II 4686, case B */
326  em = 2.52e-20/(pow(phycon.te,1.05881));
327  em *= dense.xIonDense[ipHELIUM][2]*dense.eden;
328 
329  lindst(em,-4686,"CaBo", 1,'i',false,
330  " old prediction of He II 4686, Case B at low densities");
331  }
332 
333  /* predict case b intensities of hydrogen lines */
334  if( LineSave.ipass <= 0 )
335  {
336  for(nelem=0; nelem<HS_NZ; ++nelem )
337  {
338  atmdat.lgHCaseBOK[0][nelem] = true;
339  atmdat.lgHCaseBOK[1][nelem] = true;
340  }
341  }
342  /* this is the main printout, where line intensities are entered into the stack */
343  for( nelem=0; nelem < LIMELM; nelem++ )
344  {
345  if( dense.lgElmtOn[nelem] )
346  {
347  /* HS_NZ is limit to charge of elements in HS predictions, now 8 == oxygen */
348  /* but don't do the minor elements - these were not read in and so should not be
349  * printed - remove equivalent if statement in createdata to read them in */
350  if( nelem < HS_NZ && (nelem<2 || nelem>4) )
351  {
352  int iCase;
353  for( iCase=0; iCase<2; ++iCase )
354  {
355  char chAB[2]={'A','B'};
356  char chLab[5]="Ca ";
357 
358  /* adding iCase means start from n=1 for case A, n=2 for Case B,
359  * note that principal quantum number is on physics scale, not C */
360  /* 06 aug 28, both of these from numLevels_max to _local. */
361  /* 06 dec 21, change from numLevels_max to _local was mistake for this entire file. Undo. */
362  for( ipLo=1+iCase; ipLo<MIN2(10,iso_sp[ipH_LIKE][nelem].n_HighestResolved_max + iso_sp[ipH_LIKE][nelem].nCollapsed_max); ++ipLo )
363  {
364  for( ipHi=ipLo+1; ipHi< MIN2(25,iso_sp[ipH_LIKE][nelem].n_HighestResolved_max + iso_sp[ipH_LIKE][nelem].nCollapsed_max+1); ++ipHi )
365  {
366  realnum wl;
367  double case_b_Intensity;
368  long int ipCHi , ipCLo;
369  /* Put case b predictions into line stack
370  * NB NB NB each Hummer & Storey case b line must be
371  * explicitly clobbered by hand in routine final if
372  * atmdat.lgHCaseBOK[iCase][nelem] flag is set false
373  * since this indicates that we exceeded bounds of table,
374  * DO NOT want to print lines in that case */
375 
376  /* first do case b emissivity of balmer lines */
377 
378  /* get HS predictions */
379  case_b_Intensity = atmdat_HS_caseB( ipHi,ipLo , nelem+1, phycon.te , dense.eden, chAB[iCase] );
380  if( case_b_Intensity<=0. )
381  {
382  atmdat.lgHCaseBOK[iCase][nelem] = false;
383  case_b_Intensity = 0.;
384  }
385 
386  case_b_Intensity *= dense.xIonDense[nelem][nelem+1-ipISO]*dense.eden;
387 
388  if( iCase==0 && ipLo==1 )
389  {
390  /* get physical scal prin quant numbers onto cloudy c scale */
391  ipCHi = ipHi;
392  ipCLo = 0;
393  }
394  else
395  {
396  /* get physical scal prin quant numbers onto cloudy c scale */
397  ipCHi = ipHi;
398  ipCLo = ipLo;
399  }
400 
401  /* make label either Ca A or Ca B */
402  chLab[3] = chAB[iCase];
403 
404  /* new treatment is different from old for indices greater than 2. */
405  if( ipCHi > 2 )
406  {
407  if( ipCLo > 2 )
408  {
409  /* if both indices above two, just treat as nP to n'S transition. */
410  ipCHi = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCHi][1][2];
411  ipCLo = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCLo][0][2];
412  }
413  else if( ipCLo == 2 )
414  {
415  /* treat as nS to 2P transition. */
416  ipCHi = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCHi][0][2];
417  }
418  else if( ipCLo == 1 || ipCLo == 0 )
419  {
420  /* treat as nP to n'S transition. */
421  ipCHi = iso_sp[ipH_LIKE][nelem].QuantumNumbers2Index[ipCHi][1][2];
422  }
423  }
424 
425  /* this is wavelength of interpolated case b from HS tables */
426  wl = iso_sp[ipH_LIKE][nelem].trans(ipCHi,ipCLo).WLAng();
427  atmdat.WaveLengthCaseB[nelem][ipHi][ipLo] = wl;
428 
429  lindst(case_b_Intensity,wl,chLab,iso_sp[ipH_LIKE][nelem].trans(ipCHi,ipCLo).ipCont(),'i',false,
430  " case a or case b from Hummer & Storey tables" );
431  }
432  }
433  }
434  }
435 
436  // add two-photon details here
437  if( LineSave.ipass == 0 )
438  {
439  /* chIonLbl is function that generates a null terminated 4 char string, of form "C 2"
440  * the result, chLable, is only used when ipass == 0, can be undefined otherwise */
441  chIonLbl(chLabel, nelem+1, nelem+1-ipISO);
442  }
443  for( vector<two_photon>::iterator tnu = iso_sp[ipH_LIKE][nelem].TwoNu.begin(); tnu != iso_sp[ipH_LIKE][nelem].TwoNu.end(); ++tnu )
444  {
445  fixit(); // This was multiplied by Pesc when treated as a line, now what? Only used for printout?
446  fixit(); // below should be 'i' instead of 'r' ?
447  linadd( tnu->AulTotal * tnu->E2nu * EN1RYD * (*tnu->Pop),
448  0, chLabel, 'r',
449  " two photon continuum ");
450 
451  linadd( tnu->induc_dn * tnu->E2nu * EN1RYD * (*tnu->Pop),
452  22, chLabel ,'i',
453  " induced two photon emission ");
454  }
455 
456  /* NB NB - low and high must be in this order so that all balmer, paschen,
457  * etc series line up correctly in final printout */
458  for( ipLo=ipH1s; ipLo < iso_sp[ipH_LIKE][nelem].numLevels_max-1; ipLo++ )
459  {
460  /* don't bother with decays to 2p since we set them to zero above */
461  if( ipLo==ipH2p )
462  continue;
463 
464  /* set number of levels we want to print, first is default,
465  * only print real levels, second is set with "print line
466  * iso collapsed" command */
467  long int nLoop = iso_sp[ipH_LIKE][nelem].numLevels_max - iso_sp[ipH_LIKE][nelem].nCollapsed_max;
468  if( prt.lgPrnIsoCollapsed )
469  nLoop = iso_sp[ipH_LIKE][nelem].numLevels_max;
470 
471  for( ipHi=ipLo+1; ipHi < nLoop; ipHi++ )
472  {
473  // skip non-radiative transitions
474  if( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo).ipCont() < 1 )
475  continue;
476 
477  // skip 2s-1s, so that 2p-1s comes first and cdLine finds LyA instead of the M2 transition.
478  if( ipHi==1 && ipLo==0 )
479  continue;
480 
481  char chComment[23];
482  GenerateTransitionConfiguration( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo), chComment);
483  fixit(); // put chComment instead of the below, cant just punt chComment there.
484  PutLine(iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo),
485  "predicted line, all processes included");
486  }
487 
488  // now add 2s-1s M2 transition
489  if( ipLo==0 )
490  {
491  ipHi=1;
492  char chComment[23];
493  GenerateTransitionConfiguration( iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo), chComment);
494  fixit(); // put chComment instead of the below, cant just punt chComment there.
495  PutLine(iso_sp[ipH_LIKE][nelem].trans(ipHi,ipLo),
496  "predicted line, all processes included");
497  }
498  }
499  }
500  }
501 
502  if( trace.lgTrace )
503  {
504  fprintf( ioQQQ, " lines_hydro returns\n" );
505  }
506  return;
507 }
#define MIN2
Definition: cddefines.h:765
realnum x12tot
Definition: secondaries.h:53
realnum WaveLengthCaseB[8][25][24]
Definition: atmdat.h:206
double & ots() const
Definition: emission.h:623
t_atmdat atmdat
Definition: atmdat.cpp:6
realnum EnergyErg() const
Definition: transition.h:78
realnum & Pelec_esc() const
Definition: emission.h:533
qList st
Definition: iso.h:453
void lindst(double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment)
double te03
Definition: phycon.h:48
realnum H_ion_frac_collis
Definition: hydrogenic.h:89
double RadRec_caseB
Definition: iso.h:513
t_isoCTRL iso_ctrl
Definition: iso.cpp:6
#define MAX2
Definition: cddefines.h:786
long int iEmissPower
Definition: geometry.h:61
long int nCollapsed_max
Definition: iso.h:487
realnum HCollIonMax
Definition: hydrogenic.h:86
t_phycon phycon
Definition: phycon.cpp:6
t_LineSave LineSave
Definition: lines.cpp:5
t_dense dense
Definition: dense.cpp:24
realnum covgeo
Definition: geometry.h:35
bool lgHCaseBOK[2][HS_NZ]
Definition: atmdat.h:193
FILE * ioQQQ
Definition: cddefines.cpp:7
long int nzone
Definition: cddefines.cpp:14
double HIonFracMax
Definition: atmdat.h:169
void chIonLbl(char *chIonLbl_v, const TransitionProxy &t)
Definition: transition.cpp:195
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:125
double & phots() const
Definition: emission.h:503
realnum SecHIonMax
Definition: secondaries.h:30
double SumLine[4]
Definition: lines.h:125
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:8
realnum SmallA
Definition: iso.h:371
t_trace trace
Definition: trace.cpp:5
t_geometry geometry
Definition: geometry.cpp:5
bool lgPrnIsoCollapsed
Definition: prt.h:154
vector< two_photon > TwoNu
Definition: iso.h:586
#define POW2
Definition: cddefines.h:933
const int ipH1s
Definition: iso.h:27
LinSv * LineSv
Definition: cdinit.cpp:70
realnum sec2total
Definition: secondaries.h:27
bool lgTrace
Definition: trace.h:12
void lines_hydro(void)
double & xIntensity() const
Definition: emission.h:483
EmissionList::reference Emis() const
Definition: transition.h:408
#define N_(A_)
Definition: iso.h:20
realnum qhtot
Definition: rfield.h:356
t_rfield rfield
Definition: rfield.cpp:8
long int IonHigh[LIMELM+1]
Definition: dense.h:120
float realnum
Definition: cddefines.h:107
const int ipH4p
Definition: iso.h:34
realnum & Pesc() const
Definition: emission.h:523
bool lgElmtOn[LIMELM]
Definition: dense.h:146
t_hydro hydro
Definition: hydrogenic.cpp:5
double atmdat_HS_caseB(long int iHi, long int iLo, long int iZ, double TempIn, double DenIn, char chCase)
const int ipH3s
Definition: iso.h:30
const double EN1RYD
Definition: physconst.h:179
t_radius radius
Definition: radius.cpp:5
void PutLine(const TransitionProxy &t, const char *chComment, const char *chLabelTemp)
Definition: transition.cpp:449
multi_arr< long, 3 > QuantumNumbers2Index
Definition: iso.h:461
t_prt prt
Definition: prt.cpp:10
TransitionProxy trans(const long ipHi, const long ipLo)
Definition: iso.h:444
const int ipH2p
Definition: iso.h:29
#define HS_NZ
Definition: atmdat.h:125
#define ASSERT(exp)
Definition: cddefines.h:582
const int ipH2s
Definition: iso.h:28
static double * ex
Definition: species2.cpp:28
const int ipH_LIKE
Definition: iso.h:62
const int LIMELM
Definition: cddefines.h:262
realnum dstfe2lya
Definition: hydrogenic.h:60
void GenerateTransitionConfiguration(const TransitionProxy &t, char *chComment)
Definition: transition.cpp:330
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:688
const int ipHELIUM
Definition: cddefines.h:310
double te10
Definition: phycon.h:48
double eden
Definition: dense.h:190
double HIonFrac
Definition: atmdat.h:166
double te70
Definition: phycon.h:48
const int ipH4s
Definition: iso.h:33
double alogte
Definition: phycon.h:82
long int numLevels_max
Definition: iso.h:493
long int nsum
Definition: lines.h:62
void linadd(double xInten, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
t_secondaries secondaries
Definition: secondaries.cpp:5
double te
Definition: phycon.h:11
const int ipHYDROGEN
Definition: cddefines.h:309
void fixit(void)
Definition: service.cpp:991
realnum & Aul() const
Definition: emission.h:613
const int ipH3p
Definition: iso.h:31
realnum & WLAng() const
Definition: transition.h:429
long int ipass
Definition: lines.h:75
double dVeffAper
Definition: radius.h:87
long int StuffComment(const char *chComment)
Definition: prt_final.cpp:1925