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-2017 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 char* filename = "", const char *mode = "w" );
62 
71 void cdInput( const char* filename = "", const char *mode = "r" );
72 
77 void cdDepth_depth( double cdDepth[] );
78 
82 long int cdnZone();
83 
88 double cdB21cm();
89 
100 int cdRead( const char* );
101 
111 
119 void cdNoExec();
120 
126 int cdDrive();
127 
128 
129 /* The next two routines confirm that the previous calculation was ok
130  * or produce a list of error conditions */
131 
138 void cdErrors(FILE* );
139 
155 void cdNwcns(
156  bool *lgAbort ,
157  long int *NumberWarnings,
158  long int *NumberCautions,
159  long int *NumberNotes,
160  long int *NumberSurprises,
161  long int *NumberTempFailures,
162  long int *NumberPresFailures,
163  long int *NumberIonFailures,
164  long int *NumberNeFailures );
165 
168 void cdReasonGeo(FILE*);
169 
174 void cdWarnings(FILE*);
177 void cdCautions(FILE*);
179 void cdSurprises(FILE*);
181 void cdNotes(FILE*);
182 
183 /***********************************************************
184  *
185  * The next routines examine the predictions of the previous model
186  *
187  ***********************************************************/
188 
210 long int cdLine(
211  const char *chLabel,
213  double *relint,
214  double *absint);
215 
216 long int cdLine(
217  const char *chLabel,
219  double *relint,
220  double *absint,
221  // 0 is intrinsic,
222  // 1 emergent
223  // 2 is intrinsic cumulative,
224  // 3 emergent cumulative
225  int LineType );
226 
227 
234 void cdLine_ip(long int ipLine,
235  double *relint,
236  double *absint ,
237  // 0 is intrinsic,
238  // 1 emergent
239  // 2 is intrinsic cumulative,
240  // 3 emergent cumulative
241  int LineType );
242 void cdLine_ip(long int ipLine,
243  double *relint,
244  double *absint );
245 
274 int cdColm(const char*, long, double* );
275 
279 double cdH2_colden( long iVib , long iRot );
280 
296 void cdEmis(
297  const char *chLabel,
299  double *emiss ,
300  bool lgEmergent );
301 
307 void cdEmis_ip(
308  long int ipLine,
309  double *emiss ,
310  bool lgEmergent);
311 
315 double cdCooling_last();
316 
320 double cdHeating_last();
321 
323 double cdEDEN_last();
324 
331 void cdPressure_last(
332  double *TotalPressure,
333  double *GasPressure,
334  double *RadiationPressure);
335 
346 void cdPressure_depth(
347  double TotalPressure[],
348  double GasPressure[],
349  double RadiationPressure[]);
350 
354 double cdTemp_last();
355 
376 int cdIonFrac(
377  const char *chLabel,
378  long int IonStage,
379  double *fracin,
380  const char *chWeight ,
381  bool lgDensity );
382 
387 void cdVersion(char chString[] );
388 
393 void cdDate(char chString[] );
394 
395 /* The following pairs of routines can keep track of the execution time for one model -
396  * cdSetExecTime called first (in cdInit, not by the user) to initialize timer.
397  * When cdExecTime is called it will return the elapsed time in seconds
398  * since cdInit called cdSetExecTime*/
399 
401 void cdSetExecTime();
402 
405 double cdExecTime();
406 
433 long int cdGetLineList(
434  const char chFile[],
435  vector<string>& chLabels,
436  vector<realnum>& wl);
437 
445 void cdTimescales(
446  double *TTherm ,
447  double *THRecom ,
448  double *TH2 );
449 
450 /* ******************************************************************
451  *
452  * next part deals with FeII bands. There are two types, the tabulated
453  * band that are defined in FeII_bands.ini, and the psuedo-continuum bins
454  * that are generatedby the code in FeIIContCreate.
455  * nFeIIConBins is number of continuum bins in FeII_Cont
456  * nFeIIBands is number of bands in FeII_bands.ini, and are saved in FeII_Bands
457  * the bands are created by hand and the entries in FeII_bands.ini are
458  * meant to be created by a person */
459 
460 /* the declarations for the next four are in FeIILevelPops.c */
462 extern long int nFeIIBands;
463 
465 extern long int nFeIIConBins;
466 
467 /* band wavelength, lower and upper bounds, in vacuum Angstroms */
471 extern realnum **FeII_Bands;
472 
473 /* continuum wavelengths, lower and upper bounds, in vacuum Angstroms
474  * third is integrated intensity */
477 extern realnum **FeII_Cont;
478 
505 void cdSPEC(
506  int Option ,
507  long int nEnergy ,
508  double ReturnedSpectrum[] );
509 
510 
534 void cdSPEC2(
535  int Option ,
536  long int nEnergy ,
537  long int ipLoEnergy,
538  long int ipHiEnergy,
539  realnum ReturnedSpectrum[] );
540 
558 int cdTemp(
559  const char *chLabel,
560  long int IonStage,
561  double *TeMean,
562  const char *chWeight );
563 
568 void cdPrintCommands( FILE * );
569 
571 void cdClosePunchFiles();
572 
586 long int cdH2_Line(
587  /* indices for the upper level */
588  long int iElecHi,
589  long int iVibHi ,
590  long int iRotHi ,
591  /* indices for lower level */
592  long int iElecLo,
593  long int iVibLo ,
594  long int iRotLo ,
595  /* linear intensity relative to normalization line*/
596  double *relint,
597  /* log of luminosity or intensity of line */
598  double *absint );
599 
600 // Maximum memory used for the current process (in kB)
601 long cdMemory();
602 
603 /* none of the following are generally needed */
604 
608 extern bool lgcdInitCalled;
609 
610 #endif /* CDDRIVE_H_ */
void cdDate(char chString[])
Definition: cddrive.cpp:365
void cdNotes(FILE *ioOUT)
Definition: cddrive.cpp:313
void cdLine_ip(long int ipLine, double *relint, double *absint)
Definition: cddrive.cpp:1112
long int nFeIIConBins
void cdInit()
Definition: cdinit.cpp:45
void cdPrintCommands(FILE *ioOUT)
Definition: cddrive.cpp:532
double cdHeating_last()
Definition: cddrive.cpp:380
void cdPressure_last(double *PresTotal, double *PresGas, double *PresRad)
Definition: cddrive.cpp:868
int cdDrive()
Definition: cddrive.cpp:79
void cdCautions(FILE *ioOUT)
Definition: cddrive.cpp:220
int cdIonFrac(const char *chLabel, long int IonStage, double *fracin, const char *chWeight, bool lgDensity)
Definition: cddrive.cpp:912
void cdWarnings(FILE *ioPNT)
Definition: cddrive.cpp:192
void cdInput(const char *filename, const char *mode)
Definition: cddrive.cpp:1224
void cdTimescales(double *TTherm, double *THRecom, double *TH2)
Definition: cddrive.cpp:243
int cdTemp(const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
Definition: cddrive.cpp:1296
void cdDepth_depth(double cdDepth[])
Definition: cddrive.cpp:816
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:1450
realnum ** FeII_Cont
void cdSPEC2(int Option, long int nEnergy, long int ipLoEnergy, long int ipHiEnergy, realnum ReturnedSpectrum[])
void cdNoExec()
Definition: cddrive.cpp:408
void cdEmis_ip(long int ipLine, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:573
double cdH2_colden(long iVib, long iRot)
Definition: mole_h2.cpp:2312
void cdOutput(const char *filename, const char *mode)
Definition: cddrive.cpp:1211
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:476
long debugLine(realnum wavelength)
Definition: cddrive.cpp:1034
float realnum
Definition: cddefines.h:124
void cdSPEC(int Option, long int nEnergy, double ReturnedSpectrum[])
Definition: cdspec.cpp:20
void cdPressure_depth(double TotalPressure[], double GasPressure[], double RadiationPressure[])
Definition: cddrive.cpp:841
double cdExecTime()
Definition: cddrive.cpp:483
double cdTemp_last()
Definition: cddrive.cpp:901
Definition: parser.h:539
double cdEDEN_last()
Definition: cddrive.cpp:394
double cdB21cm()
Definition: cddrive.cpp:1255
long int cdnZone()
Definition: cddrive.cpp:889
void cdEmis(const char *chLabel, realnum wavelength, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:555
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
Definition: cddrive.cpp:1069
void cdClosePunchFiles()
Definition: cddrive.cpp:1663
int cdColm(const char *chLabel, long int ion, double *theocl)
Definition: cddrive.cpp:595
void cdErrors(FILE *ioOUT)
Definition: cddrive.cpp:750
long cdMemory()
Definition: cddrive.cpp:508
void cdVersion(char chString[])
Definition: cddrive.cpp:350
double cdCooling_last()
Definition: cddrive.cpp:337
static vector< realnum > wavelength
void cdTalk(bool lgTOn)
Definition: cddrive.cpp:1242
realnum ** FeII_Bands
void cdSurprises(FILE *ioOUT)
Definition: cddrive.cpp:276
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:1175
void cdReasonGeo(FILE *ioOUT)
Definition: cddrive.cpp:169
static long int * ipLine
Definition: prt_linesum.cpp:14
bool lgAbort
Definition: cddefines.cpp:10