/*PrtHydro print out hydrogenic populations */ #include #include "cddefines.h" #include "pbn.h" #include "ionrange.h" #include "printe82.h" #include "printit.h" #include "elementnames.h" #include "hydrogenic.h" #include "prthydro.h" void PrtHydro( long ipZ ) { long i , limit ; # ifdef DEBUG_FUN fputs( "<+>PrtHydro()\n", debug_fp ); # endif /* lgPrintHLevPops is set true with print hydrogenic command, usually false * when set true, also parse in optional number of levels to print, nPrintHLevPops * will be current value of nhlevel if nothing entered, so set levels * before print command */ if( IonRange.IonHigh[ipZ] != ipZ + 2 || !printit.lgPrintHLevPops ) { # ifdef DEBUG_FUN fputs( " <->PrtHydro()\n", debug_fp ); # endif /* return if no hydrogenic species present */ return; } /* it is impossible for this to fail since ParsePrint set to at least 3 */ assert( printit.nPrintHLevPops > 2); /* print stright level pop per ionized hydrogen */ fprintf( ioQQQ, " %2s%2li 1S-12 ", elementnames.chElementSym[ipZ],(ipZ+1) ); limit = MIN2(printit.nPrintHLevPops,12); for( i=IP1S; i <= limit; i++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.hn[ipZ][i] )); } fprintf(ioQQQ,"\n"); if( printit.nPrintHLevPops > limit ) { fprintf( ioQQQ, " %2s%2li rest ", elementnames.chElementSym[ipZ], (ipZ+1) ); for( i=(limit+1); i <= printit.nPrintHLevPops; i++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.hn[ipZ][i] )); if( ((i-limit) % 13) == 0 ) { if( i!=printit.nPrintHLevPops ) { /* throw a newline every 14th column */ fprintf( ioQQQ, "\n " ); } else { /* throw a newline every 14th column */ fprintf( ioQQQ, "\n" ); } } } if( ((printit.nPrintHLevPops-limit)%14) != 0 ) { /* do not throw another if printit.nPrintHLevPops is multiple of 13 */ fprintf( ioQQQ, "\n" ); } } /* option to print dep coef */ if( pbn.lgPrtBN ) { limit = MIN2(printit.nPrintHLevPops,12); /* print this line so that it agrees with level populations above */ fprintf( ioQQQ, " %2s%2li 1S-12 ", elementnames.chElementSym[ipZ],(ipZ+1) ); for( i=IP1S; i <= limit; i++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.hbn[ipZ][i]) ); } fprintf( ioQQQ, "\n" ); if( printit.nPrintHLevPops > limit ) { fprintf( ioQQQ, " %2s%2li rest ", elementnames.chElementSym[ipZ], (ipZ+1) ); for( i=(limit+1); i <= printit.nPrintHLevPops; i++ ) { fprintf( ioQQQ,PrintEfmt("%9.2e", hydro.hbn[ipZ][i] )); if( ((i-limit) % 13) == 0 ) { if( i!=printit.nPrintHLevPops ) { /* throw a newline every 13th column */ fprintf( ioQQQ, "\n " ); } else { /* throw a newline every 13th column */ fprintf( ioQQQ, "\n" ); } } } if( ((printit.nPrintHLevPops-limit)%14) != 0 ) { /* do not throw another if printit.nPrintHLevPops is multiple of 13 */ fprintf( ioQQQ, "\n" ); } } } # ifdef DEBUG_FUN fputs( " <->PrtHydro()\n", debug_fp ); # endif return; }