35 save.nAverageList[ipPun] = 0;
42 " Punch average hit EOF while reading list; use END to end list.\n" );
47 while( p.
strcmp(
"END" ) != 0 )
50 ++
save.nAverageList[ipPun];
56 fprintf(
ioQQQ,
" save averages hit EOF while reading species list; use END to end list.\n" );
62 fprintf(
ioQQQ ,
"DEBUG save_average %li species read in.\n",
63 save.nAverageList[ipPun] );
68 if(
save.ipPnunit[ipPun] == NULL )
71 save.SaveAverageFree(ipPun);
74 save.nAverageIonList[ipPun].resize(
save.nAverageList[ipPun]);
77 save.nAverage2ndPar[ipPun].resize(
save.nAverageList[ipPun]);
80 save.chAverageType[ipPun].resize(
save.nAverageList[ipPun]);
83 save.chAverageSpeciesLabel[ipPun].resize(
save.nAverageList[ipPun]);
85 for( i=0; i <
save.nAverageList[ipPun]; ++i )
88 save.chAverageType[ipPun][i] =
new char[5];
90 save.chAverageSpeciesLabel[ipPun][i] =
new char[5];
99 fprintf(
ioQQQ ,
"DEBUG save_average %li species read in.\n",
100 save.nAverageList[ipPun] );
108 " Punch average hit EOF while reading list; use END to end list.\n" );
116 while( p.
strcmp(
"END" ) != 0 )
123 strcpy(
save.chAverageType[ipPun][
nLine-1] ,
"TEMP" );
125 else if( p.
nMatch(
"COLU" ))
128 strcpy(
save.chAverageType[ipPun][
nLine-1] ,
"COLU" );
130 else if( p.
nMatch(
"IONI" ))
133 strcpy(
save.chAverageType[ipPun][
nLine-1] ,
"IONI" );
137 fprintf(
ioQQQ,
"PROBLEM one of the jobs TEMPerature, COLUmn density, or IONIzation, must appear.\n");
146 fprintf(
ioQQQ,
"save average did not an element on this line, sorry %s\n",
157 p.
NoNumb(
"ionization stage" );
177 fprintf(
ioQQQ,
" save averages hit EOF while reading species list; use END to end list.\n" );
186 for( i=0; i<
nLine ; ++i )
188 fprintf(
ioQQQ,
"PDDEBUG %s %s %i %i\n",
189 save.chAverageType[ipPun][i],
190 save.chAverageSpeciesLabel[ipPun][i] ,
191 save.nAverageIonList[ipPun][i] ,
192 save.nAverage2ndPar[ipPun][i] );
197 sprintf(chHeader,
"#averages");
198 for( i=0; i<
nLine ; ++i )
200 sprintf(chTemp,
"\t %s %s %i %i",
201 save.chAverageType[ipPun][i],
202 save.chAverageSpeciesLabel[ipPun][i] ,
203 save.nAverageIonList[ipPun][i] ,
204 save.nAverage2ndPar[ipPun][i] );
205 strcat( chHeader, chTemp );
207 strcat( chHeader,
"\n");
219 for( i=0; i<
save.nAverageList[ipPun] ; ++i )
223 if(
save.nAverage2ndPar[ipPun][i] == 0 )
224 strcpy( chWeight ,
"RADIUS");
226 strcpy( chWeight ,
"VOLUME");
228 if( strncmp(
save.chAverageType[ipPun][i] ,
"TEMP" , 4 ) == 0)
232 save.chAverageSpeciesLabel[ipPun][i] ,
233 save.nAverageIonList[ipPun][i] ,
237 fprintf(
ioQQQ,
" save average temperature could not identify the species.\n" );
241 result = log10( result );
243 else if( strncmp(
save.chAverageType[ipPun][i] ,
"IONI" , 4 ) == 0)
248 if( strncmp(
"HYDR" ,
249 save.chAverageSpeciesLabel[ipPun][i] , 4)==0 &&
250 save.nAverageIonList[ipPun][i]== 0 )
251 strncpy(
save.chAverageSpeciesLabel[ipPun][i],
254 save.chAverageSpeciesLabel[ipPun][i] ,
255 save.nAverageIonList[ipPun][i] ,
261 fprintf(
ioQQQ,
" save average ionization fraction could not identify the species.\n" );
265 result = log10( result );
267 else if( strncmp(
save.chAverageType[ipPun][i] ,
"COLU" , 4 ) == 0)
271 save.chAverageSpeciesLabel[ipPun][i] ,
272 save.nAverageIonList[ipPun][i] ,
275 fprintf(
ioQQQ,
" save average column density fraction could not identify the species.\n" );
279 result = log10( result );
284 fprintf(
save.ipPnunit[ipPun],
"\t %.3f", result );
286 fprintf(
save.ipPnunit[ipPun],
"\n");