Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cddrive.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void cdInit ()
 
void cdTalk (bool)
 
void cdOutput (const string &filename="", const char *mode="w")
 
void cdOutput (const string &filename, FILE *fp)
 
void cdInput (const string &filename="", const char *mode="r")
 
void cdDepth_depth (double cdDepth[])
 
long int cdnZone ()
 
double cdB21cm ()
 
int cdRead (const string &)
 
long debugLine (realnum wavelength)
 
void cdNoExec ()
 
int cdDrive ()
 
void cdErrors (FILE *)
 
void cdNwcns (long int *NumberWarnings, long int *NumberCautions, long int *NumberNotes, long int *NumberSurprises, long int *NumberTempFailures, long int *NumberPresFailures, long int *NumberIonFailures, long int *NumberNeFailures)
 
void cdReasonGeo (FILE *)
 
void cdWarnings (FILE *)
 
void cdCautions (FILE *)
 
void cdSurprises (FILE *)
 
void cdNotes (FILE *)
 
long int cdLine (const string &chLabel, realnum wavelength, double *relint, double *absint, int LineType=0)
 
long int cdLine (const LineID &line, double *relint, double *absint, int LineType=0)
 
void cdLine_ip (long int ipLine, double *relint, double *absint, int LineType=0)
 
int cdColm (const char *, long, double *)
 
double cdH2_colden (long iVib, long iRot)
 
void cdEmis (const char *chLabel, realnum wavelength, double *emiss, bool lgEmergent)
 
void cdEmis (const LineID &line, double *emiss, bool lgEmergent)
 
void cdEmis_ip (long int ipLine, double *emiss, bool lgEmergent)
 
double cdCooling_last ()
 
double cdHeating_last ()
 
double cdEDEN_last ()
 
void cdPressure_last (double *TotalPressure, double *GasPressure, double *RadiationPressure)
 
void cdPressure_depth (double TotalPressure[], double GasPressure[], double RadiationPressure[])
 
double cdTemp_last ()
 
int cdIonFrac (const char *chLabel, long int IonStage, double *fracin, const char *chWeight, bool lgDensity)
 
void cdVersion (char chString[])
 
void cdDate (char chString[])
 
void cdSetExecTime ()
 
double cdExecTime ()
 
long int cdGetLineList (const string &chFile, vector< LineID > &lineids)
 
void cdTimescales (double *TTherm, double *THRecom, double *TH2)
 
void cdSPEC2 (int Option, realnum ReturnedSpectrum[])
 
int cdTemp (const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
 
int cdTemp (const string &chLabel, double *TeMean, const char *chWeight)
 
void test_cdTemp_molecules ()
 
void cdPrintCommands (FILE *)
 
void cdClosePunchFiles ()
 
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)
 
long cdMemory ()
 

Variables

bool lgcdInitCalled
 

Detailed Description

 this file contains definitions for the suite of routines that
 allow the code to be driven as a subroutine.
 These routines set up model parameters, 
 control the execution of Cloudy, and obtain results once complete
 these are the only "public" routines, and only these should
 be accessed when controlling Cloudy

 DRIVING CLOUDY FROM A FORTRAN PROGRAM:
 This should not be too hard - the recommended approach is to use
 the cfortran.h file described at http://www-zeus.desy.de/~burow/cfortran/ 

 A note on return error conditions:

 Many functions return an int to indicate success or failure.
 I try to follow standard Unix/C convention.
 A return value of zero usually indicates that the routine was successful,
 and a non-zero value (not always 1) indicates failure.  This is conventional
 in both C and Unix.  So the way to call Cloudy and test for success is

 if( cdDdrive() )
 {
           printf(" Cloudy failed.\n");
 }

 Although I try to follow this, there ARE exceptions.

Function Documentation

double cdB21cm ( )

cdB21cm returns B as measured by 21 cm assumes tangled field weighted by n(H0)/T

References DEBUG_ENTRY, mean, SMALLFLOAT, and t_mean::TempB_HarMean.

Referenced by PrtFinal().

void cdCautions ( FILE *  )

produces list of cautions

References t_warnings::chCaunln, DEBUG_ENTRY, fprintf(), and warnings.

Referenced by cdErrors(), PrtComment(), SaveLineIntensity(), SaveResults(), and ShowMe().

Here is the call graph for this function:

void cdClosePunchFiles ( )

wrapper to close all save files

References CloseSaveFiles(), and DEBUG_ENTRY.

Here is the call graph for this function:

int cdColm ( const char *  ,
long  ,
double *   
)
* cdColm 
* This obtains the column density of a species in the previously computed model.
* The first parameter is a 4 character + NULL terminated string which gives
* the first 4 char of the element name as spelled by Cloudy, either upper or lower case.
* The second parameter is the stage of ionization, 1 for atom, 2 for first ion, etc; 0 is special.
*
* examples: 
* column density of atomic carbon
* cdColm( "carb" , 1 , &col1 );
*
* doubly ionized helium
* cdColm( "heli" , 3 , &col3 );
*
* molecular hydrogen
* cdColm("H2  " , 0 , &col2 );
*
* If the ion stage is zero then the routine will check the first label
* for the values "H2  ", "OH  ", "CO  " and "CII* *", 
* and will return the H2, OH, CO or CII* column density in this case
*
* The column density [cm-2] is returned as the third parameter in all cases
*
* The function returns 0 if it found the species, 1 if it failed 
double cdCooling_last ( )

cdCooling_last The returns the total cooling (erg cm^-3 s^-1) for the last computed zone

References t_thermal::ctot, and thermal.

void cdDate ( char  chString[])

cdDate The argument is a string with at least 8 char that will receive a null terminated string with the date of the current version of the code.

References Singleton< t_version >::Inst().

Here is the call graph for this function:

void cdDepth_depth ( double  cdDepth[])

returns depth structure of previous model

Parameters
cdDepth[]

References DEBUG_ENTRY, t_struc::depth, nzone, and struc.

int cdDrive ( )

cdDrive This command actually computes a model. It returns 0 if the calculation was successful, and 1 if an error condition was encountered

References cdEXIT, cloudy(), t_input::crd, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), grid, grid_do(), InitCoreload(), t_mesh::InitMesh(), input, ioQQQ, lgcdInitCalled, t_prt::lgIncludeBlends, t_grid::lgInsideGrid, t_optimize::lgNoVary, t_optimize::lgOptimr, t_trace::lgTrace, t_optimize::lgVaryOn, t_mesh::ncells(), t_rfield::nflux, t_rfield::nflux_with_check, t_rfield::nPositive, optimize, ParseInitFile(), prt, rfield, and trace.

Referenced by cdMain().

Here is the call graph for this function:

double cdEDEN_last ( )

cdEDEN_last return electron density of last zone

References dense, and t_dense::eden.

void cdEmis ( const char *  chLabel,
realnum  wavelength,
double *  emiss,
bool  lgEmergent 
)

cdEmis This routine finds the local emissivity for any line. The first argument is the 4 character (null terminated) label as it appears in the standard output. The second argument is float wavelength as it appears in the standard output. The emissivity (erg /cm^3 /s) is returned as the last parameter. cdEms returns the index of the line in the stack if it was found, the negative of the total number of lines in the stack if it could not find the line

Parameters
*chLabel4 char null terminated string label
wavelengthline wavelength
*emissthe vol emissivity of this line in last computed zone
lgEmergentintrinsic or emergent emissivities
Returns
return value will be index of line within stack

cdEms obtain the local emissivity for a line, for the last computed zone

References cdEmis(), and DEBUG_ENTRY.

Referenced by cdEmis(), and cdEmis_ip().

Here is the call graph for this function:

void cdEmis ( const LineID line,
double *  emiss,
bool  lgEmergent 
)

References cdEmis(), DEBUG_ENTRY, t_LineSave::findline(), t_LineSave::lines, and LineSave.

Here is the call graph for this function:

void cdEmis_ip ( long int  ipLine,
double *  emiss,
bool  lgEmergent 
)

cdEms_ip obtain the local emissivity for a line with known index

Parameters
ipLineindex of the line in the stack
*emissthe vol emissivity of this line in last computed zone
lgEmergentintrinsic or emergent emissivities

References ASSERT, cdEmis(), DEBUG_ENTRY, t_LineSave::lines, LineSave, and t_LineSave::nsum.

Referenced by save_line().

Here is the call graph for this function:

void cdErrors ( FILE *  )

cdErrors After the calculation is completed, a summary of all error messages can be be generated by calling this routine. The argument is the output file

Parameters
[out]*ioOUToutput file

References cdCautions(), cdNwcns(), cdWarnings(), t_input::chTitle, DEBUG_ENTRY, fprintf(), and input.

Here is the call graph for this function:

double cdExecTime ( )

cdExecTime returns the elapsed time cpu time (sec) that has elapsed since cdInit called cdSetExecTime.

References before, cdClock(), cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and lgCalled.

Referenced by cdMain(), PrtFinal(), and SaveDo().

Here is the call graph for this function:

long int cdGetLineList ( const string &  chFile,
vector< LineID > &  lineids 
)
* cdGetLineList will read in a list of emission line labels and wavelengths
* from a file.  I use it for generating LOC grids.  
* Two files (cdGetLineList and cdGetLineList) are included in the main data 
* distribution and have list of strong emission lines for high and low density gas.
* other files can be created by the user.
*
* The first argument is the name of the file to read.
* It it is void ("") then the routine will open LineList_BLR.dat 
*
* The second argument is a list of line identifications The routine will
* allocate the needed space, but the vector is defined in the calling
* routine. like this:
* vector<LineID> lineids;
* They would appear as follows in the call to the routine:
* chGetLineList("", lineids);
*
* cdGetLineList returns the number of lines it found in the file if it was successful,
* and -1 if it could not open the file.
* 

References AS_TRY, cdEXIT, DataParser::checkEOL(), DEBUG_ENTRY, ES_STARS_AND_BLANKS, EXIT_FAILURE, fprintf(), DataParser::getline(), DataParser::getLineID(), DataParser::isOpen(), lgcdInitCalled, and DataParser::lgEODMarker().

Referenced by lines_table().

Here is the call graph for this function:

double cdH2_colden ( long  iVib,
long  iRot 
)

cdH2_colden return column density in H2, returns -1 if cannot find state, header is in cdDrive, source in h2.c

References fprintf(), diatomics::GetXColden(), h2, ioQQQ, diatomics::lgEnabled, diatomics::ortho_colden, and diatomics::para_colden.

Referenced by cdColm(), and lgCheckMonitors().

Here is the call graph for this function:

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 
)

cdH2_Line returns 1 if we found the line, or false==0 if we did not find the line because ortho-para transition or upper level has lower energy than lower level NB - this is in mole_h2_io.c

Parameters
iElecHiindices for the upper level
iVibHiindices for the upper level
iRotHiindices for the upper level
iElecLoindices for lower level
iVibLoindices for lower level
iRotLoindices for lower level
*relintlinear intensity relative to normalization line
*absintlog of luminosity or intensity of line

References DEBUG_ENTRY, diatomics::getLine(), and h2.

Here is the call graph for this function:

double cdHeating_last ( )

cdHeating_last returns the total heating (erg cm^-3 s^-1) for the last computed zone

References t_thermal::htot, and thermal.

void cdInit ( )

cdInit This routine must be called before any of the others - it reinitializes many variables, and must be called before any of the other routines. In a large grid of calculations it must be repeatedly called before the start of the new calculation and after all results have been obtained from the previous model

References called, cdSetExecTime(), t_input::clear(), cpu, t_input::crd, DEBUG_ENTRY, fprintf(), grid, t_cpu::i(), t_ran::init(), t_cpu_i::initPath(), input, ioQQQ, lgBigBotch, lgcdInitCalled, t_grid::lgGrid, lgMonitorsOK, t_cpu_i::lgMPI_talk(), t_optimize::lgNoVary, t_optimize::lgOptimr, t_grid::lgOutputTypeOn, lgPrtSciNot, t_called::lgTalk, t_called::lgTalkForcedOff, t_called::lgTalkIsOK, t_optimize::lgVaryOn, t_grid::nGridCommands, t_input::nRead, NUM_OUTPUT_TYPES, optimize, ran, TotalInsanity(), and zero().

Referenced by cdMain().

Here is the call graph for this function:

void cdInput ( const string &  filename = "",
const char *  mode = "r" 
)

cdInput This tells the code where to get input. The arguments are as for the stdio.h fopen call, but the resulting file pointer is checked for validity. All further input will come from this file. If filename = "", input is switched to stdin (and mode is ignored). If this routine is not called then all input will come from stdin, the standard c input

References AS_LOCAL_ONLY_TRY, cdEXIT, DEBUG_ENTRY, ES_FAILURE, fprintf(), ioQQQ, ioStdin, NULL, and open_data().

Referenced by cdMain(), and cdPrepareExit().

Here is the call graph for this function:

int cdIonFrac ( const char *  chLabel,
long int  IonStage,
double *  fracin,
const char *  chWeight,
bool  lgDensity 
)
 * cdIonFrac
 * This returns the ionization fraction for any element included in the calculation. 
 * The first parameter is 4 char null terminated string giving the first 4 letters of
 * element name as spelled by Cloudy.  
 * The second parameter is an integer giving the ionization stage, 
 * 1 for atom, 2 for first ion, etc.
 * The third parameter returns the predicted ionization fraction of that ion stage.
 * The last parameter is an 8 character + null string that says either "volume" or "radius",
 * to specify whether the average should be weighted by volume or radius.
 * The return value is 0 if the routine could find the species and
 * non-zero if it failed to find the element 
Parameters
*chLabelfour char string, null terminated, giving the element name
IonStageIonStage is ionization stage, 1 for atom, up to N+1 where N is atomic number
*fracinwill be fractional ionization
*chWeighthow to weight the average, must be "VOLUME" or "RADIUS"
lgDensityif true then weighting also has electron density, if false then only volume or radius

References caps(), t_elementnames::chElementNameShort, DEBUG_ENTRY, elementnames, exp10(), fprintf(), ioQQQ, ipHYDROGEN, LIMELM, mean, t_mean::MeanIon(), set_weighting(), and trimTrailingWhiteSpace().

Referenced by DynaPunchTimeDep(), lgCheckMonitors(), and save_average().

Here is the call graph for this function:

long int cdLine ( const string &  chLabel,
realnum  wavelength,
double *  relint,
double *  absint,
int  LineType = 0 
)

cdLine This routine finds the predicted intensity of any line in the standard output.

Parameters
*chLabel1st parameter is the species label, as it appears in the output.
wavelength2nd parameter is the float wavelength in Angstroms, not how it appears in printout. The digits must agree with the number in the printout, but the units must be Angstroms. 3rd parameter is the predicted intensity relative to the normalization line. 4th par is the log of the predicted luminosity or intensity of the line (ergs).
*relint5th is pointer to relative intensity, a double that is returned
*absint6th is pointer to log of absolute intensity
LineType- emergent or intrinsic intensity
Returns
return value: The routine returns an index (>0) of the array element within stack if it finds the line, It returns the negative of the total number of lines if it could not find the line. (this is a debugging aid) note that this returns a long int since there are LOTS of lines this also IS NOT the standard C convention for success or failure

References cdLine(), and DEBUG_ENTRY.

Referenced by cdLine(), ConvIterCheck(), IterStart(), lgCheckMonitors(), lines(), PrtComment(), PrtFinal(), and SaveDo().

Here is the call graph for this function:

long int cdLine ( const LineID line,
double *  relint,
double *  absint,
int  LineType = 0 
)

cdLine get the predicted line intensity, using LineID

Parameters
linethe line we are looking for
*relintlinear intensity relative to normalization line
*absintlog of luminosity or intensity of line
LineType- intrinsic or emergent intensity

References cdLine_ip(), DEBUG_ENTRY, t_LineSave::findline(), and LineSave.

Here is the call graph for this function:

void cdLine_ip ( long int  ipLine,
double *  relint,
double *  absint,
int  LineType = 0 
)

cdLine_ip get the predicted line intensity, using index for line in stack

Parameters
ipLine
*relintlinear intensity relative to normalization line
*absintlog of luminosity or intensity of line
LineType- intrinsic or emergent intensity

References ASSERT, t_radius::Conv2PrtInten, DEBUG_ENTRY, fprintf(), ioQQQ, t_LineSave::ipNormWavL, t_LineSave::lines, LineSave, t_LineSave::nsum, radius, and t_LineSave::ScaleNormLine.

Referenced by cdLine(), lgCheckMonitors(), PrtLineSum(), and save_line().

Here is the call graph for this function:

long cdMemory ( )

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

Referenced by cdMain().

Here is the call graph for this function:

void cdNoExec ( )

cdNoExec This provides option to have the code prepare the initial conditions for a model, but not actually try to compute the model. I use this when setting up a large grid so that I can quickly run through the full grid as a check that the commands are entered properly and the parameters I am going to vary do so properly. The command is then commented out when the grid is properly set up.

References DEBUG_ENTRY, t_noexec::lgNoExec, and noexec.

void cdNotes ( FILE *  )

produces list of Notes

References t_warnings::chNoteln, DEBUG_ENTRY, fprintf(), and warnings.

Referenced by PrtComment().

Here is the call graph for this function:

void cdNwcns ( long int *  NumberWarnings,
long int *  NumberCautions,
long int *  NumberNotes,
long int *  NumberSurprises,
long int *  NumberTempFailures,
long int *  NumberPresFailures,
long int *  NumberIonFailures,
long int *  NumberNeFailures 
)

cdNwcns This command returns the number of warnings, cautions, notes, surprises, assorted types of failures found the last computed model

Parameters
*NumberWarningsthe number of warnings
*NumberCautionsthe number of cautions
*NumberNotesthe number of notes
*NumberSurprisesthe number of surprises
*NumberTempFailuresthe number of temperature convergence failures
*NumberPresFailuresthe number of pressure convergence failures
*NumberIonFailuresthe number of ionization convergence failures
*NumberNeFailuresthe number of electron density convergence failures

References t_warnings::chBangln, t_warnings::chCaunln, t_warnings::chNoteln, t_warnings::chWarnln, conv, DEBUG_ENTRY, t_conv::nIonFail, t_conv::nNeFail, t_conv::nPreFail, t_conv::nTeFail, and warnings.

Referenced by cdErrors(), and cdMain().

long int cdnZone ( )

cdnZone returns number of zones

References nzone.

void cdOutput ( const string &  filename = "",
const char *  mode = "w" 
)

cdOutput This tells the code where to send output. The arguments are as for the stdio.h fopen call, but the resulting file pointer is checked for validity. All further log output will go to this file. If filename = "", output is switched to stdout (and mode is ignored). If this routine is not called then all output will go to stdout, the standard c output

References t_save::chOutputFile, DEBUG_ENTRY, ioQQQ, NULL, open_data(), and save.

Referenced by cdMain(), and cdPrepareExit().

Here is the call graph for this function:

void cdOutput ( const string &  filename,
FILE *  fp 
)
void cdPressure_depth ( double  TotalPressure[],
double  GasPressure[],
double  RadiationPressure[] 
)

cdPressure_depth This returns the pressure and its constituents for the last iteration. space was allocated in the calling routine for the vectors - before calling this, cdnZone should have been called to get the number of zones, then space allocated for the arrays

Parameters
TotalPressure[]total pressure, all forms
GasPressure[]gas pressure
RadiationPressure[]radiation pressure

References DEBUG_ENTRY, t_struc::GasPressure, nzone, t_struc::pres_radiation_lines_curr, t_struc::pressure, and struc.

void cdPressure_last ( double *  TotalPressure,
double *  GasPressure,
double *  RadiationPressure 
)
cdPressure_last

This returns the pressure and its constituents for the last computed zone.

Parameters
*TotalPressuretotal pressure, all forms
*GasPressuregas pressure
*RadiationPressureradiation pressure

References DEBUG_ENTRY, t_pressure::pres_radiation_lines_curr, t_pressure::PresGasCurr, pressure, and t_pressure::PresTotlCurr.

void cdPrintCommands ( FILE *  )

cdPrintCommands( FILE *) This routine prints all input commands into file whose handle is the argument

Parameters
*ioOUT[out] output file handle

References t_input::crd, fprintf(), and input.

Referenced by ShowMe().

Here is the call graph for this function:

int cdRead ( const string &  )

cdRead This sends commands to the code. The normal set of commands described in Part I of Hazy must be entered as a C-style or C++-style string. These strings are then fed to Cloudy with this command. The function returns the number of commands that can still be entered before the command stack is full. The code will stop if you try to continue giving it commands after the command has returned zero. This return value is the opposite of the standard - a non-zero return is normal

References AS_SILENT_TRY, cdEXIT, CardInfo::chCardSav, t_save::chOutputFile, t_input::crd, t_input::curInclLevel, DEBUG_ENTRY, EXIT_FAILURE, exp10(), fprintf(), Parser::getNumberDefault(), grid, Parser::hasCommand(), input, ioQQQ, lgcdInitCalled, t_grid::lgGrid, t_prt::lgIncludeBlends, t_input::lgInitPresent, lgIsCommentSeq(), t_optimize::lgNoVary, t_optimize::lgOptimr, t_prt::lgPrintTime, t_input::lgSetNoBuffering, t_trace::lgTrace, t_optimize::lgVaryOn, t_grid::nGridCommands, Parser::nMatch(), NULL, open_data(), optimize, ParseInit(), prt, rfield, save, Parser::setline(), t_mesh::setResolutionScaleFactor(), StripComment(), trace, and trimTrailingWhiteSpace().

Referenced by cdMain(), and ParseInitFile().

Here is the call graph for this function:

void cdReasonGeo ( FILE *  )

This prints the reason why the model stopped, and the model geometry, on the io file pointed to by the file handle

References t_warnings::chRgcln, DEBUG_ENTRY, fprintf(), and warnings.

Referenced by PrtComment().

Here is the call graph for this function:

void cdSetExecTime ( )

normally called by cdInit, this routine sets initial variables for times

References before, cdClock(), and lgCalled.

Referenced by cdInit().

Here is the call graph for this function:

void cdSPEC2 ( int  Option,
realnum  ReturnedSpectrum[] 
)

this routine returns the spectrum needed for Keith Arnaud's XSPEC X-Ray analysis code. It should be called after cdDrive has successfully computed a model. The calling routine must ensure that the vectors have enough space to store the resulting spectrum, given the bounds and energy resolution

Parameters
Option
the type of spectrum to be returned (in photons/s/bin)
      0 the total continuum, all components outward and reflected
     
      1 the incident continuum
     
      2 the attenuated incident continuum
      3 the reflected incident continuum
     
      4 diffuse emission, lines + continuum, outward
      5 diffuse emission, lines + continuum, reflected
     
      6 diffuse continuous emission, outward
      7 diffuse continuous emission, reflected
     
      8 total transmitted, incident + lines and continuum
      9 total reflected, incident + lines and continuum
     
     10 exp(-tau) to the illuminated face
ReturnedSpectrum[]the returned spectrum, should have rfield.nflux elements

References t_mesh::anu2(), ASSERT, cdEXIT, CT_INCI, CT_OUTW_DIFF, CT_OUTW_INCI, CT_OUTW_LIN, CT_REFL_DIFF, CT_REFL_INCI, CT_REFL_LIN, DEBUG_ENTRY, EXIT_FAILURE, t_opac::ExpmTau, flxCell(), fprintf(), t_rfield::getCoarseTransCoef(), ioQQQ, t_rfield::nflux, NULL, opac, t_radius::PI4_rinner_sq, radius, rfield, and t_mesh::widflx().

Referenced by GridRetrieveXSPECData(), and punchFITS_GenericData().

Here is the call graph for this function:

void cdSurprises ( FILE *  )

produces list of surprises

References broke, t_warnings::chBangln, DEBUG_ENTRY, fprintf(), Singleton< FixitList >::Inst(), t_broke::lgPrintFixits, FixitList::list, and warnings.

Referenced by PrtComment().

Here is the call graph for this function:

void cdTalk ( bool  )

cdTalk tells the code whether or not to produce any of its normal output, If the argument is true (or if it is not called at all) it produces output, produces no output if it is false

References called, cpu, DEBUG_ENTRY, t_cpu::i(), t_cpu_i::lgMPI_talk(), t_called::lgTalk, and t_called::lgTalkForcedOff.

Here is the call graph for this function:

int cdTemp ( const char *  chLabel,
long int  IonStage,
double *  TeMean,
const char *  chWeight 
)

cdTemp

* This routine finds the mean electron temperature for any ionization stage 
* It returns 0 if it could find the species, 1 if it could not find the species.
* The first argument is a null terminated 4 char string that gives the element
* name as spelled by Cloudy.  
* The second argument is ion stage, 1 for atom, 2 for first ion, etc
* This third argument will be returned as result,
* Last parameter is either "VOLUME" or "RADIUS" to give weighting 
*
* if the ion stage is zero then the element label will have a special meaning.
* The string "21CM" is will return the 21 cm temperature.
* The string "H2  " will return the temperature weighted wrt the H2 density 
Parameters
*chLabelfour char string, null terminated, giving the element name
IonStageIonStage is ionization stage, 1 for atom, up to N+1 where N is atomic number
*TeMeanwill be temperature
*chWeighthow to weight the average, must be "VOLUME" or "RADIUS"
Todo:
2 this should have a last argument like cdIonFrac for whether or not weighting is wrt electron density

References caps(), t_elementnames::chElementNameShort, DEBUG_ENTRY, elementnames, TransitionProxy::Emis(), TransitionList::Emis(), exp10(), fprintf(), HFLines, ioQQQ, ipH1s, ipH2p, ipH_LIKE, ipHYDROGEN, iso_sp, LIMELM, mean, t_mean::MeanIon(), set_weighting(), SMALLFLOAT, EmissionProxy::TauCon(), t_mean::TempEdenMean, t_mean::TempH_21cmSpinMean, t_mean::TempHarMean, t_mean::TempIonMean, t_mean::TempMean, t_iso_sp::trans(), and trimTrailingWhiteSpace().

Referenced by DynaPunchTimeDep(), lgCheckMonitors(), optimize_func(), PrtFinal(), save_average(), save_DT(), test_cdTemp_molecules(), and timestep_next().

Here is the call graph for this function:

int cdTemp ( const string &  chLabel,
double *  TeMean,
const char *  chWeight 
)

cdTemp

* This routine finds the mean electron temperature for any ionization stage 
* It returns 0 if it could find the species, 1 if it could not find the species.
* The first argument is a string that gives the species in chemical notation,
* or a special label.
* This second argument will be returned as result.
* Last parameter is either "VOLUME" or "RADIUS" to give weighting.
*
* The special labels are the following:
* - "21CM" will return the temperature wrt the atomic hydrogen density.
* - "SPIN" will return the excitation temperature of the 21cm hyperfine states.
* - "OPTI" will return the temperature from the ratio of the 21cm and Lya
*    optical depths, see AGN3, Section 5.5.
* - "H2" will return the temperature weighted wrt the H2 density.
* - "TENE" will return the temperature weighted wrt the electron density.
* - "" will return a simple mean of the kinetic temperature.
* 
Parameters
chLabel[in]String for species or special label.
TeMean[out]Temperature result.
chWeight[in]String for weighting the average; must be "VOLUME" or "RADIUS".
Returns
0 for success, 1 for failure.

References caps(), DEBUG_ENTRY, elem_symbol_to_index(), TransitionProxy::Emis(), TransitionList::Emis(), exp10(), fprintf(), HFLines, ioQQQ, ipH1s, ipH2p, ipH_LIKE, ipHYDROGEN, isAtomicIonValid(), isMolecule(), iso_sp, isSpecies(), LIMELM, mean, t_mean::MeanIon(), t_mean::MeanMoleculeTemp(), parse_chemical(), set_weighting(), SMALLFLOAT, EmissionProxy::TauCon(), t_mean::TempEdenMean, t_mean::TempH_21cmSpinMean, t_mean::TempHarMean, t_mean::TempMean, t_iso_sp::trans(), and trimTrailingWhiteSpace().

Here is the call graph for this function:

double cdTemp_last ( )

cdTemp_last returns the temperature of the last zone on last iteration

References phycon, and t_phycon::te.

void cdTimescales ( double *  TTherm,
double *  THRecom,
double *  TH2 
)

cdTimescales returns the longest thermal, recombination, and H2 formation timescales that occurred in the previous model

Parameters
*TThermthe thermal cooling timescale
*THRecomthe hydrogen recombination timescale
*TH2the H2 formation timescale

References DEBUG_ENTRY, MAX2, t_timesc::time_H2_Dest_longest, t_timesc::time_H2_Form_longest, t_timesc::time_Hrecom_long, t_timesc::time_therm_long, and timesc.

void cdVersion ( char  chString[])

cdVersion The argument is a string with at least 8 characters that will receive a null terminated string with the version number of the code.

References Singleton< t_version >::Inst().

Here is the call graph for this function:

void cdWarnings ( FILE *  )

These routines produce lists of warnings, cautions, notes, surprises These are the routines that are called by cdErrors. Normally cdErrors and not these routines would be called by the user.

References t_warnings::chWarnln, DEBUG_ENTRY, fprintf(), and warnings.

Referenced by cdErrors(), optimize_func(), PrtComment(), SaveLineIntensity(), SaveResults(), and ShowMe().

Here is the call graph for this function:

long debugLine ( realnum  wavelength)

debugLine provides a debugging hook into the main line array loops over whole array and finds every line that matches length, the wavelength, the argument to the function put breakpoint inside if test return value is number of matches, also prints all matches

Parameters
[in]theemission line wavelength
[out]thenumber of matches

References t_LineSave::lines, LineSave, t_LineSave::nsum, t_LineSave::sig_figs, wavelength, and WavlenErrorGet().

Here is the call graph for this function:

void test_cdTemp_molecules ( )

test_cdTemp_molecules - Report temperatures for all molecules

References cdTemp(), DEBUG_ENTRY, fprintf(), getMolecules(), and ioQQQ.

Referenced by PrtFinal().

Here is the call graph for this function:

Variable Documentation

bool lgcdInitCalled

this is the value that will be set true when cdInit is called. Other routines will check that this is true when they are called, to verify that cdInit was called first. Definition is in cdInit.cpp

Referenced by cdDrive(), cdGetLineList(), cdInit(), and cdRead().