Index: C:/projects/cloudy/cloudy_old/c07.02_branch/source/punch_opacity.cpp =================================================================== --- C:/projects/cloudy/cloudy_old/c07.02_branch/source/punch_opacity.cpp (revision 1285) +++ C:/projects/cloudy/cloudy_old/c07.02_branch/source/punch_opacity.cpp (revision 1286) @@ -49,7 +49,7 @@ /* punch total opacity in any element, punch opacity command * ioPUN is ioPUN unit number, ipPun is pointer within stack of punches */ - if( strcmp(opac.chOpcTyp,"TOTL") == 0 ) + if( strcmp(punch.chOpcTyp[ipPun],"TOTL") == 0 ) /* total opacity */ { for( j=0; j < rfield.nflux; j++ ) @@ -66,8 +66,8 @@ fprintf( ioPUN, "\n" ); } - else if( strcmp(opac.chOpcTyp,"BREM") == 0 ) - /* brems opacity */ + else if( strcmp(punch.chOpcTyp[ipPun],"BREM") == 0 ) + /* bremsstrahlung opacity */ { for( j=0; j < rfield.nflux; j++ ) { @@ -80,7 +80,7 @@ } /* subshell photo cross sections */ - else if( strcmp(opac.chOpcTyp,"SHEL") == 0 ) + else if( strcmp(punch.chOpcTyp[ipPun],"SHEL") == 0 ) { nelem = (long)punch.punarg[ipPun][0]; ion = (long)punch.punarg[ipPun][1]; @@ -95,7 +95,7 @@ } } - else if( strcmp(opac.chOpcTyp,"FINE") == 0 ) + else if( strcmp(punch.chOpcTyp[ipPun],"FINE") == 0 ) { /* the fine opacity array */ float sum; @@ -119,7 +119,9 @@ { nu_hi = rfield.nfine; } + nskip = (long)punch.punarg[ipPun][2]; + ASSERT( nskip > 0 ); for( i=j; i 0. ) fprintf(ioPUN,"%.5e\t%.3e\n", - AnuUnit( rfield.fine_anu[i+k/2] ), sum ); + AnuUnit( rfield.fine_anu[i+k/2] ), sum ); } } /* figure for hazy */ - else if( strcmp(opac.chOpcTyp,"FIGU") == 0 ) + else if( strcmp(punch.chOpcTyp[ipPun],"FIGU") == 0 ) { nelem = 0; for( i=iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][0]-1; i < (iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][0] - 1); i++ ) @@ -166,7 +168,7 @@ } /* photoionization data table for AGN */ - else if( strcmp(opac.chOpcTyp," AGN") == 0 ) + else if( strcmp(punch.chOpcTyp[ipPun]," AGN") == 0 ) { long int ipop, @@ -234,7 +236,7 @@ } /* hydrogen */ - else if( strcmp(opac.chOpcTyp,"HYDR") == 0 ) + else if( strcmp(punch.chOpcTyp[ipPun],"HYDR") == 0 ) { nelem = ipHYDROGEN; /* zero out the opacity arrays */ @@ -278,7 +280,7 @@ } /* helium */ - else if( strcmp(opac.chOpcTyp,"HELI") == 0 ) + else if( strcmp(punch.chOpcTyp[ipPun],"HELI") == 0 ) { /* atomic helium first, HELI1.opc */ nelem = ipHELIUM; @@ -356,12 +358,12 @@ else { - /* check for hydroge through zinc, nelem is atomic number on the c scale */ + /* check for hydrogen through zinc, nelem is atomic number on the c scale */ nelem = -1; i = 0; while( i < LIMELM ) { - if( strcmp(opac.chOpcTyp,elementnames.chElementNameShort[i]) == 0 ) + if( strcmp(punch.chOpcTyp[ipPun],elementnames.chElementNameShort[i]) == 0 ) { nelem = i; break; @@ -373,7 +375,7 @@ if( nelem < 0 ) { fprintf( ioQQQ, " Unidentified opacity key=%4.4s\n", - opac.chOpcTyp ); + punch.chOpcTyp[ipPun] ); puts( "[Stop in punopac]" ); cdEXIT(EXIT_FAILURE); } Index: C:/projects/cloudy/cloudy_old/c07.02_branch/source/zero.cpp =================================================================== --- C:/projects/cloudy/cloudy_old/c07.02_branch/source/zero.cpp (revision 1285) +++ C:/projects/cloudy/cloudy_old/c07.02_branch/source/zero.cpp (revision 1286) @@ -1011,10 +1011,8 @@ /* another case b option, turn off background opacities, no Pdest */ opac.lgCaseB_no_pdest = false; - strcpy( opac.chOpcTyp, " " ); - /* smallest allowed line and Lya optical depths, reset with - * caseb command */ + * Case B command */ opac.taumin = 1e-20f; opac.tlamin = 1e-20f; Index: C:/projects/cloudy/cloudy_old/c07.02_branch/source/parse_punch.cpp =================================================================== --- C:/projects/cloudy/cloudy_old/c07.02_branch/source/parse_punch.cpp (revision 1285) +++ C:/projects/cloudy/cloudy_old/c07.02_branch/source/parse_punch.cpp (revision 1286) @@ -239,7 +239,7 @@ { /* DoPunch will call punch_opacity to parse the subcommands * punch total opacity */ - strcpy( opac.chOpcTyp, "TOTL" ); + strcpy( punch.chOpcTyp[punch.npunch], "TOTL" ); sprintf( chHeader, "#nu\tTot opac\tAbs opac\tScat opac\tAlbedo\telem\n" ); } @@ -247,24 +247,25 @@ else if( nMatch("FIGU",chCard) ) { /* do figure for hazy */ - strcpy( opac.chOpcTyp, "FIGU" ); + strcpy( punch.chOpcTyp[punch.npunch], "FIGU" ); sprintf( chHeader, "#nu, H, He, tot opac\n" ); } else if( nMatch("FINE",chCard) ) { - /* punch out the fine opacity array with only lines */ + /* punch the fine opacity array */ rfield.lgPunchOpacityFine = true; - strcpy( opac.chOpcTyp, "FINE" ); + strcpy( punch.chOpcTyp[punch.npunch], "FINE" ); /* check for keyword UNITS on line, then scan wavelength or energy units if present, - * units are copied into punch.chConPunEnr */ + * units are copied into punch.chConPunEnr */ ChkUnits(chCard); sprintf( chHeader, "#nu\topac\n" ); ipFFmt = 5; - /* range option - important since so much data */ + /* range option - important since so much data - usually want to + * only give portion of the continuum */ if( nMatch("RANGE",chCard) ) { /* get lower and upper range, must be in Ryd */ @@ -296,6 +297,7 @@ /* default is to average together ten */ if( lgEOL ) punch.punarg[punch.npunch][2] = 10; + if( punch.punarg[punch.npunch][2] < 1 ) { fprintf(ioQQQ,"The number of fine opacities to skip must be > 0 \nSorry.\n"); @@ -316,7 +318,7 @@ else if( nMatch("BREM",chCard) ) { /* punch bremsstrahlung opacity */ - strcpy( opac.chOpcTyp, "BREM" ); + strcpy( punch.chOpcTyp[punch.npunch], "BREM" ); sprintf( chHeader, "#nu\tbrem opac\n" ); } @@ -327,7 +329,7 @@ strcpy( punch.chPunch[punch.npunch], "OPAC" ); /* punch subshell cross sections */ - strcpy( opac.chOpcTyp, "SHEL" ); + strcpy( punch.chOpcTyp[punch.npunch], "SHEL" ); /* this is element */ ipFFmt = 3; @@ -370,7 +372,7 @@ } /* copy string over */ - strcpy( opac.chOpcTyp, elementnames.chElementNameShort[nelem] ); + strcpy( punch.chOpcTyp[punch.npunch], elementnames.chElementNameShort[nelem] ); } else { @@ -437,7 +439,7 @@ else if( nMatch("OPAC",chCard) ) { /* create table for appendix in AGN */ - strcpy( opac.chOpcTyp, " AGN" ); + strcpy( punch.chOpcTyp[punch.npunch], " AGN" ); strcpy( punch.chPunch[punch.npunch], "OPAC" ); } Index: C:/projects/cloudy/cloudy_old/c07.02_branch/source/opacity.h =================================================================== --- C:/projects/cloudy/cloudy_old/c07.02_branch/source/opacity.h (revision 1285) +++ C:/projects/cloudy/cloudy_old/c07.02_branch/source/opacity.h (revision 1286) @@ -172,7 +172,7 @@ /** another case b option, turn off background opacities, no Pdest */ bool lgCaseB_no_pdest; - /** optical depths to compton and H- */ + /** optical depths to Compton and H- */ float telec, thmin; @@ -203,9 +203,6 @@ * depths have been predicted yet */ bool lgTauOutOn; - /** which opacity to punch out */ - char chOpcTyp[5]; - /** total number of opacity cells used in opacity stack * in OpacityCreateAll used as a counter to remember where * next opacity goes */ @@ -217,7 +214,7 @@ * in OpacityCreateAll */ - /** ipRayScat opacity pointer for rayleigh scattering*/ + /** ipRayScat opacity pointer for Rayleigh scattering*/ long int ipRayScat, /** iopcom compton scatterin, total recoil*/ Index: C:/projects/cloudy/cloudy_old/c07.02_branch/source/punch.h =================================================================== --- C:/projects/cloudy/cloudy_old/c07.02_branch/source/punch.h (revision 1285) +++ C:/projects/cloudy/cloudy_old/c07.02_branch/source/punch.h (revision 1286) @@ -147,6 +147,9 @@ /**chPunch - what is it we want to punch? set in GetPunch, used in DoPunch */ char chPunch[LIMPUN][5]; + /** which opacity to punch out */ + char chOpcTyp[LIMPUN][5]; + /** this flag tells us whether to punch results of a grid to separate files * for each grid point or all to the same file. Different for different * punch commands */