cloudy trunk
Loading...
Searching...
No Matches
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
36
44void cdInit();
45
51void cdTalk(bool);
52
61void cdOutput( const char* filename = "", const char *mode = "w" );
62
71void cdInput( const char* filename = "", const char *mode = "r" );
72
77void cdDepth_depth( double cdDepth[] );
78
82long int cdnZone();
83
88double cdB21cm();
89
100int cdRead( const char* );
101
109void cdPrtWL( FILE *io , realnum wl );
110
120
128void cdNoExec();
129
135int cdDrive();
136
137
138/* The next two routines confirm that the previous calculation was ok
139 * or produce a list of error conditions */
140
147void cdErrors(FILE* );
148
164void 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
177void cdReasonGeo(FILE*);
178
183void cdWarnings(FILE*);
186void cdCautions(FILE*);
188void cdSurprises(FILE*);
190void cdNotes(FILE*);
191
192/***********************************************************
193 *
194 * The next routines examine the predictions of the previous model
195 *
196 ***********************************************************/
197
218
219long int cdLine(
220 const char *chLabel,
222 double *relint,
223 double *absint);
224
225long 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
243void 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 );
251void cdLine_ip(long int ipLine,
252 double *relint,
253 double *absint );
254
282
283int cdColm(const char*, long, double* );
284
287
288double cdH2_colden( long iVib , long iRot );
289
305// this version returns intrinsic
306long int cdEmis(
307 char *chLabel,
309 double *emiss );
310
311long int cdEmis(
312 char *chLabel,
314 double *emiss ,
315 bool lgEmergent );
316
317
323void cdEmis_ip(
324 long int ipLine,
325 double *emiss ,
326 bool lgEmergent);
327
331double cdCooling_last();
332
336double cdHeating_last();
337
339double cdEDEN_last();
340
347void cdPressure_last(
348 double *TotalPressure,
349 double *GasPressure,
350 double *RadiationPressure);
351
363 double TotalPressure[],
364 double GasPressure[],
365 double RadiationPressure[]);
366
370double cdTemp_last();
371
392int cdIonFrac(
393 const char *chLabel,
394 long int IonStage,
395 double *fracin,
396 const char *chWeight ,
397 bool lgDensity );
398
403void cdVersion(char chString[] );
404
409void 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
417void cdSetExecTime();
418
421double cdExecTime();
422
448
449long int cdGetLineList(
450 const char chFile[],
451 vector<char*>& chLabels,
452 vector<realnum>& wl);
453
461void 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 */
478extern long int nFeIIBands;
479
481extern long int nFeIIConBins;
482
483/* band wavelength, lower and upper bounds, in vacuum Angstroms */
487extern realnum **FeII_Bands;
488
489/* continuum wavelengths, lower and upper bounds, in vacuum Angstroms
490 * third is integrated intensity */
493extern realnum **FeII_Cont;
494
495
522void cdSPEC(
523 int Option ,
524 long int nEnergy ,
525 double ReturnedSpectrum[] );
526
527
552 int Option ,
553 long int nEnergy ,
554 long int ipLoEnergy,
555 long int ipHiEnergy,
556 realnum ReturnedSpectrum[] );
557
575int cdTemp(
576 const char *chLabel,
577 long int IonStage,
578 double *TeMean,
579 const char *chWeight );
580
585void cdPrintCommands( FILE * );
586
588void cdClosePunchFiles();
589
603long 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
622extern bool lgcdInitCalled;
623
624#endif /* CDDRIVE_H_ */
long int nFeIIBands
realnum ** FeII_Bands
long int nFeIIConBins
realnum ** FeII_Cont
bool lgAbort
Definition cddefines.cpp:10
float realnum
Definition cddefines.h:103
void cdCautions(FILE *)
Definition cddrive.cpp:226
void cdInit()
Definition cdinit.cpp:115
void cdDepth_depth(double cdDepth[])
Definition cddrive.cpp:976
double cdCooling_last()
Definition cddrive.cpp:333
void cdTalk(bool)
Definition cddrive.cpp:1548
long int cdEmis(char *chLabel, realnum wavelength, double *emiss)
Definition cddrive.cpp:533
void cdPressure_last(double *TotalPressure, double *GasPressure, double *RadiationPressure)
Definition cddrive.cpp:1028
long int cdnZone()
Definition cddrive.cpp:1049
double cdEDEN_last()
Definition cddrive.cpp:390
void cdOutput(const char *filename="", const char *mode="w")
Definition cddrive.cpp:1517
void cdSurprises(FILE *)
Definition cddrive.cpp:282
void cdPrintCommands(FILE *)
Definition cddrive.cpp:513
int cdRead(const char *)
Definition cddrive.cpp:1752
void cdInput(const char *filename="", const char *mode="r")
Definition cddrive.cpp:1530
int cdIonFrac(const char *chLabel, long int IonStage, double *fracin, const char *chWeight, bool lgDensity)
Definition cddrive.cpp:1072
void cdClosePunchFiles()
Definition cddrive.cpp:1953
void cdEmis_ip(long int ipLine, double *emiss, bool lgEmergent)
Definition cddrive.cpp:613
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 cdPrtWL(FILE *io, realnum wl)
Definition cddrive.cpp:157
double cdH2_colden(long iVib, long iRot)
Definition mole_h2.cpp:2318
bool lgcdInitCalled
Definition cdinit.cpp:34
double cdB21cm()
Definition cddrive.cpp:1561
long int cdGetLineList(const char chFile[], vector< char * > &chLabels, vector< realnum > &wl)
void cdTimescales(double *TTherm, double *THRecom, double *TH2)
Definition cddrive.cpp:249
int cdDrive()
Definition cddrive.cpp:77
void cdDate(char chString[])
Definition cddrive.cpp:361
void cdSetExecTime()
Definition cddrive.cpp:474
int cdColm(const char *, long, double *)
void cdSPEC2(int Option, long int nEnergy, long int ipLoEnergy, long int ipHiEnergy, realnum ReturnedSpectrum[])
void cdWarnings(FILE *)
Definition cddrive.cpp:198
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
void cdNoExec()
Definition cddrive.cpp:404
void cdVersion(char chString[])
Definition cddrive.cpp:346
void cdNotes(FILE *)
Definition cddrive.cpp:309
long int cdLine(const char *chLabel, realnum wavelength, double *relint, double *absint)
Definition cddrive.cpp:1228
void cdSPEC(int Option, long int nEnergy, double ReturnedSpectrum[])
Definition cdspec.cpp:21
void cdReasonGeo(FILE *)
Definition cddrive.cpp:175
void cdPressure_depth(double TotalPressure[], double GasPressure[], double RadiationPressure[])
Definition cddrive.cpp:1001
int cdTemp(const char *chLabel, long int IonStage, double *TeMean, const char *chWeight)
Definition cddrive.cpp:1602
long debugLine(realnum wavelength)
Definition cddrive.cpp:1194
double cdTemp_last()
Definition cddrive.cpp:1061
void cdErrors(FILE *)
Definition cddrive.cpp:910
void cdLine_ip(long int ipLine, double *relint, double *absint, int LineType)
Definition cddrive.cpp:1424
double cdExecTime()
Definition cddrive.cpp:481
double cdHeating_last()
Definition cddrive.cpp:376
static realnum * wavelength
static long int * ipLine