65 extern "C" { 
int vsnprintf(
char*, 
size_t, 
const char*, va_list); }
 
   77         memset( chLine, 0, (
size_t)nChar );
 
   81         if( (chRet = fgets( chLine, nChar, ioIN )) == NULL )
 
   84         long lineLength = strlen( chRet );
 
   91         if( lineLength>=nChar-1 )
 
   94                         fprintf( 
ioQQQ, 
"DISASTER PROBLEM read_whole_line found input" 
   95                         " with a line too long to be read, limit is %i char.  " 
   96                         "Start of line follows:\n%s\n",
 
  116         string::size_type ptr1 = 0;
 
  117         string::size_type ptr2 = str.find( sep );
 
  118         string sstr = str.substr( ptr1, ptr2-ptr1 );
 
  119         if( sstr.length() > 0 )
 
  120                 lst.push_back( sstr );
 
  122                 if( lgStrict ) lgFail = 
true;
 
  123                 if( lgKeep ) lst.push_back( sstr );
 
  125         while( ptr2 != string::npos ) {
 
  127                 ptr1 = ptr2 + sep.length();
 
  128                 if( ptr1 < str.length() ) {
 
  129                         ptr2 = str.find( sep, ptr1 );
 
  130                         sstr = str.substr( ptr1, ptr2-ptr1 );
 
  131                         if( sstr.length() > 0 )
 
  132                                 lst.push_back( sstr );
 
  134                                 if( lgStrict ) lgFail = 
true;
 
  135                                 if( lgKeep ) lst.push_back( sstr );
 
  140                         if( lgStrict ) lgFail = 
true;
 
  141                         if( lgKeep ) lst.push_back( 
"" );
 
  146                 fprintf( 
ioQQQ, 
" A syntax error occurred while splitting the string: \"%s\"\n", str.c_str() );
 
  147                 fprintf( 
ioQQQ, 
" The separator is \"%s\". Empty substrings are not allowed.\n", sep.c_str() );
 
  155         size_t pos = str.find_last_not_of(
" \t");
 
  157         if ( pos != string::npos )
 
  167         int pos = strlen( str );
 
  168         while( pos > 0 && (str[pos-1]==
' ' || str[pos-1]==
'\t' ))
 
  177 void MyAssert(
const char *file, 
int line, 
const char *comment)
 
  181         fprintf(
ioQQQ,
"\n\n\n PROBLEM DISASTER\n An assert has been thrown, this is bad.\n");
 
  183         fprintf(
ioQQQ,
" It happened in the file %s at line number %i\n", file, line );
 
  184         fprintf(
ioQQQ,
" This is iteration %li, nzone %li, fzone %.2f, lgSearch=%c.\n", 
 
  217                         fprintf( 
ioQQQ, 
" >>> \n >>> \n >>> Cosmic rays are not included and the gas is molecular.  " 
  218                                 "THIS IS KNOWN TO BE UNSTABLE.  Add cosmic rays and try again.\n >>> \n >>>\n\n");
 
  223                         fprintf( 
ioQQQ, 
"           vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv \n" );
 
  224                         fprintf( 
ioQQQ, 
"          > PROBLEM DISASTER PROBLEM DISASTER.      <\n" );
 
  225                         fprintf( 
ioQQQ, 
"          > Sorry, something bad has happened.      <\n" );
 
  226                         fprintf( 
ioQQQ, 
"          > Please post this on the Cloudy web site <\n" );
 
  227                         fprintf( 
ioQQQ, 
"          > discussion board at www.nublado.org     <\n" );
 
  228                         fprintf( 
ioQQQ, 
"          > Please send all following information:  <\n" );
 
  229                         fprintf( 
ioQQQ, 
"           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n" );
 
  237                         fprintf( 
ioQQQ, 
"%5ld warnings,%3ld cautions,%3ld temperature failures.  Messages follow.\n", 
 
  251                                 fprintf(
ioQQQ,
" This input stream included one or more init files.\n");
 
  252                                 fprintf(
ioQQQ,
" If these files are not part of the standard Cloudy distribution\n"); 
 
  253                                 fprintf(
ioQQQ,
" then I will need a copy of them too.\n");
 
  267         for( 
long i=0; i < 4; i++ )
 
  270                 chCAP[i] = 
toupper( chLab[i] );
 
  271                 if( chLab[i] == 
'\0' )
 
  286         while( chCard[i] != 
'\0' )
 
  288                 chCard[i] = 
tolower( chCard[i] );
 
  300         while( chCard[i] != 
'\0' )
 
  302                 chCard[i] = 
toupper( chCard[i] );
 
  309         1.e+000, 1.e+001, 1.e+002, 1.e+003, 1.e+004, 1.e+005, 1.e+006, 1.e+007, 1.e+008, 1.e+009,
 
  310         1.e+010, 1.e+011, 1.e+012, 1.e+013, 1.e+014, 1.e+015, 1.e+016, 1.e+017, 1.e+018, 1.e+019,
 
  311         1.e+020, 1.e+021, 1.e+022, 1.e+023, 1.e+024, 1.e+025, 1.e+026, 1.e+027, 1.e+028, 1.e+029,
 
  312         1.e+030, 1.e+031, 1.e+032, 1.e+033, 1.e+034, 1.e+035, 1.e+036, 1.e+037, 1.e+038, 1.e+039,
 
  313         1.e+040, 1.e+041, 1.e+042, 1.e+043, 1.e+044, 1.e+045, 1.e+046, 1.e+047, 1.e+048, 1.e+049,
 
  314         1.e+050, 1.e+051, 1.e+052, 1.e+053, 1.e+054, 1.e+055, 1.e+056, 1.e+057, 1.e+058, 1.e+059,
 
  315         1.e+060, 1.e+061, 1.e+062, 1.e+063, 1.e+064, 1.e+065, 1.e+066, 1.e+067, 1.e+068, 1.e+069,
 
  316         1.e+070, 1.e+071, 1.e+072, 1.e+073, 1.e+074, 1.e+075, 1.e+076, 1.e+077, 1.e+078, 1.e+079,
 
  317         1.e+080, 1.e+081, 1.e+082, 1.e+083, 1.e+084, 1.e+085, 1.e+086, 1.e+087, 1.e+088, 1.e+089,
 
  318         1.e+090, 1.e+091, 1.e+092, 1.e+093, 1.e+094, 1.e+095, 1.e+096, 1.e+097, 1.e+098, 1.e+099,
 
  319         1.e+100, 1.e+101, 1.e+102, 1.e+103, 1.e+104, 1.e+105, 1.e+106, 1.e+107, 1.e+108, 1.e+109,
 
  320         1.e+110, 1.e+111, 1.e+112, 1.e+113, 1.e+114, 1.e+115, 1.e+116, 1.e+117, 1.e+118, 1.e+119,
 
  321         1.e+120, 1.e+121, 1.e+122, 1.e+123, 1.e+124, 1.e+125, 1.e+126, 1.e+127, 1.e+128, 1.e+129,
 
  322         1.e+130, 1.e+131, 1.e+132, 1.e+133, 1.e+134, 1.e+135, 1.e+136, 1.e+137, 1.e+138, 1.e+139,
 
  323         1.e+140, 1.e+141, 1.e+142, 1.e+143, 1.e+144, 1.e+145, 1.e+146, 1.e+147, 1.e+148, 1.e+149,
 
  324         1.e+150, 1.e+151, 1.e+152, 1.e+153, 1.e+154, 1.e+155, 1.e+156, 1.e+157, 1.e+158, 1.e+159,
 
  325         1.e+160, 1.e+161, 1.e+162, 1.e+163, 1.e+164, 1.e+165, 1.e+166, 1.e+167, 1.e+168, 1.e+169,
 
  326         1.e+170, 1.e+171, 1.e+172, 1.e+173, 1.e+174, 1.e+175, 1.e+176, 1.e+177, 1.e+178, 1.e+179,
 
  327         1.e+180, 1.e+181, 1.e+182, 1.e+183, 1.e+184, 1.e+185, 1.e+186, 1.e+187, 1.e+188, 1.e+189,
 
  328         1.e+190, 1.e+191, 1.e+192, 1.e+193, 1.e+194, 1.e+195, 1.e+196, 1.e+197, 1.e+198, 1.e+199,
 
  329         1.e+200, 1.e+201, 1.e+202, 1.e+203, 1.e+204, 1.e+205, 1.e+206, 1.e+207, 1.e+208, 1.e+209,
 
  330         1.e+210, 1.e+211, 1.e+212, 1.e+213, 1.e+214, 1.e+215, 1.e+216, 1.e+217, 1.e+218, 1.e+219,
 
  331         1.e+220, 1.e+221, 1.e+222, 1.e+223, 1.e+224, 1.e+225, 1.e+226, 1.e+227, 1.e+228, 1.e+229,
 
  332         1.e+230, 1.e+231, 1.e+232, 1.e+233, 1.e+234, 1.e+235, 1.e+236, 1.e+237, 1.e+238, 1.e+239,
 
  333         1.e+240, 1.e+241, 1.e+242, 1.e+243, 1.e+244, 1.e+245, 1.e+246, 1.e+247, 1.e+248, 1.e+249,
 
  334         1.e+250, 1.e+251, 1.e+252, 1.e+253, 1.e+254, 1.e+255, 1.e+256, 1.e+257, 1.e+258, 1.e+259,
 
  335         1.e+260, 1.e+261, 1.e+262, 1.e+263, 1.e+264, 1.e+265, 1.e+266, 1.e+267, 1.e+268, 1.e+269,
 
  336         1.e+270, 1.e+271, 1.e+272, 1.e+273, 1.e+274, 1.e+275, 1.e+276, 1.e+277, 1.e+278, 1.e+279,
 
  337         1.e+280, 1.e+281, 1.e+282, 1.e+283, 1.e+284, 1.e+285, 1.e+286, 1.e+287, 1.e+288, 1.e+289,
 
  338         1.e+290, 1.e+291, 1.e+292, 1.e+293, 1.e+294, 1.e+295, 1.e+296, 1.e+297, 1.e+298, 1.e+299,
 
  339         1.e+300, 1.e+301, 1.e+302, 1.e+303, 1.e+304, 1.e+305, 1.e+306, 1.e+307, 1.e+308
 
  345         1.e-000, 1.e-001, 1.e-002, 1.e-003, 1.e-004, 1.e-005, 1.e-006, 1.e-007, 1.e-008, 1.e-009,
 
  346         1.e-010, 1.e-011, 1.e-012, 1.e-013, 1.e-014, 1.e-015, 1.e-016, 1.e-017, 1.e-018, 1.e-019,
 
  347         1.e-020, 1.e-021, 1.e-022, 1.e-023, 1.e-024, 1.e-025, 1.e-026, 1.e-027, 1.e-028, 1.e-029,
 
  348         1.e-030, 1.e-031, 1.e-032, 1.e-033, 1.e-034, 1.e-035, 1.e-036, 1.e-037, 1.e-038, 1.e-039,
 
  349         1.e-040, 1.e-041, 1.e-042, 1.e-043, 1.e-044, 1.e-045, 1.e-046, 1.e-047, 1.e-048, 1.e-049,
 
  350         1.e-050, 1.e-051, 1.e-052, 1.e-053, 1.e-054, 1.e-055, 1.e-056, 1.e-057, 1.e-058, 1.e-059,
 
  351         1.e-060, 1.e-061, 1.e-062, 1.e-063, 1.e-064, 1.e-065, 1.e-066, 1.e-067, 1.e-068, 1.e-069,
 
  352         1.e-070, 1.e-071, 1.e-072, 1.e-073, 1.e-074, 1.e-075, 1.e-076, 1.e-077, 1.e-078, 1.e-079,
 
  353         1.e-080, 1.e-081, 1.e-082, 1.e-083, 1.e-084, 1.e-085, 1.e-086, 1.e-087, 1.e-088, 1.e-089,
 
  354         1.e-090, 1.e-091, 1.e-092, 1.e-093, 1.e-094, 1.e-095, 1.e-096, 1.e-097, 1.e-098, 1.e-099,
 
  355         1.e-100, 1.e-101, 1.e-102, 1.e-103, 1.e-104, 1.e-105, 1.e-106, 1.e-107, 1.e-108, 1.e-109,
 
  356         1.e-110, 1.e-111, 1.e-112, 1.e-113, 1.e-114, 1.e-115, 1.e-116, 1.e-117, 1.e-118, 1.e-119,
 
  357         1.e-120, 1.e-121, 1.e-122, 1.e-123, 1.e-124, 1.e-125, 1.e-126, 1.e-127, 1.e-128, 1.e-129,
 
  358         1.e-130, 1.e-131, 1.e-132, 1.e-133, 1.e-134, 1.e-135, 1.e-136, 1.e-137, 1.e-138, 1.e-139,
 
  359         1.e-140, 1.e-141, 1.e-142, 1.e-143, 1.e-144, 1.e-145, 1.e-146, 1.e-147, 1.e-148, 1.e-149,
 
  360         1.e-150, 1.e-151, 1.e-152, 1.e-153, 1.e-154, 1.e-155, 1.e-156, 1.e-157, 1.e-158, 1.e-159,
 
  361         1.e-160, 1.e-161, 1.e-162, 1.e-163, 1.e-164, 1.e-165, 1.e-166, 1.e-167, 1.e-168, 1.e-169,
 
  362         1.e-170, 1.e-171, 1.e-172, 1.e-173, 1.e-174, 1.e-175, 1.e-176, 1.e-177, 1.e-178, 1.e-179,
 
  363         1.e-180, 1.e-181, 1.e-182, 1.e-183, 1.e-184, 1.e-185, 1.e-186, 1.e-187, 1.e-188, 1.e-189,
 
  364         1.e-190, 1.e-191, 1.e-192, 1.e-193, 1.e-194, 1.e-195, 1.e-196, 1.e-197, 1.e-198, 1.e-199,
 
  365         1.e-200, 1.e-201, 1.e-202, 1.e-203, 1.e-204, 1.e-205, 1.e-206, 1.e-207, 1.e-208, 1.e-209,
 
  366         1.e-210, 1.e-211, 1.e-212, 1.e-213, 1.e-214, 1.e-215, 1.e-216, 1.e-217, 1.e-218, 1.e-219,
 
  367         1.e-220, 1.e-221, 1.e-222, 1.e-223, 1.e-224, 1.e-225, 1.e-226, 1.e-227, 1.e-228, 1.e-229,
 
  368         1.e-230, 1.e-231, 1.e-232, 1.e-233, 1.e-234, 1.e-235, 1.e-236, 1.e-237, 1.e-238, 1.e-239,
 
  369         1.e-240, 1.e-241, 1.e-242, 1.e-243, 1.e-244, 1.e-245, 1.e-246, 1.e-247, 1.e-248, 1.e-249,
 
  370         1.e-250, 1.e-251, 1.e-252, 1.e-253, 1.e-254, 1.e-255, 1.e-256, 1.e-257, 1.e-258, 1.e-259,
 
  371         1.e-260, 1.e-261, 1.e-262, 1.e-263, 1.e-264, 1.e-265, 1.e-266, 1.e-267, 1.e-268, 1.e-269,
 
  372         1.e-270, 1.e-271, 1.e-272, 1.e-273, 1.e-274, 1.e-275, 1.e-276, 1.e-277, 1.e-278, 1.e-279,
 
  373         1.e-280, 1.e-281, 1.e-282, 1.e-283, 1.e-284, 1.e-285, 1.e-286, 1.e-287, 1.e-288, 1.e-289,
 
  374         1.e-290, 1.e-291, 1.e-292, 1.e-293, 1.e-294, 1.e-295, 1.e-296, 1.e-297, 1.e-298, 1.e-299,
 
  375         1.e-300, 1.e-301, 1.e-302, 1.e-303, 1.e-304, 1.e-305, 1.e-306, 1.e-307
 
  378 static const int min_pow10 = -int(
sizeof(neg_pow10)/
sizeof(neg_pow10[0]) - 1);
 
  389         const char *eol_ptr = &chCard[length]; 
 
  390         const char *ptr = 
min(&chCard[*ipnt-1],eol_ptr); 
 
  394                 fprintf(
ioQQQ, 
"PROBLEM FFmtRead called with index <= 0, ipnt is %li\n",*ipnt);
 
  398         else if( *ipnt > length )
 
  400                 fprintf(
ioQQQ, 
"PROBLEM FFmtRead called with index > length, ipnt is %li length is %li\n",
 
  408                 if( ptr >= eol_ptr || ( chr = *ptr++ ) == 
'\0' )
 
  414                 const char *lptr = ptr;
 
  416                 if( ( lchr == 
'-' || lchr == 
'+' ) && lptr < eol_ptr )
 
  418                 if( lchr == 
'.'  && lptr < eol_ptr )
 
  427         int exponent=0, 
sign=1, expsign=1, scale=0;
 
  428         bool lgCommaFound = 
false, lgLastComma = 
false, foundpoint = 
false, foundexp = 
false;
 
  431                 lgCommaFound = lgLastComma;
 
  438                 else if (isdigit(chr))
 
  440                         int digit = (chr - 
'0');
 
  443                                 exponent = 10*exponent+digit;
 
  447                                 number = 10.0*number+digit;
 
  456                                 if (exponent != 0 || expsign != 1)
 
  462                                 if (number != 0 || 
sign != 1)
 
  483         while( isdigit(chr) || chr == 
'.' || chr == 
'-' || chr == 
'+' || chr == 
',' || chr == 
'e' || chr == 
'E' );
 
  487                 fprintf( 
ioQQQ, 
" PROBLEM - a comma was found embedded in a number, this is deprecated.\n" );
 
  491         int expo = expsign*exponent-scale;
 
  492         double value = 
sign*number;
 
  507                 while( expo < min_pow10 )
 
  512                 value *= neg_pow10[-expo];
 
  518         *ipnt = (long)(ptr - chCard); 
 
  533         ASSERT( strlen(chKey) > 0 );
 
  535         if( ( ptr = 
strstr_s( chCard, chKey ) ) == NULL )
 
  543                 Match_v = (long)(ptr-chCard+1);
 
  569                 fprintf( 
ioQQQ, 
" FUDGE factor not entered for array number %3ld\n", 
 
  594 double powi( 
double x, 
long int n )     
 
  630 double powpq(
double x, 
int p, 
int q)
 
  643                 return powi(sqrt(x),p);
 
  645                 return powi(cbrt(x),p);
 
  647                 return powi(sqrt(sqrt(x)),p);
 
  649                 return powi(sqrt(cbrt(x)),p);
 
  651                 return powi(sqrt(sqrt(sqrt(x))),p);
 
  653                 return powi(cbrt(cbrt(x)),p);
 
  655                 return pow(x,
double(p)/
double(q));
 
  666         if( m == 0 || (n < 0 && m > 1) )
 
  695 size_t strnlen(
const char *s, 
size_t maxlen)
 
  697         for( 
size_t i=0; i < maxlen; ++i )
 
  716 size_t sncatf( 
char* buf, 
size_t bufSize, 
const char* fmt, ... )
 
  720         size_t len = strnlen( buf, bufSize );
 
  722         va_start( args, fmt );
 
  723         result = vsnprintf( buf + len, bufSize - len, fmt, args );
 
  729 size_t sncatf( ostringstream& str, 
const char* fmt, ... )
 
  733         size_t len = str.tellp();
 
  738         va_start( args, fmt );
 
  739         result = vsnprintf( tmp, 
sizeof(tmp), fmt, args );
 
  742         if (result >= 
sizeof(tmp))
 
  744                 tmp1 = 
new char[result+1];
 
  745                 va_start( args, fmt );
 
  746                 result = vsnprintf( tmp1, result+1, fmt, args );
 
  775 char *
PrintEfmt(
const char *fmt, 
double val ) 
 
  782         sprintf(buf, fmt, val);
 
  799         if((ep = 
strchr_s(buf, 
'e')) == NULL)
 
  826         double frac , xlog , xfloor , tvalue;
 
  835         else if( value <= DBL_MIN )
 
  843                 xlog = log10( tvalue );
 
  844                 xfloor = floor(xlog);
 
  847                         frac = tvalue*
exp10(-xfloor);
 
  849                         frac = (10.*tvalue)*
exp10(-(xfloor+1.));
 
  875         double frac , xlog , xfloor , tvalue;
 
  884         else if( value <= DBL_MIN )
 
  892                 xlog = log10( tvalue );
 
  893                 xfloor = floor(xlog);
 
  896                         frac = tvalue*
exp10(-xfloor);
 
  898                         frac = (10.*tvalue)*
exp10(-(xfloor+1.));
 
  925         double frac , xlog , xfloor, tvalue;
 
  934         else if( value <= DBL_MIN )
 
  942                 xlog = log10( tvalue );
 
  943                 xfloor = floor(xlog);
 
  946                         frac = tvalue*
exp10(-xfloor);
 
  948                         frac = (10.*tvalue)*
exp10(-(xfloor+1.));
 
  978         fprintf( 
ioQQQ, 
" Something that cannot happen, has happened.\n" );
 
  979         fprintf( 
ioQQQ, 
" This is TotalInsanity, I live in %s.\n", __FILE__ );
 
  991         fprintf( 
ioQQQ, 
" A read of internal input data has failed.\n" );
 
  992         fprintf( 
ioQQQ, 
" This is BadRead, I live in %s.\n", __FILE__ );
 
 1086         oss << 
"-- At " << file << 
":"<< line << 
" in " << func <<
"()\n";
 
 1108         va_start(ap,format);
 
 1111                 i2 = vfprintf(fp,format,ap);
 
 1124         va_start(ap,format);
 
 1125         int i = vfprintf(stream.
fptr(), format, ap);
 
 1134         va_start(ap,format);
 
 1138                 i2 = vfprintf(stream.
fptr(),format,ap);
 
 1165                 i = vfprintf(
ioQQQ, fmt, ap);
 
 1179         double (*fct)(
double) )
 
 1181         double a = 0.5*(xu+xl), 
 
 1200         double weights[16] = {
 
 1201                 .35093050047350483e-2, .81371973654528350e-2, .12696032654631030e-1, .17136931456510717e-1,
 
 1202                 .21417949011113340e-1, .25499029631188088e-1, .29342046739267774e-1, .32911111388180923e-1,
 
 1203                 .36172897054424253e-1, .39096947893535153e-1, .41655962113473378e-1, .43826046502201906e-1,
 
 1204                 .45586939347881942e-1, .46922199540402283e-1, .47819360039637430e-1, .48270044257363900e-1};
 
 1207                 .498631930924740780, .49280575577263417, .4823811277937532200, .46745303796886984000,
 
 1208                 .448160577883026060, .42468380686628499, .3972418979839712000, .36609105937014484000,
 
 1209                 .331522133465107600, .29385787862038116, .2534499544661147000, .21067563806531767000,
 
 1210                 .165934301141063820, .11964368112606854, .7223598079139825e-1, .24153832843869158e-1};
 
 1212         for( 
int i=0; i<16; i++)
 
 1214                 y += b * weights[i] * ((*fct)(a+b*c[i]) + (*fct)(a-b*c[i]));
 
 1343                 if( kk != 1 && kk != 2 )
 
 1353                         for( i=0; i < nn; i++ )
 
 1368                                 for( i=0; i < nn; i++ )
 
 1386                 if( r <= 0.5898437e0 )
 
 1400                 ij = i + (long)((j-i)*r);
 
 1405                 if( x[iperm[i-1]-1] > x[lm-1] )
 
 1407                         iperm[ij-1] = iperm[i-1];
 
 1415                 if( x[iperm[j-1]-1] < x[lm-1] )
 
 1417                         iperm[ij-1] = iperm[j-1];
 
 1424                         if( x[iperm[i-1]-1] > x[lm-1] )
 
 1426                                 iperm[ij-1] = iperm[i-1];
 
 1437                         if( x[iperm[l-1]-1] <= x[lm-1] )
 
 1445                                         if( x[iperm[k-1]-1] >= x[lm-1] )
 
 1453                                 iperm[l-1] = iperm[k-1];
 
 1487                         if( x[iperm[i-1]-1] > x[lm-1] )
 
 1493                                         iperm[k] = iperm[k-1];
 
 1496                                         if( x[lm-1] >= x[iperm[k-1]-1] )
 
 1518                 for( i=0; i < nn; i++ )
 
 1530                 for( istrt=1; istrt <= nn; istrt++ )
 
 1533                         if( iperm[istrt_] >= 0 )
 
 1538                                 while( iperm[indx-1] > 0 )
 
 1540                                         x[indx-1] = x[iperm[indx-1]-1];
 
 1542                                         iperm[indx-1] = -iperm[indx-1];
 
 1543                                         indx = labs(iperm[indx-1]);
 
 1550                 for( i=0; i < nn; i++ )
 
 1552                         iperm[i] = -iperm[i];
 
 1556         for( i=0; i < nn; i++ )
 
 1579                 enum{DEBUG_LOC=
false};
 
 1582                         static long int kount=0, nTot=0;
 
 1594                 fprintf(
ioQQQ,
"DISASTER MyMalloc could not allocate %lu bytes.  Exit in MyMalloc.",
 
 1595                         (
unsigned long)size );
 
 1596                 fprintf(
ioQQQ,
"MyMalloc called from file %s at line %i.\n",
 
 1600                         fprintf(
ioQQQ,
"This may have been caused by the large number of zones." 
 1601                         " %li zones were requested.  Is this many zones really necessary?\n",
 
 1608 #       if !defined(NDEBUG) && !defined(NOINIT) 
 1610         size_t nFloat = size/4;
 
 1611         size_t nDouble = size/8;
 
 1613         double *dptr = 
static_cast<double*
>(ptr);
 
 1619         if( size == nDouble*8 )
 
 1628                 set_NaN( dptr, (
long)nDouble );
 
 1630         else if( size == nFloat*4 )
 
 1633                 set_NaN( fptr, (
long)nFloat );
 
 1637                 memset( ptr, 0xff, size );
 
 1649         void *ptr = malloc(size);
 
 1702         double  x1, 
x2, w, yy1;
 
 1704         static int use_last = 
false;
 
 1718                         w = x1 * x1 + x2 * 
x2;
 
 1719                 } 
while ( w >= 1.0 );
 
 1721                 w = sqrt((-2.0*log(w))/w);
 
 1726         return xMean + yy1 * s;
 
 1743         ASSERT( PctUncertainty < 0.5 );
 
 1745         StdDev = PctUncertainty;
 
 1753         while( (result < 1.-3.*PctUncertainty) || (result > 1.+3.*PctUncertainty) );
 
 1755         ASSERT( result>0. && result<2. );
 
 1788                 if( line[0] == 
'#' )
 
 1791                 size_t p = line.find( 
"XXXX" );
 
 1792                 if( p != string::npos )
 
 1805                 if( line[0] == 
'#' )
 
 1808                 size_t p = line.find( 
"XXXX" );
 
 1809                 if( p != string::npos )
 
 1833         istream::sentry se(is, 
true);
 
 1834         streambuf* sb = is.rdbuf();
 
 1838                 int c = sb->sbumpc();
 
 1842                         if( sb->sgetc() == EOF )
 
 1843                                 is.setstate(ios::eofbit);
 
 1846                         if( sb->sgetc() == 
'\n' )
 
 1848                         if( sb->sgetc() == EOF )
 
 1849                                 is.setstate(ios::eofbit);
 
 1853                         is.setstate(ios::eofbit);
 
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
 
vector< double, allocator_avx< double > > ContBoltz
 
void cdPrintCommands(FILE *ioOUT)
 
void PrintE93(FILE *, double)
 
istream & SafeGetline(istream &is, string &t)
 
NORETURN void TotalInsanity(void)
 
static const double neg_pow10[]
 
void set_NaN(sys_float &x)
 
static const double pos_pow10[]
 
size_t sncatf(char *buf, size_t bufSize, const char *fmt,...)
 
void cdCautions(FILE *ioOUT)
 
void cdWarnings(FILE *ioPNT)
 
long nMatch(const char *chKey, const char *chCard)
 
static const int max_pow10
 
const char * strstr_s(const char *haystack, const char *needle)
 
void * MyMalloc(size_t size, const char *file, int line)
 
sys_float sexp(sys_float x)
 
int dbg_printf(int debug, const char *fmt,...)
 
double fudge(long int ipnt)
 
molezone * findspecieslocal(const char buf[])
 
void CloudyPrintReference()
 
void cap4(char *chCAP, const char *chLab)
 
double anu(size_t i) const 
 
void trimTrailingWhiteSpace(string &str)
 
void fixit_base(const char *func, const char *file, int line, const char *reason)
 
char chVersion[iVersionLength]
 
static t_version & Inst()
 
void uncaps(char *chCard)
 
int dprintf(FILE *fp, const char *format,...)
 
void PrintE71(FILE *, double)
 
const ios_base::openmode mode_r
 
double powi(double, long int)
 
const char * strchr_s(const char *s, int c)
 
diatomics h2("h2", 4100.,&hmi.H2_total, Yan_H2_CS)
 
double RandGauss(double xMean, double s)
 
double AnuUnit(realnum energy)
 
void MyAssert(const char *file, int line, const char *comment)
 
long int ipow(long, long)
 
static const int min_pow10
 
double qg32(double, double, double(*)(double))
 
double csphot(long int inu, long int ithr, long int iofset)
 
#define DEBUG_ENTRY(funcname)
 
double powpq(double x, int p, int q)
 
STATIC void MyMalloc_base(void *ptr, size_t size, const char *chFile, int line)
 
void DatabasePrintReference()
 
int fprintf(const Output &stream, const char *format,...)
 
const char * chConSavEnr[LIMPUN]
 
void Split(const string &str, const string &sep, vector< string > &lst, split_mode mode)
 
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
 
double MyGaussRand(double PctUncertainty)
 
void PrintE82(FILE *, double)
 
double plankf(long int ip)
 
double get(const char *unit) const 
 
NORETURN void BadRead(void)
 
void spsort(realnum x[], long int n, long int iperm[], int kflag, int *ier)
 
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)