Changeset 1942
- Timestamp:
- 04/12/08 09:30:35 (9 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 46 modified
-
assert_results.cpp (modified) (8 diffs)
-
atmdat.h (modified) (1 diff)
-
atmdat_chianti.cpp (modified) (1 diff)
-
atmdat_lamda.cpp (modified) (1 diff)
-
cddefines.h (modified) (1 diff)
-
cont_createpointers.cpp (modified) (1 diff)
-
cpu.cpp (modified) (2 diffs)
-
helike_cs.cpp (modified) (1 diff)
-
helike_einsta.cpp (modified) (1 diff)
-
helike_recom.cpp (modified) (1 diff)
-
helike_recom.h (modified) (1 diff)
-
hydro_bauman.cpp (modified) (33 diffs)
-
hydro_vs_rates.cpp (modified) (1 diff)
-
hypho.cpp (modified) (2 diffs)
-
init_coreload.cpp (modified) (2 diffs)
-
iso.h (modified) (4 diffs)
-
iso_collide.cpp (modified) (3 diffs)
-
iso_continuum_lower.cpp (modified) (3 diffs)
-
iso_cool.cpp (modified) (10 diffs)
-
iso_create.cpp (modified) (23 diffs)
-
iso_ionize_recombine.cpp (modified) (8 diffs)
-
iso_level.cpp (modified) (13 diffs)
-
iso_photo.cpp (modified) (2 diffs)
-
iso_radiative_recomb.cpp (modified) (23 diffs)
-
iso_solve.cpp (modified) (6 diffs)
-
lines_service.cpp (modified) (3 diffs)
-
Makefile (modified) (1 diff)
-
parse_commands.cpp (modified) (1 diff)
-
parse_print.cpp (modified) (1 diff)
-
parse_table.cpp (modified) (2 diffs)
-
parse_trace.cpp (modified) (5 diffs)
-
path.h (modified) (4 diffs)
-
pressure_change.cpp (modified) (5 diffs)
-
prt_lines_helium.cpp (modified) (1 diff)
-
prt_lines_hydro.cpp (modified) (4 diffs)
-
prt_zone.cpp (modified) (2 diffs)
-
radius_next.cpp (modified) (3 diffs)
-
rt_line_all.cpp (modified) (2 diffs)
-
rt_line_one.cpp (modified) (1 diff)
-
rt_tau_inc.cpp (modified) (1 diff)
-
rt_tau_init.cpp (modified) (5 diffs)
-
sanity_check.cpp (modified) (4 diffs)
-
service.cpp (modified) (3 diffs)
-
stars.cpp (modified) (1 diff)
-
TestFlexArr.cpp (modified) (1 diff)
-
vs.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/assert_results.cpp
r1918 r1942 10 10 #include "iso.h" 11 11 #include "called.h" 12 #include "atmdat.h" 12 13 #include "hcmap.h" 13 14 #include "thermal.h" … … 47 48 static char **chAssertLineLabel; 48 49 50 /* element to assert H-like case B */ 51 static char chElemLabelCaseB[5]; 52 static long int nelemCaseB , nISOCaseB; 53 49 54 /* this will be = for equal, < or > for limit */ 50 55 static char *chAssertLimit; … … 344 349 345 350 /* assert line "LINE" -- key is ine_ since linear option appears on some commands */ 346 else if( nMatch(" INE ",input.chCARDCAPS ) )351 else if( nMatch(" LINE ",input.chCARDCAPS ) ) 347 352 { 348 353 if( nMatch("LUMI",input.chCARDCAPS ) || nMatch("INTE",input.chCARDCAPS )) … … 440 445 441 446 /* assert departure coefficients */ 447 else if( nMatch("CASE",input.chCARDCAPS ) ) 448 { 449 /* this is Case B for some element */ 450 strcpy( chAssertType[nAsserts] , "CB" ); 451 i = 5; 452 /* this is relative error */ 453 AssertError[nAsserts] = 454 FFmtRead(input.chCARDCAPS ,&i, INPUT_LINE_LENGTH,&lgEOL); 455 if( lgEOL ) 456 /* default error was set in define above */ 457 AssertError[nAsserts] = DEF_ERROR; 458 AssertQuantity[nAsserts] = 0; 459 strcpy( chAssertLineLabel[nAsserts] , "Ca B" ); 460 wavelength[nAsserts] = 0.; 461 462 /* assert case b for H or He */ 463 if( nMatch("H-LI",input.chCARDCAPS ) ) 464 { 465 /* H-like - now get an element */ 466 if( (nelem = GetElem( input.chCARDCAPS )) < 0 ) 467 { 468 /* no name found */ 469 fprintf(ioQQQ, "assert H-like case B did not find an element on this line, sorry %s\n", 470 input.chCARDCAPS ); 471 cdEXIT(EXIT_FAILURE); 472 } 473 if( nelem>7 ) 474 { 475 /* beyond reach of tables */ 476 fprintf(ioQQQ, "assert H-like cannot do elements heavier than O, sorry %s\n", 477 input.chCARDCAPS ); 478 cdEXIT(EXIT_FAILURE); 479 } 480 nelemCaseB = nelem; 481 nISOCaseB = 0; 482 strcpy( chElemLabelCaseB , elementnames.chElementSym[nelem] ); 483 char chNumb[4]; 484 sprintf( chNumb , "%2li" , nelem+1 ); 485 strcat( chElemLabelCaseB , chNumb ); 486 } 487 else if( nMatch("HE-L",input.chCARDCAPS ) ) 488 { 489 /* He-like - only helium itself */ 490 nelemCaseB = ipHELIUM; 491 nISOCaseB = 0; 492 strcpy( chElemLabelCaseB , "He 1" ); 493 /* beyond reach of tables */ 494 fprintf(ioQQQ, "assert He-like case b not implemented yet %s\n", 495 input.chCARDCAPS ); 496 cdEXIT(EXIT_FAILURE); 497 } 498 } 442 499 else if( nMatch("DEPA",input.chCARDCAPS ) ) 443 500 { … … 447 504 FFmtRead(input.chCARDCAPS ,&i, INPUT_LINE_LENGTH,&lgEOL); 448 505 if( lgEOL ) 449 {450 506 NoNumb(input.chOrgCard); 451 }452 507 453 508 /* this is relative error, max departure from unity of any level or std */ … … 455 510 FFmtRead(input.chCARDCAPS ,&i, INPUT_LINE_LENGTH,&lgEOL); 456 511 if( lgEOL ) 457 {458 512 /* default error was set in define above */ 459 513 AssertError[nAsserts] = DEF_ERROR; 460 }461 514 462 515 /* H-like key means do one of the hydrogenic ions */ … … 1828 1881 /* uncertainty in difference is zero */ 1829 1882 AssertError[i] = 0.; 1883 } 1884 1885 else if( strcmp( chAssertType[i] , "CB") == 0 ) 1886 { 1887 int iCase = 1; 1888 RelError[i] = 0.; 1889 fprintf(ioQQQ," Species nHi nLo Wl Computed Asserted error\n"); 1890 long nHighestPrinted = StatesElem[nISOCaseB][nelemCaseB][iso.numPrintLevels[nISOCaseB][nelemCaseB]-1].n; 1891 for( long int ipLo=1+iCase; ipLo< MIN2(24,nHighestPrinted-1); ++ipLo ) 1892 { 1893 for( long int ipHi=ipLo+1; ipHi< MIN2(25,nHighestPrinted); ++ipHi ) 1894 { 1895 /* assert the line */ 1896 realnum wl = atmdat.WaveLengthCaseB[nelemCaseB][ipHi][ipLo]; 1897 double relint , absint,CBrelint , CBabsint; 1898 cdLine( "Ca B" , wl , &CBrelint , &CBabsint ); 1899 CBabsint = pow( 10., CBabsint ); 1900 double error; 1901 if( cdLine( chElemLabelCaseB , wl , &relint , &absint ) >0) 1902 { 1903 absint = pow( 10., absint ); 1904 error = (CBabsint - absint)/MAX2(CBabsint , absint); 1905 fprintf(ioQQQ,"ChkAssert %s %3li %3li ", 1906 chElemLabelCaseB , ipHi , ipLo ); 1907 prt_wl(ioQQQ, wl ); 1908 fprintf(ioQQQ," %.2e %.2e %10.3f", 1909 absint , CBabsint , error ); 1910 } 1911 else 1912 TotalInsanity(); 1913 if( fabs(error) > AssertError[i] ) 1914 fprintf(ioQQQ , " BOTCH \n"); 1915 else 1916 fprintf(ioQQQ , "\n"); 1917 1918 PredQuan[i] = 0; 1919 AssertQuantity[i] = 0.; 1920 RelError[i] = MAX2( RelError[i] , fabs(error) ); 1921 } 1922 } 1923 fprintf(ioQQQ,"\n"); 1830 1924 } 1831 1925 … … 2392 2486 2393 2487 { 2394 /*@-redef@*/2395 2488 enum {DEBUG_LOC=false}; 2396 /*@+redef@*/2397 2489 2398 2490 if( DEBUG_LOC ) -
branches/newmole/source/atmdat.h
r1830 r1942 202 202 * with "no collisional ionization" command */ 203 203 bool lgCollIonOn; 204 205 /** wavelengths of Hummer & Storey case B lines for H - O */ 206 realnum WaveLengthCaseB[8][25][24]; 204 207 205 208 } atmdat; -
branches/newmole/source/atmdat_chianti.cpp
r1918 r1942 263 263 strncpy(atmolStates[intNS][j].chLabel,Species[intNS].chptrSpName, 4); 264 264 atmolStates[intNS][j].chLabel[4] = '\0'; 265 266 /*Index for keep track of species index*/267 atmolStates[intNS][j].AtmolIndex = intNS;268 265 269 266 fstatwt = (realnum)atof(&chLine[SWS]); -
branches/newmole/source/atmdat_lamda.cpp
r1918 r1942 141 141 strncpy(atmolStates[intNS][nMolLevs].chLabel,Species[intNS].chptrSpName, 4); 142 142 atmolStates[intNS][nMolLevs].chLabel[4] = '\0'; 143 /*Keeping track of species index*/144 atmolStates[intNS][nMolLevs].AtmolIndex = intNS;145 143 146 144 long i = 1; -
branches/newmole/source/cddefines.h
r1918 r1942 1279 1279 char chConfig[11]; 1280 1280 1281 /*Index to identify the quantum state with the species index*/1282 int AtmolIndex;1283 1284 1281 species *sp; 1285 1282 -
branches/newmole/source/cont_createpointers.cpp
r1918 r1942 607 607 atmolEmis[i].tran->EnergyWN/PI4); 608 608 atmolEmis[i].damp = -1000.0; 609 //atmolEmis[i].damp = fdampXvel/(realnum)atmolEmis[i].tran->Hi->lifetime ;610 609 /*Put null terminated line label into chLab*/ 611 610 strncpy(chLab,atmolEmis[i].tran->Hi->chLabel,4); -
branches/newmole/source/cpu.cpp
r1830 r1942 208 208 209 209 /* if the environment variable was not set, the default set in path.h takes effect */ 210 string chSearchPathRaw = ( path != NULL ) ? string( path ) : string( LOCAL_DATA_PATH );210 string chSearchPathRaw = ( path != NULL ) ? string( path ) : string( CLOUDY_DATA_PATH ); 211 211 212 212 # ifdef _WIN32 … … 490 490 fprintf( ioQQQ, "the most likely reason is that the path has not been properly set.\n"); 491 491 fprintf( ioQQQ, "Please have a look at the file path.h in the source directory.\n"); 492 fprintf( ioQQQ, "Check how the variable LOCAL_DATA_PATH is set - ");492 fprintf( ioQQQ, "Check how the variable CLOUDY_DATA_PATH is set - "); 493 493 fprintf( ioQQQ, "it should give the location of the data files I need.\n"); 494 494 fprintf( ioQQQ, "These are the files in the data download from the web site.\n"); -
branches/newmole/source/helike_cs.cpp
r1918 r1942 1154 1154 global_s = s; 1155 1155 global_temp = temp; 1156 global_collider_charge = 1.;1157 1156 global_Collider = Collider; 1157 global_collider_charge = ColliderCharge[Collider]; 1158 ASSERT( global_collider_charge > 0. ); 1158 1159 1159 1160 /* no need to do this for h-like */ -
branches/newmole/source/helike_einsta.cpp
r1918 r1942 353 353 /* This is an extrapolation to the data given above. The fit reproduces 354 354 * the above values to 10% or better. */ 355 A= 7.22E-9*pow( nelem, 9.33);355 A= 7.22E-9*pow((double)nelem, 9.33); 356 356 iso_put_error(ipHE_LIKE,nelem,ipHi,ipLo,IPRAD,0.3f); 357 357 } -
branches/newmole/source/helike_recom.cpp
r1739 r1942 2111 2111 double lambda = TE1RYD * nelem * nelem / temp; 2112 2112 /* smallest x ever used here should be lowest Z, highest T, highest n... 2113 * using helium, logt = 10., and n = 100 , we get xmin = 1.5789E-9. */2113 * using helium, logt = 10., and n = 1000, we get xmin = 1.5789E-11. */ 2114 2114 double x = lambda / n / n; 2115 2115 double AlphaN; -
branches/newmole/source/helike_recom.h
r1739 r1942 4 4 #ifndef _HELIKE_RECOM_H_ 5 5 #define _HELIKE_RECOM_H_ 6 7 8 /* following two macros used to define recombination coef arrays */9 /* Max n desired in RRCoef file. */10 /* >>chng 02 jan 28, from 10 to 20 so large HeI tests are fast */11 /** this is the number of levels used with the12 * atom he-like levels large command */13 /* Helium itself will have precompiled recombination coefficients up to this maximum n. */14 #define HE_RREC_MAXN 4015 16 /** Ions of the sequence will go up to this n. */17 #define HE_LIKE_RREC_MAXN 2018 19 #define N_HE_TE_RECOMB 4120 21 /** This is the n to go up to when calculating total recombination. Any change22 * here will not be reflected in total recomb until "compile helike" is run */23 #define SumUpToThisN 100024 /** the magic number for the table of recombination coefficients, YYMMDD */25 /* >>chng 02 mar 08, data structure the same but improved fits to He photo cs */26 #define RECOMBMAGIC (51213)27 6 28 7 double DielecRecombRate( long ipISO, long nelem, long ipLo ); -
branches/newmole/source/hydro_bauman.cpp
r1846 r1942 9 9 /* In this version, quantities that would normally cause a 64-bit floating point processor */ 10 10 /* to either underflow or overflow are evaluated using logs instead of floating point math. */ 11 /* This allows us to use an upper princip lequantum number `n' greater than which the */11 /* This allows us to use an upper principal quantum number `n' greater than which the */ 12 12 /* other version begins to fail. The trade-off is, of course, lower accuracy */ 13 13 /* ( or is it precision ). We use LOG_10 for convenience. */ … … 43 43 /* The recombination coefficient is obtained from the */ 44 44 /* photoionization cross-section (see Burgess 1965). */ 45 /* We have ,*/45 /* We have: */ 46 46 /* */ 47 47 /* - - l'=l+1 */ … … 124 124 /* r^2 */ 125 125 /* */ 126 /* Similiarly, the recombination co -efficient satisfies */126 /* Similiarly, the recombination coefficient satisfies */ 127 127 /************************************************************************************************/ 128 128 … … 144 144 /** \verbatim 145 145 ************************* for LOG version of the file *************************************** 146 In this version, quantit es that would normal cause a 64-bit floating point processor146 In this version, quantities that would normal cause a 64-bit floating point processor 147 147 to underflowed or overflow on intermediate values (ones internal to the calculation) 148 are evaluated using logs. This allows us to use an upper princip lequantum number `n'148 are evaluated using logs. This allows us to use an upper principal quantum number `n' 149 149 greater than 50 which is where the other version begins to fail. The trade-off is, 150 150 of course, lower accuracy( or is it precision ) and perhaps speed. … … 352 352 353 353 /** \verbatim 354 This routine, hri(), calculates the hydrogen radial inte rgral,354 This routine, hri(), calculates the hydrogen radial integral, 355 355 for the transition n,l --> n',l' 356 356 It is, of course, dimensionless. … … 373 373 374 374 /**\verbatim 375 This routine, hri_log10(), calculates the hydrogen radial inte rgral,375 This routine, hri_log10(), calculates the hydrogen radial integral, 376 376 for the transition n,l --> n',l' 377 377 It is, of course, dimensionless. … … 539 539 540 540 /************************************************************************/ 541 /* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BO RHRADIUS * BORHRADIUS */541 /* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BOHRRADIUS * BOHRRADIUS */ 542 542 /* */ 543 543 /* */ … … 742 742 /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd) */ 743 743 double K, 744 /* princip lequantum number */744 /* principal quantum number */ 745 745 long int n, 746 746 /* angular momentum quantum number */ 747 747 long int l, 748 /* Temp erary storage for intermediate */748 /* Temporary storage for intermediate */ 749 749 /* results of the recursive routine */ 750 750 double *rcsvV … … 754 754 755 755 long int lp = 0; /* l' */ 756 double sigma = 0.; /* Sum in brocklehurst eq. 3.13 */756 double sigma = 0.; /* Sum in Brocklehurst eq. 3.13 */ 757 757 758 758 ASSERT( n > 0 ); … … 779 779 /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd) */ 780 780 double K, 781 /* princip lequantum number */781 /* principal quantum number */ 782 782 long int n, 783 783 /* angular momentum quantum number */ 784 784 long int l, 785 /* Temp erary storage for intermediate */785 /* Temporary storage for intermediate */ 786 786 mxq *rcsvV_mxq 787 787 /* results of the recursive routine */ … … 791 791 792 792 long int lp = 0; /* l' */ 793 double sigma = 0.; /* Sum in brocklehurst eq. 3.13 */793 double sigma = 0.; /* Sum in Brocklehurst eq. 3.13 */ 794 794 795 795 ASSERT( n > 0 ); … … 835 835 long int l, 836 836 long int lp, 837 /* Temp erary storage for intermediate */837 /* Temporary storage for intermediate */ 838 838 /* results of the recursive routine */ 839 839 double *rcsvV … … 913 913 long int l, 914 914 long int lp, 915 /* Temp erary storage for intermediate */915 /* Temporary storage for intermediate */ 916 916 /* results of the recursive routine */ 917 917 mxq *rcsvV_mxq … … 1010 1010 long int l, 1011 1011 long int lp, 1012 /* Temp erary storage for intermediate */1012 /* Temporary storage for intermediate */ 1013 1013 /* results of the recursive routine */ 1014 1014 double *rcsvV … … 1104 1104 long int l, 1105 1105 long int lp, 1106 /* Temp erary storage for intermediate */1106 /* Temporary storage for intermediate */ 1107 1107 /* results of the recursive routine */ 1108 1108 mxq *rcsvV_mxq … … 1121 1121 double Ksqrd = K * K; 1122 1122 1123 mx GK_mx = {0.0,0} , null_mx = {0.0,0};1123 mx GK_mx = {0.0,0}; 1124 1124 1125 1125 /* l=l'-1 or l=l'+1 */ … … 1306 1306 /* */ 1307 1307 /* from the reference */ 1308 /* M. Broc Klehurst */1308 /* M. Brocklehurst */ 1309 1309 /* Mon. Note. R. astr. Soc. (1971) 153, 471-490 */ 1310 1310 /* */ … … 1322 1322 long int l, 1323 1323 long int lp, 1324 /* Temp erary storage for intermediate */1324 /* Temporary storage for intermediate */ 1325 1325 /* results of the recursive routine */ 1326 1326 double *rcsvV, … … 1473 1473 long int l, 1474 1474 long int lp, 1475 /* Temp erary storage for intermediate */1475 /* Temporary storage for intermediate */ 1476 1476 /* results of the recursive routine */ 1477 1477 mxq *rcsvV_mxq, … … 1682 1682 /* */ 1683 1683 /* from the reference */
