31 char chNumbers[31][3] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
32 "10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
33 "20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30"};
48 opac.lgRedoStatic =
true;
53 if( strcmp(
save.chOpcTyp[ipPun],
"TOTL") == 0 )
56 for( j=0; j <
rfield.nflux; j++ )
58 fprintf( ioPUN,
"%12.4e\t%10.2e\t%10.2e\t%10.2e\t%10.2e\t%4.4s\n",
60 opac.opacity_abs[j]+
opac.OpacStatic[j] +
opac.opacity_sct[j],
61 opac.opacity_abs[j]+
opac.OpacStatic[j],
67 fprintf( ioPUN,
"\n" );
70 else if( strcmp(
save.chOpcTyp[ipPun],
"BREM") == 0 )
73 for( j=0; j <
rfield.nflux; j++ )
75 fprintf( ioPUN,
"%.5e\t%.3e\n",
77 opac.FreeFreeOpacity[j] );
80 fprintf( ioPUN,
"\n" );
84 else if( strcmp(
save.chOpcTyp[ipPun],
"SHEL") == 0 )
86 nelem = (long)
save.punarg[ipPun][0];
87 ion = (long)
save.punarg[ipPun][1];
88 ipS = (long)
save.punarg[ipPun][2];
89 for( i=
opac.ipElement[nelem-1][ion-1][ipS-1][0]-1;
90 i <
opac.ipElement[nelem-1][ion-1][ipS-1][1]; i++ )
93 "%11.3e %11.3e\n",
rfield.anu[i],
94 opac.OpacStack[i-
opac.ipElement[nelem-1][ion-1][ipS-1][0]+
95 opac.ipElement[nelem-1][ion-1][ipS-1][2]] );
99 else if( strcmp(
save.chOpcTyp[ipPun],
"FINE") == 0 )
103 long int k, nu_hi , nskip;
104 if(
save.punarg[ipPun][0] > 0. )
115 if(
save.punarg[ipPun][1]> 0. )
124 nskip = (long)
save.punarg[ipPun][2];
127 for( i=j; i<nu_hi; i+=nskip )
130 for( k=0; k<nskip; ++k )
132 sum +=
rfield.fine_opac_zone[i+k];
136 fprintf(ioPUN,
"%.5e\t%.3e\n",
142 else if( strcmp(
save.chOpcTyp[ipPun],
"FIGU") == 0 )
147 ener =
rfield.anu[i]*0.01356;
148 ener3 = 1e24*
POW3(ener);
150 "%12.4e%12.4e%12.4e%12.4e%12.4e\n",
159 ener =
rfield.anu[i]*0.01356;
160 ener3 = 1e24*
POW3(ener);
162 "%12.4e%12.4e%12.4e%12.4e%12.4e\n",
172 else if( strcmp(
save.chOpcTyp[ipPun],
" AGN") == 0 )
178 char chOutput[100] , chString[100];
183 if(
abund.lgAGN[nelem] )
185 for( ion=0; ion<=nelem; ++ion )
188 nelec = nelem+1 - ion;
191 sprintf(chOutput,
"%s",
194 if( chOutput[1]==
' ' )
195 chOutput[1] = chOutput[2];
199 sprintf(chString,
"0 ");
203 sprintf(chString,
"+ ");
207 sprintf(chString,
"+%li ",ion);
209 strcat( chOutput , chString );
210 fprintf(ioPUN,
"%s",chOutput );
214 for( nshell=0; nshell <
Heavy.nsShells[nelem][ion]; nshell++ )
217 fprintf(ioPUN,
"\t%s",
Heavy.chShell[nshell] );
220 fprintf(ioPUN,
"\t%.2f" ,
224 ipop =
opac.ipElement[nelem][ion][nshell][2];
225 fprintf(ioPUN,
"\t%.2f",
opac.OpacStack[ipop-1]/1e-18);
228 fprintf(ioPUN,
"\t%.2f",
240 else if( strcmp(
save.chOpcTyp[ipPun],
"HYDR") == 0 )
248 ilow =
Heavy.ipHeavy[nelem][0];
251 strcpy( chFileName ,
elementnames.chElementNameShort[0] );
254 strcat( chFileName , chNumbers[1] );
257 strcat( chFileName ,
".opc" );
261 for( j=ilow; j <=
rfield.nupper; j++ )
265 fprintf( ioFILENAME ,
"\t");
268 fprintf( ioFILENAME ,
"\n");
271 fclose( ioFILENAME );
277 else if( strcmp(
save.chOpcTyp[ipPun],
"HELI") == 0 )
283 ilow =
Heavy.ipHeavy[nelem][0];
286 strcpy( chFileName ,
elementnames.chElementNameShort[1] );
289 strcat( chFileName , chNumbers[1] );
292 strcat( chFileName ,
".opc" );
296 for( j=ilow; j <=
rfield.nupper; j++ )
300 fprintf( ioFILENAME ,
"\t");
303 fprintf( ioFILENAME ,
"\n");
305 fclose( ioFILENAME );
310 ilow =
Heavy.ipHeavy[nelem][1];
313 strcpy( chFileName ,
elementnames.chElementNameShort[1] );
316 strcat( chFileName , chNumbers[2] );
319 strcat( chFileName ,
".opc" );
323 for( j=ilow; j <=
rfield.nupper; j++ )
327 fprintf( ioFILENAME ,
"\t");
330 fprintf( ioFILENAME ,
"\n");
334 fclose( ioFILENAME );
356 fprintf(
ioQQQ,
" Unidentified opacity key=%4.4s\n",
357 save.chOpcTyp[ipPun] );
372 for( ion=0; ion <= nelem; ion++ )
374 for( j=0; j < (nelem + 2); j++ )
376 dense.xIonDense[nelem][j] = 0.;
379 dense.xIonDense[nelem][ion] = 1.;
388 strcpy( chFileName ,
elementnames.chElementNameShort[nelem] );
391 strcat( chFileName , chNumbers[ion+1] );
394 strcat( chFileName ,
".opc" );
399 ilow =
Heavy.ipHeavy[nelem][ion];
405 fprintf( ioFILENAME ,
"\t");
409 fprintf( ioFILENAME ,
"\n");
412 fclose( ioFILENAME );