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-2013 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 
109 void cdPrtWL( FILE *io , realnum wl );
110 
120 
128 void cdNoExec();
129 
135 int cdDrive();
136 
137 
138 /* The next two routines confirm that the previous calculation was ok
139  * or produce a list of error conditions */
140 
147 void cdErrors(FILE* );
148 
164 void cdNwcns(
165  bool *lgAbort ,
166  long int *NumberWarnings,
167  long int *NumberCautions,
168  long int *NumberNotes,
169  long int *NumberSurprises,
170  long int *NumberTempFailures,
171  long int *NumberPresFailures,
172  long int *NumberIonFailures,
173  long int *NumberNeFailures );
174 
177 void cdReasonGeo(FILE*);
178 
183 void cdWarnings(FILE*);
186 void cdCautions(FILE*);
188 void cdSurprises(FILE*);
190 void cdNotes(FILE*);
191 
192 /***********************************************************
193  *
194  * The next routines examine the predictions of the previous model
195  *
196  ***********************************************************/
197 
219 long int cdLine(
220  const char *chLabel,
222  double *relint,
223  double *absint);
224 
225 long int cdLine(
226  const char *chLabel,
228  double *relint,
229  double *absint,
230  // 0 is intrinsic,
231  // 1 emergent
232  // 2 is intrinsic cumulative,
233  // 3 emergent cumulative
234  int LineType );
235 
236 
243 void cdLine_ip(long int ipLine,
244  double *relint,
245  double *absint ,
246  // 0 is intrinsic,
247  // 1 emergent
248  // 2 is intrinsic cumulative,
249  // 3 emergent cumulative
250  int LineType );
251 void cdLine_ip(long int ipLine,
252  double *relint,
253  double *absint );
254 
283 int cdColm(const char*, long, double* );
284 
288 double cdH2_colden( long iVib , long iRot );
289 
305 // this version returns intrinsic
306 long int cdEmis(
307  char *chLabel,
309  double *emiss );
310 
311 long int cdEmis(
312  char *chLabel,
314  double *emiss ,
315  bool lgEmergent );
316 
317 
323 void cdEmis_ip(
324  long int ipLine,
325  double *emiss ,
326  bool lgEmergent);
327 
331 double cdCooling_last();
332 
336 double cdHeating_last();
337 
339 double cdEDEN_last();
340 
347 void cdPressure_last(
348  double *TotalPressure,
349  double *GasPressure,
350  double *RadiationPressure);
351 
362 void cdPressure_depth(
363  double TotalPressure[],
364  double GasPressure[],
365  double RadiationPressure[]);
366 
370 double cdTemp_last();
371 
392 int cdIonFrac(
393  const char *chLabel,
394  long int IonStage,
395  double *fracin,
396  const char *chWeight ,
397  bool lgDensity );
398 
403 void cdVersion(char chString[] );
404 
409 void cdDate(char chString[] );
410 
411 /* The following pairs of routines can keep track of the execution time for one model -
412  * cdSetExecTime called first (in cdInit, not by the user) to initialize timer.
413  * When cdExecTime is called it will return the elapsed time in seconds
414  * since cdInit called cdSetExecTime*/
415 
417 void cdSetExecTime();
418 
421 double cdExecTime();
422 
449 long int cdGetLineList(
450  const char chFile[],
451  vector<char*>& chLabels,
452  vector<realnum>& wl);
453 
461 void cdTimescales(
462  double *TTherm ,
463  double *THRecom ,
464  double *TH2 );
465 
466 /* ******************************************************************
467  *
468  * next part deals with FeII bands. There are two types, the tabulated
469  * band that are defined in FeII_bands.ini, and the psuedo-continuum bins
470  * that are generatedby the code in FeIIContCreate.
471  * nFeIIConBins is number of continuum bins in FeII_Cont
472  * nFeIIBands is number of bands in FeII_bands.ini, and are saved in FeII_Bands
473  * the bands are created by hand and the entries in FeII_bands.ini are
474  * meant to be created by a person */
475 
476 /* the declarations for the next four are in FeIILevelPops.c */
478 extern long int nFeIIBands;
479 
481 extern long int nFeIIConBins;
482 
483 /* band wavelength, lower and upper bounds, in vacuum Angstroms */
487 extern realnum **FeII_Bands;
488 
489 /* continuum wavelengths, lower and upper bounds, in vacuum Angstroms
490  * third is integrated intensity */
493 extern realnum **FeII_Cont;
494 
495 
522 void cdSPEC(
523  int Option ,
524  long int nEnergy ,
525  double ReturnedSpectrum[] );
526 
527 
551 void cdSPEC2(
552  int Option ,
553  long int nEnergy ,
554  long int ipLoEnergy,
555  long int ipHiEnergy,
556  realnum ReturnedSpectrum[] );
557 
575 int cdTemp(
576  const char *chLabel,
577  long int IonStage,
578  double *TeMean,
579  const char *chWeight );
580 
585 void cdPrintCommands( FILE * );
586 
588 void cdClosePunchFiles();
589 
603 long int cdH2_Line(
604  /* indices for the upper level */
605  long int iElecHi,
606  long int iVibHi ,
607  long int iRotHi ,
608  /* indices for lower level */
609  long int iElecLo,
610  long int iVibLo ,
611  long int iRotLo ,
612  /* linear intensity relative to normalization line*/
613  double *relint,
614  /* log of luminosity or intensity of line */
615  double *absint );
616 
617 /* none of the following are generally needed */
618 
622 extern bool lgcdInitCalled;
623 
624 #endif /* CDDRIVE_H_ */
void cdDate(char chString[])
Definition: cddrive.cpp:361
void cdNotes(FILE *ioOUT)
Definition: cddrive.cpp:309
void cdLine_ip(long int ipLine, double *relint, double *absint)
Definition: cddrive.cpp:1414
void cdInit()
Definition: cdinit.cpp:115
void cdPrintCommands(FILE *ioOUT)
Definition: cddrive.cpp:513
double cdHeating_last()
Definition: cddrive.cpp:376
void cdPressure_last(double *PresTotal, double *PresGas, double *PresRad)
Definition: cddrive.cpp:1028
int cdDrive()
Definition: cddrive.cpp:77
static realnum * wavelength
void cdCautions(FILE *ioOUT)
Definition: cddrive.cpp:226
int cdIonFrac(const char *chLabel, long int IonStage, double *fracin, const char *chWeight, bool lgDensity)
Definition: cddrive.cpp:1072
void cdWarnings(FILE *ioPNT)
Definition: cddrive.cpp:198
void cdInput(const char *filename, const char *mode)
Definition: cddrive.cpp:1530
void cdTimescales(double *TTherm, double *THRecom, double *TH2)
Definition: cddrive.cpp:249
int cdTemp(const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
Definition: cddrive.cpp:1602
void cdDepth_depth(double cdDepth[])
Definition: cddrive.cpp:976
bool lgcdInitCalled
Definition: cdinit.cpp:34
int cdRead(const char *chInputLine)
Definition: cddrive.cpp:1752
void cdSPEC2(int Option, long int nEnergy, long int ipLoEnergy, long int ipHiEnergy, realnum ReturnedSpectrum[])
void cdNoExec()
Definition: cddrive.cpp:404
void cdEmis_ip(long int ipLine, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:613
long int cdGetLineList(const char chFile[], vector< char * > &chLabels, vector< realnum > &wl)
double cdH2_colden(long iVib, long iRot)
Definition: mole_h2.cpp:2301
void cdOutput(const char *filename, const char *mode)
Definition: cddrive.cpp:1517
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:474
long int cdEmis(char *chLabel, realnum wavelength, double *emiss)
Definition: cddrive.cpp:533
long debugLine(realnum wavelength)
Definition: cddrive.cpp:1194
float realnum
Definition: cddefines.h:107
void cdSPEC(int Option, long int nEnergy, double ReturnedSpectrum[])
Definition: cdspec.cpp:21
void cdPressure_depth(double TotalPressure[], double GasPressure[], double RadiationPressure[])
Definition: cddrive.cpp:1001
long int nFeIIBands
Definition: atom_feii.cpp:116
double cdExecTime()
Definition: cddrive.cpp:481
double cdTemp_last()
Definition: cddrive.cpp:1061
double cdEDEN_last()
Definition: cddrive.cpp:390
double cdB21cm()
Definition: cddrive.cpp:1561
long int cdnZone()
Definition: cddrive.cpp:1049
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
Definition: cddrive.cpp:1228
void cdClosePunchFiles()
Definition: cddrive.cpp:1953
int cdColm(const char *chLabel, long int ion, double *theocl)
Definition: cddrive.cpp:636
void cdErrors(FILE *ioOUT)
Definition: cddrive.cpp:910
void cdVersion(char chString[])
Definition: cddrive.cpp:346
double cdCooling_last()
Definition: cddrive.cpp:333
void cdTalk(bool lgTOn)
Definition: cddrive.cpp:1548
void cdSurprises(FILE *ioOUT)
Definition: cddrive.cpp:282
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:1481
realnum ** FeII_Cont
Definition: atom_feii.cpp:113
void cdReasonGeo(FILE *ioOUT)
Definition: cddrive.cpp:175
realnum ** FeII_Bands
Definition: atom_feii.cpp:106
long int nFeIIConBins
Definition: atom_feii.cpp:119
static long int * ipLine
Definition: prt_linesum.cpp:15
void cdPrtWL(FILE *io, realnum wl)
Definition: cddrive.cpp:157
bool lgAbort
Definition: cddefines.cpp:10