Changeset 1918
- Timestamp:
- 04/06/08 04:45:19 (9 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 94 modified
- 11 copied
-
assert_results.cpp (modified) (3 diffs)
-
atmdat_char_tran.cpp (modified) (1 diff)
-
atmdat_chianti.cpp (modified) (1 diff)
-
atmdat_lamda.cpp (modified) (4 diffs)
-
atom_feii.cpp (modified) (2 diffs)
-
atom_oi.cpp (modified) (2 diffs)
-
cddefines.h (modified) (4 diffs)
-
cddrive.cpp (modified) (6 diffs)
-
cddrive.h (modified) (1 diff)
-
cdgetlinelist.cpp (modified) (3 diffs)
-
container_classes.h (modified) (1 diff)
-
cont_createmesh.cpp (modified) (1 diff)
-
cont_createpointers.cpp (modified) (1 diff)
-
cont_gaunt.cpp (modified) (1 diff)
-
cpu.h (modified) (3 diffs)
-
date.h (modified) (1 diff)
-
elements.txt (modified) (1 diff)
-
grains_mie.cpp (modified) (1 diff)
-
grid.h (modified) (1 diff)
-
grid_do.cpp (modified) (3 diffs)
-
grid_xspec.cpp (modified) (1 diff)
-
helike_cs.cpp (modified) (2 diffs)
-
helike_einsta.cpp (modified) (4 diffs)
-
hydrocollid.cpp (modified) (2 diffs)
-
hydro_vs_rates.cpp (modified) (9 diffs)
-
hydro_vs_rates.h (modified) (3 diffs)
-
init_coreload.cpp (modified) (4 diffs)
-
init_defaults_preparse.cpp (modified) (1 diff)
-
init_sim_postparse.cpp (modified) (2 diffs)
-
input.cpp (modified) (2 diffs)
-
input.h (modified) (1 diff)
-
ion_recomb_Badnell.cpp (modified) (1 diff)
-
iso.h (modified) (2 diffs)
-
iso_collide.cpp (modified) (3 diffs)
-
iso_create.cpp (modified) (2 diffs)
-
iso_level.cpp (modified) (9 diffs)
-
iso_radiative_recomb.cpp (modified) (4 diffs)
-
maincl.cpp (modified) (1 diff)
-
Makefile (modified) (1 diff)
-
mole_h2_coll.cpp (modified) (9 diffs)
-
mole_h2_create.cpp (modified) (1 diff)
-
mole_h2_io.cpp (modified) (1 diff)
-
nemala.cpp (modified) (1 diff)
-
nemala.txt (modified) (1 diff)
-
nemala2.cpp (modified) (1 diff)
-
opacity_add1element.cpp (modified) (1 diff)
-
opacity_createall.cpp (modified) (1 diff)
-
optimize_phymir.cpp (modified) (6 diffs)
-
parse_atom_iso.cpp (modified) (1 diff)
-
parse_backgrd.cpp (modified) (1 diff)
-
parse_blackbody.cpp (modified) (3 diffs)
-
parse_CMB.cpp (modified) (2 diffs)
-
parse_commands.cpp (modified) (5 diffs)
-
parse_grid.cpp (modified) (1 diff)
-
parse_interp.cpp (modified) (2 diffs)
-
parse_print.cpp (modified) (2 diffs)
-
parse_punch.cpp (modified) (2 diffs)
-
parse_table.cpp (modified) (1 diff)
-
pressure.h (modified) (1 diff)
-
pressure_total.cpp (modified) (8 diffs)
-
prt_alltau.cpp (modified) (2 diffs)
-
prt_comment.cpp (modified) (8 diffs)
-
prt_final.cpp (modified) (3 diffs)
-
prt_linepres.cpp (modified) (9 diffs)
-
prt_lines.cpp (modified) (1 diff)
-
prt_lines_continuum.cpp (modified) (1 diff)
-
prt_lines_helium.cpp (modified) (1 diff)
-
prt_lines_hydro.cpp (modified) (3 diffs)
-
prt_met.cpp (modified) (3 diffs)
-
punch_do.cpp (modified) (4 diffs)
-
punch_fits.cpp (modified) (3 diffs)
-
punch_line.cpp (modified) (1 diff)
-
radius_next.cpp (modified) (1 diff)
-
rfield.h (modified) (1 diff)
-
rt_escprob.cpp (modified) (1 diff)
-
rt_line_all.cpp (modified) (1 diff)
-
rt_line_one.cpp (modified) (2 diffs)
-
rt_line_one_tauinc.cpp (modified) (2 diffs)
-
rt_line_one_tau_reset.cpp (modified) (1 diff)
-
rt_tau_inc.cpp (modified) (1 diff)
-
service.cpp (modified) (1 diff)
-
sys_gcc/Makefile (modified) (1 diff)
-
sys_gcc/readme.txt (modified) (1 diff)
-
sys_gcc_shared/Makefile (copied) (copied from trunk/source/sys_gcc_shared/Makefile)
-
sys_gcc_shared/readme.txt (modified) (1 diff)
-
sys_gprof/Makefile (copied) (copied from trunk/source/sys_gprof/Makefile)
-
sys_gprof/readme.txt (modified) (1 diff)
-
sys_IBMxSeries/Makefile (copied) (copied from trunk/source/sys_IBMxSeries/Makefile)
-
sys_IBMxSeries/readme.txt (modified) (1 diff)
-
sys_icc/Makefile (copied) (copied from trunk/source/sys_icc/Makefile)
-
sys_icc/readme.txt (modified) (1 diff)
-
sys_icl (copied) (copied from trunk/source/sys_icl)
-
sys_icl/Makefile (copied) (copied from trunk/source/sys_icl/Makefile)
-
sys_icl/Makefile.conf (copied) (copied from trunk/source/sys_icl/Makefile.conf)
-
sys_icl/readme.txt (copied) (copied from trunk/source/sys_icl/readme.txt)
-
sys_icl/sourceme.txt (copied) (copied from trunk/source/sys_icl/sourceme.txt)
-
sys_pgcc/Makefile (copied) (copied from trunk/source/sys_pgcc/Makefile)
-
sys_pgcc/readme.txt (modified) (1 diff)
-
sys_pgccBounds/Makefile (copied) (copied from trunk/source/sys_pgccBounds/Makefile)
-
sys_pgccBounds/Makefile.conf (modified) (1 diff)
-
sys_pgccBounds/readme.txt (modified) (1 diff)
-
temp_change.cpp (modified) (3 diffs)
-
thirdparty.h (modified) (2 diffs)
-
version.h (modified) (2 diffs, 1 prop)
-
zero.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/assert_results.cpp
r1780 r1918 2214 2214 if( called.lgTalk && nAsserts>0 ) 2215 2215 { 2216 char chVer[10];2217 2216 time_t now; 2218 cdVersion(chVer );2219 2217 2220 2218 /* First disambiguate any line identifications */ … … 2281 2279 2282 2280 /* write start of title and version number of code */ 2283 fprintf( ioASSERT, "=============Results of asserts: C %s ",chVer);2281 fprintf( ioASSERT, "=============Results of asserts: Cloudy %s ", version::Inst().chVersion ); 2284 2282 2285 2283 /* usually print date and time info - do not if "no times" command entered, … … 2468 2466 fprintf( ioASSERT, " BOTCHED ASSERTS!!! Botched Asserts!!! \n"); 2469 2467 } 2470 /* if botched asserts then explain how we were compiled */ 2471 if( !lgAssertsOK ) 2472 { 2473 fprintf( ioQQQ, " %s\n\n", version.chInfo ); 2468 2469 /* explain how we were compiled, but only if printing time */ 2470 if( prt.lgPrintTime ) 2471 { 2472 fprintf( ioQQQ, " %s\n\n", version::Inst().chInfo ); 2474 2473 } 2475 2474 } -
branches/newmole/source/atmdat_char_tran.cpp
r1780 r1918 90 90 } 91 91 92 /* >>chng 04 apr 27, the above included only the radiative charge transfer from92 /* The above included only the radiative charge transfer from 93 93 * Stancil et al 1998. must explicitly add on the ct fitted by Kingdon & Ferland, 94 * the code must have originally had the KF fit, but got hosed at some point 95 * these are two different sets of physics 96 * He0 + H+ -> He+ + H0 */ 94 * The process H0 + He+ -> He0 + H+ */ 97 95 if( phycon.te > 6000. ) 98 atmdat.HCharExc IonOf[ipHELIUM][0] += 7.47e-15*pow(phycon.te/1e4,2.06)*96 atmdat.HCharExcRecTo[ipHELIUM][0] += 7.47e-15*pow(phycon.te/1e4,2.06)* 99 97 (1.+9.93*sexp(3.89e-4*phycon.te) ); 100 98 -
branches/newmole/source/atmdat_chianti.cpp
r1830 r1918 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; 265 268 266 269 fstatwt = (realnum)atof(&chLine[SWS]); -
branches/newmole/source/atmdat_lamda.cpp
r1830 r1918 52 52 ipLo = 0; 53 53 j = 0; 54 while(intlnct < 5)54 while(intlnct < 3) 55 55 { 56 56 intlnct++; … … 61 61 } 62 62 } 63 63 /*Extracting out the molecular weight*/ 64 if(read_whole_line( chLine , (int)sizeof(chLine) , atmolLevDATA ) == NULL ) 65 { 66 fprintf( ioQQQ, " The data file %s is corrupted .\n",chEFilename); 67 cdEXIT(EXIT_FAILURE); 68 } 69 Species[intNS].fmolweight = (realnum)atof(chLine); 70 71 /*Discard this line*/ 72 if(read_whole_line( chLine , (int)sizeof(chLine) , atmolLevDATA ) == NULL ) 73 { 74 fprintf( ioQQQ, " The data file %s is corrupted .\n",chEFilename); 75 cdEXIT(EXIT_FAILURE); 76 } 77 /*Reading in the number of energy levels*/ 64 78 if(read_whole_line( chLine , (int)sizeof(chLine) , atmolLevDATA ) == NULL ) 65 79 { … … 127 141 strncpy(atmolStates[intNS][nMolLevs].chLabel,Species[intNS].chptrSpName, 4); 128 142 atmolStates[intNS][nMolLevs].chLabel[4] = '\0'; 143 /*Keeping track of species index*/ 144 atmolStates[intNS][nMolLevs].AtmolIndex = intNS; 129 145 130 146 long i = 1; … … 224 240 /* don't need the energy in GHz, so throw it away. */ 225 241 FFmtRead( chLine, &i, sizeof(chLine), &lgEOL ); 226 fenergyK = (realnum)FFmtRead( chLine, &i, sizeof(chLine), &lgEOL ); 227 242 fenergyK = (realnum)(((atmolStates[intNS][ipHi].energy) -(atmolStates[intNS][ipLo].energy))*T1CM); 228 243 ASSERT( index == intrtct + 1 ); 229 244 -
branches/newmole/source/atom_feii.cpp
r1830 r1918 60 60 #include "atomfeii.h" 61 61 #include "iso.h" 62 #include "pressure.h" 62 63 /*lint -e668 passing null pointer */ 63 64 … … 3065 3066 Fe2LevN[ipHi][ipLo].Emis->PopOpc > smallfloat ) 3066 3067 { 3067 RadPres1 = 5.551e-2*(powi(Fe2LevN[ipHi][ipLo].EnergyWN/ 3068 1.e6,4))*(Fe2LevN[ipHi][ipLo].Hi->Pop/Fe2LevN[ipHi][ipLo].Hi->g)/ 3069 (Fe2LevN[ipHi][ipLo].Lo->Pop/Fe2LevN[ipHi][ipLo].Lo->g)* 3070 RT_LineWidth(&Fe2LevN[ipHi][ipLo]); 3068 RadPres1 = RadiationPressure( &Fe2LevN[ipHi][ipLo] ); 3069 3071 3070 # ifdef DEBUGFE 3072 3071 if( RadPres1 > RadMax ) -
branches/newmole/source/atom_oi.cpp
r1780 r1918 81 81 { 82 82 /* two sided escape prob */ 83 tin = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->TauIn + 84 TauLines[ipTO1025].Emis->TauIn; 83 tin = TauLines[ipTO1025].Emis->TauIn; 85 84 esin = esc_CRDwing_1side(tin,1e-4); 86 tout = (Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->TauTot + 87 TauLines[ipTO1025].Emis->TauTot)*0.9 - 88 Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->TauIn - 85 tout = (TauLines[ipTO1025].Emis->TauTot)*0.9 - 89 86 TauLines[ipTO1025].Emis->TauIn; 90 87 91 88 if( trace.lgTr8446 && trace.lgTrace ) 92 89 { 93 fprintf( ioQQQ, " P8446 tin, tout=%10.2e%10.2e\n", 94 tin, tout ); 90 fprintf( ioQQQ, " P8446 tin, tout=%10.2e%10.2e\n", tin, tout ); 95 91 } 96 92 97 93 if( tout > 0. ) 98 94 { 99 tout = Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->TauTot + 100 TauLines[ipTO1025].Emis->TauTot - 101 Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->TauIn - 102 TauLines[ipTO1025].Emis->TauIn; 95 tout = TauLines[ipTO1025].Emis->TauTot - TauLines[ipTO1025].Emis->TauIn; 103 96 104 97 /* do not update esab if we overran optical depth scale */ … … 109 102 { 110 103 /* one-sided escape probability */ 111 esab = esc_CRDwing_1side(Transitions[ipH_LIKE][ipHYDROGEN][ipH3p][ipH1s].Emis->TauIn+ 112 TauLines[ipTO1025].Emis->TauIn,1e-4); 104 esab = esc_CRDwing_1side(TauLines[ipTO1025].Emis->TauIn,1e-4); 113 105 } 114 106 -
branches/newmole/source/cddefines.h
r1830 r1918 218 218 ipHE_PLUS, 219 219 ipALPHA, 220 ipATOMH,221 ipHE_2PLUS,222 ipH2_ORTHO,223 ipH2_PARA,220 //ipATOMH, 221 //ipHE_2PLUS, 222 //ipH2_ORTHO, 223 //ipH2_PARA, 224 224 ipNCOLLIDER 225 225 }; … … 592 592 # ifdef NDEBUG 593 593 # define ASSERT(exp) ((void)0) 594 # elif defined ASSERTDEBUG 595 # define ASSERT(exp) if (!(exp)) MyAssert(__FILE__, __LINE__) 594 596 # else 595 597 /* the do { ... } while ( 0 ) prevents bugs in code like this: … … 1277 1279 char chConfig[11]; 1278 1280 1281 /*Index to identify the quantum state with the species index*/ 1282 int AtmolIndex; 1283 1279 1284 species *sp; 1280 1285 … … 1334 1339 long ipCont; 1335 1340 }; 1341 1342 /* Explicit instantiations for debugging purposes */ 1343 INSTANTIATE_MULTI_ARR( quantumState, MEM_LAYOUT_VAL, lgBOUNDSCHECKVAL ); 1344 INSTANTIATE_MULTI_ARR( transition, MEM_LAYOUT_VAL, lgBOUNDSCHECKVAL ); 1336 1345 1337 1346 -
branches/newmole/source/cddrive.cpp
r1846 r1918 352 352 * 353 353 * cdVersion - puts version number of code into string 354 * incoming string must have at least 8 charand will become null354 * incoming string must have sufficient length and will become null 355 355 * terminated string 356 356 * 357 357 ************************************************************************/ 358 358 359 void cdVersion(char chString[] ) 360 { 361 DEBUG_ENTRY( "cdVersion()" ); 362 363 if( !lgcdInitCalled ) 364 { 365 printf(" cdInit was not called first - this must be the first call.\n"); 366 cdEXIT(EXIT_FAILURE); 367 } 368 369 /* version was set by cdInit */ 370 strcpy( chString , version.chVersion ); 359 void cdVersion(char chString[]) 360 { 361 strcpy( chString , version::Inst().chVersion ); 371 362 return; 372 363 } … … 381 372 382 373 /* cdDate - puts date of code into string */ 383 void cdDate(char chString[] ) 384 { 385 /* date was set by cdInit */ 386 strcpy( chString , version.chDate ); 374 void cdDate(char chString[]) 375 { 376 strcpy( chString , version::Inst().chDate ); 387 377 return; 388 378 } … … 1945 1935 * this is limit to how many more commands can be read */ 1946 1936 int cdRead( 1947 /* the string containing the command s*/1948 c har *chInputLine )1937 /* the string containing the command */ 1938 const char *chInputLine ) 1949 1939 { 1950 1940 char *chEOL , /* will be used to search for end of line symbols */ … … 1965 1955 * but want to include special "c " type of comment 1966 1956 * >>chng 06 sep 04 use routine to check for comments */ 1967 if( (lgInputComment( chInputLine ) /*( chInputLine[0]=='#') || 1968 (chInputLine[0]=='%') || 1969 (strncmp(chInputLine,"//", 2 )==0 ) || 1970 (chInputLine[0]=='*')*/ || 1971 /* these two are end-of-input-stream sentinels */ 1972 (chInputLine[0]=='\n')|| 1973 (chInputLine[0]==' ') ) 1974 /* option to allow "C " lines through */ 1975 && 1976 !(chInputLine[0]=='C' || chInputLine[0]=='c' ) ) 1957 if( ( lgInputComment( chInputLine ) || 1958 /* these two are end-of-input-stream sentinels */ 1959 chInputLine[0] == '\n' || chInputLine[0] == ' ' ) && 1960 /* option to allow "C" lines through */ 1961 ! ( chInputLine[0] == 'C' || chInputLine[0] == 'c' ) ) 1977 1962 { 1978 1963 /* return value is number of lines that can still be stuffed in */ … … 1983 1968 * validate a location to store this line image, then store the version * 1984 1969 * that has been truncated from special end of line characters * 1985 * stored image will have < =80 valid characters*1970 * stored image will have < INPUT_LINE_LENGTH valid characters * 1986 1971 ***************************************************************************/ 1987 1972 … … 2006 1991 } 2007 1992 1993 strncpy( chLocal, chInputLine, INPUT_LINE_LENGTH ); 1994 // strncpy will pad chLocal with null bytes if chInputLine is shorter than 1995 // INPUT_LINE_LENGTH characters, so this indicates an overlong input string 1996 if( chLocal[INPUT_LINE_LENGTH-1] != '\0' ) 1997 { 1998 chLocal[INPUT_LINE_LENGTH-1] = '\0'; 1999 fprintf(ioQQQ," PROBLEM cdRead, while parsing the following input line:\n %s\n", 2000 chInputLine); 2001 fprintf(ioQQQ," found that the line is longer than %i characters, the longest possible line.\n", 2002 INPUT_LINE_LENGTH-1); 2003 fprintf(ioQQQ," Please make the command line no longer than this limit.\n"); 2004 } 2005 2008 2006 /* now kill any part of line image after special end of line character, 2009 2007 * this stops info user wants ignored from entering after here */ 2010 if( (chEOL = strchr(ch InputLine , '\n' ) ) !=NULL )2008 if( (chEOL = strchr(chLocal, '\n' ) ) != NULL ) 2011 2009 { 2012 2010 *chEOL = '\0'; 2013 2011 } 2014 if( (chEOL = strchr(ch InputLine , '%' ) ) !=NULL )2012 if( (chEOL = strchr(chLocal, '%' ) ) != NULL ) 2015 2013 { 2016 2014 *chEOL = '\0'; 2017 2015 } 2018 2016 /* >>chng 02 apr 10, add this char */ 2019 if( (chEOL = strchr(ch InputLine , '#' ) ) !=NULL )2017 if( (chEOL = strchr(chLocal, '#' ) ) != NULL ) 2020 2018 { 2021 2019 *chEOL = '\0'; 2022 2020 } 2023 if( (chEOL = strchr(ch InputLine , ';' ) ) !=NULL )2021 if( (chEOL = strchr(chLocal, ';' ) ) != NULL ) 2024 2022 { 2025 2023 *chEOL = '\0'; 2026 2024 } 2027 if( (chEOL = strstr(ch InputLine , "//" ) ) !=NULL )2025 if( (chEOL = strstr(chLocal, "//" ) ) != NULL ) 2028 2026 { 2029 2027 *chEOL = '\0'; 2030 }2031 2032 /* check that there are less than INPUT_LINE_LENGTH characters to the null character2033 * first find the end of string mark */2034 chEOL = strchr(chInputLine , '\0' );2035 2036 /* do something if no end of string, or if string longer than2037 * INPUT_LINE_LENGTH characters */2038 if( (chEOL==NULL) || (chEOL - chInputLine)>INPUT_LINE_LENGTH )2039 {2040 /* remember, in C [INPUT_LINE_LENGTH] is the n+1th character */2041 chInputLine[INPUT_LINE_LENGTH-1] = '\0';2042 fprintf(ioQQQ," cdRead, while parsing the following input line:\n %s\n",2043 chInputLine);2044 fprintf(ioQQQ," found that the line is longer than %i characters, the longest possible line.\n",2045 INPUT_LINE_LENGTH);2046 fprintf(ioQQQ," Please make the command line shorter than this limit.\n");2047 2028 } 2048 2029 2049 2030 /* now do it again, since we now want to make sure that there is a trailing space 2050 2031 * if the line is shorter than 80 char, test on null is to keep lint happy */ 2051 if( (chEOL = strchr( chInputLine, '\0' )) == NULL )2032 if( (chEOL = strchr( chLocal, '\0' )) == NULL ) 2052 2033 TotalInsanity(); 2053 2034 2054 /* pad with a spaceif short enough,2035 /* pad with two spaces if short enough, 2055 2036 * if not short enough for this to be done, then up to user to create correct input */ 2056 strcpy( chLocal , chInputLine ); 2057 if( chEOL-chInputLine <INPUT_LINE_LENGTH-4 ) 2058 { 2059 strcat( chLocal , " " ); 2037 if( chEOL-chLocal < INPUT_LINE_LENGTH-2 ) 2038 { 2039 strcat( chLocal, " " ); 2060 2040 } 2061 2041 -
branches/newmole/source/cddrive.h
r1830 r1918 89 89 * standard - a non-zero return is normal 90 90 */ 91 int cdRead( char* );91 int cdRead( const char* ); 92 92 93 93 /** -
branches/newmole/source/cdgetlinelist.cpp
r1830 r1918 2 2 * others. For conditions of distribution and use see copyright notice in license.txt */ 3 3 /*cdGetLineList routine to read in master list of emission line wavelengths and ids, for 4 * generating loc grids, 5 * someday add cdGetNLRLineList */ 4 * generating loc grids */ 6 5 #include "cddefines.h" 7 6 #include "cddrive.h" … … 38 37 chFilename = ( strlen(chFile) == 0 ) ? "LineList_BLR.dat" : chFile; 39 38 40 /* >>chng 04 nov 06, had searched only on path, now search locally41 * and then on path if not found */42 39 /* we will check local sp
