68 fprintf( io,
"# Cloudy punts, Te=%10.3e HTOT=%10.3e CTOT=%10.3e nzone=%4ld\n",
70 fprintf( io,
"# COOLNG array is\n" );
74 coolpr(io,
"ZERO",1,0.,
"ZERO");
86 coolpr(io,
"DONE",1,0.,
"DONE");
87 fprintf( io,
"# Line heating array follows\n" );
88 coolpr(io,
"ZERO",1,0.,
"ZERO");
101 coolpr(io,
"DONE",1,0.,
"DONE");
108 fprintf( io,
"# map of heating, cooling, vs temp, follows.\n");
110 "# Te\t\t Heat-------------------------------->\tCool----------------------------------------->\t dH/dT\t dC/DT\t Ne\t NH\t H2\t HII\t Helium \n" );
113 if( strcmp(chType,
"punt") == 0 )
128 else if( strcmp(chType,
" map") == 0 )
149 TeNew = (tlowst/factor);
157 fprintf(
ioQQQ,
" PUNT called with insane argument,=%4.4s\n",
170 if( hcmap.
temap == NULL )
172 printf(
" not enough memory to allocate hcmap.temap in map_do\n" );
176 if( hcmap.
cmap == NULL )
178 printf(
" not enough memory to allocate hcmap.cmap in map_do\n" );
182 if( hcmap.
hmap == NULL )
184 printf(
" not enough memory to allocate hcmap.hmap in map_do\n" );
194 fprintf(
ioQQQ,
" MAP called temp range %.4e %.4e in %li stops ===============================================\n",
223 fprintf(
ioQQQ,
" MAP new temp %.4e ===============================================\n",
258 for( k=0; k <
LIMELM; k++ )
260 for( j=0; j <
LIMELM; j++ )
276 fprintf( io,
"# ----------------------------------------------- Probable thermal solution here. --------------------------------------------\n" );
297 fprintf( io,
"# TRACE: te, htot, ctot%11.3e%11.3e%11.3e\n",
305 fprintf(io,
" [%2ld][%2ld]\t%6.3f\t",
309 fprintf(io,
" %-10s\t%.1f%c\t%6.3f\t",
321 fprintf(io,
"%6.2f\t%6.2f\t%6.2f\t%6.2f",
336 enum {DEBUG_LOC=
false};
339 static int kount = 0;
356 for( i=2; i< hcmap.
nmap-2; ++i )
359 s1 = hcmap.
cmap[i-2] - hcmap.
cmap[i-1];
360 s2 = hcmap.
cmap[i-1] - hcmap.
cmap[i];
361 s3 = hcmap.
cmap[i] - hcmap.
cmap[i+1];
362 if( s1*s3 > 0. && s2*s3 < 0. )
371 "# cooling curve had double inflection at T=%.2e. ",
373 fprintf( io,
" Slopes were %.2e %.2e %.2e", s1, s2, s3);
374 if( fabs(s2)/hcmap.
cmap[i] > 0.05 )
377 " error large, (rel slope of %.2e).\n",
384 " error is small, (rel slope of %.2e).\n",
389 s1 = hcmap.
hmap[i-2] - hcmap.
hmap[i-1];
390 s2 = hcmap.
hmap[i-1] - hcmap.
hmap[i];
391 s3 = hcmap.
hmap[i] - hcmap.
hmap[i+1];
392 if( s1*s3 > 0. && s2*s3 < 0. )
400 "# heating curve had double inflection at T=%.2e.\n",
void coolpr(FILE *io, const char *chLabel, realnum lambda, double ratio, const char *chJOB)
void ion_trim_untrim(long nelem)
void ion_trim_invalidate(long nelem)
void TempChange(double TempNew, bool lgForceUpdate)
void PresTotCurrent(void)
const double TEMP_LIMIT_LOW
double xIonDense[LIMELM][LIMELM+1]
char chClntLab[NCOLNT][NCOLNT_LAB_LEN+1]
const double TEMP_LIMIT_HIGH
void map_do(FILE *io, const char *chType)
double heating(long nelem, long ion)
realnum gas_phase[LIMELM]
#define DEBUG_ENTRY(funcname)
int fprintf(const Output &stream, const char *format,...)