14static struct ZLabels {
17} Zs[] = { { 0,
"n" }, { 1,
"H" }, { 2,
"He" }, { 3,
"Li" }, { 4,
"Be" }, { 5,
"B" }, { 6,
"C" }, { 7,
"N" }, { 8,
"O" },
18 { 9,
"F" }, { 10,
"Ne" }, { 11,
"Na" }, { 12,
"Mg" }, { 13,
"Al" }, { 14,
"Si" }, { 15,
"P" }, { 16,
"S" }, { 17,
"Cl" },
19 { 18,
"Ar" }, { 19,
"K" }, { 20,
"Ca" }, { 21,
"Sc" }, { 22,
"Ti" }, { 23,
"V" }, { 24,
"Cr" }, { 25,
"Mn" }, { 26,
"Fe" },
20 { 27,
"Co" }, { 28,
"Ni" }, { 29,
"Cu" }, { 30,
"Zn" }, { 31,
"Ga" }, { 32,
"Ge" }, { 33,
"As" }, { 34,
"Se" }, { 35,
"Br" },
21 { 36,
"Kr" }, { 37,
"Rb" }, { 38,
"Sr" }, { 39,
"Y" }, { 40,
"Zr" }, { 41,
"Nb" }, { 42,
"Mo" }, { 43,
"Tc" }, { 44,
"Ru" },
22 { 45,
"Rh" }, { 46,
"Pd" }, { 47,
"Ag" }, { 48,
"Cd" }, { 49,
"In" }, { 50,
"Sn" }, { 51,
"Sb" }, { 52,
"Te" }, { 53,
"I" },
23 { 54,
"Xe" }, { 55,
"Cs" }, { 56,
"Ba" }, { 57,
"La" }, { 58,
"Ce" }, { 59,
"Pr" }, { 60,
"Nd" }, { 61,
"Pm" }, { 62,
"Sm" },
24 { 63,
"Eu" }, { 64,
"Gd" }, { 65,
"Tb" }, { 66,
"Dy" }, { 67,
"Ho" }, { 68,
"Er" }, { 69,
"Tm" }, { 70,
"Yb" }, { 71,
"Lu" },
25 { 72,
"Hf" }, { 73,
"Ta" }, { 74,
"W" }, { 75,
"Re" }, { 76,
"Os" }, { 77,
"Ir" }, { 78,
"Pt" }, { 79,
"Au" }, { 80,
"Hg" },
26 { 81,
"Tl" }, { 82,
"Pb" }, { 83,
"Bi" }, { 84,
"Po" }, { 85,
"At" }, { 86,
"Rn" }, { 87,
"Fr" }, { 88,
"Ra" }, { 89,
"Ac" },
27 { 90,
"Th" }, { 91,
"Pa" }, { 92,
"U" }, { 93,
"Np" }, { 94,
"Pu" }, { 95,
"Am" }, { 96,
"Cm" }, { 97,
"Bk" }, { 98,
"Cf" },
28 { 99,
"Es" }, { 100,
"Fm" }, { 101,
"Md" }, { 102,
"No" }, { 103,
"Lr" }, { 104,
"Rf" }, { 105,
"Db" }, { 106,
"Sg" }, { 107,
"Bh" },
29 { 108,
"Hs" }, { 109,
"Mt" } };
30static const int nZs =
sizeof( Zs ) /
sizeof( Zs[0] );
32static char const *lPoPs_ZSymbol(
int Z );
39 char *endptr, name_[256], AStr[32];
40 char const *ZStr, *alias = NULL;
43 char const *yiNames[] = {
"p",
"h2",
"h3",
"he3",
"he4",
"photon" };
44 char const *yiAliases[] = {
"h1",
"d",
"t",
"he3",
"a",
"g" };
48 if( special == NULL ) special =
"";
50 if( isdigit( name[0] ) ) {
51 ZA = (int) strtol( name, &endptr, 10 );
60 if( strcmp( special,
"LLNL" ) == 0 ) {
61 if( ( ZA > 1 ) && ( ZA < 8 ) ) {
62 strcpy( name_, yiNames[ZA-2] );
63 alias = yiAliases[ZA-2];
66 else if( ( ZA == 1801 ) || ( ZA == 1901 ) ) {
67 strcpy( name_, yiNames[0] );
71 else if( ZA == 1902 ) {
72 strcpy( name_, yiNames[1] );
76 else if( ZA == 4809 ) {
77 strcpy( name_,
"Be9" );
80 else if( ZA == 4909 ) {
81 strcpy( name_,
"Be9" );
84 else if( ZA == 6912 ) {
85 strcpy( name_,
"C12" );
88 else if( ZA == 8916 ) {
89 strcpy( name_,
"O16" );
92 else if( ZA == 95242 ) {
93 strcpy( name_,
"Am242_e2" );
98 if( ( 120 <=
A ) && (
A < 126 ) ) {
99 sprintf( name_,
"FissionProductENDL99%d",
A );
105 if( ispecial == 0 ) {
109 strcpy( AStr,
"_natural" ); }
111 sprintf( AStr,
"%d",
A );
113 if( ( ZStr = lPoPs_ZSymbol( Z ) ) == NULL ) {
117 sprintf( name_,
"%s%s", ZStr, AStr );
122 strcpy( name_, name );
124 if( strcmp( name,
"neutron" ) == 0 ) {
125 strcpy( name_,
"n" );
128 else if( strcmp( name,
"electron" ) == 0 ) {
129 strcpy( name_,
"e-" );
132 else if( strcmp( name,
"positron" ) == 0 ) {
133 strcpy( name_,
"e+" );
136 else if( ( strcmp( name,
"h1" ) == 0 ) || ( strcmp( name,
"proton" ) == 0 ) ) {
138 else if( ( strcmp( name,
"d" ) == 0 ) || ( strcmp( name,
"deuteron" ) == 0 ) ) {
140 else if( ( strcmp( name,
"t" ) == 0 ) || ( strcmp( name,
"triton" ) == 0 ) ) {
142 else if( strcmp( name,
"helium3" ) == 0 ) {
144 else if( ( strcmp( name,
"a" ) == 0 ) || ( strcmp( name,
"alpha" ) == 0 ) || ( strcmp( name,
"helium4" ) == 0 ) ) {
146 else if( ( strcmp( name,
"g" ) == 0 ) || ( strcmp( name,
"gamma" ) == 0 ) ) {
148 else if( strcmp( name,
"FP" ) == 0 ) {
149 strcpy( name_,
"FissionProductENDL99120" );
153 strcpy( name_, yiNames[ZA-2] );
167 if( ( pop =
PoP_makeAlias( smr, name_, name ) ) == NULL )
return( -1 );
171 if( alias != NULL ) {
173 if( ( pop =
PoP_makeAlias( smr, name_, alias ) ) == NULL )
return( -1 );
183static char const *lPoPs_ZSymbol(
int Z ) {
186 if( ( Z < 0 ) || ( Z >= nZs ) )
return( NULL );
187 return( Zs[Z].Symbol );
190#if defined __cplusplus
double A(double temperature)
@ PoPs_errorToken_badName
int PoPs_particleIndex(char const *name)
int lPoPs_addParticleIfNeeded(statusMessageReporting *smr, char const *name, char const *special)
PoP * PoPs_particleCreateLoadInfo(statusMessageReporting *smr, const char *name)
PoP * PoP_makeAlias(statusMessageReporting *smr, char const *name, char const *alias)
PoP * PoPs_addParticleIfNeeded(statusMessageReporting *smr, PoP *pop)
#define smr_setReportError2(smr, libraryID, code, fmt,...)