52 lgStop_not_enough_info;
96 for( i=0; i <
LIMSPC; i++ )
113 fprintf(
ioQQQ,
" READR turns on trace from optimize option.\n" );
121 "\n This is a beta release of Cloudy, and is intended for testing only.\n\n" );
130 fprintf(
ioQQQ,
"%57cwww.nublado.org\n\n",
' ' );
133 fprintf(
ioQQQ,
"%23c",
' ' );
134 fprintf(
ioQQQ,
"**************************************");
136 fprintf(
ioQQQ,
"**************************************\n");
138 fprintf(
ioQQQ,
"%23c*%81c*\n",
' ',
' ' );
167 while( !lgEOF && chCard[0] !=
' ' )
173 fprintf(
ioQQQ,
"%23c* %-80s*\n",
' ', chCard );
180 strncpy( chKey2 , chCard , 2 );
184 strncpy( chKey3 , chCard , 3 );
188 strncpy( chKey4 , chCard , 4 );
192 strncpy( chKey5 , chCard , 5 );
196 if(
nMatch(
"VARY",chCard) )
201 fprintf(
ioQQQ,
" Too many VARY lines entered; the limit is%4ld\n",
215 if( chCard[0]==
'C' && (chCard[1]==
' ' || chCard[1]== 0) )
223 else if( strcmp(chKey4,
"ABSO") == 0 )
229 else if( strcmp(chKey3,
"AGE") == 0 )
235 else if( strcmp(chKey4,
"AGN ") == 0 )
241 else if( strcmp(chKey4,
"ABUN") == 0 )
250 else if( strcmp(chKey4,
"APER") == 0 )
263 if(
nMatch(
"SLIT",chCard) )
269 else if(
nMatch(
"BEAM",chCard) )
278 fprintf(
ioQQQ,
" One of the keywords SLIT or BEAM must appear.\n" );
279 fprintf(
ioQQQ,
" Sorry.\n" );
284 else if( strcmp(chKey4,
"ASSE") == 0 )
290 else if( strcmp(chKey4,
"ATOM") == 0 )
299 else if(
nMatch(
"H-LI",chCard) )
305 else if(
nMatch(
"HE-L",chCard) )
311 else if(
nMatch(
"ROTO",chCard) )
314 fprintf(
ioQQQ,
"PROBLEM - the atom rotor command is now the ATOM CO command. "
315 "Please use that instead. I will accept this for now but may not in future versions.\n");
319 else if(
nMatch(
" CO ",chCard) )
326 else if(
nMatch(
" H2 ",chCard) )
335 fprintf(
ioQQQ,
" I could not recognize a keyword on this atom command.\n");
336 fprintf(
ioQQQ,
" The available keys are FeII, H-Like, He-like, rotor and H2.\n");
337 fprintf(
ioQQQ,
" Sorry.\n" );
342 else if( strcmp(chKey4,
"BACK") == 0 )
348 else if( strcmp(chKey4,
"BLAC") == 0 )
370 else if( strcmp(chKey4,
"BREM") == 0 )
407 fprintf(
ioQQQ,
" Too many continua entered; increase LIMSPC\n" );
412 else if( strcmp(chKey4,
"CASE") == 0 )
418 else if( strcmp(chKey4,
"CEXT") == 0 )
432 else if( (strcmp(chKey3,
"CMB") == 0) || (strcmp(chKey4,
"FIRE") == 0) )
442 else if( strcmp(chKey4,
"COMP") == 0 )
448 else if( strcmp(chKey4,
"CONS") == 0 )
455 else if( strcmp(chKey4,
"CORO") == 0 )
462 else if( strcmp(chKey4,
"COSM") == 0 )
469 else if( strcmp(chKey4,
"COVE") == 0 )
490 fprintf(
ioQQQ,
" A covering factor greater than 1 makes no physical sense. Sorry.\n" );
498 else if( strcmp(chKey4,
"CRAS") == 0 )
504 else if( strcmp(chKey4,
"CYLI") == 0 )
516 else if( strcmp(chKey4,
"DIEL") == 0 )
519 fprintf(
ioQQQ,
" The DIELectronic command has been replaced with the SET DIELectronic recombination command.\n" );
520 fprintf(
ioQQQ,
" Please have a look at Hazy.\n Sorry.\n\n" );
524 else if( strcmp(chKey4,
"DIFF") == 0 )
528 if(
nMatch(
" OTS",chCard) )
530 if(
nMatch(
"SIMP",chCard) )
542 else if(
nMatch(
" OUT",chCard) )
554 if( j > 0 && j < 10 )
560 fprintf(
ioQQQ,
" must be between 1 and 9 \n" );
568 fprintf(
ioQQQ,
" There should have been OUTward or OTS on this line. Sorry.\n" );
573 else if( strcmp(chKey4,
"DIST") == 0 )
584 if( !
nMatch(
"LINE",chCard ) )
590 if(
nMatch(
"PARS",chCard ) )
596 else if( strcmp(chKey4,
"DLAW") == 0 )
602 else if( strcmp(chKey4,
"DOUB") == 0 )
608 else if( strcmp(chKey4,
"DRIV") == 0 )
614 else if( strcmp(chKey4,
"EDEN") == 0 )
628 else if( strcmp(chKey4,
"ELEM") == 0 )
637 else if( strcmp(chKey4,
"ENER") == 0 )
644 fprintf(
ioQQQ,
" Too many continua entered; increase LIMSPC\n" );
665 if(
nMatch(
"LINE",chCard) || teset > 10. )
673 fprintf(
ioQQQ,
" This intensity may be too large. The code may crash due to overflow. Was log intended?\n" );
685 if(
nMatch(
"TIME" , chCard ) )
704 else if( strcmp(chKey4,
"EXTI") == 0 )
716 else if( strcmp(chKey4,
"FAIL") == 0 )
740 fprintf(
ioQQQ,
" This command should not be necessary.\n" );
741 fprintf(
ioQQQ,
" Please show this input stream to Gary Ferland if this command is really needed for this simulation.\n" );
745 else if( strcmp(chKey4,
"FILL") == 0 )
768 fprintf(
ioQQQ,
" Filling factor > 1, reset to 1\n" );
799 else if( strcmp(chKey4,
"FLUC") == 0 )
805 else if( strcmp(chKey4,
"F(NU") == 0 )
811 ParseF_nu(chCard,&nqh,&ar1,
"SQCM",lgNu2);
814 else if( strcmp(chKey4,
"FORC") == 0 )
835 fprintf(
ioQQQ,
" TE reset to 3K: entered number too small.\n" );
840 else if( strcmp(chKey4,
"FUDG") == 0 )
844 for( j=0; j <
NFUDGC; j++ )
876 else if( strcmp(chKey4,
"GLOB") == 0 )
883 else if( (strcmp(chKey4,
"GRAI") == 0 )||( strcmp(chKey4,
"PGRA") == 0 ) )
889 else if( strcmp(chKey4,
"GRID") == 0 )
896 else if( strcmp(chKey4,
"HDEN") == 0 )
902 else if( strcmp(chKey4,
"HELI") == 0 )
904 fprintf(
ioQQQ,
"Sorry, this command is replaced with ATOM HE-LIKE\n");
908 else if( strcmp(chKey4,
"HEXT") == 0 )
922 const char *chHextraScale;
926 if(
nMatch(
"DEPT" , chCard ) )
930 chHextraScale =
"DEPTH";
954 else if(
nMatch(
"DENS" , chCard ) )
957 chHextraScale =
"DENSITY";
977 if(
nMatch(
"TIME" , chCard ) )
1007 else if( strcmp(chKey4,
"HIGH") == 0 )
1013 else if( strncmp( chCard ,
"HYDROGEN",8) == 0 )
1015 fprintf(
ioQQQ,
" Sorry, this command has been replaced with the ATOM H-LIKE command.\n");
1019 else if( strcmp(chKey4,
"ILLU") == 0 )
1029 if(
nMatch(
"RADI",chCard) )
1037 fprintf(
ioQQQ,
" Angle of illumination must be between 0 and 90 degrees "
1038 "or 0 and pi/2 radians.\n" );
1063 else if( strcmp(chKey4,
"INIT") == 0 )
1076 " This is the second init file, I can only handle one.\nSorry.\n" );
1089 else if( strcmp(chKey5,
"INTEN") == 0 )
1096 fprintf(
ioQQQ,
" Too many continua entered; increase LIMSPC\n" );
1117 if(
nMatch(
"LINE",chCard) )
1129 if(
nMatch(
"TIME" , chCard ) )
1157 else if( strcmp(chKey5,
"INTER") == 0 )
1167 else if( strcmp(chKey4,
"IONI") == 0 )
1175 else if( strcmp(chKey4,
"ITER") == 0 )
1205 if(
nMatch(
"CONV",chCard) )
1224 else if( strcmp(chKey4,
"L(NU") == 0 )
1230 ParseF_nu(chCard,&nqh,&ar1,
"4 PI",lgNu2);
1233 else if( strcmp(chKey4,
"LASE") == 0 )
1267 fprintf(
ioQQQ,
" Too many continua entered; increase LIMSPC\n" );
1272 else if( strcmp(chKey4,
"LUMI") == 0 )
1279 fprintf(
ioQQQ,
" Too many continua entered; increase LIMSPC\n" );
1289 if(
nMatch(
"LINE",chCard) )
1298 if(
nMatch(
"SOLA",chCard) )
1314 if(
nMatch(
"TIME" , chCard ) )
1337 else if( strcmp(chKey4,
"MAGN") == 0 )
1343 else if( strcmp(chKey4,
"MAP ") == 0 )
1349 else if( strcmp(chKey4,
"META") == 0 )
1358 else if( strcmp(chKey4,
"NEUT") == 0 )
1387 else if( strcmp(chKey3,
"NO ") == 0 )
1393 else if( strcmp(chKey4,
"NORM") == 0 )
1399 else if( strcmp(chKey4,
"NUF(") == 0 )
1405 ParseF_nu(chCard,&nqh,&ar1,
"SQCM",lgNu2);
1408 else if( strcmp(chKey4,
"NUL(") == 0 )
1414 ParseF_nu(chCard,&nqh,&ar1,
"4 PI",lgNu2);
1417 else if( strcmp(chKey4,
"OPTI") == 0 )
1424 else if( strcmp(chKey4,
"PHI(") == 0 )
1431 fprintf(
ioQQQ,
" Too many continua entered; increase LIMSPC\n" );
1454 fprintf(
ioQQQ,
" Is the flux for this continuum correct?\n" );
1455 fprintf(
ioQQQ,
" It appears too bright to me.\n" );
1461 if(
nMatch(
"TIME" , chCard ) )
1484 else if( strcmp(chKey4,
"PLOT") == 0 )
1491 else if( strcmp(chKey4,
"POWE") == 0 )
1497 else if( strcmp(chKey4,
"PRIN") == 0 )
1503 else if( strcmp(chKey4,
"PUNC") == 0 )
1509 else if( strcmp(chKey4,
"Q(H)") == 0 )
1516 fprintf(
ioQQQ,
" Too many continua entered; increase LIMSPC\n" );
1527 fprintf(
ioQQQ,
" Is this reasonable?\n" );
1537 if(
nMatch(
"TIME" , chCard ) )
1561 else if( strcmp(chKey4,
"RATI") == 0 )
1573 else if( strcmp(chKey4,
"RADI") == 0 )
1582 else if( strcmp(chKey4,
"ROBE") == 0 )
1588 else if( strcmp(chKey4,
"SET ") == 0 )
1594 else if( strcmp(chKey4,
"SPEC") == 0 )
1600 else if( strcmp(chKey4,
"SPHE") == 0 )
1607 else if( strcmp(chKey4,
"STAT") == 0 )
1613 else if( strcmp(chKey4,
"STOP") == 0 )
1620 else if( strcmp(chKey4,
"TABL") == 0 )
1629 else if( strcmp(chKey4,
"TAUM") == 0 )
1641 else if( strcmp(chKey4 ,
"TEST" ) == 0 )
1647 else if( strcmp(chKey4,
"TIME") == 0 )
1653 else if( strcmp(chKey4,
"TITL") == 0 )
1659 else if( strcmp(chKey4,
"TLAW") == 0 )
1665 else if( strcmp(chKey4,
"TOLE") == 0 )
1668 "Sorry, this command has been replaced with the SET TEMPERATURE TOLERANCE command.\n");
1672 else if( strcmp(chKey4,
"TRAC") == 0 )
1678 else if( strcmp(chKey4,
"VLAW") == 0 )
1692 else if( strcmp(chKey4,
"TURB") == 0 )
1720 if(
nMatch(
" LOG",chCard) )
1739 if(
nMatch(
"DISS",chCard) )
1766 else if( strcmp(chKey4,
"WIND") == 0 )
1773 else if( strcmp(chKey2,
"XI") == 0 )
1786 fprintf(
ioQQQ,
" Unrecognized command. Key=\"%4.4s\". This is routine ParseCommands.\n",
1788 fprintf(
ioQQQ,
" The line image was==%s==\n",
1790 fprintf(
ioQQQ,
" Sorry.\n" );
1808 chCard[INPUT_LINE_LENGTH-1] =
'\0';
1812 fprintf(
ioQQQ,
"%23c*%81c*\n",
' ',
' ' );
1813 fprintf(
ioQQQ,
"%23c***********************************************************************************\n\n\n\n",
' ' );
1834 fprintf(
ioQQQ,
" READR turns on trace from optimize option.\n" );
1845 fprintf(
ioQQQ,
" PROBLEM DISASTER Hydrogen density set by DLAW must be > 0.\n" );
1855 fprintf(
ioQQQ,
" PROBLEM DISASTER Hydrogen density set by DLAW must be > 0.\n" );
1864 lgStop_not_enough_info =
false;
1870 fprintf(
ioQQQ,
" PROBLEM DISASTER Hydrogen density MUST be specified.\n" );
1871 lgStop_not_enough_info =
true;
1896 fprintf(
ioQQQ,
" PROBLEM DISASTER No commands were entered - whats up?\n" );
1905 fprintf(
ioQQQ,
" NOTE PROBLEM Due to the nature of the Sobolev approximation, it makes no sense to converge a windy model.\n" );
1906 fprintf(
ioQQQ,
" NOTE Iterate to convergence is turned off\n\n\n" );
1918 fprintf(
ioQQQ,
" NOTE Case B is an artificial test, it makes no sense to converge this model.\n" );
1919 fprintf(
ioQQQ,
" NOTE Iterate to convergence is turned off.\n\n\n" );
1930 fprintf(
ioQQQ,
" NOTE Specifying both a density power law and constant pressure is impossible.\n" );
1939 fprintf(
ioQQQ,
" NOTE NO REEVALUATE IONIZATION can only be used with constant density.\n" );
1940 fprintf(
ioQQQ,
" NOTE Resetting to reevaluate ionization.\n\n" );
1956 "NOTE The specified column density and hydrogen density correspond to a thickness of %.2e cm.\n",
1959 "NOTE This seems large to me.\n");
1960 fprintf(
ioQQQ,
"NOTE a very large radius may cause overflow.\n\n");
1969 "NOTE The grain temperatures are set to a constant value with the "
1970 "CONSTANT GRAIN TEMPERATURE command, but "
1971 "energy exchange \n");
1973 "NOTE is still included. The grain-gas heating-cooling will be incorrect. "
1974 "Consider turning off gas-grain collisional energy\n");
1976 "NOTE exchange with the NO GRAIN GAS COLLISIONAL ENERGY EXCHANGE command.\n\n\n");
1984 fprintf(
ioQQQ,
" NOTE NO LINE TRANSER set but fine opacities still computed.\n" );
1985 fprintf(
ioQQQ,
" NOTE Turning off fine opacities.\n\n" );
1995 fprintf(
ioQQQ,
" NOTE Large H2 molecule turned on but line transfer and fine opacities are not.\n" );
1996 fprintf(
ioQQQ,
" NOTE Turning on line transfer and fine opacities.\n\n" );
2006 fprintf(
ioQQQ,
"\n NOTE\n"
2007 " NOTE One of the incident continuum is a form used when no H-ionizing radiation is produced.\n" );
2008 fprintf(
ioQQQ,
" NOTE You must also include the EXTINGUISH command to make sure this is done.\n" );
2009 fprintf(
ioQQQ,
" NOTE The EXTINGUISH command was not included.\n" );
2010 fprintf(
ioQQQ,
" NOTE YOU MAY BE MAKING A BIG MISTAKE!!\n NOTE\n\n\n\n" );
2023 fprintf(
ioQQQ,
"\n NOTE\n"
2024 " NOTE The simulation is going into neutral gas but cosmic rays are not included.\n" );
2025 fprintf(
ioQQQ,
" NOTE Ion-molecule chemistry will not occur without a source of ionization.\n" );
2026 fprintf(
ioQQQ,
" NOTE The chemistry network may collapse deep in molecular regions.\n" );
2027 fprintf(
ioQQQ,
" NOTE Consider adding galactic background cosmic rays with the COSMIC RAYS BACKGROUND command.\n" );
2028 fprintf(
ioQQQ,
" NOTE You may be making a BIG mistake.\n NOTE\n\n\n\n" );
2036 fprintf(
ioQQQ,
" NOTE Is the entered value of the hydrogen density (%.2e) reasonable?\n",
2038 fprintf(
ioQQQ,
" NOTE It seems pretty low to me.\n\n\n" );
2042 fprintf(
ioQQQ,
" NOTE Is this value of the hydrogen density reasonable?\n" );
2043 fprintf(
ioQQQ,
" NOTE It seems pretty high to me.\n\n\n" );
2047 if(
called.
lgTalk && !lgStop && !lgStop_not_enough_info )
2051 fprintf(
ioQQQ,
" NOTE Simulation may crash because of extreme "
2052 "density. The value was %.2e\n\n" ,
2059 fprintf(
ioQQQ,
" PROBLEM DISASTER No incident radiation field was specified - "
2060 "at least put in the CMB.\n" );
2062 lgStop_not_enough_info =
true;
2067 fprintf(
ioQQQ,
" PROBLEM DISASTER Luminosity of continuum MUST be specified.\n" );
2069 lgStop_not_enough_info =
true;
2077 fprintf(
ioQQQ,
" PROBLEM DISASTER Starting radius MUST be specified.\n" );
2079 lgStop_not_enough_info =
true;
2084 fprintf(
ioQQQ,
" PROBLEM DISASTER There were not the same number of continuum shapes and luminosities entered.\n" );
2091 static bool lgFirstPass =
true;
2106 fprintf(
ioQQQ,
" PROBLEM DISASTER The GRID command was entered "
2107 "but there were %li GRID commands and %li commands with a VARY option.\n" ,
2109 fprintf(
ioQQQ,
" There must be the same number of GRIDs and VARY.\n" );
2112 lgFirstPass =
false;
2114 if( lgStop_not_enough_info )
2116 fprintf(
ioQQQ,
" PROBLEM DISASTER I do not have enough information to do the simulation, I cannot go on.\n" );
2117 fprintf(
ioQQQ,
"\n\n Sorry.\n\n\n" );