00001
00002
00003
00004 #include "cddefines.h"
00005 #include "pressure.h"
00006 #include "taulines.h"
00007 #include "iso.h"
00008 #include "dense.h"
00009 #include "lines_service.h"
00010 #include "h2.h"
00011 #include "prt.h"
00012 #include "mole.h"
00013
00014 #define THRESH 0.05
00015
00016 void PrtLinePres( FILE *ioPRESSURE )
00017 {
00018 long int i,
00019 ip,
00020 ipLo,
00021 ipHi,
00022 nelem;
00023 int ier;
00024 double RadPres1;
00025
00026
00027 const int nLine = 100;
00028
00029 char chLab[nLine][5];
00030 realnum wl[nLine] , frac[nLine];
00031 long int iperm[nLine];
00032
00033
00034 realnum smallfloat=SMALLFLOAT*10.f;
00035
00036 DEBUG_ENTRY( "PrtLinePres()" );
00037
00038
00039
00040
00041
00042 ip = 0;
00043
00044 for(i=0; i<nLine; ++i)
00045 {
00046 frac[i] = FLT_MAX;
00047 wl[i] = FLT_MAX;
00048 }
00049
00050 if( pressure.pres_radiation_lines_curr > 1e-30 )
00051 {
00055 for( long ipISO = 0; ipISO<NISO; ipISO++ )
00056 {
00057 for( nelem=ipISO; nelem < LIMELM; nelem++ )
00058 {
00059
00060 if( dense.IonHigh[nelem] >= nelem + 1 - ipISO )
00061 {
00062
00063
00064 for( ipHi=1; ipHi <iso_sp[ipISO][nelem].numLevels_local - iso_sp[ipISO][nelem].nCollapsed_local; ipHi++ )
00065 {
00066 for( ipLo=0; ipLo < ipHi; ipLo++ )
00067 {
00068 if( iso_sp[ipISO][nelem].trans(ipHi,ipLo).ipCont() <= 0 )
00069 continue;
00070
00071 ASSERT( iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().Aul() > iso_ctrl.SmallA );
00072
00073
00074 if( iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().PopOpc() > smallfloat &&
00075
00076 ( (iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().TauTot() - iso_sp[ipISO][nelem].trans(ipHi,ipLo).Emis().TauIn()) > smallfloat ) )
00077 {
00078 RadPres1 = PressureRadiationLine( iso_sp[ipISO][nelem].trans(ipHi,ipLo), GetDopplerWidth(dense.AtomicWeight[nelem]) );
00079
00080 if( RadPres1 > pressure.pres_radiation_lines_curr*THRESH )
00081 {
00082 wl[ip] = iso_sp[ipISO][nelem].trans(ipHi,ipLo).WLAng();
00083
00084
00085 chIonLbl(chLab[ip], iso_sp[ipISO][nelem].trans(ipHi,ipLo));
00086 frac[ip] = (realnum)(RadPres1/pressure.pres_radiation_lines_curr);
00087
00088 ip = MIN2((long)nLine-1,ip+1);
00089 }
00090 }
00091 }
00092 }
00093 }
00094 }
00095 }
00096
00097
00098 for( i=1; i <= nLevel1; i++ )
00099 {
00100 if( (*TauLines[i].Hi()).Pop() > 1e-30 )
00101 {
00102 RadPres1 = PressureRadiationLine( TauLines[i], GetDopplerWidth(dense.AtomicWeight[(*TauLines[i].Hi()).nelem()-1]) );
00103 }
00104 else
00105 {
00106 RadPres1 = 0.;
00107 }
00108
00109 if( RadPres1 > pressure.pres_radiation_lines_curr*THRESH )
00110 {
00111 wl[ip] = TauLines[i].WLAng();
00112
00113
00114 chIonLbl(chLab[ip], TauLines[i]);
00115 frac[ip] = (realnum)(RadPres1/pressure.pres_radiation_lines_curr);
00116
00117 ip = MIN2((long)nLine-1,ip+1);
00118 }
00119 }
00120
00121 for( i=0; i < nWindLine; i++ )
00122 {
00123 if( (*TauLine2[i].Hi()).IonStg() < (*TauLine2[i].Hi()).nelem()+1-NISO )
00124 {
00125 if( (*TauLine2[i].Hi()).Pop() > 1e-30 )
00126 {
00127 RadPres1 = PressureRadiationLine( TauLine2[i], GetDopplerWidth(dense.AtomicWeight[(*TauLine2[i].Hi()).nelem()-1]) );
00128 }
00129 else
00130 {
00131 RadPres1 = 0.;
00132 }
00133
00134 if( RadPres1 > pressure.pres_radiation_lines_curr*THRESH )
00135 {
00136 wl[ip] = TauLine2[i].WLAng();
00137
00138
00139 chIonLbl(chLab[ip], TauLine2[i]);
00140 frac[ip] = (realnum)(RadPres1/pressure.pres_radiation_lines_curr);
00141
00142 ip = MIN2((long)nLine-1,ip+1);
00143 }
00144 }
00145 }
00146
00147 for( i=0; i < nHFLines; i++ )
00148 {
00149 if( (*HFLines[i].Hi()).Pop() > 1e-30 )
00150 {
00151 RadPres1 = PressureRadiationLine( HFLines[i], GetDopplerWidth(dense.AtomicWeight[(*HFLines[i].Hi()).nelem()-1]) );
00152 }
00153 else
00154 {
00155 RadPres1 = 0.;
00156 }
00157
00158 if( RadPres1 > pressure.pres_radiation_lines_curr*THRESH )
00159 {
00160 wl[ip] = HFLines[i].WLAng();
00161
00162
00163 chIonLbl(chLab[ip], HFLines[i]);
00164 frac[ip] = (realnum)(RadPres1/pressure.pres_radiation_lines_curr);
00165
00166 ip = MIN2((long)nLine-1,ip+1);
00167 }
00168 }
00169
00170
00171 for( long ipSpecies=0; ipSpecies<nSpecies; ipSpecies++ )
00172 {
00173 if( dBaseSpecies[ipSpecies].lgActive )
00174 {
00175 realnum DopplerWidth = GetDopplerWidth( dBaseSpecies[ipSpecies].fmolweight );
00176 for (TransitionList::iterator tr=dBaseTrans[ipSpecies].begin();
00177 tr != dBaseTrans[ipSpecies].end(); ++tr)
00178 {
00179 int ipHi = (*tr).ipHi();
00180 if (ipHi >= dBaseSpecies[ipSpecies].numLevels_local || (*tr).ipCont() <= 0)
00181 continue;
00182 if( (*(*tr).Hi()).Pop() > 1e-30 )
00183 {
00184 RadPres1 = PressureRadiationLine( *tr, DopplerWidth );
00185 }
00186 else
00187 {
00188 RadPres1 = 0.;
00189 }
00190
00191 if( RadPres1 > pressure.pres_radiation_lines_curr*THRESH )
00192 {
00193 wl[ip] = (*tr).WLAng();
00194
00195
00196 chIonLbl(chLab[ip], *tr );
00197 frac[ip] = (realnum)(RadPres1/pressure.pres_radiation_lines_curr);
00198
00199 ip = MIN2((long)nLine-1,ip+1);
00200 }
00201 }
00202 }
00203 }
00204
00205
00206 for( diatom_iter diatom = diatoms.begin(); diatom != diatoms.end(); ++diatom )
00207 {
00208 RadPres1 = (*diatom)->H2_RadPress();
00209 if( RadPres1 > pressure.pres_radiation_lines_curr*THRESH )
00210 {
00211 wl[ip] = 0;
00212
00213
00214 strcpy(chLab[ip], "H2 ");
00215 frac[ip] = (realnum)(RadPres1/pressure.pres_radiation_lines_curr);
00216
00217 ip = MIN2((long)nLine-1,ip+1);
00218 }
00219 }
00220
00221
00222 if( ip<= 0 )
00223 {
00224 fprintf( ioPRESSURE, "\n" );
00225 return;
00226 }
00227
00228
00229 spsort(
00230
00231 frac,
00232
00233 ip,
00234
00235 iperm,
00236
00237
00238 -1,
00239
00240 &ier);
00241
00242
00243 fprintf( ioPRESSURE, " P(Lines):" );
00244 for( i=0; i < MIN2(10,ip); i++ )
00245 {
00246 int ipline = iperm[i];
00247 fprintf( ioPRESSURE, "(%4.4s ", chLab[ipline]);
00248 prt_wl(ioPRESSURE, wl[ipline] );
00249 fprintf(ioPRESSURE," %.2f) ",frac[ipline]);
00250 }
00251
00252
00253 fprintf( ioPRESSURE, "\n" );
00254 }
00255 return;
00256 }