cloudy
trunk
|
#include "cdstd.h"
#include <cstdarg>
#include "cddefines.h"
#include "service.h"
#include "cddrive.h"
#include "called.h"
#include "opacity.h"
#include "rfield.h"
#include "hextra.h"
#include "struc.h"
#include "fudgec.h"
#include "broke.h"
#include "trace.h"
#include "input.h"
#include "save.h"
#include "version.h"
#include "warnings.h"
#include "conv.h"
#include "atmdat.h"
#include "mole.h"
#include "prt.h"
#include "integrate.h"
Go to the source code of this file.
Functions | |
char * | read_whole_line (char *chLine, int nChar, FILE *ioIN) |
void | Split (const string &str, const string &sep, vector< string > &lst, split_mode mode) |
void | trimTrailingWhiteSpace (string &str) |
void | trimTrailingWhiteSpace (char *str) |
void | MyAssert (const char *file, int line, const char *comment) |
double | AnuUnit (realnum energy_ryd) |
void | ShowMe (void) |
void | cap4 (char *chCAP, const char *chLab) |
void | uncaps (char *chCard) |
void | caps (char *chCard) |
double | FFmtRead (const char *chCard, long int *ipnt, long int length, bool *lgEOL) |
long | nMatch (const char *chKey, const char *chCard) |
double | fudge (long int ipnt) |
double | powi (double x, long int n) |
double | powpq (double x, int p, int q) |
long | ipow (long m, long n) |
size_t | sncatf (char *buf, size_t bufSize, const char *fmt,...) |
size_t | sncatf (ostringstream &str, const char *fmt,...) |
void | PrintE82 (FILE *ioOUT, double value) |
void | PrintE71 (FILE *ioOUT, double value) |
void | PrintE93 (FILE *ioOUT, double value) |
NORETURN void | TotalInsanity (void) |
NORETURN void | BadRead (void) |
sys_float | sexp (sys_float x) |
double | sexp (double x) |
double | dsexp (double x) |
void | TestCode (void) |
void | broken (void) |
void | fixit_base (const char *func, const char *file, int line, const char *reason) |
void | CodeReview (void) |
int | dprintf (FILE *fp, const char *format,...) |
int | fprintf (const Output &stream, const char *format,...) |
int | dprintf (const Output &stream, const char *format,...) |
int | dbg_printf (int debug, const char *fmt,...) |
double | qg32 (double xl, double xu, double(*fct)(double)) |
void | spsort (realnum x[], long int n, long int iperm[], int kflag, int *ier) |
STATIC void | MyMalloc_base (void *ptr, size_t size, const char *chFile, int line) |
void * | MyMalloc (size_t size, const char *chFile, int line) |
double | csphot (long int inu, long int ithr, long int iofset) |
double | RandGauss (double xMean, double s) |
double | MyGaussRand (double PctUncertainty) |
double | plankf (long int ip) |
void | CloudyPrintReference () |
void | DatabasePrintReference () |
istream & | SafeGetline (istream &is, string &t) |
Variables | |
static const double | pos_pow10 [] |
static const int | max_pow10 = int(sizeof(pos_pow10)/sizeof(pos_pow10[0]) - 1) |
static const double | neg_pow10 [] |
static const int | min_pow10 = -int(sizeof(neg_pow10)/sizeof(neg_pow10[0]) - 1) |
double AnuUnit | ( | realnum | energy | ) |
AnuUnit produce continuum energy in arbitrary units, ip is on C scale
Definition at line 197 of file service.cpp.
References t_save::chConSavEnr, DEBUG_ENTRY, Energy::get(), t_save::ipConPun, and save.
Referenced by AGN_Hemis(), energy(), pseudo_cont::getWl(), Save1Line(), Save1LineData(), save_opacity(), and SaveDo().
NORETURN void BadRead | ( | void | ) |
BadRead tried to read internal data and failed
Definition at line 986 of file service.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and ShowMe().
Referenced by diatomics::H2_Read_hminus_distribution(), and HelikeTransProbSetup().
void broken | ( | void | ) |
broken set flag saying that the code is broken
Definition at line 1067 of file service.cpp.
References broke, DEBUG_ENTRY, and t_broke::lgBroke.
Referenced by ion_solver(), and PresTotCurrent().
void cap4 | ( | char * | chCAP, |
const char * | chLab | ||
) |
cap4 convert first 4 char of input line chLab into chCAP all in caps, null termination
chCAP | output string, cap'd first 4 char of chLab, |
chLab | with null terminating input string ending with eol |
Definition at line 261 of file service.cpp.
References DEBUG_ENTRY, and toupper().
Referenced by lgCheckMonitors(), optimize_func(), and PrtFinal().
void caps | ( | char * | chCard | ) |
caps convert input command line (through eol) to ALL CAPS
chCard | - line image as string of characters |
Definition at line 295 of file service.cpp.
References DEBUG_ENTRY, and toupper().
Referenced by atmdat_STOUT_readin(), cdColm(), cdIonFrac(), cdTemp(), LinSv::chALabSet(), t_LineSave::findline(), lgCheckMonitors(), LinSv::makeBlend(), Parser::newlineProcess(), ParseAbundances(), ParseNorm(), and ParseTable().
void CloudyPrintReference | ( | ) |
CloudyPrintReference print preferred citation to Cloudy
Definition at line 1781 of file service.cpp.
References fprintf(), Singleton< t_version >::Inst(), ioQQQ, mode_r, open_data(), and SafeGetline().
Referenced by PrtHeader().
void CodeReview | ( | void | ) |
CodeReview - placed next to code that needs to be checked
Definition at line 1093 of file service.cpp.
References broke, DEBUG_ENTRY, and t_broke::lgCheckit.
double csphot | ( | long int | inu, |
long int | ithr, | ||
long int | iofset | ||
) |
csphot returns photoionization cross section from opacity stage using std pointers
inu | INU is array index pointing to frequency where opacity is to be evaluated on f not c scale |
ithr | ITHR is pointer to threshold |
iofset | IOFSET is offset as defined in opac0 |
Definition at line 1655 of file service.cpp.
References DEBUG_ENTRY, opac, and t_opac::OpacStack.
Referenced by OpacityAddTotal().
void DatabasePrintReference | ( | ) |
DatabasePrintReference print some database references
Definition at line 1798 of file service.cpp.
References atmdat, t_atmdat::chVersion, fprintf(), ioQQQ, mode_r, open_data(), and SafeGetline().
Referenced by PrtFinal(), and PrtHeader().
int dbg_printf | ( | int | debug, |
const char * | fmt, | ||
... | |||
) |
dbg_printf is a debug print routine that was provided by Peter Teuben, as a component from his NEMO package. It offers run-time specification of the level of debugging
Definition at line 1153 of file service.cpp.
References DEBUG_ENTRY, t_trace::debug_level, ioQQQ, and trace.
int dprintf | ( | FILE * | fp, |
const char * | format, | ||
... | |||
) |
dprintf – version of fprintf which prepends DEBUG
Definition at line 1102 of file service.cpp.
References DEBUG_ENTRY, and fprintf().
Referenced by DumpCoolStack(), DumpHeatStack(), iso_radiative_recomb_effective(), iter_track::print_status(), qheat_init(), read_UTA_lines(), and Recomb_Seaton59().
int dprintf | ( | const Output & | stream, |
const char * | format, | ||
... | |||
) |
Definition at line 1130 of file service.cpp.
References DEBUG_ENTRY, fprintf(), and Output::fptr().
double dsexp | ( | double | x | ) |
dsexp safe exponential function for doubles
x |
Definition at line 1038 of file service.cpp.
References DEBUG_ENTRY, and DSEXP_LIMIT.
Referenced by FastVoigtH(), ga08_oH2_e(), ga08_oH2_H_b100(), ga08_pH2_e(), ga08_pH2_H_b100(), diatomics::H2_Level_low_matrix(), Hion_coll_ioniz_ratecoef(), hydro_vs_ioniz(), iso_satellite_update(), diatomics::mole_H2_LTE(), mole_partition_function(), setCollRate::operator()(), RT_continuum_shield_fcn_point(), RT_recom_effic(), and diatomics::SolveSomeGroundElectronicLevels().
double FFmtRead | ( | const char * | chCard, |
long int * | ipnt, | ||
long int | last, | ||
bool * | lgEOL | ||
) |
FFmtRead - the free-format number reader
*chCard | string giving the line image |
*ipnt | the index for the character in the string where we shall start |
last | the number of characters in the string - do not search beyond it |
*lgEOL | true if hit end of line with no number |
Definition at line 381 of file service.cpp.
References DEBUG_ENTRY, fprintf(), ioQQQ, max_pow10, min(), min_pow10, pos_pow10, sign(), tolower(), and TotalInsanity().
Referenced by atmdat_LAMDA_readin(), atmdat_STOUT_readin(), Badnell_rec_init(), ContBandsCreate(), database_readin(), dgaunt(), DrvEscP(), DrvHyas(), diatomics::GetIndices(), GetStandardHeLines(), diatomics::H2_Read_hminus_distribution(), diatomics::H2_ReadDissocEnergies(), diatomics::H2_ReadDissprob(), diatomics::H2_ReadEnergies(), diatomics::H2_ReadTransprob(), HeCollidSetup(), HelikeTransProbSetup(), HyperfineCreate(), iso_recomb_setup(), bands_file::load(), LoadIsotopes(), FunctLAMDA::operator()(), t_mesh::p_ReadResolution(), ParseAbundances(), ParseDrive(), ParseTable(), read_Helike_cross_sections(), read_SH98_He1_cross_sections(), and ReadCollisionRateTable().
void fixit_base | ( | const char * | func, |
const char * | file, | ||
int | line, | ||
const char * | reason | ||
) |
fixit set flag saying that this code needs attention, but is not broken, code is in service.cpp
Definition at line 1076 of file service.cpp.
References broke, DEBUG_ENTRY, Singleton< FixitList >::Inst(), t_broke::lgFixit, and FixitList::list.
Referenced by Fixit::Fixit().
int fprintf | ( | const Output & | stream, |
const char * | format, | ||
... | |||
) |
overloads to allow interception of output
Definition at line 1121 of file service.cpp.
References Output::fptr().
Referenced by AbortErrorMessage(), abund_starburst(), AbundancesPrt(), AbundancesSet(), AbundancesTable(), t_PredCont::add(), addComment(), LinSv::addComponent(), addKeyword_num(), addKeyword_txt(), AGN_He1_CS(), AGN_Hemis(), AtlasCompile(), atmdat_3body(), atmdat_CHIANTI_readin(), atmdat_dielrec_fe(), atmdat_LAMDA_readin(), atmdat_outer_shell(), atmdat_readin(), atmdat_STOUT_readin(), AtmospheresAvail(), AulTTError(), Badnell_rec_init(), badprt(), BadRead(), t_warnings::bangin(), bessel_y0(), bessel_y1(), bessel_yn(), C6cs123(), Ca20cs123(), t_warnings::caunin(), cdCautions(), cdClock(), cdColm(), cdDrive(), cdErrors(), cdExecTime(), cdGetLineList(), cdH2_colden(), cdInit(), cdInput(), cdIonFrac(), cdLine_ip(), cdMain(), cdMemory(), cdNotes(), cdPrepareExit(), cdPrintCommands(), cdRead(), cdReasonGeo(), cdSPEC2(), cdSurprises(), cdTemp(), cdWarnings(), ChargTranPun(), ChargTranSumHeat(), check_data(), pseudo_cont::check_index_fatal(), species_bands::check_index_fatal(), check_LAMDA_comment(), check_mult_path(), t_mesh::CheckMesh(), CheckVal(), t_mole_local::chem_heat(), ChemImportance(), chi2_func(), CHIANTI_Upsilon(), chkCaHeps(), chMolBranch(), CloseSaveFiles(), cloudy(), CloudyPrintReference(), cnewton(), t_ADfA::coll_ion_wrapper(), collectSkipTrans(), collision_strength_VF01(), CollisSuppres(), Parser::CommandError(), conorm(), ContBandsCreate(), ContCreateMesh(), ContCreatePointers(), ContNegative(), ContRate(), ContSetIntensity(), ConvBase(), ConvCrossSect2CollStr(), ConvEdenIoniz(), ConvFail(), ConvInitSolution(), ConvIoniz(), ConvIterCheck(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolEvaluate(), CoolHeatError(), CoolHyperfine(), coolpr(), CoolSave(), CoolSum(), CoStarCompile(), CoStarInitialize(), CoStarListModels(), CS_l_mixing(), database_readin(), DatabasePrintReference(), dBase_solve(), dBaseAbund(), dense_fabden(), dgaunt(), dgaunt_check(), dmpary(), do_dump_state(), do_restore_state(), doData(), DoFSMixing(), doHeader(), doop(), Parser::doSetVar(), dprintf(), Drive_cdLine(), DrivePump(), DrvEscP(), DrvHyas(), DumpAtmosphere(), DumpLine(), DynaEndZone(), DynaIonize(), DynaIterEnd(), DynaIterStart(), DynaNewStep(), DynaPrtZone(), DynaPunchTimeDep(), DynaSave(), DynaStartZone(), e1(), e1_scaled(), e2(), t_input::echo(), Parser::echo(), eden_sum(), EdenError(), ElectronFractions(), ellpk(), t_debug::enter(), Parser::Error(), esc_2side_base(), esc_CRDwing(), escmase(), expn(), factorial(), fc2_scl(), Fe26cs123(), Parser::FFmtRead(), FFmtRead(), ffun(), ffun1(), FillExtraLymanLine(), FillJ(), find_arr(), find_solution(), t_LineSave::findline(), findspecies_validate(), fndneg(), fndstr(), fudge(), funjac(), GammaPrt(), GammaPrtRate(), GammaPrtShells(), gauss_legendre(), Energy::get(), get_total_abundance_ions(), GetBins(), Parser::getFirstChunk(), GetFracPop(), GetHelikeCollisionStrength(), band_cont::getInten(), getLevelsGeneric(), Parser::getLineID(), GetLineRec(), GetModel(), GetNextLine(), Parser::getNumberCheckAlwaysLogLim(), GetOptColDen(), GetOptLineInt(), GetOptTemp(), Parser::getPairs(), GetPotValues(), GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), getSpecies(), GetStandardHeLines(), Parser::getSymbol(), diatomics::GetXColden(), GrainCharge(), GrainChargeTemp(), GrainCollHeating(), GrainDrift(), GrainDrive(), GrainsInit(), GrainTemperature(), GravitationalPressure(), grid_do(), GridCompile(), GridRetrieveXSPECData(), gridXspec(), GrnStdDpth(), GrnVryDpth(), H21_cm_pops(), diatomics::H2_Colden(), diatomics::H2_CollidRateEvalAll(), diatomics::H2_CollidRateRead(), diatomics::H2_Cooling(), diatomics::H2_Level_low_matrix(), diatomics::H2_LevelPops(), diatomics::H2_ParseSave(), diatomics::H2_Prt_column_density(), diatomics::H2_Prt_Zone(), diatomics::H2_PrtDepartCoef(), diatomics::H2_Punch_line_data(), diatomics::H2_PunchDo(), diatomics::H2_RadPress(), diatomics::H2_Read_hminus_distribution(), diatomics::H2_Read_LTE_cooling_per_H2(), diatomics::H2_ReadDissocEnergies(), diatomics::H2_ReadDissprob(), diatomics::H2_ReadEnergies(), diatomics::H2_ReadTransprob(), diatomics::H2_Reset(), diatomics::H2_X_coll_rate_evaluate(), H_Einstein_A_lin(), H_Einstein_A_log10(), H_photo_cs_lin(), H_photo_cs_log10(), HCSAR_interp(), HCTIon(), HCTRecom(), He2cs123(), he_1trans(), HeatSum(), HeCollidSetup(), HelikeTransProbSetup(), Parser::help(), highen(), HomogeneousSource(), t_ADfA::hpfit(), hv(), Hydcs123(), HydroEinstA(), HydroLevel(), HydroRecCool(), HyperfineCreate(), hypho(), IncidentContinuumHere(), load_balance::init(), diatomics::init(), t_mole_global::init(), t_yield::init_yield(), InitEmissivities(), InitGrid(), InitGridASCII(), InitGridBin(), InitSimPostparse(), InterpolateGridCoStar(), InterpolateModel(), InterpolateModelCoStar(), InterpolateRectGrid(), inv_ufunct(), ion_photo(), ion_recom_calculate(), ion_recomb(), ion_recombAGN(), ion_trim(), ion_trim2(), ion_wrapper(), IonHelium(), IonHydro(), IonNelem(), ipContEnergy(), ipLineEnergy(), ipoint(), ipShells(), iso_cascade(), iso_collide(), iso_continuum_lower(), iso_cool(), iso_get_collision_strength(), iso_ionize_recombine(), iso_level(), iso_photo(), iso_prt_pops(), iso_radiative_recomb(), iso_radiative_recomb_effective(), iso_recomb_setup(), iso_renorm(), iso_set_ion_rates(), iso_solve(), iso_update_num_levels(), iter_end_check(), IterEnd(), IterRestart(), IterStart(), Kurucz79Compile(), t_debug::leave(), lfactorial(), lgCheckMonitors(), lgCompileAtmosphere(), lgConserveEnergy(), lgConvTemp(), lgCoolNetConverge(), lgElemsConserved(), lgNetEdenSrcSmall(), lgNucleiConserved(), lgOptimize_do(), lgReactBalance(), lgReadAtmosphereHead(), lgReadAtmosphereTail(), lgStatesConserved(), lgValidModel(), LimitSh(), lindst(), lines(), lines_continuum(), lines_general(), lines_helium(), lines_hydro(), lines_iron_Ka(), lines_table(), LineStackCreate(), bands_file::load(), LoadIsotopes(), LinSv::makeBlend(), map_do(), maybeNumber(), mc_escape(), t_mean::MeanIon(), mie_auxiliary(), mie_auxiliary2(), mie_cs(), mie_cs_size_distr(), mie_find_slope(), mie_next_line(), mie_read_double(), mie_read_long(), mie_read_mix(), mie_read_opc(), mie_read_realnum(), mie_read_rfi(), mie_read_szd(), mie_repair(), mie_step(), mie_write_opc(), MihalasCompile(), molcol(), mole_check_reverse_reactions(), mole_cmp_num_in_out_reactions(), mole_create_react(), mole_dominant_rates(), mole_eval_balance(), mole_generate_isotopologue_reactions(), mole_h2_grain_form(), diatomics::mole_H2_LTE(), mole_h_rate_diagnostics(), mole_h_reactions(), mole_print_species_reactions(), mole_rk_bigchange(), mole_save(), mole_solve(), mole_system_error(), mole_update_rks(), mole_update_species_cache(), my_Integrand_VF01_E< P >::my_Integrand_VF01_E(), MyAssert(), MyMalloc_base(), Ne10cs123(), newreact(), newspecies(), newton_step(), Parser::NoNumb(), t_warnings::notein(), opacity_more_memory(), OpacityAddTotal(), OpacityCreate1Element(), OpacityCreateAll(), OpacityCreateReilMan(), setCollRate::operator()(), Atom_LevelN::operator()(), FunctLAMDA::operator()(), optimize_func(), optimize_phymir(), phymir_state< X, Y, NP, NSTR >::p_execute_job(), Flux::p_InternalFluxUnit(), t_gaunt::p_read_table(), t_mesh::p_ReadResolution(), EnergyEntry::p_set_ip(), t_mesh::p_SetupMesh(), parse_reaction(), parse_save_average(), parse_save_line(), Parse_Save_Line_RT(), parse_species_label(), parse_udfa(), ParseAbsMag(), ParseAbundances(), ParseAge(), ParseAgn(), ParseAperture(), ParseBackgrd(), ParseBlackbody(), ParseBremsstrahlung(), ParseChemistry(), ParseCMB(), ParseCommands(), ParseCompile(), ParseConstant(), ParseCoronal(), ParseCosm(), ParseCosmicRays(), ParseCosmology(), ParseCovering(), ParseCrashDo(), ParseDarkMatter(), ParseDatabase(), ParseDatabaseH2(), ParseDatabaseISO(), ParseDielectronic(), ParseDiffuse(), ParseDLaw(), ParseDont(), ParseDrive(), ParseDynaTime(), ParseDynaWind(), ParseElement(), ParseEnergy(), ParseExtinguish(), ParseF_nu(), ParseFail(), ParseFill(), ParseFluc(), ParseForceTemperature(), ParseGlobule(), ParseGrain(), ParseGravity(), ParseGrid(), ParseHDEN(), ParseHeLike(), ParseHExtra(), ParseHydrogen(), ParseIlluminate(), ParseInit(), ParseIntensity(), ParseInterp(), ParseIonPar(), ParseLaser(), ParseLuminosity(), ParseMagnet(), ParseMap(), ParseMetal(), ParseMonitorResults(), ParseNorm(), ParseNumber(), ParseOptimize(), ParsePGrains(), ParsePhi(), ParsePlot(), ParsePlotRangeContin(), ParsePlotRangeOption(), ParsePowerlawContinuum(), ParsePrint(), ParsePrtLineSum(), ParseQH(), ParseRadius(), ParseRangeOption(), ParseRatio(), ParseSave(), ParseSet(), ParseSpecies(), ParseSphere(), ParseState(), ParseStop(), ParseTable(), ParseTest(), ParseTLaw(), ParseTolerance(), ParseTrace(), ParseTurbulence(), PlanckIntegral(), plot(), plot_sparsity(), pltcon(), pltmap(), pltopc(), pltr(), pnegopc(), PntForLine(), PressureChange(), PresTotCurrent(), bad_assert::print(), print_delimiter(), print_emline_fine(), iter_track::print_history(), PrintCenterLine(), t_cpu_i::printDataPath(), PrintE71(), PrintE82(), PrintE93(), Parser::PrintLine(), PrintLineDataHeader(), PrintRates(), PrintRatio(), PrintShortZero(), PrintSpectrum(), prme(), process_output(), LinSv::prt(), t_physconst::prt_constants(), prt_constants(), prt_header_cols(), prt_line_err(), prt_line_inlist(), prt_LineLabels(), prt_smooth_predictions(), prt_trans_opc_debug(), prt_wl(), PrtAllTau(), PrtColumns(), PrtComment(), PrtElem(), PrtFinal(), PrtHeader(), PrtHydroTrace1(), PrtHydroTrace1a(), isotope::prtIso(), isotope::prtIsoPairs(), PrtLinePres(), PrtLineSum(), prtLineType(), PrtMacros(), PrtMeanIon(), prtmet(), PrtOneMonitor(), prtPunOpacSummary(), t_prt_matrix::prtRates(), PrtTwoPhotonEmissCoef(), PrtZone(), punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), punchFITS_SpectraHeader(), qheat(), qintr(), r1mach(), t_ADfA::rad_rec(), radius_first(), radius_increment(), radius_next(), RauchCompile(), RauchInitialize(), RauchReadMPP(), read_data(), read_Helike_cross_sections(), read_Hummer_Storey(), read_level2_lines(), read_mewe_gbar(), read_SH98_He1_cross_sections(), read_UTA_lines(), read_whole_line(), t_input::readarray(), ReadAugerData(), ReadBadnellAIData(), Parser::readLaw(), Parser::readList(), ReadTable(), RebinQHeatResults(), rec6j(), t_conv::register_(), renorm_solution(), RT_continuum(), RT_continuum_shield_fcn(), RT_DestProb(), RT_diffuse(), RT_line_all(), RT_line_all_escape(), RT_line_driving(), RT_line_escape(), RT_line_one_fine(), RT_line_one_tau_reset(), RT_line_one_tauinc(), RT_line_pumping(), RT_OTS(), RT_OTS_AddLine(), RT_OTS_ChkSum(), RT_OTS_PrtRate(), RT_recom_effic(), RT_tau_inc(), RT_tau_init(), RT_tau_reset(), RTesc_lya_1side(), SanityCheck(), SanityCheckBegin(), SanityCheckGaunt(), Save1Line(), Save1LineData(), save_average(), save_line(), Save_Line_RT(), save_opacity(), SaveAllSpeciesLabelsLevels(), SaveDo(), saveFITSfile(), SaveGaunts(), SaveGrid(), SaveHeat(), SaveLineData(), SaveLineIntensity(), SaveLineStuff(), SaveResults(), SaveSpecial(), SaveSpecies(), SaveSpeciesBands(), SaveSpeciesHeader(), SaveSpeciesLines(), SaveSpeciesOne(), SaveSpeciesOptDep(), SaveSpeciesPseudoCont(), ScaleAllDensities(), ScanProbDistr(), search_limit(), SecIoniz(), Energy::set(), set_xIntensity(), SetLimits(), setProperties(), t_prt_matrix::setSpecies(), GroupMap::setup(), setXtraRatesO1(), Parser::showLocation(), ShowMe(), size_distr(), solve_system(), diatomics::SolveExcitedElectronicLevels(), solveions(), speciesCheck(), speciesOff(), spectral_to_chemical(), spline_cubic_set(), Split(), StandardEnergyUnit(), StandardFluxUnit(), StarburstCompile(), StarburstInitialize(), state_do(), state_get_put(), states_nelemfill(), stepDensity(), StoutCollRate(), StuffComment(), pseudo_cont::sumBand(), species_bands::sumBand(), SumDensities(), t_ADfA::t_ADfA(), t_physconst::t_physconst(), t_version::t_version(), DepthTable::tabval(), TempChange(), TempInterp(), test_expn(), tfidle(), timestep_next(), TlustyCompile(), TotalInsanity(), totlin(), trim_levels(), uderiv(), ufunct(), UpdatePot(), UpdateUTAs(), validate_magic_number_1arg(), validate_magic_number_3arg(), t_mesh::ValidateEdges(), ValidateGrid(), ValidateMesh(), vary_input(), t_warnings::warnin(), WernerCompile(), WMBASICCompile(), WriteASCIIData(), WriteASCIIHead(), XERBLA(), xerror_(), y0b01(), Yfunc(), zero(), t_abund::zero(), zoneDensity(), and ZoneStart().
double fudge | ( | long int | ipnt | ) |
fudge enter fudge factors, or some arbitrary number, with fudge command return value is the fudge factor fudge(-1) queries the routine for the number of fudge parameters that were entered, zero returned if none
ipnt | integer saying which of the possible numbers on the fudge command to use - 0 would be the first |
Definition at line 555 of file service.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), t_fudgec::fudgea, fudgec, ioQQQ, t_fudgec::lgFudgeUsed, and t_fudgec::nfudge.
Referenced by GrainChargeTemp(), InitEmissivities(), and PresTotCurrent().
long ipow | ( | long | , |
long | |||
) |
ipow
Definition at line 658 of file service.cpp.
References DEBUG_ENTRY, and is_odd().
void MyAssert | ( | const char * | file, |
int | line, | ||
const char * | comment | ||
) |
MyAssert a version of assert that fails gracefully
*file | |
line |
Definition at line 177 of file service.cpp.
References cdEXIT, conv, DEBUG_ENTRY, EXIT_FAILURE, fnzone, fprintf(), ioQQQ, iteration, t_conv::lgSearch, nzone, ShowMe(), and TorF().
Referenced by cdMain().
double MyGaussRand | ( | double | PctUncertainty | ) |
A custom wrapper for RandGauss than truncates at two standard deviations.
PctUncertainty |
Definition at line 1736 of file service.cpp.
References ASSERT, DEBUG_ENTRY, and RandGauss().
Referenced by iso_error_generation().
void* MyMalloc | ( | size_t | size, |
const char * | file, | ||
int | line | ||
) |
MyMalloc wrapper for malloc(). Returns a good pointer or dies.
size | use same type as library function malloc |
file | |
line |
Definition at line 1643 of file service.cpp.
References ASSERT, and MyMalloc_base().
STATIC void MyMalloc_base | ( | void * | ptr, |
size_t | size, | ||
const char * | chFile, | ||
int | line | ||
) |
Definition at line 1570 of file service.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, t_struc::nzlim, set_NaN(), and struc.
Referenced by MyMalloc().
long nMatch | ( | const char * | chKey, |
const char * | chCard | ||
) |
nMatch determine whether match to a keyword occurs on command line, return value is 0 if no match, and position of match within string if hit
*chKey | |
*chCard |
Definition at line 525 of file service.cpp.
References ASSERT, DEBUG_ENTRY, and strstr_s().
Referenced by atmdat_CHIANTI_readin(), atmdat_STOUT_readin(), Badnell_rec_init(), mie_read_mix(), mie_read_rfi(), mie_read_szd(), Parser::nMatch1(), ParseAbundances(), ParseGrain(), ParseTable(), StandardEnergyUnit(), StandardFluxUnit(), and vary_input().
double plankf | ( | long int | ip | ) |
plankf evaluate Planck function for any cell at current electron temperature
ip |
Definition at line 1760 of file service.cpp.
References t_mesh::anu(), t_rfield::ContBoltz, DEBUG_ENTRY, POW2, and rfield.
Referenced by SaveDo().
double powi | ( | double | , |
long | int | ||
) |
powi raise x to integer power
Definition at line 594 of file service.cpp.
References DEBUG_ENTRY, and is_odd().
Referenced by add_mx(), atmdat_STOUT_readin(), bessel_jn(), bhG(), bhg(), CollisSuppres(), ContCreatePointers(), CS_PercivalRichards78(), DebyeDeriv(), expn(), F21i_log(), fsff(), GrainCharge(), H21_cm_pops(), t_ADfA::H_rad_rec(), highen(), Hion_coll_ioniz_ratecoef(), hrii(), hrii_log(), hydro_transprob(), HydroRecCool(), InitEmissivities(), iso_rad_rec_cooling_extra(), iso_state_lifetime(), MolDissocCrossSection(), ParseBackgrd(), PlanckIntegral(), powpq(), PrtComment(), rayleh(), SaveSpecial(), setXtraRatesFe2(), size_distr(), and unmxify().
double powpq | ( | double | x, |
int | p, | ||
int | q | ||
) |
powpq raise x to rational power p/q
Definition at line 630 of file service.cpp.
References DEBUG_ENTRY, and powi().
Referenced by atmdat_dielrec_fe(), ContSetIntensity(), CS_l_mixing_PS64(), CS_l_mixing_PS64_expI(), CS_l_mixing_VOS12(), da(), eeBremsCooling(), eeBremsSpectrum(), elec_esc_length(), ffun1(), GetHelikeCollisionStrength(), GrainScreen(), GrainsInit(), H21cm_electron(), he_1trans(), Hydcs123(), hydro_vs_coll_str(), hydro_vs_deexcit(), hydro_vs_ioniz(), ion_recom_calculate(), iso_collide(), iso_continuum_lower(), iso_get_collision_strength(), iso_radrecomb_from_cross_section(), iso_satellite_update(), lgCheckMonitors(), lgValidModel(), mole_partition_function(), my_Integrand_VF01_E< P >::my_Integrand_VF01_E(), OpacityCreateAll(), PrtZone(), qheat_init(), t_ADfA::rec_lines(), Recomb_Seaton59(), RT_stark(), X1Int(), X2Int(), and Yan_H2_CS().
void PrintE71 | ( | FILE * | , |
double | |||
) |
print with 1p,e8.1 format onto stream FILE
Definition at line 873 of file service.cpp.
References DEBUG_ENTRY, exp10(), fprintf(), and frac().
Referenced by PrtFinal().
void PrintE82 | ( | FILE * | , |
double | |||
) |
print with 1p,e8.2 format onto stream FILE all are located in printe82.c
Definition at line 824 of file service.cpp.
References DEBUG_ENTRY, exp10(), fprintf(), and frac().
Referenced by AbundancesSet(), IonHydro(), PrtAllTau(), PrtFinal(), and PrtHeader().
void PrintE93 | ( | FILE * | , |
double | |||
) |
print with 1p,e9.3 format onto stream FILE
Definition at line 923 of file service.cpp.
References DEBUG_ENTRY, exp10(), fprintf(), and frac().
Referenced by HydroLevel(), PrtAllTau(), PrtFinal(), PrtHeader(), PrtHydroTrace1a(), PrtZone(), and save_opacity().
double qg32 | ( | double | , |
double | , | ||
double(*)(double) | |||
) |
32 point gaussian quadrature integration
xl | lower limit to integration |
xu | - upper limit to integration |
(*fct) | - pointer to routine to be integrated, arg is x val |
Definition at line 1175 of file service.cpp.
References DEBUG_ENTRY.
Referenced by AngerJ(), CS_ThermAve_PR78(), iso_radrecomb_from_cross_section(), Recomb_Seaton59(), and SanityCheckBegin().
double RandGauss | ( | double | xMean, |
double | s | ||
) |
normal random variate generator
xMean | mean value |
s | standard deviation s |
Definition at line 1696 of file service.cpp.
References BIGDOUBLE, DEBUG_ENTRY, genrand_real3(), x1, and x2.
Referenced by Badnell_rec_init(), diatomics::init(), mc_escape(), and MyGaussRand().
char* read_whole_line | ( | char * | chLine, |
int | nChar, | ||
FILE * | ioIN | ||
) |
read_whole_line safe version of fgets - read a line, return null if cannot read line or if input line is too long
char | *chLine - previously allocated string where the line image will be stored |
int | nChar size of chLine, we will return NULL if input line is longer than this |
FILE | *ioIN a previously opened file handle, will read from from here |
Definition at line 70 of file service.cpp.
References called, DEBUG_ENTRY, fprintf(), ioQQQ, lgAbort, and t_called::lgTalk.
Referenced by atmdat_LAMDA_readin(), atmdat_STOUT_readin(), Badnell_rec_init(), cdGetLineList(), cdMain(), ContBandsCreate(), CoStarInitialize(), database_readin(), dgaunt(), DrvEscP(), DrvHyas(), GetNextLine(), GetStandardHeLines(), diatomics::H2_CollidRateRead(), diatomics::H2_Read_hminus_distribution(), diatomics::H2_Read_LTE_cooling_per_H2(), diatomics::H2_ReadDissocEnergies(), diatomics::H2_ReadDissprob(), diatomics::H2_ReadEnergies(), diatomics::H2_ReadTransprob(), HeCollidSetup(), HelikeTransProbSetup(), HyperfineCreate(), t_yield::init_yield(), iso_recomb_setup(), lgReadAtmosphereHead(), bands_file::load(), LoadIsotopes(), mie_next_line(), t_mesh::p_ReadResolution(), ParseAbundances(), ParseDrive(), ParseInit(), ParseTable(), RauchInitialize(), read_data_line(), read_Helike_cross_sections(), read_level2_lines(), read_mewe_gbar(), diatomics::Read_Mol_Diss_cross_sections(), read_SH98_He1_cross_sections(), read_UTA_lines(), ReadCollisionRateTable(), ReadTable(), StarburstInitialize(), validate_magic_number_1arg(), and validate_magic_number_3arg().
istream& SafeGetline | ( | istream & | is, |
string & | t | ||
) |
Definition at line 1823 of file service.cpp.
Referenced by CloudyPrintReference(), and DatabasePrintReference().
sexp safe exponential function
Definition at line 999 of file service.cpp.
References DEBUG_ENTRY, and SEXP_LIMIT.
Referenced by atmdat_dielrec_fe(), atom_level2(), Badnell_DR_rate_eval(), ChargTranEval(), ColStrGBar(), extin(), ffun1(), GetAveVelocity(), t_rfield::getCoarseTransCoef(), GetDopplerWidth(), GrnStdDpth(), H21_cm_pops(), H21cm_electron(), diatomics::H2_CollidRateEvalAll(), diatomics::H2_LevelPops(), H2_vib_dist(), HCTRecom(), highen(), hmrate4(), diatomics::init(), ion_recom_calculate(), IterEnd(), IterRestart(), IterStart(), lines_continuum(), mole_h2_grain_form(), mole_h_reactions(), ParseAgn(), ParseDrive(), PrtFinal(), RT_continuum(), SaveDo(), and shieldFederman().
double sexp | ( | double | x | ) |
Definition at line 1018 of file service.cpp.
References DEBUG_ENTRY, and SEXP_LIMIT.
void ShowMe | ( | void | ) |
print comment asking to show output to me
Definition at line 205 of file service.cpp.
References cdCautions(), cdPrintCommands(), cdWarnings(), conv, t_hextra::cryden, DEBUG_ENTRY, findspecieslocal(), fprintf(), h2, hextra, input, Singleton< t_version >::Inst(), ioQQQ, t_input::lgInitPresent, t_warnings::ncaun, t_conv::nTeFail, t_warnings::nwarn, warnings, and molezone::xFracLim.
Referenced by BadRead(), cloudy(), cnewton(), ContSetIntensity(), ConvEdenIoniz(), ConvFail(), ConvInitSolution(), ConvTempEdenIoniz(), CoolEvaluate(), coolpr(), escmase(), GetFracPop(), GrainCharge(), diatomics::H2_ReadTransprob(), HeatSum(), ipoint(), iso_level(), iso_radiative_recomb(), iter_end_check(), lgCheckMonitors(), lines(), mie_auxiliary(), mie_auxiliary2(), mie_cs_size_distr(), mie_read_mix(), mie_read_rfi(), mie_repair(), mie_write_opc(), MyAssert(), PresTotCurrent(), PrintRates(), prt_smooth_predictions(), PrtComment(), radius_first(), RT_continuum(), RT_line_escape(), RT_tau_init(), SanityCheckBegin(), SaveDo(), size_distr(), TotalInsanity(), t_abund::zero(), and zoneDensity().
size_t sncatf | ( | char * | buf, |
size_t | bufSize, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 716 of file service.cpp.
Referenced by diatomics::H2_ParseSave(), parse_save_average(), parse_save_line(), and ParseSave().
size_t sncatf | ( | ostringstream & | str, |
const char * | fmt, | ||
... | |||
) |
Definition at line 729 of file service.cpp.
References DEBUG_ENTRY.
void Split | ( | const string & | str, |
const string & | sep, | ||
vector< string > & | lst, | ||
split_mode | mode | ||
) |
Split: split a string into substrings using "sep" as separator
Definition at line 106 of file service.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, SPM_KEEP_EMPTY, and SPM_STRICT.
Referenced by HyperfineCreate(), t_cpu_i::t_cpu_i(), and t_version::t_version().
void spsort | ( | realnum | x[], |
long int | n, | ||
long int | iperm[], | ||
int | kflag, | ||
int * | ier | ||
) |
spsort netlib routine to sort array returning sorted indices
x[] | input array to be sorted |
n | number of values in x |
iperm[] | permutation output array |
kflag | flag saying what to do - 1 sorts into increasing order, not changing |
kflag | the original routine |
*ier | error condition, should be 0 |
Definition at line 1222 of file service.cpp.
References DEBUG_ENTRY.
Referenced by CoolSave(), diatomics::H2_PunchDo(), PrintSpectrum(), PrtLinePres(), SanityCheckBegin(), and SaveHeat().
void TestCode | ( | void | ) |
TestCode set flag saying that test code is in place
Definition at line 1057 of file service.cpp.
References DEBUG_ENTRY, and lgTestCodeCalled.
NORETURN void TotalInsanity | ( | void | ) |
TotalInsanity general error handler for something that cannot happen, exits
Definition at line 971 of file service.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and ShowMe().
Referenced by AbundancesPrt(), multi_arr< StoutColls, 2 >::alloc(), atmdat_CHIANTI_readin(), atmdat_LAMDA_readin(), atmdat_readin(), atmdat_STOUT_readin(), avg_shield(), Badnell_rec_init(), t_gaunt::brems_cool(), t_gaunt::brems_opac(), t_gaunt::brems_rt(), cdInit(), cdMain(), CHIANTI_Upsilon(), t_ADfA::coll_ion_wrapper(), CollisSuppres(), conorm(), ContSetIntensity(), ConvInitSolution(), ConvIterCheck(), ConvTempEdenIoniz(), CoolEvaluate(), CoolSave(), cross_section(), CS_PercivalRichards78(), database_readin(), dawson(), dBase_solve(), dBaseUpdateCollCoeffs(), DebyeDeriv(), DynaPunchTimeDep(), DynaSave(), EdenChange(), fc2(), FFmtRead(), multi_geom< d, MEM_LAYOUT_VAL >::finalize(), FindIndex(), t_LineSave::findline(), flxCell(), ForbiddenAuls(), ForcePass(), GetHelikeCollisionStrength(), getIntenTypeStr(), t_cpu_i::getPathList(), GetStandardHeLines(), GrainChargeTemp(), GrainMakeDiffuse(), GravitationalPressure(), GrnStdDpth(), H21_cm_pops(), diatomics::H2_LevelPops(), diatomics::H2_Read_LTE_cooling_per_H2(), HaardtMadauInterpolate(), he_1trans(), helike_quantum_defect(), diatomics::init(), t_yield::init_yield(), InterpolateGridCoStar(), InterpolateModel(), InterpolateRectGrid(), irsl2ind(), iso_assign_quantum_numbers(), iso_collapsed_Aul_update(), iso_create(), iso_cross_section(), iso_get_collision_strength_collapsed_to_collapsed_fast(), iso_get_collision_strength_collapsed_to_resolved(), iso_get_collision_strength_resolved(), iso_get_total_num_levels(), iso_radrecomb_from_cross_section(), iter_end_check(), IterEnd(), lgCheckMonitors(), lgInputComment(), lgOptimize_do(), lines(), t_mole_global::make_species(), t_mean::MeanIon(), mole_effects(), mole_generate_isotopologue_reactions(), mole_h_reactions(), my_Integrand_VF01_E< P >::my_Integrand_VF01_E(), Opacity_iso_photo_cs(), Atom_LevelN::operator()(), phymir_state< X, Y, NP, NSTR >::p_barrier(), phymir_state< X, Y, NP, NSTR >::p_execute_job(), t_gaunt::p_setup_brems(), pah2_fun(), pah3_fun(), ParseBlackbody(), ParseCosmology(), ParseCrashDo(), ParseDatabaseH2(), ParseDatabaseISO(), ParseGrain(), ParseMonitorResults(), ParseTable(), PrintSpectrum(), PrtColumns(), PrtComment(), PrtFinal(), PrtMeanIon(), radius_first(), radius_next(), RauchInitialize(), read_SH98_He1_cross_sections(), read_UTA_lines(), ReadBadnellAIData(), rfield_opac_malloc(), RT_continuum(), RT_continuum_shield_fcn_point(), RT_OTS_ChkSum(), save_average(), SaveDo(), SaveFilesInit(), SaveSpecies(), SaveSpeciesPseudoCont(), sg(), StarburstInitialize(), state_get_put(), states_nelemfill(), Integrator< Integrand, Method >::sum(), VecIntegrator< Integrand, Method >::sum(), SumDensities(), tbl_fun(), tfidle(), TlustyInterpolate(), TotalInsanityAsStub(), vary_input(), zoneDensity(), and ZoneStart().
void trimTrailingWhiteSpace | ( | string & | str | ) |
Definition at line 153 of file service.cpp.
Referenced by cdColm(), cdIonFrac(), cdTemp(), LinSv::chALabSet(), database_readin(), t_LineSave::findline(), Parser::getLineID(), ParseMonitorResults(), ParseNorm(), ParseSave(), ParseSet(), and ParseStop().
void trimTrailingWhiteSpace | ( | char * | str | ) |
Definition at line 165 of file service.cpp.
void uncaps | ( | char * | chCard | ) |
uncaps convert input command line (through eol) to all lowercase
chCard | - line image as string of characters |
Definition at line 281 of file service.cpp.
References DEBUG_ENTRY, and tolower().
Referenced by atmdat_CHIANTI_readin(), atmdat_STOUT_readin(), and database_readin().
Definition at line 342 of file service.cpp.
Referenced by FFmtRead().
Definition at line 378 of file service.cpp.
Referenced by FFmtRead().
|
static |
Definition at line 344 of file service.cpp.
|
static |
Definition at line 308 of file service.cpp.
Referenced by FFmtRead().