cloudy  trunk
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_ */
cdLine_ip
void cdLine_ip(long int ipLine, double *relint, double *absint, int LineType)
Definition: cddrive.cpp:1424
cdEmis
long int cdEmis(char *chLabel, realnum wavelength, double *emiss)
Definition: cddrive.cpp:533
lgAbort
bool lgAbort
Definition: cddefines.cpp:10
cdEmis_ip
void cdEmis_ip(long int ipLine, double *emiss, bool lgEmergent)
Definition: cddrive.cpp:613
debugLine
long debugLine(realnum wavelength)
Definition: cddrive.cpp:1194
cdTimescales
void cdTimescales(double *TTherm, double *THRecom, double *TH2)
Definition: cddrive.cpp:249
nFeIIConBins
long int nFeIIConBins
Definition: atom_feii.cpp:119
cdInput
void cdInput(const char *filename="", const char *mode="r")
Definition: cddrive.cpp:1530
realnum
float realnum
Definition: cddefines.h:103
cdCautions
void cdCautions(FILE *)
Definition: cddrive.cpp:226
cdPressure_depth
void cdPressure_depth(double TotalPressure[], double GasPressure[], double RadiationPressure[])
Definition: cddrive.cpp:1001
cdOutput
void cdOutput(const char *filename="", const char *mode="w")
Definition: cddrive.cpp:1517
cdDepth_depth
void cdDepth_depth(double cdDepth[])
Definition: cddrive.cpp:976
cdCooling_last
double cdCooling_last()
Definition: cddrive.cpp:333
lgcdInitCalled
bool lgcdInitCalled
Definition: cdinit.cpp:34
cdTemp_last
double cdTemp_last()
Definition: cddrive.cpp:1061
cdnZone
long int cdnZone()
Definition: cddrive.cpp:1049
nFeIIBands
long int nFeIIBands
Definition: atom_feii.cpp:116
cdB21cm
double cdB21cm()
Definition: cddrive.cpp:1561
cdVersion
void cdVersion(char chString[])
Definition: cddrive.cpp:346
FeII_Cont
realnum ** FeII_Cont
Definition: atom_feii.cpp:113
cdSPEC2
void cdSPEC2(int Option, long int nEnergy, long int ipLoEnergy, long int ipHiEnergy, realnum ReturnedSpectrum[])
cdH2_colden
double cdH2_colden(long iVib, long iRot)
Definition: mole_h2.cpp:2318
cdTalk
void cdTalk(bool)
Definition: cddrive.cpp:1548
ipLine
static long int * ipLine
Definition: prt_linesum.cpp:15
cdReasonGeo
void cdReasonGeo(FILE *)
Definition: cddrive.cpp:175
cdNoExec
void cdNoExec()
Definition: cddrive.cpp:404
cdH2_Line
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:1913
cdPressure_last
void cdPressure_last(double *TotalPressure, double *GasPressure, double *RadiationPressure)
Definition: cddrive.cpp:1028
cdGetLineList
long int cdGetLineList(const char chFile[], vector< char * > &chLabels, vector< realnum > &wl)
Definition: cdgetlinelist.cpp:10
cdSPEC
void cdSPEC(int Option, long int nEnergy, double ReturnedSpectrum[])
Definition: cdspec.cpp:21
cdColm
int cdColm(const char *, long, double *)
cdWarnings
void cdWarnings(FILE *)
Definition: cddrive.cpp:198
cdRead
int cdRead(const char *)
Definition: cddrive.cpp:1752
cdIonFrac
int cdIonFrac(const char *chLabel, long int IonStage, double *fracin, const char *chWeight, bool lgDensity)
Definition: cddrive.cpp:1072
cdSetExecTime
void cdSetExecTime()
Definition: cddrive.cpp:474
cdNotes
void cdNotes(FILE *)
Definition: cddrive.cpp:309
cdExecTime
double cdExecTime()
Definition: cddrive.cpp:481
cdErrors
void cdErrors(FILE *)
Definition: cddrive.cpp:910
cdHeating_last
double cdHeating_last()
Definition: cddrive.cpp:376
cdSurprises
void cdSurprises(FILE *)
Definition: cddrive.cpp:282
cdDrive
int cdDrive()
Definition: cddrive.cpp:77
cdLine
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
Definition: cddrive.cpp:1228
cdPrtWL
void cdPrtWL(FILE *io, realnum wl)
Definition: cddrive.cpp:157
cdEDEN_last
double cdEDEN_last()
Definition: cddrive.cpp:390
FeII_Bands
realnum ** FeII_Bands
Definition: atom_feii.cpp:106
cdClosePunchFiles
void cdClosePunchFiles()
Definition: cddrive.cpp:1953
cdNwcns
void cdNwcns(bool *lgAbort, 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
cdPrintCommands
void cdPrintCommands(FILE *)
Definition: cddrive.cpp:513
cdDate
void cdDate(char chString[])
Definition: cddrive.cpp:361
cdTemp
int cdTemp(const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
Definition: cddrive.cpp:1602
cdInit
void cdInit()
Definition: cdinit.cpp:115
wavelength
static realnum * wavelength
Definition: monitor_results.cpp:70