cloudy  trunk
 All Data Structures 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-2022 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 
44 void cdInit();
45 
51 void cdTalk(bool);
52 
61 void cdOutput( const string& filename = "", const char *mode = "w" );
62 void cdOutput( const string& filename, FILE* fp );
63 
72 void cdInput( const string& filename = "", const char *mode = "r" );
73 
78 void cdDepth_depth( double cdDepth[] );
79 
83 long int cdnZone();
84 
89 double cdB21cm();
90 
101 int cdRead( const char* );
102 
112 
120 void cdNoExec();
121 
127 int cdDrive();
128 
129 
130 /* The next two routines confirm that the previous calculation was ok
131  * or produce a list of error conditions */
132 
139 void cdErrors(FILE* );
140 
156 void cdNwcns(
157  bool *lgAbort ,
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(
212  const char *chLabel,
214  double *relint,
215  double *absint);
216 
217 long int cdLine(
218  const char *chLabel,
220  double *relint,
221  double *absint,
222  // 0 is intrinsic,
223  // 1 emergent
224  // 2 is intrinsic cumulative,
225  // 3 emergent cumulative
226  int LineType );
227 
228 
235 void cdLine_ip(long int ipLine,
236  double *relint,
237  double *absint ,
238  // 0 is intrinsic,
239  // 1 emergent
240  // 2 is intrinsic cumulative,
241  // 3 emergent cumulative
242  int LineType );
243 void cdLine_ip(long int ipLine,
244  double *relint,
245  double *absint );
246 
275 int cdColm(const char*, long, double* );
276 
280 double cdH2_colden( long iVib , long iRot );
281 
297 void cdEmis(
298  const char *chLabel,
300  double *emiss ,
301  bool lgEmergent );
302 
308 void cdEmis_ip(
309  long int ipLine,
310  double *emiss ,
311  bool lgEmergent);
312 
316 double cdCooling_last();
317 
321 double cdHeating_last();
322 
324 double cdEDEN_last();
325 
332 void cdPressure_last(
333  double *TotalPressure,
334  double *GasPressure,
335  double *RadiationPressure);
336 
347 void cdPressure_depth(
348  double TotalPressure[],
349  double GasPressure[],
350  double RadiationPressure[]);
351 
355 double cdTemp_last();
356 
377 int cdIonFrac(
378  const char *chLabel,
379  long int IonStage,
380  double *fracin,
381  const char *chWeight ,
382  bool lgDensity );
383 
388 void cdVersion(char chString[] );
389 
394 void cdDate(char chString[] );
395 
396 /* The following pairs of routines can keep track of the execution time for one model -
397  * cdSetExecTime called first (in cdInit, not by the user) to initialize timer.
398  * When cdExecTime is called it will return the elapsed time in seconds
399  * since cdInit called cdSetExecTime*/
400 
402 void cdSetExecTime();
403 
406 double cdExecTime();
407 
434 long int cdGetLineList(
435  const char chFile[],
436  vector<string>& chLabels,
437  vector<realnum>& wl);
438 
446 void cdTimescales(
447  double *TTherm ,
448  double *THRecom ,
449  double *TH2 );
450 
451 /* ******************************************************************
452  *
453  * next part deals with FeII bands. There are two types, the tabulated
454  * band that are defined in FeII_bands.ini, and the psuedo-continuum bins
455  * that are generatedby the code in FeIIContCreate.
456  * nFeIIConBins is number of continuum bins in FeII_Cont
457  * nFeIIBands is number of bands in FeII_bands.ini, and are saved in FeII_Bands
458  * the bands are created by hand and the entries in FeII_bands.ini are
459  * meant to be created by a person */
460 
461 /* the declarations for the next four are in FeIILevelPops.c */
463 extern long int nFeIIBands;
464 
466 extern long int nFeIIConBins;
467 
468 /* band wavelength, lower and upper bounds, in vacuum Angstroms */
472 extern realnum **FeII_Bands;
473 
474 /* continuum wavelengths, lower and upper bounds, in vacuum Angstroms
475  * third is integrated intensity */
478 extern realnum **FeII_Cont;
479 
509 void cdSPEC2(
510  int Option,
511  realnum ReturnedSpectrum[] );
512 
530 int cdTemp(
531  const char *chLabel,
532  long int IonStage,
533  double *TeMean,
534  const char *chWeight );
535 
540 void cdPrintCommands( FILE * );
541 
543 void cdClosePunchFiles();
544 
558 long int cdH2_Line(
559  /* indices for the upper level */
560  long int iElecHi,
561  long int iVibHi ,
562  long int iRotHi ,
563  /* indices for lower level */
564  long int iElecLo,
565  long int iVibLo ,
566  long int iRotLo ,
567  /* linear intensity relative to normalization line*/
568  double *relint,
569  /* log of luminosity or intensity of line */
570  double *absint );
571 
572 // Maximum memory used for the current process (in kB)
573 long cdMemory();
574 
575 /* none of the following are generally needed */
576 
580 extern bool lgcdInitCalled;
581 
582 #endif /* CDDRIVE_H_ */
void cdDate(char chString[])
Definition: cddrive.cpp:362
void cdNotes(FILE *ioOUT)
Definition: cddrive.cpp:310
void cdLine_ip(long int ipLine, double *relint, double *absint)
Definition: cddrive.cpp:1110
long int nFeIIConBins
void cdInit()
Definition: cdinit.cpp:46
void cdPrintCommands(FILE *ioOUT)
Definition: cddrive.cpp:527
double cdHeating_last()
Definition: cddrive.cpp:376
void cdPressure_last(double *PresTotal, double *PresGas, double *PresRad)
Definition: cddrive.cpp:865
int cdDrive()
Definition: cddrive.cpp:81
void cdCautions(FILE *ioOUT)
Definition: cddrive.cpp:219
int cdIonFrac(const char *chLabel, long int IonStage, double *fracin, const char *chWeight, bool lgDensity)
Definition: cddrive.cpp:909
void cdWarnings(FILE *ioPNT)
Definition: cddrive.cpp:192
void cdTimescales(double *TTherm, double *THRecom, double *TH2)
Definition: cddrive.cpp:242
int cdTemp(const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
Definition: cddrive.cpp:1311
void cdDepth_depth(double cdDepth[])
Definition: cddrive.cpp:813
void cdSPEC2(int Option, realnum ReturnedSpectrum[])
Definition: save_do.cpp:148
long int nFeIIBands
long int cdGetLineList(const char chFile[], vector< string > &chLabels, vector< realnum > &wl)
bool lgcdInitCalled
Definition: cdinit.cpp:27
int cdRead(const char *chInputLine)
Definition: cddrive.cpp:1466
realnum ** FeII_Cont
void cdNoExec()
Definition: cddrive.cpp:403
void cdEmis_ip(long int ipLine, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:570
void cdInput(const string &filename, const char *mode)
Definition: cddrive.cpp:1232
double cdH2_colden(long iVib, long iRot)
Definition: mole_h2.cpp:2320
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)
void cdSetExecTime()
Definition: cddrive.cpp:471
long debugLine(realnum wavelength)
Definition: cddrive.cpp:1032
float realnum
Definition: cddefines.h:124
void cdPressure_depth(double TotalPressure[], double GasPressure[], double RadiationPressure[])
Definition: cddrive.cpp:838
double cdExecTime()
Definition: cddrive.cpp:478
double cdTemp_last()
Definition: cddrive.cpp:898
Definition: parser.h:545
double cdEDEN_last()
Definition: cddrive.cpp:389
double cdB21cm()
Definition: cddrive.cpp:1270
long int cdnZone()
Definition: cddrive.cpp:886
void cdEmis(const char *chLabel, realnum wavelength, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:552
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
Definition: cddrive.cpp:1067
void cdClosePunchFiles()
Definition: cddrive.cpp:1644
int cdColm(const char *chLabel, long int ion, double *theocl)
Definition: cddrive.cpp:592
void cdErrors(FILE *ioOUT)
Definition: cddrive.cpp:747
long cdMemory()
Definition: cddrive.cpp:503
void cdVersion(char chString[])
Definition: cddrive.cpp:347
double cdCooling_last()
Definition: cddrive.cpp:334
static vector< realnum > wavelength
void cdTalk(bool lgTOn)
Definition: cddrive.cpp:1257
realnum ** FeII_Bands
void cdOutput(const string &filename, const char *mode)
Definition: cddrive.cpp:1209
void cdSurprises(FILE *ioOUT)
Definition: cddrive.cpp:274
void cdNwcns(bool *lgAbort_ret, 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:1173
void cdReasonGeo(FILE *ioOUT)
Definition: cddrive.cpp:170
static long int * ipLine
Definition: prt_linesum.cpp:14
bool lgAbort
Definition: cddefines.cpp:10