00001
00002
00003
00004 #include "cddefines.h"
00005 #include "phycon.h"
00006 #include "dense.h"
00007 #include "atoms.h"
00008
00009
00010 double atom_pop3(
00011
00012 double g1, double g2, double g3,
00013
00014
00015 double o12, double o13, double o23,
00016
00017
00018 double a21, double a31, double a32,
00019
00020
00021 double Tex12, double Tex23,
00022
00023
00024 float *pop2,
00025
00026
00027 double abund,
00028
00029
00030 double gam2,
00031
00032
00033
00034 double r12,
00035 double r13 )
00036 {
00037 double alf,
00038 b12,
00039 b13,
00040 b23,
00041 bet,
00042 c21,
00043 c23,
00044 c31,
00045 c32,
00046 ex,
00047 fac,
00048 pop3_v;
00049
00050 DEBUG_ENTRY( "atom_pop3()" );
00051
00052
00053
00054 ex = Tex12/phycon.te;
00055 if( (abund <= 0.) || (ex > 20. && r12<SMALLFLOAT ) )
00056 {
00057 pop3_v = 0.;
00058 *pop2 = 0.;
00059
00060 DEBUG_EXIT( "atom_pop3()" );
00061 return( pop3_v );
00062 }
00063
00064
00065 ASSERT( g1>0. && g2>0. && g3>0. && o12>=0. && o13>=0. && o23>=0. && a21>=0. && a31>=0. && a32>=0. &&
00066 Tex12>=0. && Tex23>=0. );
00067
00068 b12 = exp(-ex);
00069 b23 = exp(-Tex23/phycon.te);
00070
00071 b13 = b12*b23;
00072 if( b13 == 0. && r12<SMALLFLOAT )
00073 {
00074 pop3_v = 0.;
00075 *pop2 = 0.;
00076
00077 DEBUG_EXIT( "atom_pop3()" );
00078 return( pop3_v );
00079 }
00080
00081
00082 atoms.c12 = dense.cdsqte*o12/g1*b12 + r12;
00083 atoms.c13 = dense.cdsqte*o13/g1*b13 + r13;
00084 c23 = dense.cdsqte*o23/g2*b23;
00085 c32 = dense.cdsqte*o23/g3;
00086 c31 = dense.cdsqte*o13/g3;
00087 c21 = dense.cdsqte*o12/g2;
00088
00089 alf = a21 + c21 + c23 + gam2;
00090 bet = a31 + a32 + c31 + c32;
00091 *pop2 = (float)((atoms.c13/bet + atoms.c12/(c32 + a32))/(alf/(c32 + a32) - c23/bet));
00092 pop3_v = (atoms.c13 + *pop2*c23)/bet;
00093
00094
00095 fac = abund/(1. + *pop2 + pop3_v);
00096 *pop2 *= (float)fac;
00097 pop3_v *= fac;
00098
00099 DEBUG_EXIT( "atom_pop3()" );
00100
00101 return( pop3_v );
00102 }
00103