cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
service.cpp File Reference
#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"
Include dependency graph for service.cpp:

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 last, bool *lgEOL)
 
long nMatch (const char *chKey, const char *chCard)
 
double fudge (long int ipnt)
 
int GetQuote (char *chStringOut, char *chCard, char *chCardRaw, bool lgAbort)
 
double powi (double x, long int n)
 
double powpq (double x, int p, int q)
 
long ipow (long m, long n)
 
size_t strnlen (const char *s, size_t maxlen)
 
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)
 
void * MyMalloc_avx (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)
 

Function Documentation

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(), SaveDo(), and SaveNewContinuum().

Here is the call graph for this function:

NORETURN void BadRead ( void  )

BadRead tried to read internal data and failed

Definition at line 1082 of file service.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and ShowMe().

Referenced by diatomics::H2_Read_hminus_distribution(), and HelikeTransProbSetup().

Here is the call graph for this function:

void broken ( void  )

broken set flag saying that the code is broken

Definition at line 1163 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

Parameters
chCAPoutput string, cap'd first 4 char of chLab,
chLabwith null terminating input string ending with eol

Definition at line 264 of file service.cpp.

References DEBUG_ENTRY, and toupper().

Referenced by lgCheckMonitors(), optimize_func(), and PrtFinal().

Here is the call graph for this function:

void caps ( char *  chCard)

caps convert input command line (through eol) to ALL CAPS

Parameters
chCard- line image as string of characters

Definition at line 304 of file service.cpp.

References DEBUG_ENTRY, and toupper().

Referenced by atmdat_STOUT_readin(), cdColm(), cdIonFrac(), cdRead(), cdTemp(), LinSv::chALabSet(), t_input::echo(), t_LineSave::findline(), lgCheckMonitors(), LinSv::makeBlend(), Parser::newlineProcess(), ParseAbundances(), ParseNorm(), ParseTable(), and PrtFinal().

Here is the call graph for this function:

void CloudyPrintReference ( )

CloudyPrintReference print preferred citation to Cloudy

Definition at line 1890 of file service.cpp.

References fprintf(), Singleton< t_version >::Inst(), ioQQQ, mode_r, open_data(), and SafeGetline().

Referenced by PrtHeader().

Here is the call graph for this function:

void CodeReview ( void  )

CodeReview - placed next to code that needs to be checked

Definition at line 1189 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

Parameters
inuINU is array index pointing to frequency where opacity is to be evaluated on f not c scale
ithrITHR is pointer to threshold
iofsetIOFSET is offset as defined in opac0

Definition at line 1764 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 1907 of file service.cpp.

References atmdat, t_atmdat::chVersion, fprintf(), ioQQQ, mode_r, open_data(), and SafeGetline().

Referenced by PrtFinal(), and PrtHeader().

Here is the call graph for this function:

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 1249 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 1198 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().

Here is the call graph for this function:

int dprintf ( const Output stream,
const char *  format,
  ... 
)

Definition at line 1226 of file service.cpp.

References DEBUG_ENTRY, fprintf(), and Output::fptr().

Here is the call graph for this function:

double dsexp ( double  x)
double FFmtRead ( const char *  chCard,
long int *  ipnt,
long int  last,
bool *  lgEOL 
)
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 1172 of file service.cpp.

References broke, DEBUG_ENTRY, Singleton< FixitList >::Inst(), t_broke::lgFixit, and FixitList::list.

Referenced by Fixit::Fixit().

Here is the call graph for this function:

int fprintf ( const Output stream,
const char *  format,
  ... 
)

overloads to allow interception of output

Definition at line 1217 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(), cdIonFrac(), cdLine_ip(), cdMain(), cdMemory(), cdNotes(), cdPrepareExit(), cdPrintCommands(), cdRead(), cdReasonGeo(), cdSPEC(), 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(), dgaunt(), dgaunt_check(), dmpary(), do_dump_state(), do_restore_state(), doData(), DoFSMixing(), doHeader(), doop(), Parser::doSetVar(), dprintf(), Drive_cdLine(), DrivePump(), DrvCaseBHS(), 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(), 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(), GetQuote(), getSpecies(), GetStandardHeLines(), Parser::getSymbol(), diatomics::GetXColden(), GrainCharge(), GrainChargeTemp(), GrainCollHeating(), GrainDrift(), GrainDrive(), GrainsInit(), GrainTemperature(), GravitationalPressure(), grid_do(), GridCompile(), 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(), input_readvector(), 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(), ParseInitCount(), 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_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(), SaveNewContinuum(), 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(), 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().

Here is the call graph for this function:

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

Parameters
ipntinteger saying which of the possible numbers on the fudge command to use - 0 would be the first

Definition at line 567 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().

Here is the call graph for this function:

int GetQuote ( char *  chLabel,
char *  chCard,
char *  chCardRaw,
bool  lgABORT 
)
GetQuote get any name between double quotes off command line

return string as chLabel, is null terminated returns zero for success, 1 for did not find double quotes

Parameters
*chLabelnull terminated string between quotes
*chCardinput line, imagae, we set string between quotes to spaces
lgABORTif true then abort if no double quotes found, if false then return null string in this case,
Returns
0 if found double quotes, 1 if did not, string between quotes set to spaces

Definition at line 599 of file service.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, strchr_s(), and TotalInsanity().

Referenced by cdRead().

Here is the call graph for this function:

long ipow ( long  ,
long   
)
ipow
Returns
m^n

Definition at line 754 of file service.cpp.

References DEBUG_ENTRY, and is_odd().

Here is the call graph for this function:

void MyAssert ( const char *  file,
int  line,
const char *  comment 
)
MyAssert a version of assert that fails gracefully
Parameters
*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().

Here is the call graph for this function:

double MyGaussRand ( double  PctUncertainty)

A custom wrapper for RandGauss than truncates at two standard deviations.

Parameters
PctUncertainty

Definition at line 1845 of file service.cpp.

References ASSERT, DEBUG_ENTRY, and RandGauss().

Referenced by iso_error_generation().

Here is the call graph for this function:

void* MyMalloc ( size_t  size,
const char *  file,
int  line 
)

MyMalloc wrapper for malloc(). Returns a good pointer or dies.

Parameters
sizeuse same type as library function malloc
file
line

Definition at line 1739 of file service.cpp.

References ASSERT, and MyMalloc_base().

Here is the call graph for this function:

void* MyMalloc_avx ( size_t  size,
const char *  file,
int  line 
)

MyMalloc_avx - same as MyMalloc, but returned memory is aligned on AVX / AVX512 size boundary

Definition at line 1750 of file service.cpp.

References ASSERT, CD_ALIGN, and MyMalloc_base().

Here is the call graph for this function:

STATIC void MyMalloc_base ( void *  ptr,
size_t  size,
const char *  chFile,
int  line 
)

Definition at line 1666 of file service.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, t_struc::nzlim, set_NaN(), and struc.

Referenced by MyMalloc(), and MyMalloc_avx().

Here is the call graph for this function:

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

Parameters
*chKey
*chCard

Definition at line 537 of file service.cpp.

References ASSERT, DEBUG_ENTRY, and strstr_s().

Referenced by atmdat_CHIANTI_readin(), atmdat_STOUT_readin(), Badnell_rec_init(), cdRead(), t_input::echo(), mie_read_mix(), mie_read_rfi(), mie_read_szd(), Parser::nMatch1(), ParseAbundances(), ParseGrain(), ParseTable(), PrtFinal(), StandardEnergyUnit(), StandardFluxUnit(), and vary_input().

Here is the call graph for this function:

double plankf ( long int  ip)

plankf evaluate Planck function for any cell at current electron temperature

Parameters
ip

Definition at line 1869 of file service.cpp.

References t_mesh::anu(), t_rfield::ContBoltz, DEBUG_ENTRY, POW2, and rfield.

Referenced by SaveDo().

Here is the call graph for this function:

double powi ( double  ,
long  int 
)
double powpq ( double  x,
int  p,
int  q 
)
void PrintE71 ( FILE *  ,
double   
)

print with 1p,e8.1 format onto stream FILE

Definition at line 969 of file service.cpp.

References DEBUG_ENTRY, exp10(), fprintf(), and frac().

Referenced by PrtFinal().

Here is the call graph for this function:

void PrintE82 ( FILE *  ,
double   
)

print with 1p,e8.2 format onto stream FILE all are located in printe82.c

Definition at line 920 of file service.cpp.

References DEBUG_ENTRY, exp10(), fprintf(), and frac().

Referenced by AbundancesSet(), IonHydro(), PrtAllTau(), PrtFinal(), and PrtHeader().

Here is the call graph for this function:

void PrintE93 ( FILE *  ,
double   
)

print with 1p,e9.3 format onto stream FILE

Definition at line 1019 of file service.cpp.

References DEBUG_ENTRY, exp10(), fprintf(), and frac().

Referenced by HydroLevel(), PrtAllTau(), PrtFinal(), PrtHeader(), PrtHydroTrace1a(), PrtZone(), and save_opacity().

Here is the call graph for this function:

double qg32 ( double  ,
double  ,
double(*)(double)   
)

32 point gaussian quadrature integration

Parameters
xllower limit to integration
xu- upper limit to integration
(*fct)- pointer to routine to be integrated, arg is x val

Definition at line 1271 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 
Parameters
xMeanmean value
sstandard deviation s

Definition at line 1805 of file service.cpp.

References BIGDOUBLE, DEBUG_ENTRY, genrand_real3(), x1, and x2.

Referenced by Badnell_rec_init(), diatomics::init(), mc_escape(), and MyGaussRand().

Here is the call graph for this function:

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

Parameters
char*chLine - previously allocated string where the line image will be stored
intnChar 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 72 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(), DrvCaseBHS(), 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().

Here is the call graph for this function:

istream& SafeGetline ( istream &  is,
string &  t 
)

Definition at line 1932 of file service.cpp.

Referenced by CloudyPrintReference(), and DatabasePrintReference().

sys_float sexp ( sys_float  x)
double sexp ( double  x)

Definition at line 1114 of file service.cpp.

References DEBUG_ENTRY, and SEXP_LIMIT.

void ShowMe ( void  )
size_t sncatf ( char *  buf,
size_t  bufSize,
const char *  fmt,
  ... 
)

Definition at line 812 of file service.cpp.

References strnlen().

Referenced by diatomics::H2_ParseSave(), parse_save_average(), parse_save_line(), and ParseSave().

Here is the call graph for this function:

size_t sncatf ( ostringstream &  str,
const char *  fmt,
  ... 
)

Definition at line 825 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 108 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().

Here is the call graph for this function:

void spsort ( realnum  x[],
long int  n,
long int  iperm[],
int  kflag,
int *  ier 
)

spsort netlib routine to sort array returning sorted indices

Parameters
x[]input array to be sorted
nnumber of values in x
iperm[]permutation output array
kflagflag saying what to do - 1 sorts into increasing order, not changing
kflagthe original routine
*iererror condition, should be 0

Definition at line 1318 of file service.cpp.

References DEBUG_ENTRY.

Referenced by CoolSave(), diatomics::H2_PunchDo(), PrintSpectrum(), PrtLinePres(), SanityCheckBegin(), and SaveHeat().

size_t strnlen ( const char *  s,
size_t  maxlen 
)

Definition at line 791 of file service.cpp.

Referenced by sncatf().

void TestCode ( void  )

TestCode set flag saying that test code is in place

Definition at line 1153 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 1067 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(), cdRead(), 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(), ForbiddenAuls(), ForcePass(), GetHelikeCollisionStrength(), getIntenTypeStr(), t_cpu_i::getPathList(), Parser::GetQuote(), GetQuote(), GetStandardHeLines(), GrainChargeTemp(), GrainMakeDiffuse(), GravitationalPressure(), GridGatherInCloudy(), 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_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().

Here is the call graph for this function:

void trimTrailingWhiteSpace ( string &  str)
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

Parameters
chCard- line image as string of characters

Definition at line 287 of file service.cpp.

References DEBUG_ENTRY, and tolower().

Referenced by atmdat_CHIANTI_readin(), atmdat_STOUT_readin(), and database_readin().

Here is the call graph for this function:

Variable Documentation

const int max_pow10 = int(sizeof(pos_pow10)/sizeof(pos_pow10[0]) - 1)
static

Definition at line 354 of file service.cpp.

Referenced by FFmtRead().

const int min_pow10 = -int(sizeof(neg_pow10)/sizeof(neg_pow10[0]) - 1)
static

Definition at line 390 of file service.cpp.

Referenced by FFmtRead().

const double neg_pow10[]
static

Definition at line 356 of file service.cpp.

const double pos_pow10[]
static

Definition at line 320 of file service.cpp.

Referenced by FFmtRead().