Changeset 2125 for branches/newmole/source
- Timestamp:
- 06/24/08 16:39:58 (5 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 12 modified
-
cloudy.cpp (modified) (1 diff)
-
cont_createmesh.cpp (modified) (1 diff)
-
conv_base.cpp (modified) (2 diffs)
-
conv_init_solution.cpp (modified) (1 diff)
-
dynamics.cpp (modified) (1 diff)
-
iso_level.cpp (modified) (2 diffs)
-
iter_end_chk.cpp (modified) (1 diff)
-
mole_h2_io.cpp (modified) (2 diffs)
-
parse_punch.cpp (modified) (2 diffs)
-
punch_do.cpp (modified) (2 diffs)
-
rfield.h (modified) (3 diffs)
-
rt_diffuse.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/cloudy.cpp
r1739 r2125 223 223 224 224 /* converge the pressure-temperature-ionization solution for this zone 225 * NB ignoring return value - should be ok (return 1 for disaster) */ 225 * NB ignoring return value - should be ok (return 1 for abort) 226 * we can't break here in case of abort since there is still housekeeping 227 * that must be done in following routines */ 226 228 ConvPresTempEdenIoniz(); 227 229 -
branches/newmole/source/cont_createmesh.cpp
r2079 r2125 147 147 /* nend_max+1 because search phase is zone 0, first zone at illumin face is 1 */ 148 148 rfield.ConEmitLocal = (realnum**)MALLOC( (size_t)(geometry.nend_max+1)*sizeof(realnum *) ); 149 rfield.ConSourceFcnLocal = (realnum**)MALLOC( (size_t)(geometry.nend_max+1)*sizeof(realnum *) ); 149 150 for( i=0;i<(geometry.nend_max+1); ++i ) 150 151 { 151 152 rfield.ConEmitLocal[i] = (realnum*)MALLOC( (size_t)rfield.nupper*sizeof(realnum) ); 153 rfield.ConSourceFcnLocal[i] = (realnum*)MALLOC( (size_t)rfield.nupper*sizeof(realnum) ); 154 } 155 for( i=0;i<(geometry.nend_max+1); ++i ) 156 { 157 for( long j=0; j<rfield.nupper; ++j) 158 { 159 rfield.ConSourceFcnLocal[i][j] = 1.; 160 } 152 161 } 153 162 -
branches/newmole/source/conv_base.cpp
r2096 r2125 855 855 PresTotCurrent(); 856 856 857 if( trace.lgTrace )858 {859 fprintf( ioQQQ,860 " ConvBase return. %.2f Te:%.3e HI:%.3e HII:%.3e H2:%.3e Ne:%.3e htot:%.3e CSUP:%.2e Conv?%c\n",861 fnzone,862 phycon.te,863 dense.xIonDense[ipHYDROGEN][0],864 dense.xIonDense[ipHYDROGEN][1],865 hmi.H2_total,866 dense.eden,867 thermal.htot,868 secondaries.csupra[ipHYDROGEN][0] ,869 TorF(conv.lgConvIoniz) );870 }871 872 857 ASSERT(lgElemsConserved()); 873 858 … … 879 864 * reset to zero each time ConvPresTempEdenIoniz is called */ 880 865 ++conv.nPres2Ioniz; 866 867 if( trace.lgTrace ) 868 { 869 fprintf( ioQQQ, 870 " ConvBase return. fnzone %.2f nPres2Ioniz %li Te:%.3e HI:%.3e HII:%.3e H2:%.3e Ne:%.3e htot:%.3e CSUP:%.2e Conv?%c reason:%s\n", 871 fnzone, 872 conv.nPres2Ioniz, 873 phycon.te, 874 dense.xIonDense[ipHYDROGEN][0], 875 dense.xIonDense[ipHYDROGEN][1], 876 hmi.H2_total, 877 dense.eden, 878 thermal.htot, 879 secondaries.csupra[ipHYDROGEN][0] , 880 TorF(conv.lgConvIoniz) , 881 conv.chConvIoniz); 882 } 881 883 882 884 /* this is abort option set with SET PRESIONIZ command, -
branches/newmole/source/conv_init_solution.cpp
r2124 r2125 319 319 PresTotCurrent(); 320 320 321 /* now get final temperature */321 /* now get new initial temperature */ 322 322 if( ConvPresTempEdenIoniz() ) 323 323 { -
branches/newmole/source/dynamics.cpp
r1780 r2125 1850 1850 if( lgWind ) 1851 1851 { 1852 /* incre se precision of solution */1852 /* increase precision of solution */ 1853 1853 conv.EdenErrorAllowed = 1e-3; 1854 1854 /* the actual relative error is relative to the total heating and cooling, -
branches/newmole/source/iso_level.cpp
r2112 r2125 202 202 else 203 203 { 204 /* this branch is main solver, full level populations 205 * assert since this code must change if NISO ever increased */ 204 206 ASSERT( NISO == 2 ); 205 207 long SpinUsed[NISO] = {2,1}; … … 455 457 * 456 458 * ==================================================================== */ 457 458 459 /* save matrix, this allocates SaveZ */ 459 460 SaveZ = z; -
branches/newmole/source/iter_end_chk.cpp
r1800 r2125 161 161 } 162 162 163 else if( (StopCalc.nTotalIonizStop>0) && conv.nTotalIoniz> StopCalc.nTotalIonizStop ) 164 { 165 /* stop if exceed number of calls to conv base set with 166 * stop nTotalIonizStop command */ 167 lgDone = true; 168 strncpy( StopCalc.chReasonStop, "nTotalIonizStop reached.", sizeof(StopCalc.chReasonStop) ); 169 } 170 163 171 /* this flag says that 21cm line optical depth is the stop quantity */ 164 172 else if( StopCalc.lgStop21cm && (HFLines[0].Emis->TauCon >= StopCalc.tauend) ) -
branches/newmole/source/mole_h2_io.cpp
r2023 r2125 272 272 strcpy( punch.chPunch[punch.npunch], "H2ln" ); 273 273 sprintf( chHeader, 274 "#H2 line\tEhi\tVhi\tJhi\tElo\tVlo\tJlo\twl(mic)\twl(lab)\tlog L or I\tI/Inorm\tExcit(hi, K)\tg_u h \\nu * Aul\n" );274 "#H2 line\tEhi\tVhi\tJhi\tElo\tVlo\tJlo\twl(mic)\twl(lab)\tlog L or I\tI/Inorm\tExcit(hi, K)\tg_u h nu * Aul\n" ); 275 275 /* first optional number changes the threshold of weakest line to print*/ 276 276 /* fe2thresh is intensity relative to normalization line, … … 2192 2192 /* excitation energy of upper level in K */ 2193 2193 fprintf( io, "\t%.3f", energy_wn[iElecHi][iVibHi][iRotHi]*T1CM ); 2194 /* the product h nu * Aul */2194 /* the product g_hi h nu * Aul */ 2195 2195 ASSERT( H2Lines[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo].ipCont > 0 ); 2196 2196 fprintf( io, "\t%.3e", H2Lines[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo].Emis->Aul* -
branches/newmole/source/parse_punch.cpp
r2112 r2125 2007 2007 else if( nMatch("SOUR",chCard) ) 2008 2008 { 2009 2010 /* check for keyword UNITS on line, then scan wavelength or energy units if present, 2011 * units are copied into punch.chConPunEnr */ 2012 ChkUnits(chCard); 2013 2009 2014 if( nMatch("DEPT",chCard) ) 2010 2015 { … … 2019 2024 strcpy( punch.chPunch[punch.npunch], "SOUS" ); 2020 2025 sprintf( chHeader, 2021 "#continuum source function\n" ); 2026 "#continuum source function nu(Ryd)\tConEmitLocal/widflx" 2027 "\tabs opac\tConSourceFcnLocal\tConSourceFcnLocal[nzone][j]/plankf\n" ); 2022 2028 } 2023 2029 else -
branches/newmole/source/punch_do.cpp
r2112 r2125 453 453 454 454 /* the outward emitted continuum */ 455 conem = ( (rfield.ConEmitOut[j])/455 conem = (rfield.ConEmitOut[j]/ 456 456 rfield.widflx[j]*rfield.anu2[j] + punch.PunchLWidth* 457 457 rfield.outlin[j]*rfield.anu[j])*radius.r1r0sq* … … 2901 2901 { 2902 2902 fprintf( punch.ipPnunit[ipPun], 2903 "%.4e\t%.4e\t%.4e\t%.4e\t%.4e\ n",2904 rfield.anu[j],2903 "%.4e\t%.4e\t%.4e\t%.4e\t%.4e\t%.4e\n", 2904 AnuUnit(rfield.AnuOrg[j]), 2905 2905 rfield.ConEmitLocal[nzone][j]/rfield.widflx[j], 2906 2906 opac.opacity_abs[j], 2907 rfield.Con EmitLocal[nzone][j]/rfield.widflx[j]/SDIV( opac.opacity_abs[j]),2908 rfield.Con EmitLocal[nzone][j]/rfield.widflx[j]/SDIV( opac.opacity_abs[j])/plankf(j) );2907 rfield.ConSourceFcnLocal[nzone][j], 2908 rfield.ConSourceFcnLocal[nzone][j]/plankf(j) ); 2909 2909 } 2910 2910 } -
branches/newmole/source/rfield.h
r1918 r2125 124 124 realnum **ConEmitLocal/* [depth][energy]*/; 125 125 126 /** the local source function - diffuse emission, photons Ryd-1 s-1 */ 127 realnum **ConSourceFcnLocal/* [depth][energy]*/; 128 126 129 /** reflected diffuse emission continuum */ 127 130 realnum *ConEmitReflec; … … 129 132 /** outward diffuse emission continuum (not the interactive one), 130 133 * this is incremented in radinc because of interplay between absorption 131 * and emission - get the outward bremsstrahlung right */ 134 * and emission - get the outward bremsstrahlung right 135 * photons cell-1 cm-2 s-1 */ 132 136 realnum *ConEmitOut; 133 137 … … 168 172 **otssav/*[NC_ELL][2]*/; 169 173 170 /** outward directed line emission */174 /** outward directed line emission photons cm-2 s-1 */ 171 175 realnum *outlin, 172 176 *outlin_noplot; -
branches/newmole/source/rt_diffuse.cpp
r2079 r2125 738 738 /* >>chng 00 oct 03, add diffuse continua */ 739 739 /* local diffuse continua */ 740 rfield.OccNumbDiffCont[nu] = rfield.ConEmitLocal[nzone][nu]*rfield.convoc[nu]; 740 rfield.OccNumbDiffCont[nu] = 741 rfield.ConEmitLocal[nzone][nu]*rfield.convoc[nu]; 742 743 rfield.ConSourceFcnLocal[nzone][nu] = 744 rfield.ConEmitLocal[nzone][nu]/rfield.widflx[nu]/ 745 (realnum)SDIV( opac.opacity_abs[nu]); 741 746 742 747 /* confirm that all are non-negative */
