57 if( strcmp(
"H2 ",
label.c_str() ) == 0 )
98 H2_SaveLine[(*Hi).n()][(*Hi).v()][(*Hi).J()][(*Lo).n()][(*Lo).v()][(*Lo).J()] = 0.;
102 H2_SaveLine[(*Hi).n()][(*Hi).v()][(*Hi).J()][(*Lo).n()][(*Lo).v()][(*Lo).J()] +=
129 "H2 vibration state",0.0);
133 "H2 rotation state",0.0);
140 sprintf( chHeader,
"#vib\trot\tcolumn density\n" );
146 sprintf( chHeader,
"#vib\trot\tEner(K)\tcolden\tcolden/stat wght\tLTE colden\tLTE colden/stat wght\n" );
149 else if( p.
nMatch(
"COOL") )
154 "#H2 depth\ttot cool\tTH Sol\tBig Sol\tTH pht dis\tpht dis\tTH Xcool\tXcool \n" );
157 else if( p.
nMatch(
"CREA") )
160 fprintf(
ioQQQ,
" This command has been superseded by the \"creation\" option of the \"save chemistry rates\" command.\n" );
161 fprintf(
ioQQQ,
" Sorry.\n" );
164 else if( p.
nMatch(
"DEST") )
167 fprintf(
ioQQQ,
" This command has been superseded by the \"destruction\" option of the \"save chemistry rates\" command.\n" );
168 fprintf(
ioQQQ,
" Sorry.\n" );
172 else if( p.
nMatch(
"HEAT") )
177 "#H2 depth\ttot Heat\tHeat(big)\tHeat(TH85)\tDissoc(Big)\tDissoc(TH85) \n" );
180 else if( p.
nMatch(
"LEVE") )
185 "#H2 v\tJ\tenergy(wn)\tstat wght\tSum As" );
191 strcat( chHeader , chHoldit );
193 strcat( chHeader ,
"\n" );
196 else if( p.
nMatch(
"LINE") )
201 "#H2 line\tEhi\tVhi\tJhi\tElo\tVlo\tJlo\twl(mic)\twl(lab)\tlog L or I\tI/Inorm\tExcit(hi, K)\tg_u h nu * Aul\n" );
208 "faintest line to save",1e-4);
223 else if( p.
nMatch(
"GROU") )
231 "electronic levels for output",1.0);
236 else if( p.
nMatch(
" PDR") )
240 sprintf( chHeader,
"#H2 creation, destruction. \n" );
242 else if( p.
nMatch(
"POPU") )
252 "highest H2 save vibration state",0.0);
256 "highest H2 save rotation state",0.0);
262 sprintf( chHeader,
"#depth\torth\tpar\te=1 rel pop\te=2 rel pop\tv,J rel pops\n" );
273 sprintf( chHeader,
"#vib\trot\tpops\n" );
279 sprintf( chHeader,
"#vib\trot\ts\tenergy(wn)\tpops/H2\told/H2\tpops/g/H2\tdep coef\tFin(Col)\tFout(col)\tRCout\tRRout\tRCin\tRRin\n" );
284 else if( p.
nMatch(
"RATE") )
289 "#depth\tN(H2)\tN(H2)/u(H2)\tA_V(star)\tn(Eval)"
290 "\tH2/Htot\trenorm\tfrm grn\tfrmH-\tdstTH85\tBD96\tELWERT\tBigH2\telec->H2g\telec->H2s"
291 "\tG(TH85)\tG(DB96)\tCR\tEleclife\tShield(BD96)\tShield(H2)\tBigh2/G0(spc)\ttot dest"
292 "\tHeatH2Dish_TH85\tHeatH2Dexc_TH85\tHeatDish_BigH2\tHeatDexc_BigH2\thtot\n" );
294 else if( p.
nMatch(
"SOLO") )
299 "#depth\tSol tot\tpump/dissoc\tpump/dissoc BigH2\tavH2g\tavH2s\tH2g chem/big H2\tH2s chem/big H2\tfrac H2g BigH2\tfrac H2s BigH2\teHi\tvHi\tJHi\tvLo\tJLo\tfrac\twl(A)\n" );
301 else if( p.
nMatch(
"SPEC") )
306 "#depth\tspecial\n" );
308 else if( p.
nMatch(
"TEMP") )
313 "#depth\tH2/H\tn(1/0)\tn(ortho/para)\tT(1/0)\tT(2/0)\tT(3/0)\tT(3/1)\tT(4/0)\tT(kin)\tT(21cm)\tT_sum(1/0)\tT_sum(2/0)\tT_sum(3/0)\tT_sum(3/1)\tT_sum(4/0) \n");
315 else if( p.
nMatch(
"THER") )
320 "#depth\tH2/H\tn(1/0)\tn(ortho/para)\tT(1/0)\tT(2/0)\tT(3/0)\tT(3/1)\tT(4/0)\tT(kin)\tT(21cm)\tT_sum(1/0)\tT_sum(2/0)\tT_sum(3/0)\tT_sum(3/1)\tT_sum(4/0) \n");
325 " There must be a second key; they are RATE, LINE, COOL, COLUMN, _PDR, SOLOmon, TEMP, and POPUlations\n" );
341 fprintf(
ioQQQ,
" %s density ",
label.c_str() );
344 fprintf(
ioQQQ,
" orth/par");
347 fprintf(
ioQQQ,
" v0 J=0,3");
353 fprintf(
ioQQQ,
" TOTv=0,3");
358 fprintf(
ioQQQ,
"\n");
371 fprintf(
ioQQQ,
" %s departure coefficients\n",
label.c_str() );
374 fprintf(
ioQQQ,
"%li electronic\n", iElec );
375 for(
long iVib=0; iVib<=
nVib_hi[iElec]; ++iVib )
377 for(
long iRot=0; iRot<
Jlowest[iElec]; ++iRot )
378 fprintf(
ioQQQ,
" -----" );
379 for(
long iRot=Jlowest[iElec]; iRot<=
nRot_hi[iElec][iVib]; ++iRot )
384 fprintf(
ioQQQ,
"\n" );
386 fprintf(
ioQQQ,
"\n" );
409 fprintf( ioMEAN,
" H2 total ");
412 fprintf( ioMEAN,
" H2 ortho ");
415 fprintf( ioMEAN,
" para");
419 fprintf( ioMEAN,
" v0 J=0,3");
432 const char* cdDATAFILE[
N_ELEC] =
436 "transprob_C_plus.dat",
437 "transprob_C_minus.dat",
438 "transprob_B_primed.dat",
439 "transprob_D_plus.dat",
440 "transprob_D_minus.dat"
444 long int i, n1, n2, n3;
445 long int iVibHi , iVibLo , iRotHi , iRotLo , iElecHi , iElecLo;
452 strcpy( chPath,
path.c_str() );
454 strcat( chPath, cdDATAFILE[nelec] );
460 fprintf(
ioQQQ,
" H2_ReadTransprob could not read first line of %s\n", cdDATAFILE[nelec]);
465 n1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
466 n2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
467 n3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
471 if( ( n1 != 2 ) || ( n2 != 4 ) || ( n3 != 29 ) )
474 " H2_ReadTransprob: the version of %s is not the current version.\n", cdDATAFILE[nelec] );
476 " I expected to find the number 2 4 29 and got %li %li %li instead.\n" ,
478 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
483 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
488 if( chLine[0]==
'\n' || chLine[0]==
'\0' || chLine[0]==
' ' )
492 int n = sscanf(chLine,
"%li\t%li\t%li\t%li\t%li\t%li\t%le",
493 &iElecHi , &iVibHi ,&iRotHi , &iElecLo , &iVibLo , &iRotLo , &Aul );
495 ASSERT( iElecHi == nelec );
500 if( iVibHi <=
nVib_hi[iElecHi] &&
502 iRotHi <=
nRot_hi[iElecHi][iVibHi] &&
503 iRotLo <=
nRot_hi[iElecLo][iVibLo])
507 double ener =
states[ipHi].energy().WN() -
states[ipLo].energy().WN();
511 trns[lineIndex].AddLine2Stack();
521 fprintf(
ioQQQ,
"negative energy H2 transition\t%li\t%li\t%li\t%li\t%.2e\t%.2e\n",
522 iVibHi,iVibLo,iRotHi,iRotLo,Aul,ener);
529 fprintf(
ioQQQ,
" There are a total of %li lines in the entire H2 molecule.\n", nlines );
537 void H2_Read_Cosmicray_distribution(
void)
544 long int i, n1, n2, n3, iVib , iRot;
552 strcpy( chPath, path.c_str() );
554 strcat( chPath,
"H2_CosmicRay_collision.dat" );
560 fprintf(
ioQQQ,
" H2_Read_Cosmicray_distribution could not read first line of %s\n",
"H2_Cosmic_collision.dat");
566 n1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
567 n2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
568 n3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
572 if( ( n1 != 1 ) || ( n2 != 21 ) || ( n3 != 3 ) )
575 " H2_Read_Cosmicray_distribution: the version of %s is not the current version.\n",
"H2_Cosmic_collision.dat" );
577 " I expected to find the number 1 21 3 and got %li %li %li instead.\n" ,
579 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
587 while( chLine[0]==
'#' )
601 sscanf(chLine,
"%li\t%li\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf",
602 &iVib ,&j_minus_ji , &a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9]
611 ASSERT( j_minus_ji == -2 || j_minus_ji == +2 || j_minus_ji == 0 );
612 ASSERT( neut_frac < CR_X );
615 j_minus_ji = 1 + j_minus_ji/2;
616 ASSERT( j_minus_ji>=0 && j_minus_ji<=2 );
619 for( iRot=0; iRot<CR_J; ++iRot )
621 cr_rate[neut_frac][iVib][iRot][j_minus_ji] = (
realnum)a[iRot];
623 if( lgH2_NOISECOSMIC )
628 for( iRot=0; iRot<CR_J; ++iRot )
630 cr_rate[neut_frac][iVib][iRot][j_minus_ji] *= (
realnum)pow(10.,(
double)r);
636 fprintf(
ioQQQ,
"cr rate\t%li\t%li", iVib , j_minus_ji );
637 for( iRot=0; iRot<CR_J; ++iRot )
639 fprintf(
ioQQQ,
"\t%.3e", cr_rate[neut_frac][iVib][iRot][j_minus_ji] );
641 fprintf(
ioQQQ,
"\n" );
647 while( chLine[0]==
'#' )
687 vector<level_tmp> levels;
688 levels.resize( n.size() );
689 ASSERT( levels.size() > 0 );
690 for(
unsigned i = 0; i < n.size(); ++i )
695 levels[i].eWN = eWN[i];
699 sort( levels.begin(), levels.end() );
702 for( vector<level_tmp>::iterator lev = levels.begin(); lev != levels.end(); ++lev )
709 states[i].energy().set( lev->eWN,
"cm^-1" );
733 nRot_hi[ (*st).n() ][ (*st).v() ] =
MAX2(
nRot_hi[ (*st).n() ][ (*st).v() ], (*st).J() );
742 const char* cdDATAFILE[
N_ELEC] =
747 "energy_C_minus.dat",
748 "energy_B_primed.dat",
754 strcpy( chPath,
path.c_str() );
756 strcat( chPath, cdDATAFILE[nelec] );
760 long int i, n1, n2, n3;
766 fprintf(
ioQQQ,
" H2_ReadEnergies could not read first line of %s\n", cdDATAFILE[nelec]);
771 n1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
772 n2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
773 n3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
777 if( ( n1 != 2 ) || ( n2 != 4 ) || ( n3 != 29 ) )
780 " H2_ReadEnergies: the version of %s is not the current version.\n", cdDATAFILE[nelec] );
782 " I expected to find the number 2 4 29 and got %li %li %li instead.\n" ,
784 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
793 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
798 if( chLine[0]==
'\n' || chLine[0]==
'\0' || chLine[0]==
' ' )
802 int nReads = sscanf(chLine,
"%li\t%li\t%le", &iVib, &iRot, &energyWN );
806 ASSERT( energyWN > 0. || (nelec==0 && iVib==0 && iRot==0 ) );
808 n.push_back( nelec );
811 eWN.push_back( energyWN );
833 const char* cdDATAFILE =
"energy_dissoc.dat";
836 long int i, n1, n2, n3;
843 strcpy( chPath,
path.c_str() );
845 strcat( chPath, cdDATAFILE );
851 fprintf(
ioQQQ,
" H2_ReadDissocEnergies could not read first line of %s\n", cdDATAFILE );
856 n1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
857 n2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
858 n3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
862 if( ( n1 != 2 ) || ( n2 != 4 ) || ( n3 != 29 ) )
865 " H2_ReadDissocEnergies: the version of %s is not the current version.\n", cdDATAFILE );
867 " I expected to find the number 2 4 29 and got %li %li %li instead.\n" ,
869 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
873 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
878 if( chLine[0]==
'\n' || chLine[0]==
'\0' || chLine[0]==
' ' )
882 int n = sscanf(chLine,
"%li\t%le", &iElec, &energyWN );
897 const char* cdDATAFILE[
N_ELEC] =
901 "dissprob_C_plus.dat",
902 "dissprob_C_minus.dat",
903 "dissprob_B_primed.dat",
904 "dissprob_D_plus.dat",
905 "dissprob_D_minus.dat"
916 strcpy( chPath,
path.c_str() );
918 strcat( chPath, cdDATAFILE[nelec] );
924 fprintf(
ioQQQ,
" H2_ReadDissprob could not read first line of %s\n", cdDATAFILE[nelec]);
929 long n1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
930 long n2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
931 long n3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
935 if( ( n1 != 3 ) || ( n2 != 2 ) || ( n3 != 11 ) )
938 " H2_ReadDissprob: the version of %s is not the current version.\n", cdDATAFILE[nelec] );
940 " I expected to find the number 3 2 11 and got %li %li %li instead.\n" ,
942 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
946 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
951 if( chLine[0]==
'\n' || chLine[0]==
'\0' || chLine[0]==
' ' )
957 sscanf(chLine,
"%li\t%li\t%le\t%le",
972 ( iRot >
nRot_hi[nelec][iVib] ) )
990 long int i, n1, n2, n3, iVib , iRot;
994 const bool lgH2HMINUS_PRT =
false;
1000 strcpy( chPath,
path.c_str() );
1002 strcat( chPath,
"hminus_deposit.dat" );
1006 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1008 fprintf(
ioQQQ,
" H2_Read_hminus_distribution could not read first line of %s\n", chPath );
1014 n1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
1015 n2 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
1016 n3 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
1020 if( ( n1 != 2 ) || ( n2 != 10 ) || ( n3 != 17 ) )
1023 " H2_Read_hminus_distribution: the version of %s is not the current version.\n", chPath );
1025 " I expected to find the number 2 10 17 and got %li %li %li instead.\n" ,
1027 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
1032 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1035 while( chLine[0]==
'#' )
1037 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1048 sscanf(chLine,
"%li\t%li\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf",
1049 &iVib ,&iRot , &ener, &a[0],&a[1],&a[2] , &a[3],&a[4],&a[5] ,&a[6]
1059 if( lgH2HMINUS_PRT )
1060 fprintf(
ioQQQ,
"hminusss\t%li\t%li", iVib , iRot );
1065 if( lgH2HMINUS_PRT )
1068 if( lgH2HMINUS_PRT )
1069 fprintf(
ioQQQ,
"\n" );
1071 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1073 while( chLine[0]==
'#' )
1075 if(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) == NULL )
1081 if( lgH2HMINUS_PRT )
1084 fprintf(
ioQQQ,
" total H- formation rate ");
1088 fprintf(
ioQQQ,
"\t%.3e" , sumrate[i]);
1090 fprintf(
ioQQQ,
"\n" );
1094 for( iVib=0; iVib<=
nVib_hi[0]; ++iVib )
1105 if( lgH2HMINUS_PRT )
1108 fprintf(
ioQQQ,
" H- distribution function ");
1109 for( iVib=0; iVib<=
nVib_hi[0]; ++iVib )
1113 fprintf(
ioQQQ,
"%li\t%li", iVib , iRot );
1118 fprintf(
ioQQQ,
"\n" );
1141 " H2_Punch_line_data ALL option not implemented in H2_Punch_line_data yet 1\n" );
1146 bool lgPrint =
false;
1147 fprintf( ioPUN,
"#Eu\tVu\tJu\tEl\tVl\tJl\tWL\tgl\tgu\tgf\tA\tCS\tn(crt)\n" );
1151 if( (*tr).ipCont() <= 0 )
1153 (*tr).Coll().col_str() = 0.;
1157 fprintf(ioPUN,
"%2li\t%2li\t%2li\t%2li\t%2li\t%2li\t",
1158 (*Hi).n(), (*Hi).v(), (*Hi).J(),
1159 (*Lo).n(), (*Lo).v(), (*Lo).J() );
1163 fprintf( ioPUN ,
"\n");
1179 if( (*tr).ipCont() <= 0 )
1199 if( (*tr).ipCont() <= 0 )
1212 char chBranch[5] = {
'O',
'P',
'Q',
'R',
'S'};
1214 int ip = 2 + (iRotHi - iRotLo);
1217 fprintf(
ioQQQ,
" chMolBranch called with insane iRotHi=%li iRotLo=%li ip=%i\n",
1218 iRotHi , iRotLo , ip );
1222 return( chBranch[ip] );
1235 if( (strcmp( chJOB ,
"H2po" ) == 0) && (strcmp(chTime,
"LAST") == 0) &&
1244 long LimVib, LimRot;
1259 fprintf(io,
"%i\t%i\t%.3e\tortho\n",
1263 fprintf(io,
"%i\t%i\t%.3e\tpara\n",
1267 fprintf(io,
"%i\t%i\t%.3e\ttotal\n",
1273 for( iVibHi=0; iVibHi<=LimVib; ++iVibHi )
1278 LimRot = (long)
MIN2(
1283 LimRot =
nRot_hi[iElecHi][iVibHi];
1291 fprintf(io,
"vib\\rot");
1293 for( i=0; i<=LimRot; ++i )
1295 fprintf(io,
"\t%li",i);
1299 fprintf(io,
"%li",iVibHi );
1300 for( iRotHi=
Jlowest[iElecHi]; iRotHi<=LimRot; ++iRotHi )
1302 fprintf(io,
"\t%.3e",
1310 for( iRotHi=
Jlowest[iElecHi]; iRotHi<=LimRot; ++iRotHi )
1315 const char chlgPara[2]={
'P',
'O'};
1316 const long ipHi =
ipEnergySort[iElecHi][iVibHi][iRotHi];
1319 fprintf(io,
"%li\t%li\t%c\t%.1f\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
1323 chlgPara[
H2_lgOrtho[iElecHi][iVibHi][iRotHi]],
1325 states[ipHi].energy().WN(),
1355 else if( (strcmp( chJOB ,
"H2po" ) == 0) && (strcmp(chTime,
"LAST") != 0) &&
1364 fprintf(io,
"\t%.3e\t%.3e",
1368 long LimVib, LimRot;
1376 LimVib =
nRot_hi[iElecHi][iVibHi];
1386 LimRot =
nRot_hi[iElecHi][iVibHi];
1388 for( iVibHi = 0; iVibHi<=LimVib; ++iVibHi )
1390 fprintf(io,
"\tv=%li",iVibHi);
1391 long int LimRotVib =
MIN2( LimRot ,
nRot_hi[iElecHi][iVibHi] );
1392 for(
long iRotHi=
Jlowest[iElecHi]; iRotHi<=LimRotVib; ++iRotHi )
1394 fprintf(io,
"\t%.3e",
1403 else if( (strcmp( chJOB ,
"H2cl" ) == 0) && (strcmp(chTime,
"LAST") == 0) )
1408 long LimVib, LimRot;
1423 fprintf(io,
"%i\t%i\t%.3e\tortho\n",
1427 fprintf(io,
"%i\t%i\t%.3e\tpara\n",
1432 fprintf(io,
"%i\t%i\t%.3e\ttotal\n",
1438 for( iVibHi=0; iVibHi<=LimVib; ++iVibHi )
1449 LimRot =
nRot_hi[iElecHi][iVibHi];
1457 fprintf(io,
"vib\\rot");
1459 for( i=0; i<=LimRot; ++i )
1461 fprintf(io,
"\t%li",i);
1465 fprintf(io,
"%li",iVibHi );
1466 for( iRotHi=
Jlowest[iElecHi]; iRotHi<=LimRot; ++iRotHi )
1468 fprintf(io,
"\t%.3e",
1476 for( iRotHi=
Jlowest[iElecHi]; iRotHi<=LimRot; ++iRotHi )
1478 fprintf(io,
"%li\t%li\t%.1f\t%.3e\t%.3e\t%.3e\t%.3e\n",
1494 else if( (strcmp(chJOB ,
"H2pd" ) == 0) && (strcmp(chTime,
"LAST") != 0) )
1498 fprintf(io,
"%.5e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
1511 else if( (strcmp(chJOB ,
"H2co" ) == 0) && (strcmp(chTime,
"LAST") != 0) )
1514 fprintf(io,
"%.5e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
1535 else if( (strcmp(chJOB ,
"H2le" ) == 0) && (strcmp(chTime,
"LAST") == 0) )
1547 for(
long int ipLo=0; ipLo<ipHi; ++ipLo )
1555 if( ( abs(iRotHi-iRotLo) == 2 || (iRotHi-iRotLo) == 0 ) && iVibLo <= iVibHi &&
1563 Csum[nColl] += H2cr[nColl];
1567 fprintf(io,
"%li\t%li\t%.2f\t%li\t%.3e",
1569 states[ipHi].energy().WN(),
1574 fprintf(io,
"\t%.3e",Csum[nColl]);
1579 else if( (strcmp(chJOB ,
"H2ra" ) == 0) && (strcmp(chTime,
"LAST") != 0) )
1582 double sumpop = 0. , sumlife = 0.;
1591 if( (*Lo).n() > 0 || (*Lo).v() > 0 )
1593 sumlife += (*tr).Emis().pump() * (*(*tr).Lo()).Pop();
1594 sumpop += (*(*tr).Lo()).Pop();
1602 "%.5e\t%.3e\t%.3e\t%.3e\t%li",
1615 "\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e",
1638 "\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e",
1645 sumlife/
SDIV( sumpop ) ,
1651 "\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
1659 else if( (strcmp(chJOB ,
"H2so" ) == 0) && (strcmp(chTime,
"LAST") != 0) )
1662 const int nSOL = 100;
1664 long int jlosave[nSOL] , ivlosave[nSOL],
1665 iehisave[nSOL] ,jhisave[nSOL] , ivhisave[nSOL],
1669 realnum fsave[nSOL], wlsave[nSOL];
1671 fprintf(io,
"%.5e\t%.3e",
1686 sum += (*(*tr).Lo()).Pop() * (*tr).Emis().pump();
1693 const double frac = 0.01;
1700 one = (*(*tr).Lo()).Pop() * (*tr).Emis().pump();
1701 if( one/sum > frac && nsave<nSOL)
1704 fsave[nsave] = (
realnum)(one/sum);
1705 jlosave[nsave] = (*Lo).J();
1706 ivlosave[nsave] = (*Lo).v();
1707 jhisave[nsave] = (*Hi).J();
1708 ivhisave[nsave] = (*Hi).v();
1709 iehisave[nsave] = (*Hi).n();
1710 wlsave[nsave] = (*tr).WLAng();
1733 fprintf(io,
"\t%.3f\t%.3f\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e",
1744 for(
long i=0; i<nsave; ++i )
1746 long ip = ipOrdered[i];
1748 fprintf(io,
"\t%li\t%li\t%li\t%li\t%li\t%.3f\t%.3f",
1749 iehisave[ip],ivhisave[ip],jhisave[ip],ivlosave[ip] , jlosave[ip] , fsave[ip] , wlsave[ip] );
1756 else if( (strcmp(chJOB ,
"H2te" ) == 0) && (strcmp(chTime,
"LAST") != 0) )
1759 double pop_ratio10,pop_ratio20,pop_ratio30,pop_ratio31,pop_ratio40;
1760 double T10,T20,T30,T31,T40;
1762 double T10_sum,T20_sum,T30_sum,T31_sum,T40_sum;
1763 double pop_ratio10_sum,pop_ratio20_sum,pop_ratio30_sum,pop_ratio31_sum,pop_ratio40_sum;
1766 double pop0 =
states[0].Pop();
1767 double pop1 =
states[1].Pop();
1768 double pop2 =
states[2].Pop();
1769 double pop3 =
states[3].Pop();
1770 double pop4 =
states[4].Pop();
1772 double energyK =
states[1].energy().K() -
states[0].energy().K();
1774 pop_ratio10 = pop1/
SDIV(pop0);
1780 energyK =
states[2].energy().K() -
states[0].energy().K();
1781 pop_ratio20 = pop2/
SDIV(pop0);
1787 energyK =
states[3].energy().K() -
states[0].energy().K();
1788 pop_ratio30 = pop3/
SDIV(pop0);
1794 energyK =
states[3].energy().K() -
states[1].energy().K();
1795 pop_ratio31 = pop3/
SDIV(pop1);
1801 energyK =
states[4].energy().K() -
states[0].energy().K();
1802 pop_ratio40 = pop4/
SDIV(pop0);
1811 pop_ratio10_sum = 0.;
1826 "%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n" ,
1835 T10,T20,T30,T31,T40,
1839 else if( (strcmp(chJOB ,
"H2ln" ) == 0) && (strcmp(chTime,
"LAST") == 0) )
1872 long iElecHi = (*Hi).n();
1873 long iVibHi = (*Hi).v();
1874 long iRotHi = (*Hi).J();
1875 long iElecLo = (*Lo).n();
1876 long iVibLo = (*Lo).v();
1877 long iRotLo = (*Lo).J();
1880 if(
H2_SaveLine[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo] > thresh )
1884 double wl = (*tr).WLAng()/1e4;
1885 fprintf(io,
"%li-%li %c(%li)", iVibHi, iVibLo,
chMolBranch( iRotHi, iRotLo ), iRotLo );
1886 fprintf( io,
"\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld", iElecHi , iVibHi , iRotHi , iElecLo , iVibLo , iRotLo);
1888 fprintf( io,
"\t%.7f\t", wl );
1890 prt_wl( io , (*tr).WLAng() );
1892 fprintf( io,
"\t%.3f\t%.3e",
1894 H2_SaveLine[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo]*renorm );
1896 fprintf( io,
"\t%.3f", (*Hi).energy().K() );
1898 fprintf( io,
"\t%.3e", (*tr).Emis().Aul() * (*tr).EnergyErg() * (*(*tr).Hi()).
g() );
1904 else if( (strcmp(chJOB ,
"H2sp" ) == 0) )
1906 fprintf( io,
"PUT SOMETHING HERE!\n" );
1930 return h2.
getLine( iElecHi, iVibHi, iRotHi, iElecLo, iVibLo, iRotLo, relint, absint );
1933 long int diatomics::getLine(
long iElecHi,
long iVibHi,
long iRotHi,
long iElecLo,
long iVibLo,
long iRotLo,
double *relint,
double *absint )
1943 if( iElecHi!=0 || iElecLo!=0 )
1952 if(
states[ipHi].energy().WN() <
states[ipLo].energy().WN() )
1973 *relint =
H2_SaveLine[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo]/
1982 if(
H2_SaveLine[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo] > 0. )
1984 *absint = log10(
H2_SaveLine[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo]) +
multi_arr< double, 2 > H2_rad_rate_in
char chH2ColliderLabels[N_X_COLLIDER][chN_X_COLLIDER]
static realnum thresh_punline_h2
iterator begin(size_type i1)
multi_arr< double, 2 > H2_col_rate_out
bool nMatch(const char *chKey) const
multi_arr< realnum, 3 > H2_dissprob
realnum punarg[LIMPUN][3]
void prt_wl(FILE *ioOUT, realnum wl)
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
realnum & Pelec_esc() const
double H2_DissocEnergies[N_ELEC]
void lindst(double xInten, realnum wavelength, const char *chLab, long int ipnt, char chInfo, bool lgOutToo, const char *chComment)
void H2_Punch_line_data(FILE *ioPUN, bool lgDoAll)
const int FILENAME_PATH_LENGTH_2
multi_arr< double, 2 > pops_per_vib
valarray< long > ipVib_H2_energy_sort
double H2_Solomon_dissoc_rate_TH85_H2s
void H2_Prt_column_density(FILE *ioMEAN)
double H2_Solomon_dissoc_rate_BD96_H2g
multi_arr< realnum, 3 >::const_iterator mr3ci
molezone * findspecieslocal(const char buf[])
void prme(const bool lgReset, const TransitionProxy &t)
void H2_Read_hminus_distribution(void)
double H2_Solomon_dissoc_rate_BD96_H2s
double H2_Solomon_dissoc_rate_TH85_H2g
double Solomon_dissoc_rate_g
multi_arr< realnum, 3 > CollRateCoeff
const double *const dense_total
multi_arr< realnum, 3 > H2_stat
multi_arr< long int, 3 > ipEnergySort
multi_arr< double, 3 > H2_old_populations
multi_arr< realnum, 3 > H2_disske
bool operator<(const level_tmp &second) const
multi_arr< realnum, 3 > H2_X_hminus_formation_distribution
long int nLevels_per_elec[N_ELEC]
long int cdH2_Line(long int iElecHi, long int iVibHi, long int iRotHi, long int iElecLo, long int iVibLo, long int iRotLo, double *relint, double *absint)
multi_arr< double, 3 > H2_populations_LTE
multi_arr< realnum, 2 > H2_X_colden_LTE
multi_arr< bool, 2 > lgH2_radiative
void H2_PrtDepartCoef(void)
realnum AtomicWeight[LIMELM]
multi_arr< realnum, 6 > H2_SaveLine
multi_arr< double, 3 > H2_rad_rate_out
diatomics h2("h2", 4100.,&hmi.H2_total, Yan_H2_CS)
realnum GetDopplerWidth(realnum massAMU)
double RandGauss(double xMean, double s)
void PutLine(const TransitionProxy &t, const char *chComment, const char *chLabelTemp)
realnum UV_Cont_rel2_Draine_DB96_depth
realnum gas_phase[LIMELM]
void H2_ReadTransprob(long int nelec, TransitionList &trans)
STATIC char chMolBranch(long iRotHi, long int iRotLo)
long int getLine(long iElecHi, long iVibHi, long iRotHi, long iElecLo, long iVibLo, long iRotLo, double *relint, double *absint)
void H2_PunchLineStuff(FILE *io, realnum xLimit, long index)
#define DEBUG_ENTRY(funcname)
realnum UV_Cont_rel2_Habing_spec_depth
double Solomon_dissoc_rate_s
multi_arr< long int, 2 > ipTransitionSort
void H2_PunchDo(FILE *io, char chJOB[], const char chTime[], long int ipPun)
diatomics * whichDiatomToPrint[LIMPUN]
double getNumberDefault(const char *chDesc, double fdef)
double Solomon_elec_decay_g
void H2_Prt_line_tau(void)
realnum UV_Cont_rel2_Habing_TH85_depth
TransitionList::iterator rad_end
void Save1LineData(const TransitionProxy &t, FILE *io, bool lgCS_2, bool &lgPrint)
void H2_ReadDissocEnergies(void)
valarray< long > nRot_hi[N_ELEC]
double pops_per_elec[N_ELEC]
double Solomon_elec_decay_s
sys_float SDIV(sys_float x)
double H2_renorm_chemistry
valarray< long > ipRot_H2_energy_sort
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
t_secondaries secondaries
void set_numLevelsMatrix(long numLevels)
double H2_Solomon_dissoc_rate_ELWERT_H2g
void H2_ReadDissprob(long int nelec)
double getNumberDefaultNegImplLog(const char *chDesc, double fdef)
void H2_ParseSave(Parser &p, char *chHeader)
NORETURN void BadRead(void)
multi_arr< double, 2 > H2_col_rate_in
double rate_h2_form_grains_used_total
multi_arr< realnum, 2 > H2_X_colden
void spsort(realnum x[], long int n, long int iperm[], int kflag, int *ier)
void Save1Line(const TransitionProxy &t, FILE *io, realnum xLimit, long index, realnum DopplerWidth)
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)
multi_arr< bool, 3 > H2_lgOrtho