cloudy
trunk
|
00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 /*PrtAllTau master routine controlling printout of optical depths at end of calculation */ 00004 #include "cddefines.h" 00005 #include "taulines.h" 00006 #include "iso.h" 00007 #include "opacity.h" 00008 #include "dense.h" 00009 #include "colden.h" 00010 #include "elementnames.h" 00011 #include "geometry.h" 00012 #include "prt.h" 00013 00014 void PrtAllTau(void) 00015 { 00016 long int i, 00017 n, 00018 nelem; 00019 realnum fcon, 00020 flin; 00021 00022 DEBUG_ENTRY( "PrtAllTau()" ); 00023 00024 /* optical depths used by code are total through model, 00025 * when sphere is set, this is twice optical depth through 00026 * computed structure */ 00027 if( geometry.lgSphere ) 00028 { 00029 fcon = 2.; 00030 if( geometry.lgStatic ) 00031 { 00032 flin = 2.; 00033 } 00034 else 00035 { 00036 flin = 1.; 00037 } 00038 } 00039 else 00040 { 00041 fcon = 1.; 00042 flin = 1.; 00043 } 00044 00045 /* print out optical depths and column densities */ 00046 00047 /* R(1300) is Rayleigh scattering */ 00048 fprintf( ioQQQ, "\n Contin Optical Depths: COMP:"); 00049 00050 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.telec)); 00051 fprintf( ioQQQ, " H-:"); 00052 fprintf( ioQQQ,PrintEfmt("%9.2e",opac.thmin )); 00053 00054 fprintf( ioQQQ, " R(1300):"); 00055 fprintf( ioQQQ,PrintEfmt("%9.2e", colden.colden[ipCOL_H0]*6.71e-24)); 00056 00057 fprintf( ioQQQ, " H2+:"); 00058 fprintf( ioQQQ,PrintEfmt("%9.2e", colden.colden[ipCOL_H2p]*7e-18)); 00059 00060 fprintf( ioQQQ, " Pfa:"); 00061 /* 06 aug 28, from numLevels_max to _local. */ 00062 if( iso.numLevels_local[ipH_LIKE][ipHYDROGEN] > ipH5p ) 00063 { 00064 ASSERT( Transitions[ipH_LIKE][ipHYDROGEN][ipH5p][ipH4s].ipCont > 0 ); 00065 PrintE82( ioQQQ , opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH5p][ipH4s].ipCont-1]/fcon); 00066 } 00067 else 00068 { 00069 PrintE82( ioQQQ , 0.); 00070 } 00071 fprintf( ioQQQ, "\n" ); 00072 00073 fprintf( ioQQQ, " Pa:"); 00074 /* 06 aug 28, from numLevels_max to _local. */ 00075 if( iso.numLevels_local[ipH_LIKE][ipHYDROGEN] > ipH4p ) 00076 { 00077 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH3s].ipCont-1]/fcon)); 00078 } 00079 else 00080 { 00081 PrintE82( ioQQQ , 0.); 00082 } 00083 00084 fprintf( ioQQQ, " Ba:"); 00085 /* 06 aug 28, from numLevels_max to _local. */ 00086 if( iso.numLevels_local[ipH_LIKE][ipHYDROGEN] > 3 ) 00087 { 00088 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH2s].ipCont-1]/fcon)); 00089 } 00090 else 00091 { 00092 PrintE82( ioQQQ , 0.); 00093 } 00094 00095 fprintf( ioQQQ, " Hb:"); 00096 /* 06 aug 28, from numLevels_max to _local. */ 00097 if( iso.numLevels_local[ipH_LIKE][ipHYDROGEN] > 4 ) 00098 { 00099 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH4p][ipH2s].ipCont-1]/fcon)); 00100 } 00101 else 00102 { 00103 PrintE82( ioQQQ , 0.); 00104 } 00105 00106 fprintf( ioQQQ, " La:"); 00107 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauTotalGeo[0][Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s].ipCont-1]/fcon)); 00108 00109 fprintf( ioQQQ, " 1r:"); 00110 PrintE93( ioQQQ , opac.TauTotalGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][ipHYDROGEN][ipH1s]-1]/fcon); 00111 00112 fprintf( ioQQQ, " 1.8:"); 00113 PrintE82( ioQQQ , opac.TauTotalGeo[0][iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][0]-1]/fcon); 00114 00115 fprintf( ioQQQ, " 4.:"); 00116 PrintE93( ioQQQ , opac.TauTotalGeo[0][iso.ipIsoLevNIonCon[ipH_LIKE][1][ipH1s]-1]/fcon); 00117 fprintf( ioQQQ, "\n"); 00118 00119 /* print optical depths of some metal lines */ 00120 prtmet(); 00121 00122 /* print H-like H, He+ optical depths */ 00123 for( nelem=ipHYDROGEN; nelem<=ipHELIUM; ++nelem ) 00124 { 00125 /* helium may be turned off */ 00126 if( dense.lgElmtOn[nelem] ) 00127 { 00128 # define NUMB_PER_LINE 8 00129 fprintf( ioQQQ, "\n Old, new %s%2li continuum optical depths:\n", 00130 elementnames.chElementSym[nelem] , 00131 nelem+1); 00132 /* absorption continuum optical depths are energies of the h-like ion continua 00133 * loop over old, then new optical depths */ 00134 for( i=1; i>=0; --i ) 00135 { 00136 /* print ground, skip t2, then do 2p */ 00137 /* 06 aug 28, from numLevels_max to _local. */ 00138 for( n=ipH1s; n < iso.numLevels_local[ipH_LIKE][nelem]; n++ ) 00139 { 00140 if( n==ipH2s ) 00141 continue; 00142 if( n%NUMB_PER_LINE ==1) 00143 fprintf(ioQQQ,"\n"); 00144 /* this, combined with "continue" above, ensures that we print 00145 * 1 (1s), 2(tot 2), then 3 */ 00146 fprintf( ioQQQ , "%6ld",MAX2(1,n)); 00147 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauAbsGeo[i][iso.ipIsoLevNIonCon[ipH_LIKE][nelem][n]-1]/fcon)); 00148 } 00149 fprintf( ioQQQ, "\n" ); 00150 } 00151 00152 /* now do h-like line optical depths */ 00153 fprintf( ioQQQ, "\n Old, new %s%2li line optical depths:\n", 00154 elementnames.chElementSym[nelem] , 00155 nelem+1); 00156 /* Lya is a special case due to 2s-2p resolution - explictly print it first */ 00157 fprintf( ioQQQ, "%3i-%2i",2, 1 ); 00158 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][ipH2p][ipH1s].Emis->TauTot/flin )); 00159 /* total optical depth in 3-2s and 3-2p, is total of both so 2-1 is correct for 3-2*/ 00160 /* 06 aug 28, from numLevels_max to _local. */ 00161 for( n=3; n <= iso.n_HighestResolved_local[ipH_LIKE][nelem]; n++ ) 00162 { 00163 if( n%NUMB_PER_LINE ==1) 00164 fprintf(ioQQQ,"\n"); 00165 fprintf( ioQQQ, "%3ld-%2ld",n, n-1 ); 00166 fprintf( ioQQQ,PrintEfmt("%9.2e", 00167 /* just do nP - n'S */ 00168 Transitions[ipH_LIKE][nelem][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n][1][2] ][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n-1][0][2] ].Emis->TauTot/flin )); 00169 } 00170 for( n=iso.numLevels_local[ipH_LIKE][nelem] - iso.nCollapsed_local[ipH_LIKE][nelem]; n < iso.numLevels_local[ipH_LIKE][nelem]; n++ ) 00171 { 00172 if( StatesElem[ipH_LIKE][nelem][n].n % NUMB_PER_LINE ==1) 00173 fprintf(ioQQQ,"\n"); 00174 fprintf( ioQQQ, "%3ld-%2ld", StatesElem[ipH_LIKE][nelem][n].n, StatesElem[ipH_LIKE][nelem][n-1].n ); 00175 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][n][n-1].Emis->TauTot/flin )); 00176 } 00177 00178 fprintf( ioQQQ, "\n" ); 00179 00180 fprintf( ioQQQ, "%3i-%2i",2, 1 ); 00181 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][ipH2p][ipH1s].Emis->TauIn/flin )); 00182 /* 06 aug 28, from numLevels_max to _local. */ 00183 for( n=3; n <= iso.n_HighestResolved_local[ipH_LIKE][nelem]; n++ ) 00184 { 00185 if( n%NUMB_PER_LINE ==1) 00186 fprintf(ioQQQ,"\n"); 00187 fprintf( ioQQQ, "%3ld-%2ld",n, n-1 ); 00188 fprintf( ioQQQ,PrintEfmt("%9.2e", 00189 /* just do nP - n'S */ 00190 Transitions[ipH_LIKE][nelem][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n][1][2] ][ iso.QuantumNumbers2Index[ipH_LIKE][nelem][n-1][0][2] ].Emis->TauIn/flin )); 00191 } 00192 for( n=iso.numLevels_local[ipH_LIKE][nelem] - iso.nCollapsed_local[ipH_LIKE][nelem]; n < iso.numLevels_local[ipH_LIKE][nelem]; n++ ) 00193 { 00194 if( StatesElem[ipH_LIKE][nelem][n].n % NUMB_PER_LINE ==1) 00195 fprintf(ioQQQ,"\n"); 00196 fprintf( ioQQQ, "%3ld-%2ld", StatesElem[ipH_LIKE][nelem][n].n, StatesElem[ipH_LIKE][nelem][n-1].n ); 00197 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipH_LIKE][nelem][n][n-1].Emis->TauIn/flin )); 00198 } 00199 fprintf( ioQQQ, "\n" ); 00200 } 00201 } 00202 00203 /* ================================================================================ */ 00204 00205 /* print helium lines if helium exists */ 00206 if( dense.lgElmtOn[ipHELIUM] ) 00207 { 00208 fprintf( ioQQQ, "\n Old He Is optical depths:" ); 00209 for( i=0; i < 5; i++ ) 00210 { 00211 fprintf( ioQQQ, "%5ld", i+1 ); 00212 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauAbsGeo[1][iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][i]-1]/fcon) ); 00213 } 00214 fprintf( ioQQQ, "\n" ); 00215 00216 fprintf( ioQQQ, " New He Is optical depths:" ); 00217 for( i=0; i < 5; i++ ) 00218 { 00219 fprintf( ioQQQ, "%5ld", i+1 ); 00220 fprintf( ioQQQ,PrintEfmt("%9.2e", opac.TauAbsGeo[0][iso.ipIsoLevNIonCon[ipHE_LIKE][ipHELIUM][i]-1]/fcon )); 00221 } 00222 fprintf( ioQQQ, "\n" ); 00223 00224 /* ================================================================================*/ 00225 00226 fprintf( ioQQQ, " Old He Is Lines:" ); 00227 fprintf( ioQQQ, " %4d",584 ); 00228 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe2p1P][ipHe1s1S].Emis->TauTot/flin )); 00229 fprintf( ioQQQ, " %4d",3889 ); 00230 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p3P][ipHe2s3S].Emis->TauTot/flin )); 00231 fprintf( ioQQQ, " %4d",5016 ); 00232 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p1P][ipHe2s1S].Emis->TauTot/flin )); 00233 fprintf( ioQQQ, " %4d",5876 ); 00234 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3d3D][ipHe2p3P2].Emis->TauTot/flin )); 00235 fprintf( ioQQQ, "\n" ); 00236 00237 fprintf( ioQQQ, " New He Is Lines:" ); 00238 fprintf( ioQQQ, " %4d",584 ); 00239 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe2p1P][ipHe1s1S].Emis->TauIn/flin )); 00240 fprintf( ioQQQ, " %4d",3889 ); 00241 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p3P][ipHe2s3S].Emis->TauIn/flin )); 00242 fprintf( ioQQQ, " %4d",5016 ); 00243 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3p1P][ipHe2s1S].Emis->TauIn/flin )); 00244 fprintf( ioQQQ, " %4d",5876 ); 00245 fprintf( ioQQQ,PrintEfmt("%9.2e", Transitions[ipHE_LIKE][ipHELIUM][ipHe3d3D][ipHe2p3P2].Emis->TauIn/flin )); 00246 fprintf( ioQQQ, "\n" ); 00247 00248 /* ================================================================================*/ 00249 } 00250 return; 00251 }