Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cddrive.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2023 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef CDDRIVE_H_
5 #define CDDRIVE_H_
6 
7 class LineID;
8 
46 void cdInit();
47 
53 void cdTalk(bool);
54 
63 void cdOutput( const string& filename = "", const char *mode = "w" );
64 void cdOutput( const string& filename, FILE* fp );
65 
74 void cdInput( const string& filename = "", const char *mode = "r" );
75 
80 void cdDepth_depth( double cdDepth[] );
81 
85 long int cdnZone();
86 
91 double cdB21cm();
92 
103 int cdRead( const string& );
104 
114 
122 void cdNoExec();
123 
129 int cdDrive();
130 
131 
132 /* The next two routines confirm that the previous calculation was ok
133  * or produce a list of error conditions */
134 
141 void cdErrors(FILE* );
142 
157 void cdNwcns(
158  long int *NumberWarnings,
159  long int *NumberCautions,
160  long int *NumberNotes,
161  long int *NumberSurprises,
162  long int *NumberTempFailures,
163  long int *NumberPresFailures,
164  long int *NumberIonFailures,
165  long int *NumberNeFailures );
166 
169 void cdReasonGeo(FILE*);
170 
175 void cdWarnings(FILE*);
178 void cdCautions(FILE*);
180 void cdSurprises(FILE*);
182 void cdNotes(FILE*);
183 
184 /***********************************************************
185  *
186  * The next routines examine the predictions of the previous model
187  *
188  ***********************************************************/
189 
211 long int cdLine(const string& chLabel,
213  double *relint,
214  double *absint,
215  // 0 is intrinsic,
216  // 1 emergent
217  // 2 is intrinsic cumulative,
218  // 3 emergent cumulative
219  int LineType = 0 );
220 
227 long int cdLine(
228  const LineID& line,
229  /* linear intensity relative to normalization line*/
230  double *relint,
231  /* log of luminosity or intensity of line */
232  double *absint ,
233  // 0 is intrinsic,
234  // 1 emergent
235  // 2 is intrinsic cumulative,
236  // 3 emergent cumulative
237  int LineType = 0 );
238 
245 void cdLine_ip(long int ipLine,
246  double *relint,
247  double *absint ,
248  // 0 is intrinsic,
249  // 1 emergent
250  // 2 is intrinsic cumulative,
251  // 3 emergent cumulative
252  int LineType = 0 );
253 
282 int cdColm(const char*, long, double* );
283 
287 double cdH2_colden( long iVib , long iRot );
288 
304 void cdEmis(
305  const char *chLabel,
307  double *emiss,
308  bool lgEmergent );
309 
310 void cdEmis(
311  const LineID& line,
312  double *emiss,
313  bool lgEmergent );
314 
320 void cdEmis_ip(
321  long int ipLine,
322  double *emiss ,
323  bool lgEmergent);
324 
328 double cdCooling_last();
329 
333 double cdHeating_last();
334 
336 double cdEDEN_last();
337 
344 void cdPressure_last(
345  double *TotalPressure,
346  double *GasPressure,
347  double *RadiationPressure);
348 
359 void cdPressure_depth(
360  double TotalPressure[],
361  double GasPressure[],
362  double RadiationPressure[]);
363 
367 double cdTemp_last();
368 
389 int cdIonFrac(
390  const char *chLabel,
391  long int IonStage,
392  double *fracin,
393  const char *chWeight ,
394  bool lgDensity );
395 
400 void cdVersion(char chString[] );
401 
406 void cdDate(char chString[] );
407 
408 /* The following pairs of routines can keep track of the execution time for one model -
409  * cdSetExecTime called first (in cdInit, not by the user) to initialize timer.
410  * When cdExecTime is called it will return the elapsed time in seconds
411  * since cdInit called cdSetExecTime*/
412 
414 void cdSetExecTime();
415 
418 double cdExecTime();
419 
444 long int cdGetLineList(
445  const string& chFile,
446  vector<LineID>& lineids);
447 
455 void cdTimescales(
456  double *TTherm ,
457  double *THRecom ,
458  double *TH2 );
459 
489 void cdSPEC2(
490  int Option,
491  realnum ReturnedSpectrum[] );
492 
510 int cdTemp(
511  const char *chLabel,
512  long int IonStage,
513  double *TeMean,
514  const char *chWeight );
515 
541 int cdTemp(
542  const string &chLabel,
543  double *TeMean,
544  const char *chWeight );
545 
547 void test_cdTemp_molecules();
548 
549 
554 void cdPrintCommands( FILE * );
555 
557 void cdClosePunchFiles();
558 
572 long int cdH2_Line(
573  /* indices for the upper level */
574  long int iElecHi,
575  long int iVibHi ,
576  long int iRotHi ,
577  /* indices for lower level */
578  long int iElecLo,
579  long int iVibLo ,
580  long int iRotLo ,
581  /* linear intensity relative to normalization line*/
582  double *relint,
583  /* log of luminosity or intensity of line */
584  double *absint );
585 
586 // Maximum memory used for the current process (in kB)
587 long cdMemory();
588 
589 /* none of the following are generally needed */
590 
594 extern bool lgcdInitCalled;
595 
596 #endif /* CDDRIVE_H_ */
long int cdGetLineList(const string &chFile, vector< LineID > &lineids)
Definition: cdgetlinelist.cpp:11
void cdDate(char chString[])
Definition: cddrive.cpp:327
long debugLine(realnum wavelength)
Definition: cddrive.cpp:1021
void cdInit()
Definition: cdinit.cpp:49
void cdPressure_depth(double TotalPressure[], double GasPressure[], double RadiationPressure[])
Definition: cddrive.cpp:808
void cdEmis_ip(long int ipLine, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:544
void cdDepth_depth(double cdDepth[])
Definition: cddrive.cpp:783
long cdMemory()
Definition: cddrive.cpp:468
static vector< long > ipLine
Definition: prt_linesum.cpp:12
void cdTimescales(double *TTherm, double *THRecom, double *TH2)
Definition: cddrive.cpp:225
void cdSPEC2(int Option, realnum ReturnedSpectrum[])
Definition: save_do.cpp:149
double cdCooling_last()
Definition: cddrive.cpp:299
Definition: lines.h:14
void cdReasonGeo(FILE *)
Definition: cddrive.cpp:177
void cdNoExec()
Definition: cddrive.cpp:368
bool lgcdInitCalled
Definition: cdinit.cpp:29
void cdVersion(char chString[])
Definition: cddrive.cpp:312
string chLabel
Definition: lines.h:17
long int cdnZone()
Definition: cddrive.cpp:856
double cdB21cm()
Definition: cddrive.cpp:1241
double cdTemp_last()
Definition: cddrive.cpp:868
void cdEmis(const char *chLabel, realnum wavelength, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:516
double cdH2_colden(long iVib, long iRot)
Definition: mole_h2.cpp:2310
void cdTalk(bool)
Definition: cddrive.cpp:1228
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)
Definition: mole_h2_io.cpp:1847
void cdSetExecTime()
Definition: cddrive.cpp:436
double cdExecTime()
Definition: cddrive.cpp:443
float realnum
Definition: cddefines.h:127
int cdColm(const char *, long, double *)
void cdWarnings(FILE *)
Definition: cddrive.cpp:194
static vector< LineID > lineids
Definition: monitor_results.cpp:58
long int cdLine(const string &chLabel, realnum wavelength, double *relint, double *absint, int LineType=0)
Definition: cddrive.cpp:1054
void cdSurprises(FILE *)
Definition: cddrive.cpp:257
Definition: parser.h:885
void test_cdTemp_molecules()
Definition: cddrive.cpp:1538
int cdIonFrac(const char *chLabel, long int IonStage, double *fracin, const char *chWeight, bool lgDensity)
Definition: cddrive.cpp:910
void cdPressure_last(double *TotalPressure, double *GasPressure, double *RadiationPressure)
Definition: cddrive.cpp:835
void cdNotes(FILE *)
Definition: cddrive.cpp:284
int cdRead(const string &)
Definition: cddrive.cpp:1576
void cdLine_ip(long int ipLine, double *relint, double *absint, int LineType=0)
Definition: cddrive.cpp:1098
static vector< realnum > wavelength
Definition: monitor_results.cpp:79
void cdClosePunchFiles()
Definition: cddrive.cpp:1725
void cdInput(const string &filename="", const char *mode="r")
Definition: cddrive.cpp:1203
void cdErrors(FILE *)
Definition: cddrive.cpp:721
double cdHeating_last()
Definition: cddrive.cpp:341
int cdDrive()
Definition: cddrive.cpp:81
int cdTemp(const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
Definition: cddrive.cpp:1281
void cdOutput(const string &filename="", const char *mode="w")
Definition: cddrive.cpp:1180
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)
Definition: cddrive.cpp:1148
double cdEDEN_last()
Definition: cddrive.cpp:354
void cdPrintCommands(FILE *)
Definition: cddrive.cpp:492
void cdCautions(FILE *)
Definition: cddrive.cpp:211