35 static char chPLab[
NPUNLM][5];
36 static long int nLinesEntered;
38 static long int ipLine[
NPUNLM];
43 long int nCdLineReturn;
44 static bool lgRelativeIntensity;
54 if( strcmp(chDo,
"READ") == 0 )
61 lgRelativeIntensity = lgLog3;
71 " Hit EOF while reading line list; use END to end list.\n" );
76 strcpy( chCap, chCard );
79 while( strncmp(chCap,
"END" ,3 ) != 0 )
81 if( nLinesEntered >=
NPUNLM )
84 " Too many lines have been entered; the limit is %ld. Increase variable NPUNLM in routine punch_line.\n",
90 strncpy( chPLab[nLinesEntered], chCard , 4 );
93 chPLab[nLinesEntered][4] = 0;
104 wavelength[nLinesEntered] *= 1e4;
109 wavelength[nLinesEntered] *= 1e8;
119 fprintf(
ioQQQ,
" Hit EOF while reading line list; use END to end list.\n" );
124 strcpy( chCap, chCard );
132 sprintf( chHeader,
"#depth\t");
133 for( i=0; i < nLinesEntered; i++ )
135 sprintf( chTemp,
"%s ", chPLab[i] );
136 strcat( chHeader, chTemp );
137 sprt_wl( chTemp, wavelength[i] );
138 strcat( chHeader, chTemp );
139 strcat( chHeader,
"\t" );
141 strcat( chHeader,
"\n" );
144 else if( strcmp(chDo,
"PUNS") == 0 )
147 static bool lgMustGetLines=
true,
150 static bool lgBadH2Line;
160 for( i=0; i < nLinesEntered; i++ )
162 if(
nzone <= 1 && lgMustGetLines )
164 if( (ipLine[i] =
cdEmis((
char*)chPLab[i],wavelength[i],&emiss)) <= 0 )
167 if( !
h2.
lgH2ON && strncmp( chPLab[i] ,
"H2 " , 4 )==0 )
169 static bool lgMustPrintFirstTime =
true;
170 if( lgMustPrintFirstTime )
173 fprintf(
ioQQQ,
"\nPROBLEM Did not find an H2 line, the large model is not "
174 "included, so I will ignore it. Log intensity set to -30.\n" );
175 fprintf(
ioQQQ,
"I will totally ignore any future missed H2 lines\n\n");
176 lgMustPrintFirstTime =
false;
184 fprintf(
ioQQQ,
" PUNLIN could not find line: %s %f\n",
185 chPLab[i], wavelength[i] );
192 ASSERT( ipLine[i] > 0 || lgBadLine || lgBadH2Line );
199 else if( ipLine[i]>0 )
209 lgMustGetLines =
false;
215 for( i=0; i < nLinesEntered; i++ )
218 fprintf( ioPUN,
"\t%.4f", log10(
MAX2(
SMALLFLOAT , dlum[i] ) ) );
221 fprintf( ioPUN,
"\n" );
224 else if( strcmp(chDo,
"PUNC") == 0 )
235 for( i=0; i < nLinesEntered; i++ )
237 if( lgRelativeIntensity )
240 nCdLineReturn =
cdLine((
char*)chPLab[i],wavelength[i],&a[i],&absint);
245 nCdLineReturn =
cdLine((
char*)chPLab[i],wavelength[i],&relint,&a[i]);
248 if( nCdLineReturn<=0 )
251 if( !
h2.
lgH2ON && strncmp( chPLab[i] ,
"H2 " , 4 )==0 )
253 static bool lgMustPrintFirstTime =
true;
254 if( lgMustPrintFirstTime )
257 fprintf(
ioQQQ,
"Did not find an H2 line, the large model is not "
258 "included, so I will ignore it. Log intensity set to -30.\n" );
259 fprintf(
ioQQQ,
"I will totally ignore any future missed H2 lines\n");
260 lgMustPrintFirstTime =
false;
269 fprintf(
ioQQQ,
" PUNLIN could not fine line: %s %f\n",
270 chPLab[i], wavelength[i] );
276 for( i=0; i < nLinesEntered; i++ )
278 fprintf( ioPUN,
"\t%.4e", a[i] );
281 fprintf( ioPUN,
"\n" );
287 " unrecognized key for punch_line=%4.4s\n",
303 {LONG_MIN , LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN },
305 {LONG_MIN , LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN },
307 {LONG_MIN , LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN },
309 {LONG_MIN , LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN },
311 {LONG_MIN , LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN ,LONG_MIN };
312 static bool lgMustPrintHeader=
true;
313 static long int nLine=-1;
322 if( strcmp(chDo,
"READ") == 0 )
329 lgMustPrintHeader =
true;
337 " Hit EOF while reading line list; use END to end list.\n" );
345 fprintf(
ioQQQ,
" PUNCH RT has too many lines - increase LIMLINE in punch_line.c\n");
350 strcpy( chCap[nLine], chCard );
364 " there must be five numbers on this line =%s\n",
375 }
while( !lgEOF && !
nMatch(
"END" , chCard) );
379 " Punch_Line_RT hit end of file looking for END of RT lines =%s\n",
385 else if( strcmp(chDo,
"PUNC") == 0 )
389 if( lgMustPrintHeader )
391 fprintf( ioPUN ,
"Line\tP(con,inc)\tAul\tgl\tgu\n");
392 for( n=0; n<nLine; ++n )
395 sprintf( chLabel[n] ,
"%s ",
396 chLineLbl(&
Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]]) );
397 fprintf( ioPUN ,
"%s ", chLabel[n] );
398 fprintf( ioPUN ,
"%.4e ",
399 Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].Emis->pump);
400 fprintf( ioPUN ,
"%.4e ",
401 Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].Emis->Aul);
402 fprintf( ioPUN ,
"%.0f ",
403 Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].Lo->g);
404 fprintf( ioPUN ,
"%.0f ",
405 Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].Hi->g);
406 fprintf( ioPUN ,
"\n");
408 if( line_RT_type[n]!=0. )
412 " PunchLine_RT only H, He like allowed for now\n");
416 fprintf( ioPUN ,
"Line\tTauIn\tPopLo\tPopHi\tCul\tk(line)\tk(con,abs)\tk(con,scat)\n");
417 lgMustPrintHeader =
false;
420 fprintf(ioPUN,
"RADIUS\t%e\tDEPTH\t%e\tTe\t%e\tNe\t%e\n",
425 for( n=0; n<nLine; ++n )
428 long int ipCont =
Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].ipCont;
429 fprintf( ioPUN ,
"%s ", chLabel[n] );
430 fprintf( ioPUN ,
"\t%e\t%e\t%e",
431 Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].Emis->TauIn ,
432 StatesElem[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipLo[n]].Pop ,
433 StatesElem[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]].Pop
435 fprintf( ioPUN ,
"\t%e",
436 Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].Coll.ColUL
439 fprintf( ioPUN ,
"\t%e\t%e\t%e\n",
440 Transitions[line_RT_ipISO[n]][line_RT_nelem[n]][line_RT_ipHi[n]][line_RT_ipLo[n]].Emis->PopOpc ,
450 " internal error, unrecognized key for punch line rt=%4.4s\n",