root/branches/newmole/source/abundances.cpp

Revision 2582, 26.8 kB (checked in by rporter, 2 weeks ago)

branches/newmole - bring in trunk r2541:2581

  • Property svn:eol-style set to native
Line 
1/* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2 * others.  For conditions of distribution and use see copyright notice in license.txt */
3/*AbundancesPrt print all abundances, both gas phase and grains */
4/*AbundancesSet sets initial abundances after parameters are entered by reading input */
5/*AbundancesTable interpolate on table of points to do 'element table' command, */
6/*PrtElem print chemical composition at start of calculation */
7#include "cddefines.h"
8#include "physconst.h"
9#include "phycon.h"
10#include "called.h"
11#include "stopcalc.h"
12#include "thermal.h"
13#include "trace.h"
14#include "elementnames.h"
15#include "dense.h"
16#include "radius.h"
17#include "grainvar.h"
18#include "abund.h"
19
20/*PrtElem print chemical composition at start of calculation */
21STATIC void PrtElem(
22  /* the job to do, the options are "init", "fill", "flus" */
23  const char *chJob,
24  /* label for the element */
25  const char *chLabl,
26  /* its abundance */
27  double abund_prt);
28
29/*AbundancesPrt print all abundances, both gas phase and grains */
30void AbundancesPrt( void )
31{
32        long int i,
33                nd;
34        double GrainNumRelHydrSilicate ,
35                GrainNumRelHydrCarbonaceous ,
36                GrainNumRelHydr_PAH,
37                GrainMassRelHydrSilicate,
38                GrainMassRelHydrCarbonaceous,
39                GrainMassRelHydr_PAH;
40
41        DEBUG_ENTRY( "AbundancesPrt()" );
42
43        /* this is main loop to print abundances of each element */
44        if( called.lgTalk )
45        {
46                PrtElem("initG","  ",0.);/* initialize print routine for gas*/
47                for( i=0; i < LIMELM; i++ )
48                {
49                        if( dense.lgElmtOn[i] )
50                        {
51                                /* fill in print buffer with abundances */
52                                PrtElem("fill",(char*)elementnames.chElementSym[i],
53                                  abund.solar[i]);
54                        }
55                }
56
57                /* flush the print buffer */
58                PrtElem("flus","  ",0.);
59                /* final carriage return */
60                fprintf( ioQQQ, " \n" );
61
62                /* now grains if present */
63                if( gv.lgDustOn )
64                {
65                        /* we will first print the total abundances of each element locked up in grains */
66                        /* initialize print routine for dust*/
67                        PrtElem("initD","  ",0.);
68                        for( i=0; i < LIMELM; i++ )
69                        {
70                                if( gv.elmSumAbund[i]>SMALLFLOAT )
71                                {
72                                        /* fill in print buffer with abundances */
73                                        PrtElem("fill",(char*)elementnames.chElementSym[i],
74                                                gv.elmSumAbund[i]/dense.gas_phase[ipHYDROGEN]);
75                                }
76                        }
77                        /* flush the print buffer */
78                        PrtElem("flus","  ",0.);
79                        /* final carriage return */
80                        fprintf( ioQQQ, " \n" );
81
82                        /* this is used to store grain number density per hydrogen */
83                        GrainNumRelHydrSilicate = 0.;
84                        GrainNumRelHydrCarbonaceous = 0;
85                        GrainNumRelHydr_PAH = 0.;
86                        GrainMassRelHydrSilicate = 0.;
87                        GrainMassRelHydrCarbonaceous = 0;
88                        GrainMassRelHydr_PAH = 0.;
89
90                        for( nd=0; nd < gv.nBin; nd++ )
91                        {
92
93                                /* number density of grains per hydrogen, the ratio
94                                 * gv.bin[nd]->IntVol/gv.bin[nd]->AvVol is the number of grain particles
95                                 * per H at standard grain abundance*/
96                                realnum DensityNumberPerHydrogen =
97                                        (gv.bin[nd]->IntVol/gv.bin[nd]->AvVol)*gv.bin[nd]->dstAbund /
98                                        gv.bin[nd]->GrnVryDpth;
99                                /* mass of grains per hydrogen */
100                                realnum DensityMassPerHydrogen =
101                                        gv.bin[nd]->IntVol*gv.bin[nd]->dustp[0]*gv.bin[nd]->dstAbund/
102                                        (realnum)ATOMIC_MASS_UNIT / gv.bin[nd]->GrnVryDpth;
103                                        /*(gv.bin[nd]->IntVol/gv.bin[nd]->AvVol)*gv.bin[nd]->dstAbund*
104                                        gv.bin[nd]->atomWeight / gv.bin[nd]->GrnVryDpth;*/
105
106                                /* >>chng 06 mar 05, fix expression for calculating grain number density, PvH */
107                                if( gv.bin[nd]->matType == MAT_CAR || gv.bin[nd]->matType == MAT_CAR2 )
108                                {
109                                        /* carbonaceous grains */
110                                        GrainNumRelHydrCarbonaceous += DensityNumberPerHydrogen;
111                                        GrainMassRelHydrCarbonaceous += DensityMassPerHydrogen;
112                                }
113                                else if( gv.bin[nd]->matType == MAT_SIL || gv.bin[nd]->matType == MAT_SIL2 )
114                                {
115                                        /* silicate grains */
116                                        GrainNumRelHydrSilicate += DensityNumberPerHydrogen;
117                                        GrainMassRelHydrSilicate += DensityMassPerHydrogen;
118                                }
119                                else if( gv.bin[nd]->matType == MAT_PAH || gv.bin[nd]->matType == MAT_PAH2 )
120                                {
121                                        /* PAHs - full abundance - remove possible factor accounting for
122                                         * variation of abundances with physical conditions - this will
123                                         * be the PAH abundance with scale factor of unity */
124                                        GrainNumRelHydr_PAH += DensityNumberPerHydrogen;
125                                        GrainMassRelHydr_PAH += DensityMassPerHydrogen;
126                                }
127                                else
128                                        TotalInsanity();
129                        }
130
131                        /* now print total number of grains of each type */
132                        fprintf(ioQQQ,"              Number of grains per hydrogen (scale=1)                         Mass of grains per hydrogen (scale=1)\n");
133                        fprintf(ioQQQ,"        Carbonaceous: %.3f  Silicate: %.3f  PAH: %.3f         Carbonaceous: %.3f  Silicate: %.3f  PAH: %.3f\n\n" ,
134                                log10( MAX2( 1e-30, GrainNumRelHydrCarbonaceous ) ) ,
135                                log10( MAX2( 1e-30, GrainNumRelHydrSilicate ) ) ,
136                                log10( MAX2( 1e-30, GrainNumRelHydr_PAH ) ) ,
137                                log10( MAX2( 1e-30, GrainMassRelHydrCarbonaceous ) ) ,
138                                log10( MAX2( 1e-30, GrainMassRelHydrSilicate ) ) ,
139                                log10( MAX2( 1e-30, GrainMassRelHydr_PAH ) )  );
140                }
141        }
142        return;
143}
144
145/*AbundancesSet print all abundances, both gas phase and grains */
146void AbundancesSet(void)
147{
148        long int i,
149          nelem;
150        double fac;
151        static bool lgFirstCall=true;
152        static bool lgElOnOff[LIMELM];
153
154        DEBUG_ENTRY( "AbundancesSet()" );
155
156        /* if this is the first call to this routine in this core load,
157         * save the state of the lgElmOn array, so that it is possible
158         * to turn off elements in later models, but not turn on an
159         * element that was initially turned off.  This is necessary since
160         * the Create... routines that create space for elements will
161         * not be revisited in later models.  You can turn off an initially
162         * enabled element, but not turn a disabled one on.  */
163
164        if( lgFirstCall )
165        {
166                /* first call - save the initial state of the lgElmtOn vector */
167                for( i=0; i<LIMELM; ++i )
168                {
169                        lgElOnOff[i] = dense.lgElmtOn[i];
170                }
171        }
172        lgFirstCall = false;
173
174        /* make sure that initially false elements remain off, while letting
175         * enabled elements be turned off */
176        for( i=ipHYDROGEN; i<LIMELM; ++i )
177        {
178                dense.lgElmtOn[i] = lgElOnOff[i] && dense.lgElmtOn[i];
179        }
180
181        /* rescale so that abundances are H=1 */
182        for( i=ipHELIUM; i < LIMELM; i++ )
183        {
184                abund.solar[i] /= abund.solar[0];
185        }
186        abund.solar[ipHYDROGEN] = 1.;
187
188        /* set current abundances to "solar" times metals scale factor
189         * and grain depletion factor */
190        abund.solar[ipHELIUM] *= abund.depset[1]*abund.ScaleElement[1];
191
192        /* option for density or abundance variations, this flag is true by default,
193         * set in zero, but set false if variations are enabled AND these
194         * are not density variations, but rather abundances */
195        if( dense.lgDenFlucOn )
196        {
197                /* usual case - either density fluctuations or none at all */
198                fac = 1.;
199        }
200        else
201        {
202                /* abundance fluctuations enabled, set initial value */
203                fac = dense.cfirst*cos(dense.flcPhase) + dense.csecnd;
204        }
205
206        for( i=ipLITHIUM; i < LIMELM; i++ )
207        {
208                abund.solar[i] *= (realnum)(abund.ScaleMetals*abund.depset[i]*
209                  abund.ScaleElement[i]*fac);
210        }
211
212        /* now fix abundance of any element with element table set */
213        if( abund.lgAbTaON )
214        {
215                for( nelem=ipHELIUM; nelem < LIMELM; ++nelem )
216                {
217                        if( abund.lgAbunTabl[nelem] )
218                        {
219                                abund.solar[nelem] = (realnum)(AbundancesTable(radius.Radius,
220                                  radius.depth,nelem+1));
221                        }
222                }
223        }
224
225        /* dense.gas_phase[nelem] contains total abundance of element */
226        /* the density of hydrogen itself has already been set at this point -
227         * it is set when commands parsed, most likely by the hden command -
228         * set all heavier elements */
229        /* if abund.solar[ipHYDROGEN] == 1, consistency doesn't hurt that much */
230        for( nelem=ipHYDROGEN; nelem < LIMELM; ++nelem )
231        {
232                /* this implements the element off limit xxx command, where
233                 * xxx is the limit to the smallest n(A)/n(H) that will remain on */
234                if( abund.solar[nelem] < dense.AbundanceLimit )
235                        dense.lgElmtOn[nelem] = false;
236
237                if( dense.lgElmtOn[nelem] )
238                {
239                        dense.gas_phase[nelem] = abund.solar[nelem]*dense.gas_phase[ipHYDROGEN];
240                        if( dense.gas_phase[nelem] <= 0. )
241                        {
242                                fprintf( ioQQQ, " Abundances must be greater than zero.  "
243                                        "Check entered abundance for element%3ld  = %2.2s\n",
244                                nelem, elementnames.chElementSym[nelem] );
245                                cdEXIT(EXIT_FAILURE);
246                        }
247                        else if( dense.gas_phase[nelem] < SMALLFLOAT )
248                        {
249                                fprintf(ioQQQ," Abundance for %s is %.2e, less than lower "
250                                        "limit of %.3e, so turning element off.\n",
251                                        elementnames.chElementSym[nelem],
252                                        dense.gas_phase[nelem],
253                                        SMALLFLOAT );
254                                dense.lgElmtOn[nelem] = false;
255                        }
256                        else if( dense.gas_phase[nelem] > MAX_DENSITY )
257                        {
258                                fprintf(ioQQQ," Abundance for %s is %.2e.  This version of Cloudy does not "
259                                        "permit densities greater than %e cm-3.\n",
260                                        elementnames.chElementSym[nelem],
261                                        dense.gas_phase[nelem],
262                                        MAX_DENSITY );
263                                cdEXIT(EXIT_FAILURE);
264                        }
265                }
266                if( !dense.lgElmtOn[nelem] )
267                {
268                        /* >>chng 04 apr 20, set to zero if element is off */
269                        dense.gas_phase[nelem] = 0.;
270                }
271
272                /* Set all neutral ions to maintain invariant */
273                dense.xIonDense[nelem][0] = dense.gas_phase[nelem];
274                for( long int ion=1; ion < LIMELM+1; ion++ )
275                {
276                        dense.xIonDense[nelem][ion] = 0.;
277                }
278
279        }
280
281        /* if stop temp set below default then we are going into cold and possibly
282         * molecular gas - check some parameters in this case */
283        if( called.lgTalk && (StopCalc.TempLoStopZone < phycon.TEMP_STOP_DEFAULT ||
284                /* thermal.ConstTemp def is zero, set pos when used */
285                (thermal.ConstTemp > 0. && thermal.ConstTemp < phycon.TEMP_STOP_DEFAULT ) ) )
286        {
287
288                /* print warning if temperature set below default but C > O */
289                if( dense.lgElmtOn[ipOXYGEN] && dense.gas_phase[ipCARBON]/SDIV( dense.gas_phase[ipOXYGEN]) >= 1. )
290                {
291                        fprintf( ioQQQ, "\n >>> \n"
292                                                        " >>> The simulation is going into possibly molecular gas but the carbon/oxygen abundance ratio is greater than unity.\n" );
293                        fprintf( ioQQQ, " >>> Standard interstellar chemistry networks are designed for environments with C/O < 1.\n" );
294                        fprintf( ioQQQ, " >>> The chemistry network may (or may not) collapse deep in molecular regions where CO is fully formed.\n" );
295                        fprintf( ioQQQ, " >>> \n\n\n\n\n" );
296                }
297        }
298
299        if( trace.lgTrace )
300        {
301                realnum sumx , sumy , sumz = 0.;
302
303                sumx = dense.gas_phase[ipHYDROGEN]*dense.AtomicWeight[ipHYDROGEN];
304                sumy = dense.gas_phase[ipHELIUM]*dense.AtomicWeight[ipHELIUM];
305
306                fprintf( ioQQQ, "\n AbundancesSet sets following densities (cm^-3); \n" );
307                for( i=0; i<3; i++ )
308                {
309                        for( nelem=i*10; nelem < i*10+10; nelem++ )
310                        {
311                                fprintf( ioQQQ, " %2.2s", elementnames.chElementSym[nelem] );
312                                PrintE82( ioQQQ, dense.gas_phase[nelem] );
313                                if( nelem>ipHELIUM )
314                                        sumz += dense.gas_phase[nelem]*dense.AtomicWeight[nelem];
315                        }
316                        fprintf( ioQQQ, " \n" );
317                }
318                fprintf( ioQQQ, "\n AbundancesSet sets following abundances rel to H; \n" );
319                for( i=0; i<3; i++ )
320                {
321                        for( nelem=i*10; nelem < i*10+10; nelem++ )
322                        {
323                                fprintf( ioQQQ, " %2.2s", elementnames.chElementSym[nelem] );
324                                PrintE82( ioQQQ, dense.gas_phase[nelem]/dense.gas_phase[ipHYDROGEN] );
325                        }
326                        fprintf( ioQQQ, " \n" );
327                }
328                fprintf( ioQQQ, " \n" );
329                fprintf(ioQQQ," Gas-phase mass fractions, X:%.3e Y:%.3e Z:%.3e\n\n",
330                        sumx/SDIV(sumx+sumy+sumz) ,
331                        sumy/SDIV(sumx+sumy+sumz) ,
332                        sumz/SDIV(sumx+sumy+sumz) );
333        }
334        return;
335}
336
337/* this is number of elements across one line */
338#define NELEM1LINE      9
339
340/*PrtElem print chemical composition at start of calculation */
341STATIC void PrtElem(
342  /* the job to do, the options are "init", "fill", "flus" */
343  const char *chJob,
344  /* label for the element */
345  const char *chLabl,
346  /* its abundance */
347  double abund_prt)
348{
349        static char chAllLabels[NELEM1LINE][14];/* buffer where elements will be stored*/
350        long int i,
351          noffset;
352        static long int nelem;  /* counter for number of elements read in*/
353
354        DEBUG_ENTRY( "PrtElem()" );
355
356        if( strcmp(chJob,"initG") == 0 )
357        {
358                /* gas phase abundances */
359                nelem = 0;
360                fprintf( ioQQQ,
361                        "                                                  Gas Phase Chemical Composition\n" );
362        }
363        else if( strcmp(chJob,"initD") == 0 )
364        {
365                /* abundances in grains */
366                nelem = 0;
367                fprintf( ioQQQ,
368                        "                                                    Grain Chemical Composition\n" );
369        }
370
371        else if( strcmp(chJob,"fill") == 0 )
372        {
373                /* print log of abundance to avoid exponential output */
374                abund_prt = log10( abund_prt );
375                /* stuff in labels and abundances */
376                sprintf( chAllLabels[nelem], "  %2.2s:%8.4f", chLabl, abund_prt );
377                if( nelem == NELEM1LINE-1 )
378                {
379                        /* we hit as many as it will hold - print it out and reset*/
380                        fprintf( ioQQQ, "      " );
381                        for( i=0; i < NELEM1LINE; i++ )
382                        {
383                                fprintf( ioQQQ, "%13.13s", chAllLabels[i] );
384                        }
385                        fprintf( ioQQQ, "\n" );
386                        /* reset counter to zero */
387                        nelem = 0;
388                }
389                else
390                {
391                        /* just increment */
392                        ++nelem;
393                }
394        }
395
396#       if 0
397        /* Do this if you want to know about PAH number abundance */
398        else if( strcmp(chJob,"fillp") == 0 )
399        {
400                /* print log of abundance to avoid exponential output */
401                abund_prt = log10( abund_prt );
402
403                /* stuff in labels and abundances */
404                sprintf( chAllLabels[nelem], "  %2.2s:%8.4f", chLabl, abund_prt );
405                if( nelem == NELEM1LINE-1 )
406                {
407                        /* we hit as many as it will hold - print it out and reset*/
408                        fprintf( ioQQQ, "      " );
409                        for( i=0; i < NELEM1LINE; i++ )
410                        {
411                                fprintf( ioQQQ, "%13.13s", chAllLabels[i] );
412                        }
413                        fprintf( ioQQQ, "\n" );
414                        /* reset counter to zero */
415                        nelem = 0;
416                }
417                else
418                {
419                        /* just increment */
420                        ++nelem;
421                }
422        }
423#       endif
424
425        else if( strcmp(chJob,"flus") == 0 )
426        {
427                /* flush the stack */
428                i = NELEM1LINE - (nelem - 2);
429                noffset = i/2-1;
430                /* make format pretty */
431                fprintf( ioQQQ, "      " );
432
433                for(i=0; i < noffset; i++)
434                {
435                        /* skip out this many fields */
436                        fprintf( ioQQQ, "             " );
437                }
438
439                /* if nelem is even we need to space out another 8 */
440                if( !(nelem%2) && nelem > 0)
441                        fprintf( ioQQQ,"        ");
442
443                for( i=0; i < nelem; i++ )
444                {
445                        fprintf( ioQQQ, "%13.13s", chAllLabels[i] );
446                }
447
448                fprintf( ioQQQ, "\n" );
449        }
450        else
451        {
452                fprintf( ioQQQ, " PrtElem does not understand job=%4.4s\n",
453                  chJob );
454                cdEXIT(EXIT_FAILURE);
455        }
456        return;
457}
458
459
460/*AbundancesTable interpolate on table of points to do 'element table' command, */
461double AbundancesTable(double r0,
462  double depth,
463  long int iel)
464{
465        bool lgHit;
466        long int j;
467        double frac,
468          tababun_v,
469          x;
470
471        DEBUG_ENTRY( "AbundancesTable()" );
472        /* interpolate on table of points to do 'element table' command, based
473         * on code by K Volk, each line is log radius and abundance. */
474
475        /* interpolate on radius or depth? */
476        if( abund.lgAbTaDepth[iel-1] )
477        {
478                /* depth key appeared = we want depth */
479                x = log10(depth);
480        }
481        else
482        {
483                /* use radius */
484                x = log10(r0);
485        }
486
487        /* this will be reset below, but is here as a safety check */
488        tababun_v = -DBL_MAX;
489
490        if( x < abund.AbTabRad[0][iel-1] || x >= abund.AbTabRad[abund.nAbunTabl-1][iel-1] )
491        {
492                fprintf( ioQQQ, " requested radius outside range of AbundancesTable\n" );
493                fprintf( ioQQQ, " radius was%10.2e min, max=%10.2e%10.2e\n",
494                  x, abund.AbTabRad[0][iel-1], abund.AbTabRad[abund.nAbunTabl-1][iel-1] );
495                cdEXIT(EXIT_FAILURE);
496        }
497
498        else
499        {
500                lgHit = false;
501                j = 1;
502
503                while( !lgHit && j <= abund.nAbunTabl - 1 )
504                {
505                        if( abund.AbTabRad[j-1][iel-1] <= (realnum)x &&
506                                abund.AbTabRad[j][iel-1] > (realnum)x )
507                        {
508                                frac = (x - abund.AbTabRad[j-1][iel-1])/(abund.AbTabRad[j][iel-1] -
509                                  abund.AbTabRad[j-1][iel-1]);
510                                tababun_v = abund.AbTabFac[j-1][iel-1] + frac*
511                                  (abund.AbTabFac[j][iel-1] - abund.AbTabFac[j-1][iel-1]);
512                                lgHit = true;
513                        }
514                        ++j;
515                }
516
517                if( !lgHit )
518                {
519                        fprintf( ioQQQ, " radius outran dlaw table scale, requested=%6.2f largest=%6.2f\n",
520                          x, abund.AbTabRad[abund.nAbunTabl-1][iel-1] );
521                        cdEXIT(EXIT_FAILURE);
522                }
523        }
524
525        /* got it, now return value, not log of density */
526        tababun_v = pow(10.,tababun_v);
527        return( tababun_v );
528}
529
530#ifdef _MSC_VER
531#       pragma warning( disable : 4305 )/* disable const double to float warning in MS VS -
532                                                                           very large number of warns result */
533#endif
534/*AbundancesZero set initial abundances for different mixes */
535void AbundancesZero(void)
536{
537        long int i;
538
539        DEBUG_ENTRY( "AbundancesZero()" );
540
541        /* solar abundances
542         * >>refer      solar   abund   Grevesse, N., & Sauval, A.J., 2001, Space Science Review, 85, 161-174 */
543        /* >>chng 02 aug 20, update to these values */
544        abund.SolarSave[ipHYDROGEN] = 1.0f;
545        abund.SolarSave[ipHELIUM] = 0.100f;
546        abund.SolarSave[ipLITHIUM] = 2.04e-9f;
547        abund.SolarSave[ipBERYLLIUM] = 2.63e-11f;
548        abund.SolarSave[ipBORON] = 6.17E-10f;
549        /* >>chng 02 jul 30, from 3.55 to 2.45, */
550        /* >>refer      C       abund   Allende Prieto, C.,
551         * >>refercon   Lambert, D.L., & Asplund, M., 2002, ApJ, 573, L137 */
552        abund.SolarSave[ipCARBON] = 2.45e-4f;
553        /* >>chng 02 jul 30, from 9.33 to 8.53, */
554        /* >>refer      N       abund   Holweger, H., 2001, Joint SOHO/ACE workshop `Solar and Galactic
555         * >>refercon   Composition'. Edited by Robert F. Wimmer-Schweingruber. Publisher:
556         * >>refercon   American Institute of Physics Conference proceedings vol. 598 location: Bern,
557         * >>refercon   Switzerland, March 6 - 9, 2001., p.23 */
558        abund.SolarSave[ipNITROGEN] = 8.51e-5f;
559        /* >>chng 02 jul 30, from 7.41 to 4.90, */
560        /* >>refer      O       abund   Allende Prieto, C.,
561         * >>refercon   Lambert, D.L., & Asplund, M., 2001, ApJ, 556, L63 */
562        abund.SolarSave[ipOXYGEN] = 4.90e-4f;
563        abund.SolarSave[ipFLUORINE] = 3.02e-8f;
564        /* >>chng 02 jul 30, from 1.17 to 1.00, */
565        /* >>refer      Ne      abund   Holweger, H., 2001, Joint SOHO/ACE workshop `Solar and Galactic
566         * >>refercon   Composition'. Edited by Robert F. Wimmer-Schweingruber. Publisher:
567         * >>refercon   American Institute of Physics Conference proceedings vol. 598 location: Bern,
568         * >>refercon   Switzerland, March 6 - 9, 2001., p.23 */
569        abund.SolarSave[ipNEON] = 1.00e-4f;
570        abund.SolarSave[ipSODIUM] = 2.14e-6f;
571        /* >>chng 02 jul 30, from 3.80 to 3.45, */
572        /* >>refer      Mg      abund   Holweger, H., 2001, Joint SOHO/ACE workshop `Solar and Galactic
573         * >>refercon   Composition'. Edited by Robert F. Wimmer-Schweingruber. Publisher:
574         * >>refercon   American Institute of Physics Conference proceedings vol. 598 location: Bern,
575         * >>refercon   Switzerland, March 6 - 9, 2001., p.23 */
576        abund.SolarSave[ipMAGNESIUM] = 3.47e-5f;
577        abund.SolarSave[ipALUMINIUM] = 2.95e-6f;
578        /* >>chng 02 jul 30, from 3.55 to 3.44, */
579        /* >>refer      Si      abund   Holweger, H., 2001, Joint SOHO/ACE workshop `Solar and Galactic
580         * >>refercon   Composition'. Edited by Robert F. Wimmer-Schweingruber. Publisher:
581         * >>refercon   American Institute of Physics Conference proceedings vol. 598 location: Bern,
582         * >>refercon   Switzerland, March 6 - 9, 2001., p.23 */
583        abund.SolarSave[ipSILICON] = 3.47e-5f;
584        abund.SolarSave[ipPHOSPHORUS] = 3.20e-7f;
585        abund.SolarSave[ipSULPHUR] = 1.84e-5f;
586        abund.SolarSave[ipCHLORINE] = 1.91e-7f;
587        abund.SolarSave[ipARGON] = 2.51e-6f;
588        abund.SolarSave[ipPOTASSIUM] = 1.32e-7f;
589        abund.SolarSave[ipCALCIUM] = 2.29e-6f;
590        abund.SolarSave[ipSCANDIUM] = 1.48e-9f;
591        abund.SolarSave[ipTITANIUM] = 1.05e-7f;
592        abund.SolarSave[ipVANADIUM] = 1.00e-8f;
593        abund.SolarSave[ipCHROMIUM] = 4.68e-7f;
594        abund.SolarSave[ipMANGANESE] = 2.88e-7f;
595        /* >>chng 02 jul 30, from 3.24 to 2.81, */
596        /* >>refer      Fe      abund   Holweger, H., 2001, Joint SOHO/ACE workshop `Solar and Galactic
597         * >>refercon   Composition'. Edited by Robert F. Wimmer-Schweingruber. Publisher:
598         * >>refercon   American Institute of Physics Conference proceedings vol. 598 location: Bern,
599         * >>refercon   Switzerland, March 6 - 9, 2001., p.23 */
600        abund.SolarSave[ipIRON] = 2.82e-5f;
601        abund.SolarSave[ipCOBALT] = 8.32e-8f;
602        abund.SolarSave[ipNICKEL] = 1.78e-6f;
603        abund.SolarSave[ipCOPPER] = 1.62e-8f;
604        abund.SolarSave[ipZINC] = 3.98e-8f;
605
606        /* abundance set from pre-c96 */
607        /* solar abundances Grevesse and Anders 1989, Grevesse and Noel 1993 */
608        abund.OldSolar84[ipHYDROGEN] = 1.0;
609        abund.OldSolar84[ipHELIUM] = 0.100;
610        abund.OldSolar84[ipLITHIUM] = 2.04e-9;
611        abund.OldSolar84[ipBERYLLIUM] = 2.63e-11;
612        abund.OldSolar84[ipBORON] = 7.59e-10;
613        abund.OldSolar84[ipCARBON] = 3.55e-4;
614        abund.OldSolar84[ipNITROGEN] = 9.33e-5;
615        abund.OldSolar84[ipOXYGEN] = 7.41e-4;
616        abund.OldSolar84[ipFLUORINE] = 3.02e-8;
617        abund.OldSolar84[ipNEON] = 1.17e-4;
618        abund.OldSolar84[ipSODIUM] = 2.06e-6;
619        abund.OldSolar84[ipMAGNESIUM] = 3.80e-5;
620        abund.OldSolar84[ipALUMINIUM] = 2.95e-6;
621        abund.OldSolar84[ipSILICON] = 3.55e-5;
622        abund.OldSolar84[ipPHOSPHORUS] = 3.73e-7;
623        abund.OldSolar84[ipSULPHUR] = 1.62e-5;
624        abund.OldSolar84[ipCHLORINE] = 1.88e-7;
625        abund.OldSolar84[ipARGON] = 3.98e-6;
626        abund.OldSolar84[ipPOTASSIUM] = 1.35e-7;
627        abund.OldSolar84[ipCALCIUM] = 2.29e-6;
628        abund.OldSolar84[ipSCANDIUM] = 1.58e-9;
629        abund.OldSolar84[ipTITANIUM] = 1.10e-7;
630        abund.OldSolar84[ipVANADIUM] = 1.05e-8;
631        abund.OldSolar84[ipCHROMIUM] = 4.84e-7;
632        abund.OldSolar84[ipMANGANESE] = 3.42e-7;
633        abund.OldSolar84[ipIRON] = 3.24e-5;
634        abund.OldSolar84[ipCOBALT] = 8.32e-8;
635        abund.OldSolar84[ipNICKEL] = 1.76e-6;
636        abund.OldSolar84[ipCOPPER] = 1.87e-8;
637        abund.OldSolar84[ipZINC] = 4.52e-8;
638
639        /* Nova Cyg 75 abundances, C, O, NE UP 20, NIT UP 100, REST SOLAR AR */
640        abund.anova[ipHYDROGEN] = 1.0;
641        abund.anova[ipHELIUM] = 0.098;
642        abund.anova[ipLITHIUM] = 2.04e-9;
643        abund.anova[ipBERYLLIUM] = 2.6e-11;
644        abund.anova[ipBORON] = 7.60e-9;
645        abund.anova[ipCARBON] = 9.4e-4;
646        abund.anova[ipNITROGEN] = 9.8e-3;
647        abund.anova[ipOXYGEN] = 1.7e-2;
648        abund.anova[ipFLUORINE] = 3.02e-8;
649        abund.anova[ipNEON] = 2.03e-3;
650        abund.anova[ipSODIUM] = 2.06e-6;
651        abund.anova[ipMAGNESIUM] = 3.80e-5;
652        abund.anova[ipALUMINIUM] = 2.95e-6;
653        abund.anova[ipSILICON] = 3.55e-5;
654        abund.anova[ipPHOSPHORUS] = 3.73e-7;
655        abund.anova[ipSULPHUR] = 1.62e-5;
656        abund.anova[ipCHLORINE] = 1.88e-7;
657        abund.anova[ipARGON] = 3.63e-6;
658        abund.anova[ipPOTASSIUM] = 1.35e-7;
659        abund.anova[ipCALCIUM] = 2.29e-6;
660        abund.anova[ipSCANDIUM] = 1.22e-9;
661        abund.anova[ipTITANIUM] = 8.60e-8;
662        abund.anova[ipVANADIUM] = 1.05e-8;
663        abund.anova[ipCHROMIUM] = 4.84e-7;
664        abund.anova[ipMANGANESE] = 3.42e-7;
665        abund.anova[ipIRON] = 4.68e-5;
666        abund.anova[ipCOBALT] = 2.24e-9;
667        abund.anova[ipNICKEL] = 1.76e-6;
668        abund.anova[ipCOPPER] = 1.87e-8;
669        abund.anova[ipZINC] = 4.52e-8;
670
671        /* primordial abundances */
672        abund.aprim[ipHYDROGEN] = 1.0;
673        abund.aprim[ipHELIUM] = 0.072;
674        abund.aprim[ipLITHIUM] = 1e-10;
675        abund.aprim[ipBERYLLIUM] = 1e-16;
676
677        for( i=4; i < LIMELM; i++ )
678        {
679                abund.aprim[i] = 1e-25;
680        }
681
682        /* typical ISM abundances, mean of Table 3, Cowie+Songaila, Ann Rev '86
683         * also Table 5, Savage and Sembach, Ann Rev 1996 */
684        abund.aism[ipHYDROGEN] = 1.;
685        abund.aism[ipHELIUM] = 0.098;
686        abund.aism[ipLITHIUM] = 5.4e-11;
687        abund.aism[ipBERYLLIUM] = 1e-20;
688        abund.aism[ipBORON] = 8.9e-11;
689        abund.aism[ipCARBON] = 2.51e-4;
690        abund.aism[ipNITROGEN] = 7.94e-5;
691        /* >>chng >>01 feb 19, from 5.01e-4 to 3.19e-4, value from */
692        /* >>refer      O       abundance       Meyers, D.M., Jura, M., & Cardelli, J.A., 1998, ApJ, 493, 222-229 */
693        /* they quote 3.19 +/- 0.14 e-4 */
694        abund.aism[ipOXYGEN] = 3.19e-4;
695        abund.aism[ipFLUORINE] = 1e-20;
696        abund.aism[ipNEON] = 1.23e-4;
697        abund.aism[ipSODIUM] = 3.16e-7;
698        abund.aism[ipMAGNESIUM] = 1.26e-5;
699        abund.aism[ipALUMINIUM] = 7.94e-8;
700        abund.aism[ipSILICON] = 3.16e-6;
701        abund.aism[ipPHOSPHORUS] = 1.6e-7;
702        abund.aism[ipSULPHUR] = 3.24e-5;
703        abund.aism[ipCHLORINE] = 1e-7;
704        abund.aism[ipARGON] = 2.82e-6;
705        abund.aism[ipPOTASSIUM] = 1.1e-8;
706        abund.aism[ipCALCIUM] = 4.1e-10;
707        abund.aism[ipSCANDIUM] = 1e-20;
708        abund.aism[ipTITANIUM] = 5.8e-10;
709        abund.aism[ipVANADIUM] = 1.0e-10;
710        abund.aism[ipCHROMIUM] = 1.0e-8;
711        abund.aism[ipMANGANESE] = 2.3e-8;
712        abund.aism[ipIRON] = 6.31e-7;
713        abund.aism[ipCOBALT] = 1e-20;
714        abund.aism[ipNICKEL] = 1.82e-8;
715        abund.aism[ipCOPPER] = 1.5e-9;
716        abund.aism[ipZINC] = 2.0e-8;
717
718        /* HII region abundances, Orion mean of Baldwin et al, Rubin et al,
719         * and DEO et al, all 1991 apj
720         * also Table 5, Savage and Sembach, Ann Rev 1996 for ism */
721        abund.ahii[ipHYDROGEN] = 1.;
722        abund.ahii[ipHELIUM] = 0.095;
723        abund.ahii[ipLITHIUM] = 5.4e-11;
724        abund.ahii[ipBERYLLIUM] = 1e-20;
725        abund.ahii[ipBORON] = 8.9e-11;
726        abund.ahii[ipCARBON] = 3.e-4;
727        abund.ahii[ipNITROGEN] = 7.0e-5;
728        abund.ahii[ipOXYGEN] = 4.0e-4;
729        abund.ahii[ipFLUORINE] = 1e-20;
730        abund.ahii[ipNEON] = 6e-5;
731        abund.ahii[ipSODIUM] = 3e-7;
732        abund.ahii[ipMAGNESIUM] = 3.e-6;
733        abund.ahii[ipALUMINIUM] = 2.e-7;
734        abund.ahii[ipSILICON] = 4.e-6;
735        abund.ahii[ipPHOSPHORUS] = 1.6e-7;
736        abund.ahii[ipSULPHUR] = 1.0e-5;
737        abund.ahii[ipCHLORINE] = 1.e-7;
738        abund.ahii[ipARGON] = 3.e-6;
739        abund.ahii[ipPOTASSIUM] = 1.1e-8;
740        abund.ahii[ipCALCIUM] = 2.e-8;
741        abund.ahii[ipSCANDIUM] = 1e-20;
742        abund.ahii[ipTITANIUM] = 5.8e-10;
743        abund.ahii[ipVANADIUM] = 1.0e-10;
744        abund.ahii[ipCHROMIUM] = 1.0e-8;
745        abund.ahii[ipMANGANESE] = 2.3e-8;
746        abund.ahii[ipIRON] = 3.0e-6;
747        abund.ahii[ipCOBALT] = 1e-20;
748        abund.ahii[ipNICKEL] = 1e-7;
749        abund.ahii[ipCOPPER] = 1.5e-9;
750        abund.ahii[ipZINC] = 2.0e-8;
751
752        /* PN abund from  */
753        /* >>refer      PN      abundances      Aller+Czyzak, ApJ Sup 51, 211 */
754        abund.apn[ipHYDROGEN] = 1.;
755        abund.apn[ipHELIUM] = 0.1;
756        abund.apn[ipLITHIUM] = 1e-20;
757        abund.apn[ipBERYLLIUM] = 1e-20;
758        abund.apn[ipBORON] = 1e-20;
759        abund.apn[ipCARBON] = 7.8e-4;
760        abund.apn[ipNITROGEN] = 1.8e-4;
761        abund.apn[ipOXYGEN] = 4.4e-4;
762        abund.apn[ipFLUORINE] = 3e-7;
763        abund.apn[ipNEON] = 1.1e-4;
764        abund.apn[ipSODIUM] = 1.9e-6;
765        abund.apn[ipMAGNESIUM] = 1.6e-6;
766        abund.apn[ipALUMINIUM] = 2.7e-7;
767        abund.apn[ipSILICON] = 1e-5;
768        abund.apn[ipPHOSPHORUS] = 2e-7;
769        abund.apn[ipSULPHUR] = 1e-5;
770        abund.apn[ipCHLORINE] = 1.7e-7;
771        abund.apn[ipARGON] = 2.7e-6;
772        abund.apn[ipPOTASSIUM] = 1.2e-7;
773        abund.apn[ipCALCIUM] = 1.2e-8;
774        abund.apn[ipSCANDIUM] = 1e-20;
775        abund.apn[ipTITANIUM] = 1e-20;
776        abund.apn[ipVANADIUM] = 1e-20;
777        abund.apn[ipCHROMIUM] = 1e-20;
778        abund.apn[ipMANGANESE] = 1e-20;
779        abund.apn[ipIRON] = 5.0e-7;
780        abund.apn[ipCOBALT] = 1e-20;
781        abund.apn[ipNICKEL] = 1.8e-8;
782        abund.apn[ipCOPPER] = 1e-20;
783        abund.apn[ipZINC] = 1e-20;
784
785        /* mix from Cameron 1982, in "Essays on Nuclear Astro" */
786        abund.camern[ipHYDROGEN] = 1.;
787        abund.camern[ipHELIUM] = .0677;
788        abund.camern[ipLITHIUM] = 2.2e-9;
789        abund.camern[ipBERYLLIUM] = 4.5e-11;
790        abund.camern[ipBORON] = 3.4e-10;
791        abund.camern[ipCARBON] = 4.22e-4;
792        abund.camern[ipNITROGEN] = 8.72e-5;
793        abund.camern[ipOXYGEN] = 6.93e-4;
794        abund.camern[ipFLUORINE] = 2.9e-8;
795        abund.camern[ipNEON] = 9.77e-5;
796        abund.camern[ipSODIUM] = 2.25e-6;
797        abund.camern[ipMAGNESIUM] = 3.98e-5;
798        abund.camern[ipALUMINIUM] = 3.20e-6;
799        abund.camern[ipSILICON] = 3.76e-5;
800        abund.camern[ipPHOSPHORUS] = 2.4e-7;
801        abund.camern[ipSULPHUR] = 1.88e-5;
802        abund.camern[ipCHLORINE] = 1.78e-7;
803        abund.camern[ipARGON] = 3.99e-6;
804        abund.camern[ipPOTASSIUM] = 1.3e-7;
805        abund.camern[ipCALCIUM] = 2.35e-6;
806        abund.camern[ipSCANDIUM] = 1.16e-9;
807        abund.camern[ipTITANIUM] = 9.0e-8;
808        abund.camern[ipVANADIUM] = 9.5e-9;
809        abund.camern[ipCHROMIUM] = 4.8e-7;
810        abund.camern[ipMANGANESE] = 3.5e-7;
811        abund.camern[ipIRON] = 3.38e-5;
812        abund.camern[ipCOBALT] = 8.27e-8;
813        abund.camern[ipNICKEL] = 1.80e-6;
814        abund.camern[ipCOPPER] = 2.0e-8;
815        abund.camern[ipZINC] = 4.7e-8;
816
817        /* set logical flags saying whether to include element in AGN tables */
818        /* first set all false, since most not included */
819        for( i=0; i < LIMELM; i++ )
820        {
821                abund.lgAGN[i] = false;
822        }
823        abund.lgAGN[ipHYDROGEN] = true;
824        abund.lgAGN[ipHELIUM] = true;
825        abund.lgAGN[ipCARBON] = true;
826        abund.lgAGN[ipNITROGEN] = true;
827        abund.lgAGN[ipOXYGEN] = true;
828        abund.lgAGN[ipNEON] = true;
829        abund.lgAGN[ipMAGNESIUM] = true;
830        abund.lgAGN[ipSILICON] = true;
831        abund.lgAGN[ipSULPHUR] = true;
832        abund.lgAGN[ipARGON] = true;
833        abund.lgAGN[ipIRON] = true;
834        return;
835}
Note: See TracBrowser for help on using the browser.