/*pmeani print mean ionization fractions or temperatures for all elements */ #include "cddefines.h" #include "geopp.h" #include "elmton.h" #include "mean.h" #include "elementnames.h" #include "pmeani.h" void pmeani( /* this is either 't' or 'i', for mean ionization or temperature */ char chType , /* this is stream used for io, is stdout when called by final, * is punch unit when punch output generated */ FILE *ioMEAN ) { long int i, limit, n, nelem; float aa[64], c[64]; # ifdef DEBUG_FUN fputs( "<+>pmeani()\n", debug_fp ); # endif assert( chType == 'i' || chType == 't' ); /* print mean ionization or temperature for the computed model */ /* only print sphereical if not plane parallel */ /* >>>chng 99 may 1, test included one for sphere being set, * so no printout when not set. now print even when sphere not * set but geo is not plane parallel */ if( /*sphere.lgSphere &&*/ (!GeoPP.lgGeoPP) ) { /* get means for hydrogen and helium */ VolMean(chType,1,&n,aa); VolMean(chType,2,&n,c); /* now print hydrogen */ fprintf( ioMEAN, "\n Hydrogen " ); for( i=0; i < 2; i++ ) { fprintf( ioMEAN, "%7.3f", aa[i] ); } if( chType=='i' ) { fprintf( ioMEAN, " Log10 Mean Ionisation (over volume)\n" ); } else { fprintf( ioMEAN, " Log10 Mean Temperature (over volume)\n" ); } /* helium ionization fractions */ if( elmton.lgElmtOn[1] ) { fprintf( ioMEAN, " Helium " ); for( i=0; i < 3; i++ ) { fprintf( ioMEAN, "%7.3f", c[i] ); } fprintf( ioMEAN, "\n" ); } for( nelem=2; nelem < LIMELM; nelem++ ) { if( elmton.lgElmtOn[nelem] ) { VolMean(chType,nelem+1,&n,aa); limit = MIN2(17,n); fprintf( ioMEAN, " %10.10s", elementnames.chElementName[nelem] ); for( i=0; i < limit; i++ ) { fprintf( ioMEAN, "%7.3f", aa[i] ); } fprintf( ioMEAN, "\n" ); if( n > 17 ) { fprintf( ioMEAN, " " ); for( i=18; i <= n; i++ ) { fprintf( ioMEAN, "%7.3f", aa[i-1] ); } fprintf( ioMEAN, "\n" ); } } } } fprintf( ioMEAN, " " ); for( i=1; i <= 17; i++ ) { fprintf( ioMEAN, "%7ld", i ); } fprintf( ioMEAN, "\n" ); RadMean(chType,1,&n,aa); RadMean(chType,2,&n,c); fprintf( ioMEAN, "\n Hydrogen " ); for( i=0; i < 2; i++ ) { fprintf( ioMEAN, "%7.3f", aa[i] ); } if( chType=='i' ) { fprintf( ioMEAN, " Log10 Mean Ionisation (over radius)\n" ); } else { fprintf( ioMEAN, " Log10 Mean Temperature (over radius)\n" ); } /* now do helium */ if( elmton.lgElmtOn[1] ) { fprintf( ioMEAN, " Helium " ); for( i=0; i < 3; i++ ) { fprintf( ioMEAN, "%7.3f", c[i] ); } fprintf( ioMEAN, "\n" ); } for( nelem=2; nelem < LIMELM; nelem++ ) { if( elmton.lgElmtOn[nelem] ) { RadMean(chType,nelem+1,&n,aa); limit = MIN2(17,n); fprintf( ioMEAN, " %10.10s", elementnames.chElementName[nelem] ); for( i=1; i <= limit; i++ ) { fprintf( ioMEAN, "%7.3f", aa[i-1] ); } fprintf( ioMEAN, "\n" ); if( n > 17 ) { fprintf( ioMEAN, " " ); for( i=18; i <= n; i++ ) { fprintf( ioMEAN, "%7.3f", aa[i-1] ); } fprintf( ioMEAN, "\n" ); } } } # ifdef DEBUG_FUN fputs( " <->pmeani()\n", debug_fp ); # endif return; }