/home66/gary/public_html/cloudy/c08_branch/source/prt_lines_continuum.cpp

Go to the documentation of this file.
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_continuum put energetics, H, and He lines into line intensity stack */
00004 #include "cddefines.h"
00005 #include "taulines.h"
00006 #include "physconst.h"
00007 #include "iso.h"
00008 #include "geometry.h"
00009 #include "dense.h"
00010 #include "prt.h"
00011 #include "opacity.h"
00012 #include "coolheavy.h"
00013 #include "phycon.h"
00014 #include "rfield.h"
00015 #include "predcont.h"
00016 #include "lines_service.h"
00017 #include "radius.h"
00018 #include "continuum.h"
00019 #include "lines.h"
00020 
00021 void lines_continuum(void)
00022 {
00023 
00024         double f1, 
00025                 f2 , 
00026                 bac , 
00027                 flow;
00028         long i,nBand;
00029 
00030         DEBUG_ENTRY( "lines_continuum()" );
00031 
00032         /* code has all local emissivities zeroed out with cryptic comment about being
00033          * situation dependent.  Why?  this is option to turn back on */
00034         const bool KILL_CONT = false;
00035 
00036         i = StuffComment( "continua" );
00037         linadd( 0., (realnum)i , "####", 'i',
00038                 " start continua");
00039 
00040         /***********************************************************************
00041          * stuff in Bac ratio - continuum above the Balmer Jump 
00042          * this is trick, zeroing out saved continuum integrated so far,
00043          * and adding the current version, so that the line array gives the 
00044          * value in the final continuum 
00045          *
00046          * reflected continuum is different from others since relative to inner
00047          * radius, others for for this radius 
00048          *************************************************************************/
00049 
00051         /***************************************************************************
00052          * "Bac " , 3646,  this is residual continuum at peak of Balmer Jump
00053          * flux below - flux above                                   
00054          ***************************************************************************/
00055         /* >>chng 00 dec 02, remove opac.tmn */
00056         /* >>chng 00 dec 19, remove / radius.GeoDil */
00057         /* extrapolated continuum above head */
00058         /* >>chng 01 jul 13, from ConInterOut to ConEmitOut */
00059         f1 = (rfield.ConEmitOut[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1] + 
00060                 rfield.ConEmitReflec[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]/radius.r1r0sq )/
00061           rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]/*/radius.GeoDil /opac.tmn[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]*/;
00062 
00063         /* extrapolated continuum below head */
00064         /* >>chng 00 dec 19, remove / radius.GeoDil */
00065         f2 = (rfield.ConEmitOut[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]+ 
00066                 rfield.ConEmitReflec[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]/radius.r1r0sq )/
00067           rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]/*/radius.GeoDil /opac.tmn[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]*/;
00068 
00069         /* convert to nuFnu units */
00070         f1 = f1*0.250*0.250*EN1RYD*radius.r1r0sq;
00071         f2 = f2*0.250*0.250*EN1RYD*radius.r1r0sq;
00072         bac = (f1 - f2);
00073 
00074         /* memory not allocated until ipass >= 0 
00075          * clear summed intrinsic and emergent intensity of following
00076          * entry - following call to linadd will enter the total and
00077          * keep entering the total but is done for each zone hence need to
00078          * keep resetting to zero*/
00079         if( LineSave.ipass > 0 )
00080         {
00081                 LineSv[LineSave.nsum].sumlin[0] = 0.;
00082                 LineSv[LineSave.nsum].sumlin[1] = 0.;
00083         }
00084 
00085         linadd(MAX2(0.,bac)/radius.dVeff,3646,"Bac ",'i',
00086                 "residual flux at head of Balmer continuum, nuFnu ");
00087         /* >>chng 03 feb 06, set to zero */
00088         /* emslin saves the per unit vol emissivity of a line, which is normally 
00089          * what goes into linadd.  We zero this unit emissivity which was set
00090          * FOR THE PREVIOUS LINE since it is so situation dependent */
00091         if( KILL_CONT && LineSave.ipass > 0 )
00092         {
00093                 LineSv[LineSave.nsum-1].emslin[0] = 0.;
00094                 LineSv[LineSave.nsum-1].emslin[1] = 0.;
00095         }
00096 
00097         /* memory not allocated until ipass >= 0 */
00098         if( LineSave.ipass > 0 )
00099         {
00100                 LineSv[LineSave.nsum].sumlin[0] = 0.;
00101                 LineSv[LineSave.nsum].sumlin[1] = 0.;
00102         }
00103 
00104         linadd(f1/radius.dVeff,3645,"nFnu",'i',
00105                 "total flux above head of Balmer continuum, nuFnu ");
00106         /* >>chng 03 feb 06, set to zero */
00107         /* emslin saves the per unit vol emissivity of a line, which is normally 
00108          * what goes into linadd.  We zero this unit emissivity which was set
00109          * FOR THE PREVIOUS LINE since it is so situation dependent */
00110         if( KILL_CONT && LineSave.ipass > 0 )
00111         {
00112                 LineSv[LineSave.nsum-1].emslin[0] = 0.;
00113                 LineSv[LineSave.nsum-1].emslin[1] = 0.;
00114         }
00115 
00116         /* memory not allocated until ipass >= 0 */
00117         if( LineSave.ipass > 0 )
00118         {
00119                 LineSv[LineSave.nsum].sumlin[0] = 0.;
00120                 LineSv[LineSave.nsum].sumlin[1] = 0.;
00121         }
00122 
00123         linadd(f2/radius.dVeff,3647,"nFnu",'i',
00124                 "total flux above head of Balmer continuum, nuFnu ");
00125         /* >>chng 03 feb 06, set to zero */
00126         /* emslin saves the per unit vol emissivity of a line, which is normally 
00127          * what goes into linadd.  We zero this unit emissivity which was set
00128          * FOR THE PREVIOUS LINE since it is so situation dependent */
00129         if( KILL_CONT && LineSave.ipass > 0 )
00130         {
00131                 LineSv[LineSave.nsum-1].emslin[0] = 0.;
00132                 LineSv[LineSave.nsum-1].emslin[1] = 0.;
00133         }
00134 
00135         /******************************************************************************
00136          * "cout" , 3646,  this is outward residual continuum at peak of Balmer Jump  *
00137          * equal to total in spherical geometry, half in opt thin open geometry       *
00138          ******************************************************************************/
00139         /* >>chng 00 dec 02, remove opac.tmn */
00140         /* >>chng 00 dec 19, remove / radius.GeoDil */
00141         f1 = rfield.ConEmitOut[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]/
00142                 rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]/*/radius.GeoDil /opac.tmn[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]*/;
00143 
00144         /* >>chng 00 dec 19, remove / radius.GeoDil */
00145         f2 = rfield.ConEmitOut[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]/
00146                 rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]/*/radius.GeoDil /opac.tmn[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]*/;
00147 
00148         /* net Balmer jump */
00149         bac = (f1 - f2)*0.250*0.250*EN1RYD*radius.r1r0sq;
00150 
00151         /* memory not allocated until ipass >= 0 */
00152         if( LineSave.ipass > 0 )
00153         {
00154                 LineSv[LineSave.nsum].sumlin[0] = 0.;
00155                 LineSv[LineSave.nsum].sumlin[1] = 0.;
00156         }
00157 
00158         linadd(MAX2(0.,bac)/radius.dVeff,3646,"cout",'i',
00159                 "residual flux in Balmer continuum, nuFnu ");
00160         /* >>chng 03 feb 06, set to zero */
00161         /* emslin saves the per unit vol emissivity of a line, which is normally 
00162          * what goes into linadd.  We zero this unit emissivity which was set
00163          * FOR THE PREVIOUS LINE since it is so situation dependent */
00164         if( KILL_CONT && LineSave.ipass > 0 )
00165         {
00166                 LineSv[LineSave.nsum-1].emslin[0] = 0.;
00167                 LineSv[LineSave.nsum-1].emslin[1] = 0.;
00168         }
00169 
00170         /*********************************************************************
00171          * "cref" , 3646,  this is reflected continuum at peak of Balmer Jump*
00172          * equal to zero in spherical geometry, half of total in op thin opn *
00173          *********************************************************************/
00174         /* >>chng 00 dec 02, remove opac.tmn */
00175         /* >>chng 00 dec 19, remove / radius.GeoDil */
00176         f1 = rfield.ConEmitReflec[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]/
00177                 rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1];
00178 
00179         f2 = rfield.ConEmitReflec[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]/
00180                 rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2];
00181 
00182         /* net Balmer jump */
00183         bac = (f1 - f2)*0.250*0.250*EN1RYD;
00184 
00185         /* memory not allocated until ipass >= 0 */
00186         if( LineSave.ipass > 0 )
00187         {
00188                 LineSv[LineSave.nsum].sumlin[0] = 0.;
00189                 LineSv[LineSave.nsum].sumlin[1] = 0.;
00190         }
00191 
00192         linadd(MAX2(0.,bac)/radius.dVeff,3646,"cref",'i',
00193                 "residual flux in Balmer continuum, nuFnu ");
00194         /* >>chng 03 feb 06, set to zero */
00195         /* emslin saves the per unit vol emissivity of a line, which is normally 
00196          * what goes into linadd.  We zero this unit emissivity which was set
00197          * FOR THE PREVIOUS LINE since it is so situation dependent */
00198         if( KILL_CONT && LineSave.ipass > 0 )
00199         {
00200                 LineSv[LineSave.nsum-1].emslin[0] = 0.;
00201                 LineSv[LineSave.nsum-1].emslin[1] = 0.;
00202         }
00203 
00204         /*********************************************************************
00205          * "thin" , 3646, tot optically thin continuum at peak of Balmer Jump*/
00206         if( nzone > 0 )
00207         {
00208                 /* rfield.ConEmitLocal is not defined initially, only evaluate when into model */
00209                 f1 = rfield.ConEmitLocal[nzone][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1]/
00210                         rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-1];
00211                 f2 = rfield.ConEmitLocal[nzone][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2]/
00212                         rfield.widflx[iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][2]-2];
00213                 bac = (f1 - f2)*0.250*0.250*EN1RYD;
00214         }
00215         else
00216         {
00217                 f1 = 0.;
00218                 f2 = 0.;
00219                 bac = 0.;
00220         }
00221 
00222         linadd(MAX2(0.,bac),3646,"thin",'i',
00223                 "residual flux in Balmer continuum, nuFnu ");
00224 
00225         continuum.cn4861 /= (realnum)radius.dVeff;
00226         linadd(continuum.cn4861,4860,"Inci",'i',
00227                 "incident continuum nu*f_nu at H-beta, at illuminated face of cloud ");
00228         /* >>chng 07 jun 13, at this point nsum is the number of lines in the stack
00229          * so nsum-1 is the entry created by the above call to linadd
00230          * we want to set the emergent incident continuum to the intrinsic
00231          * incident continuum - there are reports of the incident continuum 
00232          * striking the cloud and the emergent - incident distinction does
00233          * not apply - code had left emergent intensity at zero, bug reported
00234          * by K Korista on discussion group 2007 jun 14 */
00235         if( LineSave.ipass > 0 )
00236         {
00237                 LineSv[LineSave.nsum-1].sumlin[1] = LineSv[LineSave.nsum-1].sumlin[0];
00238         }
00239 
00240         continuum.cn1216 /= (realnum)radius.dVeff;
00241         linadd(continuum.cn1216,1215,"Inci",'i',
00242                 "incident continuum nu*f_nu near Ly-alpha, at illuminated face of cloud");
00243         /* see comment concerning parallel code immediately above */
00244         if( LineSave.ipass > 0 )
00245         {
00246                 LineSv[LineSave.nsum-1].sumlin[1] = LineSv[LineSave.nsum-1].sumlin[0];
00247         }
00248 
00249         continuum.cn1216 *= (realnum)radius.dVeff;
00250         continuum.cn4861 *= (realnum)radius.dVeff;
00251 
00252         if( LineSave.ipass > 0 )
00253         {
00254                 continuum.cn4861 = 0.;
00255                 continuum.cn1216 = 0.;
00256         }
00257 
00258         flow = (iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH2p][ipRecRad] + 
00259                 iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH2s][ipRecRad])*
00260           iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH2p][ipRecEsc]*
00261           dense.eden*dense.xIonDense[ipHYDROGEN][1]* 5.45e-12;
00262         linadd(flow,0,"Ba C",'i',
00263                 "integrated Balmer continuum emission");
00264 
00265         if( iso.n_HighestResolved_max[ipH_LIKE][ipHYDROGEN] >= 3 )
00266         {
00267                 flow = ( iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH3s][ipRecRad]*
00268                         iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH3s][ipRecEsc] +
00269                         iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH3p][ipRecRad]*
00270                         iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH3p][ipRecEsc] +
00271                         iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH3d][ipRecRad]*
00272                         iso.RadRecomb[ipH_LIKE][ipHYDROGEN][ipH3d][ipRecEsc] ) * 
00273                         dense.eden*dense.xIonDense[ipHYDROGEN][1]*3.53e-12;
00274         }
00275         else
00276         {
00277                 flow = iso.RadRecomb[ipH_LIKE][ipHYDROGEN][3][ipRecRad]*
00278                         iso.RadRecomb[ipH_LIKE][ipHYDROGEN][3][ipRecEsc]*
00279                   dense.eden*dense.xIonDense[ipHYDROGEN][1]*3.53e-12;
00280         }
00281         linadd(flow,0,"PA C",'i',
00282                 "Paschen continuum emission ");
00283 
00284         /* >>chng 05 oct 16, add this output option, these are a
00285          * series of continuum bands defined in the file bands_continuum.dat
00286          * this makes it possible to enter any integrated total emission
00287          * into the emission-line stack */
00288         for( nBand=0; nBand<continuum.nContBand; ++nBand )
00289         {
00290                 double total = 0.;
00291                 /* find total emission over band - units will be erg cm-2 s-1 */
00292                 for( i=continuum.ipContBandLow[nBand]; i<continuum.ipContBandHi[nBand]; ++i )
00293                 {
00294                         double xIntenOut = 
00295                                 /* the attenuated incident continuum */
00296                                 rfield.flux[i-1] +
00297 
00298                                 /* the outward emitted continuum radiation field 
00299                                  * >>chng 06 aug 07, add geomery.covgeo here */
00300                                 (rfield.ConEmitOut[i-1] + 
00301 
00302                                 /* outward emitted lines */
00303                                 rfield.outlin[i-1])*geometry.covgeo;
00304                         /* div by opac.E2TauAbsFace[i] because ConEmitReflec has already
00305                          * been corrected for this - emergent_line will introduce a 
00306                          * further correction so this will cancel the extra factor */
00307                         double xIntenIn = 
00308                                 ((double)rfield.ConEmitReflec[i-1]/SDIV((double)opac.E2TauAbsFace[i-1]) + 
00309                                  /* outward emitted lines */
00310                                  rfield.reflin[i-1] )*geometry.covgeo;
00311 
00312                         /* the fraction of this that gets out */
00313                         total += rfield.anu[i-1] * 
00314                                 emergent_line( xIntenIn , xIntenOut , i )
00315                                 /* >>chng 06 aug 07, add opac.tmn here */
00316                                 / SDIV(opac.tmn[i-1]);
00317                 }
00318                 /* we will call lindst with an energy half way between the two
00319                  * ends of the band.  This will make an extinction correction that
00320                  * has already been applied above by multiplying by emergent_line.
00321                  * Find this factor and remove it before the call */
00322                 double corr = emergent_line( 0.5 , 0.5 , 
00323                         (continuum.ipContBandLow[nBand]+continuum.ipContBandHi[nBand])/2 );
00324                 if( corr < SMALLFLOAT )
00325                         total = 0.;
00326                 else
00327                         total /= corr;
00328 
00329                 /* convert to physical units */
00330                 total *= EN1RYD*radius.r1r0sq/radius.dVeff;
00331                 /* memory not allocated until ipass >= 0 */
00332                 if( LineSave.ipass > 0 )
00333                 {
00334                         LineSv[LineSave.nsum].sumlin[0] = 0.;
00335                         LineSv[LineSave.nsum].sumlin[1] = 0.;
00336                 }
00337 
00338                 lindst( total , 
00339                         // the negative wavelength is a sentinel that the wavelength
00340                         // may be bogus - very often the "center" of the band, as defined
00341                         // by observers, is far to the blue end of the range.  use the
00342                         // observed definition of the wavelength.  This introduces an error
00343                         // since the wavelength is used to determine the transfer of the
00344                         // band against background opacities
00345                         -continuum.ContBandWavelength[nBand] , 
00346                         continuum.chContBandLabels[nBand],
00347                         (continuum.ipContBandLow[nBand]+continuum.ipContBandHi[nBand])/2 ,
00348                         'i' , false,
00349                         "continuum bands defined in bands_continuum.dat");
00350         }
00351 
00352         linadd(MAX2(0.,CoolHeavy.brems_cool_net),0,"HFFc",'c',
00353                 "net free-free cooling, ALL species, free-free heating subtracted, so nearly cancels with cooling in LTE ");
00354 
00355         linadd(MAX2(0.,-CoolHeavy.brems_cool_net),0,"HFFh",'h',
00356                 "net free-free heating, nearly cancels with cooling in LTE ");
00357 
00358         linadd(CoolHeavy.brems_cool_h,0,"H FF",'i',
00359                 " H brems (free-free) cooling ");
00360 
00361         linadd(CoolHeavy.brems_heat_total,0,"FF H",'i',
00362                 "total free-free heating ");
00363 
00364         linadd(CoolHeavy.brems_cool_he,0,"HeFF",'i',
00365                 "He brems emission ");
00366 
00367         linadd(CoolHeavy.herec,0,"HeFB",'c',
00368                 "He recombination cooling ");
00369 
00370         linadd(CoolHeavy.heavfb,0,"MeFB",'c',
00371                 "heavy element recombination cooling ");
00372 
00373         linadd(CoolHeavy.brems_cool_metals,0,"MeFF",'i',
00374                 "heavy elements (metals) brems cooling, heat not subtracted ");
00375 
00376         linadd(CoolHeavy.brems_cool_h+CoolHeavy.brems_cool_he+CoolHeavy.brems_cool_metals,0,"ToFF",'i',
00377                 "total brems emission - total cooling but not minus heating ");
00378 
00379         linadd((CoolHeavy.brems_cool_h+CoolHeavy.brems_cool_he)*sexp(5.8e6/phycon.te),0,"FF X",'i',
00380                 "part of H brems, in x-ray beyond 0.5KeV ");
00381 
00382         linadd(CoolHeavy.eebrm,0,"eeff",'c',
00383                 "electron - electron brems ");
00384 
00385         /* predict emitted continuum at series of continuum points */
00386         /* variables are located in predcont.h, 
00387          * NPREDCONT number of continuum points,
00388          * next two arrays are defined in zerologic.c
00389          * EnrPredCont - energy (Ryd) where we want to predict the continuum,
00390          *               these are set in zerologic.c,
00391          * ipPreCont -   pointers to energy within continuum array, 
00392          *               these are set in ContCreatePointers
00393          *
00394          * the array of continuum energies where this will be done is
00395          * stored as EnrPredCont which lives in predcont.h
00396          * and is initialized in zerologic.c
00397          *
00398          * the entry nFnu will only be printed if the command
00399          * print diffuse continuum
00400          * is entered - 
00401          *
00402          * this code should be kept parallel with that in dopunch, where
00403          * punch continuum is produced, since two must agree */
00404         for( i=0; i < NPREDCONT; i++ )
00405         {
00406                 double SourceTransmitted , Cont_nInu;
00407                 double SourceReflected, 
00408                   DiffuseOutward,
00409                   DiffuseInward;
00410                 double renorm;
00411 
00412                 /* put wavelength in Angstroms into dummy structure, so that we can use iWavLen
00413                  * to get a proper wavelength with units, continuum energies are stored in EnrPredCont */
00414                 TauDummy.WLAng = (realnum)(RYDLAM/EnrPredCont[i]);
00415                 /*lambda = iWavLen(&TauDummy , &chUnits , &chShift );*/
00416 
00417                 /* >>chng 00 dec 02, there were three occurrences of /opac.tmn which had the
00418                  * effect of raising the summed continuum by the local opacity correction factor.
00419                  * in the case of the Lyman continuum this raised the reported value by orders
00420                  * of magnitude.  There have been commented out in the following for now. */
00421                 /* reflected total continuum (diff+incident emitted inward direction) */
00422 
00423                 /* >>chng 00 dec 08, implement the "set nFnu [SOURCE_REFLECTED] ... command, PvH */
00424                 /* >>chng 00 dec 19, remove / radius.GeoDil */
00425                 renorm = rfield.anu2[ipPredCont[i]]*EN1RYD/rfield.widflx[ipPredCont[i]]/*/radius.GeoDil*/;
00426 
00427                 /* this is the reflected diffuse continuum */
00428                 if( prt.lgDiffuseInward )
00429                 {
00430                         DiffuseInward = rfield.ConEmitReflec[ipPredCont[i]]*renorm;
00431                         /* /opac.tmn[ipPredCont[i]]*/
00432                 }
00433                 else
00434                 {
00435                         DiffuseInward = 0.;
00436                 }
00437 
00438                 /* the outward diffuse continuum */
00439                 if( prt.lgDiffuseOutward )
00440                 {
00441                         DiffuseOutward = rfield.ConEmitOut[ipPredCont[i]]*renorm*radius.r1r0sq;
00442                 }
00443                 else
00444                 {
00445                         DiffuseOutward = 0.;
00446                 }
00447 
00448                 /* reflected part of INCIDENT continuum (only incident, not diffuse, which was above) */
00449                 if( prt.lgSourceReflected )
00450                 {
00451                         SourceReflected =  rfield.ConRefIncid[ipPredCont[i]]*renorm;
00452                         /* /opac.tmn[ipPredCont[i]]*/
00453                 }
00454                 else
00455                 {
00456                         SourceReflected =  0.;
00457                 }
00458 
00459                 /* the attenuated incident continuum */
00460                 if( prt.lgSourceTransmitted )
00461                 {
00462                         SourceTransmitted = rfield.flux[ipPredCont[i]]*renorm*radius.r1r0sq;
00463                 }
00464                 else
00465                 {
00466                         SourceTransmitted = 0.;
00467                 }
00468 
00469                 /* memory has not been allocated until ipass >= 0, so must not access this element,
00470                  * this element will be used to save the following quantity */
00471                 if( LineSave.ipass > 0 )
00472                 {
00473                         LineSv[LineSave.nsum].sumlin[0] = 0.;
00474                         LineSv[LineSave.nsum].sumlin[1] = 0.;
00475                 }
00476 
00477                 linadd((DiffuseInward+SourceReflected+DiffuseOutward+SourceTransmitted)/radius.dVeff,
00478                         TauDummy.WLAng,"nFnu",'i',
00479                         "total continuum at selected energy points " );
00480 
00481                 /* emslin saves the per unit vol emissivity of a line, which is normally 
00482                  * what goes into linadd.  We zero this unit emissivity which was set
00483                  * FOR THE PREVIOUS LINE since it is so situation dependent */
00484                 if( KILL_CONT && LineSave.ipass > 0 )
00485                 {
00486                         LineSv[LineSave.nsum-1].emslin[0] = 0.;
00487                         LineSv[LineSave.nsum-1].emslin[1] = 0.;
00488                 }
00489 
00490                 /* this is the normal set to zero to trick the NEXT line into going in properly */
00491                 if( LineSave.ipass > 0 )
00492                 {
00493                         LineSv[LineSave.nsum].sumlin[0] = 0.;
00494                         LineSv[LineSave.nsum].sumlin[1] = 0.;
00495                 }
00496 
00497                 /* the nsum-1 -- emslin and nsum -- sumlin is not a bug, look above - they do
00498                  * different things to different saves */
00499                 Cont_nInu = rfield.flux[ipPredCont[i]]*renorm*radius.r1r0sq +
00500                         rfield.ConRefIncid[ipPredCont[i]]*renorm;
00501 
00502 #               if 0
00503                 /* this code can be used to create assert statements for the continuum shape */
00504                 if( !i )
00505                         fprintf(ioQQQ,"\n");
00506                 char chWL[1000];
00507                 sprt_wl( chWL , TauDummy.WLAng );
00508                 fprintf( ioQQQ,"assert line luminosity \"nInu\" %s  %.3f\n",
00509                         chWL , 
00510                         log10(SDIV(Cont_nInu/radius.dVeff)) + radius.Conv2PrtInten  );
00511 #               endif
00512 
00513                 linadd( Cont_nInu/radius.dVeff,TauDummy.WLAng,"nInu",'i',
00514                         "transmitted and reflected incident continuum at selected energy points " );
00515 
00516                 /* emslin saves the per unit volume emissivity of a line, which is normally 
00517                  * what goes into linadd.  We zero this unit emissivity since it is so situation dependent */
00518                 if( KILL_CONT && LineSave.ipass > 0 )
00519                 {
00520                         LineSv[LineSave.nsum-1].emslin[0] = 0.;
00521                         LineSv[LineSave.nsum-1].emslin[1] = 0.;
00522                 }
00523 
00524                 /* memory has not been allocated until ipass >= 0 */
00525                 if( LineSave.ipass > 0 )
00526                 {
00527                         LineSv[LineSave.nsum].sumlin[0] = 0.;
00528                         LineSv[LineSave.nsum].sumlin[1] = 0.;
00529                 }
00530 
00531                 linadd( (DiffuseInward+SourceReflected)/radius.dVeff,TauDummy.WLAng,"InwT",'i',
00532                         "total reflected continuum, total inward emission plus reflected (XXdiffuseXX) total continuum ");
00533 
00534                 if( KILL_CONT && LineSave.ipass > 0 )
00535                 {
00536                         LineSv[LineSave.nsum-1].emslin[0] = 0.;
00537                         LineSv[LineSave.nsum-1].emslin[1] = 0.;
00538                 }
00539 
00540                 /* memory has not been allocated until ipass >= 0 */
00541                 if( LineSave.ipass > 0 )
00542                 {
00543                         LineSv[LineSave.nsum].sumlin[0] = 0.;
00544                         LineSv[LineSave.nsum].sumlin[1] = 0.;
00545                 }
00546 
00547                 linadd(SourceReflected/radius.dVeff,TauDummy.WLAng,"InwC",'i',
00548                         "reflected incident continuum (only incident) ");
00549 
00550                 if( KILL_CONT && LineSave.ipass > 0 )
00551                 {
00552                         LineSv[LineSave.nsum-1].emslin[0] = 0.;
00553                         LineSv[LineSave.nsum-1].emslin[1] = 0.;
00554                 }
00555         }
00556         return;
00557 }

Generated on Mon Feb 16 12:01:26 2009 for cloudy by  doxygen 1.4.7