/*HydroSumTrans photoionization, recombination, radiative rates for model hydrogen atom */ #include "cddefines.h" #include "taulines.h" #include "trace.h" #include "touton.h" #include "phycon.h" #include "hcbr.h" #include "hstat.h" #include "rin2ph.h" #include "printe82.h" #include "hydrogenic.h" void HydroSumTrans(long int ipZ) { long int i, ipHi, ipLo, level; # ifdef DEBUG_FUN fputs( "<+>HydroSumTrans()\n", debug_fp ); # endif /* check that we were called with valid charge */ assert( ipZ >= 0); assert( ipZ < LIMELM ); for( ipHi=IP2S; ipHi <= nhlevel; ++ipHi ) { for( ipLo=IP1S; ipLo < ipHi; ++ipLo ) { /* net rate used for populations - * NB - note that indices are backwards!!! */ hydro.HRadNet[ipZ][ipLo][ipHi] = HydroLines[ipZ][ipHi][ipLo].Aul* (HydroLines[ipZ][ipHi][ipLo].Pesc + HydroLines[ipZ][ipHi][ipLo].Pdest); } } /* for H Lya only, add destruction by FeII lines */ if( ipZ==0 ) { hydro.HRadNet[0][IP1S][IP2P] += hydro.dstfe2lya*HydroLines[0][IP2P][IP1S].Aul; } /* sum of spontaneous decays down, used in matrix soln */ for( ipHi=IP1S; ipHi <= nhlevel; ipHi++ ) { hcbr.hradn[ipZ][ipHi] = 0.; /* no loop for ipHi=1 */ for( ipLo=IP1S; ipLo < ipHi; ipLo++ ) { hcbr.hradn[ipZ][ipHi] += hydro.HRadNet[ipZ][ipLo][ipHi]; } } /* total rates out of level due to induced processes */ for( level=IP1S; level <= nhlevel; level++ ) { hcbr.hbul[ipZ][level] = 0.; for( ipLo=IP1S; ipLo <= (level - 1); ipLo++ ) { hcbr.hbul[ipZ][level] += HydroLines[ipZ][level][ipLo].pump* hstat.HStatWght[ipLo]/hstat.HStatWght[level]; } for( ipHi=level + 1; ipHi <= nhlevel; ipHi++ ) { hcbr.hbul[ipZ][level] += HydroLines[ipZ][ipHi][level].pump; } } if( (trace.lgTrace && trace.lgHBugFull) && (ipZ == trace.ipZTrace) ) { fprintf( ioQQQ, " HydroSumTrans%3ld finds arrays, with optical depths defined? %1c induced 2ph=%12.3e\n", ipZ, TorF(touton.lgTauOutOn), rin2ph.ri2s1s ); for( ipHi=IP2S; ipHi <= nhlevel; ipHi++ ) { fprintf( ioQQQ, "up:%2ld", ipHi ); fprintf( ioQQQ, "lo" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ, "%9ld", ipLo ); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " A-net" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.HRadNet[ipZ][ipLo][ipHi]) ); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " A*esc" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].Aul* HydroLines[ipZ][ipHi][ipLo].Pesc )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " tauin" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].TauIn )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " t tot" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].TauTot )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " Esc " ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].Pesc )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " Dest " ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].Pdest) ); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " A*dst" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].Aul* HydroLines[ipZ][ipHi][ipLo].Pdest )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " StrkE" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.pestrk[ipLo][ipHi] )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " EsctE" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.esesc[ipZ][ipLo][ipHi] )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " B(ul)" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].pump* hstat.HStatWght[ipLo]/hstat.HStatWght[ipHi] )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " tcont" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", HydroLines[ipZ][ipHi][ipLo].TauCon )); } fprintf( ioQQQ, "\n" ); fprintf( ioQQQ, "%3ld", ipHi ); fprintf( ioQQQ, " C(ul)" ); for( ipLo=IP1S; ipLo <= (ipHi - 1); ipLo++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.hcol[ipZ][ipLo][ipHi]*phycon.eden )); } fprintf( ioQQQ, "\n" ); if( ipHi == 2 ) { fprintf( ioQQQ, " FeIIo"); fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.dstfe2lya* HydroLines[0][IP2P][IP1S].Aul )); fprintf( ioQQQ, "\n"); } } fprintf( ioQQQ, " " ); for( i=1; i <= (nhlevel + 1); i++ ) { fprintf( ioQQQ, "%9ld", i ); } fprintf( ioQQQ, "\n" ); } # ifdef DEBUG_FUN fputs( " <->HydroSumTrans()\n", debug_fp ); # endif return; }