|
Revision 1739, 2.3 kB
(checked in by rjrw, 12 months ago)
|
|
Merged from trunk r1700:1738
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | #include "cddefines.h" |
|---|
| 5 | #include "phycon.h" |
|---|
| 6 | #include "dense.h" |
|---|
| 7 | #include "atoms.h" |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | double atom_pop3( |
|---|
| 11 | |
|---|
| 12 | double g1, double g2, double g3, |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | double o12, double o13, double o23, |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | double a21, double a31, double a32, |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | double Tex12, double Tex23, |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | realnum *pop2, |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | double abund, |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | double gam2, |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | double r12, |
|---|
| 35 | double r13 ) |
|---|
| 36 | { |
|---|
| 37 | double alf, |
|---|
| 38 | b12, |
|---|
| 39 | b13, |
|---|
| 40 | b23, |
|---|
| 41 | bet, |
|---|
| 42 | c21, |
|---|
| 43 | c23, |
|---|
| 44 | c31, |
|---|
| 45 | c32, |
|---|
| 46 | ex, |
|---|
| 47 | fac, |
|---|
| 48 | pop3_v; |
|---|
| 49 | |
|---|
| 50 | DEBUG_ENTRY( "atom_pop3()" ); |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | ex = Tex12/phycon.te; |
|---|
| 55 | if( (abund <= 0.) || (ex > 20. && r12<SMALLFLOAT ) ) |
|---|
| 56 | { |
|---|
| 57 | pop3_v = 0.; |
|---|
| 58 | *pop2 = 0.; |
|---|
| 59 | return( pop3_v ); |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | ASSERT( g1>0. && g2>0. && g3>0. && o12>=0. && o13>=0. && o23>=0. && a21>=0. && a31>=0. && a32>=0. && |
|---|
| 64 | Tex12>=0. && Tex23>=0. ); |
|---|
| 65 | |
|---|
| 66 | b12 = exp(-ex); |
|---|
| 67 | b23 = exp(-Tex23/phycon.te); |
|---|
| 68 | |
|---|
| 69 | b13 = b12*b23; |
|---|
| 70 | if( b13 == 0. && r12<SMALLFLOAT ) |
|---|
| 71 | { |
|---|
| 72 | pop3_v = 0.; |
|---|
| 73 | *pop2 = 0.; |
|---|
| 74 | return( pop3_v ); |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | atoms.c12 = dense.cdsqte*o12/g1*b12 + r12; |
|---|
| 79 | atoms.c13 = dense.cdsqte*o13/g1*b13 + r13; |
|---|
| 80 | c23 = dense.cdsqte*o23/g2*b23; |
|---|
| 81 | c32 = dense.cdsqte*o23/g3; |
|---|
| 82 | c31 = dense.cdsqte*o13/g3; |
|---|
| 83 | c21 = dense.cdsqte*o12/g2; |
|---|
| 84 | |
|---|
| 85 | alf = a21 + c21 + c23 + gam2; |
|---|
| 86 | bet = a31 + a32 + c31 + c32; |
|---|
| 87 | *pop2 = (realnum)((atoms.c13/bet + atoms.c12/(c32 + a32))/(alf/(c32 + a32) - c23/bet)); |
|---|
| 88 | pop3_v = (atoms.c13 + *pop2*c23)/bet; |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | fac = abund/(1. + *pop2 + pop3_v); |
|---|
| 92 | *pop2 *= (realnum)fac; |
|---|
| 93 | pop3_v *= fac; |
|---|
| 94 | |
|---|
| 95 | return( pop3_v ); |
|---|
| 96 | } |
|---|