Changeset 2440 for branches/newmole
- Timestamp:
- 11/04/08 14:25:16 (2 months ago)
- Location:
- branches/newmole
- Files:
-
- 29 modified
- 1 copied
-
docs/latex/Hazy1 (copied) (copied from trunk/docs/latex/Hazy1)
-
source/atmdat_readin.cpp (modified) (3 diffs)
-
source/atoms.h (modified) (4 diffs)
-
source/atom_feii.cpp (modified) (1 diff)
-
source/atom_oi.cpp (modified) (8 diffs)
-
source/cddefines.h (modified) (1 diff)
-
source/conv_base.cpp (modified) (1 diff)
-
source/date.h (modified) (1 diff)
-
source/dynamics.cpp (modified) (1 diff)
-
source/dynamics.h (modified) (1 diff)
-
source/ion_solver.cpp (modified) (1 diff)
-
source/iso_level.cpp (modified) (1 diff)
-
source/lines_service.cpp (modified) (2 diffs)
-
source/lines_service.h (modified) (1 diff)
-
source/mole_h2.cpp (modified) (1 diff)
-
source/prt_final.cpp (modified) (1 diff)
-
source/rt.h (modified) (1 diff)
-
source/rt_line_all.cpp (modified) (13 diffs)
-
source/rt_line_one.cpp (modified) (15 diffs)
-
tsuite/auto/blr_f92.in (modified) (2 diffs)
-
tsuite/auto/blr_n12_p19.in (modified) (1 diff)
-
tsuite/auto/blr_n12_p19_Z20.in (modified) (1 diff)
-
tsuite/auto/blr_n13_p18.in (modified) (1 diff)
-
tsuite/auto/dynamics_orion_flow.in (modified) (1 diff)
-
tsuite/auto/nova_photos.in (modified) (6 diffs)
-
tsuite/slow/feii_blr_n11_p20_Z20.in (modified) (1 diff)
-
tsuite/slow/feii_blr_n12_p19.in (modified) (1 diff)
-
tsuite/slow/feii_blr_n12_p19_Z20.in (modified) (1 diff)
-
tsuite/slow/feii_blr_n13_p18_Z20.in (modified) (1 diff)
-
tsuite/slow/feii_blr_n13_p22.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/atmdat_readin.cpp
r2406 r2440 1050 1050 } 1051 1051 1052 nUTA = UTALines.size();1052 nUTA = (long)UTALines.size(); 1053 1053 1054 1054 /* option to dump UTA lines */ … … 1640 1640 UTA.back().Hi->IonStg = ion+1; 1641 1641 1642 UTA.back().Hi->g = level[ind_hi].g;1643 UTA.back().Lo->g = level[ind_lo].g;1642 UTA.back().Hi->g = (realnum)level[ind_hi].g; 1643 UTA.back().Lo->g = (realnum)level[ind_lo].g; 1644 1644 1645 1645 double WavNum = edif*RYD_INF; … … 1659 1659 /* Badnell gives UPWARD transition rate Alu, an unusual notation, 1660 1660 * convert it here to the normal downward transition rate Aul */ 1661 UTA.back().Emis->Aul = Bij*UTA.back().Lo->g/UTA.back().Hi->g;1661 UTA.back().Emis->Aul = (realnum)(Bij*UTA.back().Lo->g/UTA.back().Hi->g); 1662 1662 UTA.back().Emis->gf = 1663 1663 (realnum)GetGF( UTA.back().Emis->Aul, UTA.back().EnergyWN, UTA.back().Hi->g ); -
branches/newmole/source/atoms.h
r1739 r2440 4 4 #ifndef _ATOMS_H_ 5 5 #define _ATOMS_H_ 6 7 6 8 7 /** … … 219 218 220 219 /** number of levels in OI atom */ 221 #define N_OI_LEVELS 6 220 const int N_OI_LEVELS = 6; 221 const long LIMLEVELN = 20L; 222 222 223 223 EXTERN struct t_atoms { … … 240 240 /** populations from OI fluorescense problem */ 241 241 realnum popoi[N_OI_LEVELS]; 242 243 double pmph31,244 esch31;245 242 246 243 realnum pmpo51, … … 252 249 popmg2; 253 250 254 #define LIMLEVELN 20L255 251 /** 256 252 * this stores most recently evaluated level populations -
branches/newmole/source/atom_feii.cpp
r2406 r2440 1584 1584 /*RT_line_one do rt for emission line structure - 1585 1585 * calls RT_line_static or RT_line_wind */ 1586 RT_line_one( &Fe2LevN[ipHi][ipLo] , lgDoEsc , lgUpdateFineOpac,true);1586 RT_line_one( &Fe2LevN[ipHi][ipLo], lgDoEsc, lgUpdateFineOpac, true, 0.f, 1.f ); 1587 1587 } 1588 1588 } -
branches/newmole/source/atom_oi.cpp
r2139 r2440 18 18 /*oi_level_pops get OI level population with Ly-beta pumping */ 19 19 STATIC void oi_level_pops(double abundoi, 20 double *coloi);20 double *coloi); 21 21 22 22 /*atom_oi drive the solution of OI level populations, Ly-beta pumping */ 23 23 void atom_oi_calc(double *coloi) 24 24 { 25 long int i; 26 double esin, 25 double esab, 27 26 eslb, 28 27 esoi, … … 31 30 opaclb, 32 31 opacoi, 33 tin,34 tout,35 32 xlb, 36 33 xoi; 37 static double esab; 38 static double aoi = TauLines[ipTO1025].Emis->Aul; 39 static double alb = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Aul; 34 double aoi = TauLines[ipTO1025].Emis->Aul; 35 double alb = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Aul; 40 36 41 37 DEBUG_ENTRY( "atom_oi_calc()" ); 42 38 39 fixit(); 40 // The code below should be calculating the O I 1025 pumping by H Ly beta, as well as 41 // the inverse process (this can become important in hydrogen-deficient environments). 42 // It now uses the Elitzur & Netzer (1985, ApJ, 291, 464) theory, which is no longer 43 // valid since the line overlap code prevents us from getting at the escape probability 44 // of individual lines. 45 43 46 /* A's from Pradhan; OI pump line; Ly beta, 8446 */ 44 45 /* Notation;46 * PMPH31 net rate hydrogen level 3 depopulated to 147 * PMPO15 and PMPO51 are similar, but for oxygen48 * ESCH31 is emission in 1025 transition */49 47 50 48 /* called by LINES before calc really start, protect here … … 52 50 if( dense.xIonDense[ipOXYGEN][0] <= 0. ) 53 51 { 54 for( i =0; i < 6; i++ )52 for( int i=0; i < 6; i++ ) 55 53 { 56 54 atoms.popoi[i] = 0.; 57 55 } 58 /* return zero */59 56 *coloi = 0.; 60 57 atoms.pmpo15 = 0.; 61 58 atoms.pmpo51 = 0.; 62 atoms.pmph31 = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Aul*63 (Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pesc +64 Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pelec_esc);65 66 atoms.esch31 = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Aul*67 (Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pesc +68 Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pelec_esc);69 70 /* all trace output turned on with "trace ly beta command' */71 if( trace.lgTr8446 && trace.lgTrace )72 {73 fprintf( ioQQQ,74 " P8446 called for first time, finds A*escape prob 3-1 =%10.2e\n",75 atoms.esch31 );76 }77 59 return; 78 60 } 79 61 80 if( iteration > 1 ) 81 { 82 /* two sided escape prob */ 83 tin = TauLines[ipTO1025].Emis->TauIn; 84 esin = esc_CRDwing_1side(tin,1e-4); 85 tout = (TauLines[ipTO1025].Emis->TauTot)*0.9 - 86 TauLines[ipTO1025].Emis->TauIn; 87 88 if( trace.lgTr8446 && trace.lgTrace ) 89 { 90 fprintf( ioQQQ, " P8446 tin, tout=%10.2e%10.2e\n", tin, tout ); 91 } 92 93 if( tout > 0. ) 94 { 95 tout = TauLines[ipTO1025].Emis->TauTot - TauLines[ipTO1025].Emis->TauIn; 96 97 /* do not update esab if we overran optical depth scale */ 98 esab = 0.5*(esin + esc_CRDwing_1side(tout,1e-4)); 99 } 100 } 101 else 102 { 103 /* one-sided escape probability */ 104 esab = esc_CRDwing_1side(TauLines[ipTO1025].Emis->TauIn,1e-4); 105 } 106 107 esoi =TauLines[ipTO1025].Emis->Pelec_esc + TauLines[ipTO1025].Emis->Pesc; 108 eslb =Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pelec_esc + 62 // line overlap code makes this the escape probability of the combined lines 63 esab = TauLines[ipTO1025].Emis->Pelec_esc + TauLines[ipTO1025].Emis->Pesc; 64 65 // these two are no longer correct, the line overlap code makes it impossible 66 // to get at the escape probabilities of the individual lines... 67 esoi = TauLines[ipTO1025].Emis->Pelec_esc + TauLines[ipTO1025].Emis->Pesc; 68 eslb = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pelec_esc + 109 69 Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pesc; 110 70 … … 118 78 119 79 /* find relative opacities for two lines */ 120 opacoi = 2.92e-9*dense.xIonDense[ipOXYGEN][0]*0.5556/DoppVel.doppler[ 7];121 opaclb = 1.22e-8*dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH1s].Pop/DoppVel.doppler[ 0];80 opacoi = 2.92e-9*dense.xIonDense[ipOXYGEN][0]*0.5556/DoppVel.doppler[ipOXYGEN]; 81 opaclb = 1.22e-8*dense.xIonDense[ipHYDROGEN][1]*StatesElem[ipH_LIKE][ipHYDROGEN][ipH1s].Pop/DoppVel.doppler[ipHYDROGEN]; 122 82 123 83 /* these are x sub a (OI) and x sub b (ly beta) defined in Elitz+Netz */ … … 128 88 foi = MIN2(DoppVel.doppler[ipHYDROGEN],DoppVel.doppler[ipOXYGEN])/DoppVel.doppler[ipOXYGEN]; 129 89 flb = MIN2(DoppVel.doppler[ipHYDROGEN],DoppVel.doppler[ipOXYGEN])/DoppVel.doppler[ipHYDROGEN]* 130 MAX2(0.,1.- TauLines[ipTO1025].Emis->Pelec_esc - TauLines[ipTO1025].Emis->Pesc);90 MAX2(0.,1.- TauLines[ipTO1025].Emis->Pelec_esc - TauLines[ipTO1025].Emis->Pesc); 131 91 132 92 if( trace.lgTr8446 && trace.lgTrace ) … … 139 99 /* pumping of OI by L-beta - this goes into OI matrix as 1-5 rate 140 100 * lgInducProcess set false with no induced command, usually true */ 101 /* Notation: pmpo15 net rate oxygen level 5 populated from 1 */ 141 102 if( rfield.lgInducProcess ) 142 103 { 143 atoms.pmpo15 = (realnum)(flb*alb*(StatesElem[ipH_LIKE][ipHYDROGEN][ipH3p].Pop*dense.xIonDense[ipHYDROGEN][1])*xoi*(1. - esab)/ 144 dense.xIonDense[ipOXYGEN][0]); 104 atoms.pmpo15 = (realnum)(flb*alb*dense.xIonDense[ipHYDROGEN][1]* 105 StatesElem[ipH_LIKE][ipHYDROGEN][ipH3p].Pop* 106 xoi*(1. - esab)/dense.xIonDense[ipOXYGEN][0]); 145 107 /* net decay rate from upper level */ 146 atoms.pmpo51 = (realnum)(aoi*(1. - (1. - foi)*(1. - esoi) - xoi*(1. - 147 esab)*foi)); 108 atoms.pmpo51 = (realnum)(aoi*(1. - (1. - foi)*(1. - esoi) - xoi*(1. - esab)*foi)); 148 109 } 149 110 else … … 155 116 /* find level populations for OI */ 156 117 oi_level_pops(dense.xIonDense[ipOXYGEN][0],coloi); 157 158 /* escape term from n=3 of H; followed by pump term to n=3 */159 /** \todo 2 this is not used, should it be? */160 //atoms.pmph31 = alb*(1. - (1. - flb)*(1. - eslb) - xlb*(1. - esab)*flb);161 162 /*pmph13 = xlb*(1. - esab)*foi*aoi*atoms.popoi[4];*/163 atoms.pmph31 = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Aul*164 (Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pelec_esc + Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->Pesc);165 166 /* following is actual emission rate, used to predict Ly-beta in lines.for */167 atoms.esch31 = alb*(eslb*(1. - flb) + esab*flb);168 169 /* all trace output turned on with "trace ly beta command' */170 if( trace.lgTr8446 && trace.lgTrace )171 {172 fprintf( ioQQQ, " P8446 PMPH31=%10.2e EscP3-1%10.2e ESCH31=%10.2e\n",173 atoms.pmph31, atoms.pmph31/alb, atoms.esch31/alb );174 }175 118 176 119 /* continuum pumping due to J=1, 0 sub states. … … 220 163 /*oi_level_pops get OI level population with Ly-beta pumping */ 221 164 STATIC void oi_level_pops(double abundoi, 222 double *coloi)165 double *coloi) 223 166 { 224 167 bool lgNegPop; -
branches/newmole/source/cddefines.h
r2406 r2440 1559 1559 } 1560 1560 1561 /**get_ptr attribute shim to get raw pointer to contained data with 1562 * correct type */ 1563 template<class T> inline T* get_ptr(valarray<T> &v) 1564 { 1565 return &v[0]; 1566 } 1567 template<class T> inline T* get_ptr(vector<T> &v) 1568 { 1569 return &v[0]; 1570 } 1571 template<class T> inline const T* get_ptr(const valarray<T> &v) 1572 { 1573 return const_cast<const T*>(&const_cast<valarray<T>&>(v)[0]); 1574 } 1575 template<class T> inline const T* get_ptr(const vector<T> &v) 1576 { 1577 return const_cast<const T*>(&const_cast<vector<T>&>(v)[0]); 1578 } 1579 1580 1561 1581 /************************************************************************** 1562 1582 * -
branches/newmole/source/conv_base.cpp
r2406 r2440 629 629 * activate. when it passes rm this block and 630 630 * change err_tol in following block to a small number */ 631 if( 0 &conv.lgConvIoniz &&631 if( 0 && conv.lgConvIoniz && 632 632 iso.pop_ion_ov_neut[ipISO][nelem] > 1e-15 && 633 633 dense.xIonDense[nelem][nelem+1-ipISO]>SMALLFLOAT && -
branches/newmole/source/date.h
r2406 r2440 16 16 #define MONTH 9 17 17 /* day is correct */ 18 #define DAY 918 #define DAY 26 19 19 20 20 #endif /* _DATE_H_ */ -
branches/newmole/source/dynamics.cpp
r2346 r2440 1655 1655 dynamics.lgRecom = false; 1656 1656 1657 /* don't force populations to equilibrium levels */ 1658 dynamics.lgEquilibrium = false; 1659 1657 1660 /* set true if time dependent calculation is finished */ 1658 1661 dynamics.lgStatic_completed = false; -
branches/newmole/source/dynamics.h
r2346 r2440 165 165 realnum dDensityDT; 166 166 167 /** Enforce equilibrium populations */ 168 bool lgEquilibrium; 167 169 168 170 /* set true with trace option on time command */ -
branches/newmole/source/ion_solver.cpp
r2112 r2440 376 376 377 377 /* chng 03 jan 13 rjrw, add in dynamics if required here, 378 * last test- only do advection if we have not overrun the radius scale */379 if( dynamics.lgAdvection && iteration > dynamics.n_initial_relax+1378 * - only do advection if we have not overrun the radius scale */ 379 if( iteration > dynamics.n_initial_relax+1 && dynamics.lgAdvection && !dynamics.lgEquilibrium 380 380 /*&& radius.depth < dynamics.oldFullDepth*/ ) 381 381 { -
branches/newmole/source/iso_level.cpp
r2346 r2440 328 328 /* >>chng 02 Sep 06 rjrw -- all elements have these terms */ 329 329 /*>>>chng 02 oct 01, only include if lgAdvection is set */ 330 if( dynamics.lgAdvection && dynamics.lgISO[ipISO])330 if( dynamics.lgAdvection && !dynamics.lgEquilibrium && dynamics.lgISO[ipISO]) 331 331 { 332 332 /* add in advection - these terms normally zero */ -
branches/newmole/source/lines_service.cpp
r2406 r2440 23 23 /*EmLineZero set all elements of transition struc to zero */ 24 24 /*LineConvRate2CS convert down coll rate back into electron cs in case other parts of code need this for reference */ 25 /*lgTauGood returns true is we have not overrun optical depth scale */26 25 /*OccupationNumberLine - derive the photon occupation number at line center for any line */ 27 26 /*outline - adds line photons to reflin and outlin */ … … 1154 1153 } 1155 1154 1156 /* returns true is we have not overrun optical depth scale */1157 bool lgTauGood( transition * t)1158 {1159 bool lgGoodTau;1160 1161 DEBUG_ENTRY( "lgTauGood()" );1162 1163 if( (t->Emis->TauTot*0.9 - t->Emis->TauIn < 0. && t->Emis->TauIn > 0.) &&1164 ! fp_equal( t->Emis->TauTot, opac.taumin ) )1165 {1166 /* do not do anything if we have overrun the scale, */1167 lgGoodTau = false;1168 }1169 else1170 {1171 lgGoodTau = true;1172 }1173 return lgGoodTau;1174 }1175 1176 1155 /*gbar0 compute g-bar gaunt factor for neutrals */ 1177 1156 STATIC void gbar0(double ex, -
branches/newmole/source/lines_service.h
r1739 r2440 220 220 \param *t 221 221 */ 222 bool lgTauGood( transition * t); 222 inline bool lgTauGood( transition* t ) 223 { 224 return ( iteration == 1 || t->Emis->TauIn <= 0. || t->Emis->TauTot*0.9 - t->Emis->TauIn >= 0. ); 225 } 223 226 224 227 /**MakeCS compute collision strength by g-bar approximations -
branches/newmole/source/mole_h2.cpp
r2346 r2440 663 663 * variation in the line pumping rate, which made H2 abundance fluctuate due to 664 664 * Solomon process having slight dr-caused mole. */ 665 RT_line_one( &H2Lines[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo], lgDoEsc, lgUpdateFineOpac, false );665 RT_line_one( &H2Lines[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo], lgDoEsc, lgUpdateFineOpac, false, 0.f, 1.f ); 666 666 } 667 667 } -
branches/newmole/source/prt_final.cpp
r2346 r2440 802 802 fprintf( ioQQQ, "%s" , chIntensityType[ipEmType] ); 803 803 fprintf( ioQQQ, " line intensities\n" ); 804 // caution about emergent intensities when outward optical 805 // depths are not yet known 806 if( ipEmType==1 && iteration==1 ) 807 fprintf(ioQQQ," Caution: emergent intensities are not reliable on the " 808 "first iteration.\n"); 804 809 805 810 /* option to only print brighter lines */ -
branches/newmole/source/rt.h
r1830 r2440 32 32 this can cause pump to depend on zone thickness, and leads to unstable 33 33 feedback in some models with the large H2 molecule, due to Solomon 34 process depending on zone thickness and level populations. 35 */ 36 void RT_line_one(transition * t , 37 bool lgDoEsc , 38 bool lgUpdateFineOpac, 39 bool lgShield_this_zone ); 34 process depending on zone thickness and level populations. 35 \param pestrk Stark escape probability 36 \param efac Exponential correction for single-flight escape probability? usually 1 37 */ 38 void RT_line_one(transition* t, 39 bool lgDoEsc, 40 bool lgUpdateFineOpac, 41 bool lgShield_this_zone, 42 realnum pestrk, 43 realnum efac); 40 44 41 45 /**rt_continuum_shield_fcn computing continuum shielding due to single line -
branches/newmole/source/rt_line_all.cpp
r2406 r2440 33 33 nelem; 34 34 long ipHi , ipLo; 35 double factor, 36 coloi; 35 double factor; 37 36 double SaveLyaPesc[NISO][LIMELM] , 38 37 SaveLyaPdest[NISO][LIMELM]; … … 95 94 /*if( lgUpdateFineOpac ) 96 95 fprintf(ioQQQ,"debuggg\tlgUpdateFineOpac in rt_line_all\n");*/ 97 for( ipISO=ipH_LIKE; ipISO <NISO; ++ipISO )96 for( ipISO=ipH_LIKE; ipISO < NISO; ++ipISO ) 98 97 { 99 98 /* loop over all iso-electronic sequences */ 100 for( nelem=ipISO; nelem <LIMELM; ++nelem )99 for( nelem=ipISO; nelem < LIMELM; ++nelem ) 101 100 { 102 101 /* parent ion stage, for H is 1, for He is 1 for He-like and … … 108 107 continue; 109 108 /* need we consider this ion? */ 110 if( ion <= dense.IonHigh[nelem] )109 if( ion <= dense.IonHigh[nelem] ) 111 110 { 112 111 /* save escape and destruction probs for each Lya since … … 115 114 * evaluating iso sequence that does not exist for an element, 116 115 * as in He-like hydrogen */ 117 if( ipISO<=nelem ) 118 { 119 SaveLyaPesc[ipISO][nelem] = Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->Pesc; 120 SaveLyaPdest[ipISO][nelem] = Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->Pdest; 121 } 116 SaveLyaPesc[ipISO][nelem] = Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->Pesc; 117 SaveLyaPdest[ipISO][nelem] = Transitions[ipISO][nelem][iso.nLyaLevel[ipISO]][0].Emis->Pdest; 122 118 123 119 /* convert pops to per unit vol rather than per ion */ … … 153 149 Transitions[ipISO][nelem][ipHi][ipLo].Emis->TauTot);*/ 154 150 151 fixit(); // is this factor needed? should it be for he-like lya only? 152 realnum efac; 153 if( ipISO > 0 && ipHi == iso.nLyaLevel[ipISO] && ipLo == 0 ) 154 /* do not let too much Lya escape outward since so important 155 * H Lya is special case done elsewhere */ 156 efac = opac.ExpmTau[Transitions[ipISO][nelem][ipHi][ipLo].ipCont-1]; 157 else 158 efac = 1.f; 159 155 160 /* generate escape prob, pumping rate, destruction prob, 156 161 * inward outward fracs */ 157 RT_line_one(&Transitions[ipISO][nelem][ipHi][ipLo] , lgDoEsc , lgUpdateFineOpac,true); 158 159 162 RT_line_one( &Transitions[ipISO][nelem][ipHi][ipLo], 163 lgDoEsc, 164 lgUpdateFineOpac, 165 true, 166 (realnum)iso.pestrk[ipISO][nelem][ipLo][ipHi], 167 efac ); 168 169 /* set true to print pump rates*/ 170 enum {DEBUG_LOC=false}; 171 &nbs
