57 hcmap.lgMapDone =
true;
66 fprintf( io,
" Cloudy punts, Te=%10.3e HTOT=%10.3e CTOT=%10.3e nzone=%4ld\n",
68 fprintf( io,
" COOLNG array is\n" );
72 coolpr(io,
"ZERO",1,0.,
"ZERO");
73 for( i=0; i <
thermal.ncltot; i++ )
83 coolpr(io,
"DONE",1,0.,
"DONE");
84 fprintf( io,
" Line heating array follows\n" );
85 coolpr(io,
"ZERO",1,0.,
"ZERO");
87 for( i=0; i <
thermal.ncltot; i++ )
97 coolpr(io,
"DONE",1,0.,
"DONE");
104 fprintf( io,
" map of heating, cooling, vs temp, follows.\n");
106 " Te Heat--------------------> Cool---------------------> dH/dT dC/DT Ne NH HII Helium \n" );
109 if( strcmp(chType,
"punt") == 0 )
120 factor = pow(10.,log10(tmax/tmin)/(
double)(
hcmap.nMapStep));
124 else if( strcmp(chType,
" map") == 0 )
132 factor = pow(10.,log10(tmax/tmin)/(
double)(
hcmap.nMapStep));
145 TeNew = (tlowst/factor);
153 fprintf(
ioQQQ,
" PUNT called with insane argument,=%4.4s\n",
159 if(
hcmap.nMapAlloc==0 )
166 if(
hcmap.temap == NULL )
168 printf(
" not enough memory to allocate hcmap.temap in map_do\n" );
172 if(
hcmap.cmap == NULL )
174 printf(
" not enough memory to allocate hcmap.cmap in map_do\n" );
178 if(
hcmap.hmap == NULL )
180 printf(
" not enough memory to allocate hcmap.hmap in map_do\n" );
190 fprintf(
ioQQQ,
" MAP called temp range %.4e %.4e in %li stops ===============================================\n",
195 while( (
double)
phycon.te < tmax*0.999 && (
double)
phycon.te > tmin*1.001 )
204 if(
dense.lgElmtOn[nelem] )
206 dense.IonLow[nelem] = 0;
213 dense.IonHigh[nelem] = nelem + 1;
218 dense.IonLow[nelem] = -1;
219 dense.IonHigh[nelem] = -1;
224 conv.lgSearch =
true;
227 fprintf(
ioQQQ,
" MAP new temp %.4e ===============================================\n",
232 conv.nTotalIoniz = 0;
246 for( j=0; j <
thermal.ncltot; j++ )
248 if(
thermal.cooling[j] > strong )
250 strcpy( chLabel,
thermal.chClntLab[j] );
262 for( k=0; k <
LIMELM; k++ )
264 for( j=0; j <
LIMELM; j++ )
266 if(
thermal.heating[k][j] > strhet )
268 strhet =
thermal.heating[k][j];
278 if( oldch/ch < 0. &&
called.lgTalk )
280 fprintf( io,
" ----------------------------------------------- Probable thermal solution here. --------------------------------------------\n" );
301 fprintf( io,
"TRACE: te, htot, ctot%11.3e%11.3e%11.3e\n",
309 fprintf(io,
" [%2ld][%2ld]%6.3f",
313 fprintf(io,
" %s %.1f%c%6.3f",
324 fprintf(io,
"%6.2f%6.2f%6.2f%6.2f\n",
338 enum {DEBUG_LOC=
false};
341 static int kount = 0;
347 fprintf(
ioQQQ,
" exiting in map_do\n");
356 hcmap.lgMapOK =
true;
358 for( i=2; i<
hcmap.nmap-2; ++i )
364 if( s1*s3 > 0. && s2*s3 < 0. )
373 " cooling curve had double inflection at T=%.2e. ",
375 fprintf( io,
" Slopes were %.2e %.2e %.2e", s1, s2, s3);
376 if( fabs(s2)/
hcmap.cmap[i] > 0.05 )
379 " error large, (rel slope of %.2e).\n",
381 hcmap.lgMapOK =
false;
386 " error is small, (rel slope of %.2e).\n",
394 if( s1*s3 > 0. && s2*s3 < 0. )
402 " heating curve had double inflection at T=%.2e.\n",
404 hcmap.lgMapOK =
false;
void coolpr(FILE *io, const char *chLabel, realnum lambda, double ratio, const char *chJOB)