Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
save.h File Reference
#include "energy.h"
#include "lines.h"
#include "prt.h"
Include dependency graph for save.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SaveParams
 
class  adjPseudoCont
 
class  save_img_matrix
 
struct  t_save
 

Functions

void SaveDo (const char *chTime)
 
double PrtLogLin (double value)
 
void Save1Line (const TransitionProxy &t, FILE *io, realnum xLimit, long index, realnum DopplerWidth)
 
NORETURN void SaveLineData (FILE *io)
 
void save_opacity (FILE *io, long int np)
 
void SaveSpecial (FILE *io, const char *chTime)
 
void SaveAllSpeciesLabelsLevels (FILE *ioPUN)
 
void SaveSpecies (FILE *ioPUN, long int ipPun)
 
void SaveSpeciesPseudoCont (const long ipPun, const string &speciesLabel)
 
void SaveSpeciesBands (const long ipPun, const string &speciesLabel, const string &fileBands, const bool lgEmergent)
 
void SaveSpeciesOptDep (const long int ipPun, const string &speciesLabel)
 
void mole_save (FILE *punit, const char speciesname[], const char args[], bool lgHeader, bool lgData, bool lgCoef, double depth)
 
void mole_dominant_rates (const vector< const molecule * > &debug_list, FILE *ioOut, bool lgPrintReagents, size_t NPRINT, double fprint)
 
void mole_print_species_reactions (molecule *speciesToPrint)
 
void PrintLineDataHeader (FILE *ioPUN)
 
void Save1LineData (const TransitionProxy &t, FILE *io, bool lgCS_2)
 
void save_line (FILE *ip, const char *chDo, bool lgEmergent, long ipPun)
 
void save_average (long int ipPun)
 
void Save_Line_RT (FILE *ip)
 
void saveFITSfile (FILE *io, int option, realnum Elo=0.f, realnum Ehi=0.f, realnum Enorm=0.f)
 
void saveFITSimg (FILE *io, const string &extName, const string &units, const long nPixels, const multi_arr< double, 2, C_TYPE > &image)
 
void saveFITSimg (FILE *io, const string &extName, const string &units, const long nCols, const valarray< double > &vec)
 
void SaveHeat (FILE *io)
 
void CoolSave (FILE *io, const char chJob[])
 
void SaveGrid (FILE *pnunit, exit_type status)
 

Variables

static const long LIMPUN = 100L
 
static const long VERSION_TRNCON = 20190210L
 
t_save save
 

Function Documentation

◆ CoolSave()

void CoolSave ( FILE * io,
const char chJob[] )

CoolSave save coolants, called by save_do

Parameters
iothe file we will write to
*chJob

References cdEXIT, conv, CoolHeavy, DEBUG_ENTRY, dynamics, EXIT_FAILURE, fprintf(), gv, hmi, ioQQQ, LIMELM, MAX2, phycon, radius, safe_div(), save, sign(), SMALLFLOAT, spsort(), thermal, TotalInsanity(), and zero().

Referenced by ConvBase(), ConvInitSolution(), and SaveDo().

Here is the call graph for this function:

◆ mole_dominant_rates()

void mole_dominant_rates ( const vector< const molecule * > & debug_list,
FILE * ioOut,
bool lgPrintReagents,
size_t NPRINT,
double fprint )
extern

◆ mole_print_species_reactions()

◆ mole_save()

void mole_save ( FILE * punit,
const char speciesname[],
const char args[],
bool lgHeader,
bool lgData,
bool lgCoef,
double depth )
extern

◆ PrintLineDataHeader()

void PrintLineDataHeader ( FILE * ioPUN)

References fprintf().

Referenced by SaveLineData().

Here is the call graph for this function:

◆ PrtLogLin()

double PrtLogLin ( double value)

SAVE command has option LOG to print log quantities as in <= C13

References ipPun, save, and SDIV().

Referenced by save_average(), and SaveDo().

Here is the call graph for this function:

◆ Save1Line()

◆ Save1LineData()

void Save1LineData ( const TransitionProxy & t,
FILE * io,
bool lgCS_2 )

Save1LineData data for save one line

Parameters
t
io
lgCS_2this flag says whether collision strength should be saveed - should be false for multi level atoms since sums are not done properly
Todo
1 define lifetime and collision rate for multi-level species so that the critical density is derived correctly in this routine. For now the flag lgCS_2 being true means to save critical den and is only true for two-level systems all places where this routine is called with lgCS_2 false need to be fixed

References AnuUnit(), EmissionProxy::Aul(), chIonLbl(), CollisionProxy::col_str(), TransitionProxy::Coll(), EmissionProxy::damp(), DEBUG_ENTRY, TransitionProxy::Emis(), TransitionProxy::EnergyRyd(), fprintf(), EmissionProxy::gf(), TransitionProxy::Hi(), TransitionProxy::ipCont(), TransitionProxy::Lo(), phycon, PrintEfmt, t_wavl::prt_wl(), save, and TransitionProxy::twav().

Referenced by diatomics::H2_Punch_line_data(), and SaveLineData().

Here is the call graph for this function:

◆ save_average()

void save_average ( long int ipPun)

save_average parse save average command, or actually do the save output

Parameters
ipPun- array index for file for final save output

References cdColm(), cdEXIT, cdIonFrac(), cdTemp(), DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, ipPun, PrtLogLin(), save, and TotalInsanity().

Referenced by SaveDo().

Here is the call graph for this function:

◆ save_line()

void save_line ( FILE * ip,
const char * chDo,
bool lgEmergent,
long ipPun )

save_line do the save output

Parameters
ipthe file we will write to
chDo
lgEmergentintrinsic or emergent emission
ipPun

References TransitionProxy::associated(), cdEmis_ip(), cdEXIT, cdLine_ip(), DEBUG_ENTRY, TransitionProxy::Emis(), EXIT_FAILURE, fprintf(), h2, ioQQQ, ipLine, ipPun, lineids, linelist, LineSave, nzone, prt_line_err(), radius, and EmissionProxy::TauIn().

Referenced by SaveDo().

Here is the call graph for this function:

◆ Save_Line_RT()

◆ save_opacity()

◆ SaveAllSpeciesLabelsLevels()

void SaveAllSpeciesLabelsLevels ( FILE * ioPUN)

SaveAllSpeciesLabelsLevels – generate output of all species labels & levels

Parameters
ioPUNio unit for save

References ipPun.

◆ SaveDo()

void SaveDo ( const char * chTime)

SaveDo produce save output during calculation

Parameters
chTimechTime is null terminated 4 char string, either "MIDL" or "LAST"

lgLastOnly true, print after iteration is complete, false, evey zone

References abund, AGN_He1_CS(), AGN_Hemis(), AnuUnit(), ASSERT, TransitionProxy::associated(), called, cdColm(), cdExecTime(), cdEXIT, cdLine(), ChargTranPun(), CHIANTI_Upsilon(), TransitionProxy::chLabel(), colden, colliders, column(), conv, CoolSave(), cpu, CT_GRN_GRA, CT_GRN_SIL, CT_GRN_TOT, CT_INCI, CT_OUTW_DIFF, CT_OUTW_INCI, CT_OUTW_LIN, CT_REFL_DIFF, CT_REFL_INCI, CT_REFL_LIN, dBaseSpecies, dBaseTrans, DEBUG_ENTRY, molezone::den, dense, density(), DoppVel, dynamics, DynaPunchTimeDep(), DynaSave(), elementnames, TransitionProxy::Emis(), energy(), EXIT_FAILURE, EXIT_SUCCESS, exp10(), findspecies(), findspecieslocal(), FindStrongestLineLabels(), flxCell(), fp_equal(), fprintf(), qStateProxy::g(), GammaPrt(), geometry, t_ADfA::getEthresh(), grid, gv, h2, hcmap, Heavy, HFLines, TransitionProxy::Hi(), hmi, hyperfine, molecule::index, Singleton< t_ADfA >::Inst(), Singleton< t_yield >::Inst(), ion_recombAGN(), ionbal, ioQQQ, ipALUMINIUM, ipCARBON, ipCOL_elec, ipCOL_HTOT, ipELECTRON, ipFineCont(), ipH1s, ipH2p, ipH2s, ipH_LIKE, ipHe1s1S, ipHe2p1P, ipHe2p3P0, ipHe2p3P1, ipHe2p3P2, ipHe2s3S, ipHE_LIKE, ipHELIUM, ipHYDROGEN, ipIRON, ipMAGNESIUM, ipoint(), ipOXYGEN, ipPun, ipRecEsc, ipRecNetEsc, ipRecRad, ipSILICON, ipSODIUM, ipSULPHUR, is_odd(), iso_Max_Emitting_Level(), iso_RRCoef_Te(), iso_sp, iteration, iterations, lgCheckMonitors(), lgMustPrintHeader, LIMELM, LineSave, TransitionProxy::Lo(), magnetic, map_do(), matchGeneric(), MAX2, mean, MIN2, mole, mole_dominant_rates(), mole_global, mole_save(), NCHLAB, t_yield::nelec_eject(), nSpecies, null_mole, NUM_OUTPUT_TYPES, nzone, OccupationNumberLine(), opac, optimize, phycon, plankf(), qStateProxy::Pop(), POW2, pressure, prt, prt_line_inlist(), prt_LineLabels(), PrtLinePres(), PrtLogLin(), PrtMeanIon(), radius, rfield, safe_div(), save, save_average(), save_line(), Save_Line_RT(), save_opacity(), saveFITSfile(), SaveGaunts(), SaveHeat(), SaveLineData(), SaveLineIntensity(), SaveLineStuff(), SaveResults(), SaveSpecial(), SaveSpecies(), SaveSpeciesBands(), SaveSpeciesOptDep(), SaveSpeciesPseudoCont(), SDIV(), secondaries, sexp(), ShowMe(), SMALLFLOAT, struc, EmissionProxy::TauInSpecific(), TempChange(), TexcLine(), thermal, timesc, TorF(), TotalInsanity(), VERSION_TRNCON, and wind.

Referenced by cloudy().

◆ saveFITSfile()

void saveFITSfile ( FILE * io,
int option,
realnum Elo = 0.f,
realnum Ehi = 0.f,
realnum Enorm = 0.f )

Save spectra to a FITS compatible file.

Parameters
iothe file we will write to
optionchoose type of spectrum to save
Eloif set, lower bound of spectrum to save
Ehiif set, upper bound of spectrum to save
Enormif set, normalize spectrum to 1 at this frequency

References ASSERT, DEBUG_ENTRY, fprintf(), grid, GridRetrieveXSPECData(), ioFITS_OUTPUT, MAX2, maxParamValues, NUM_OUTPUT_TYPES, open_data(), optimize, punchFITS_EnergyData(), punchFITS_EnergyHeader(), punchFITS_GenericData(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), punchFITS_SpectraHeader(), rfield, and wr_block().

Referenced by process_output(), and SaveDo().

Here is the call graph for this function:

◆ saveFITSimg() [1/2]

void saveFITSimg ( FILE * io,
const string & extName,
const string & units,
const long nCols,
const valarray< double > & vec )

Save rate matrix to a FITS file. Mainly a debugging aid.

Parameters
io[in] the file we will write to
extName[in] extension name
units[in] vector units
nCols[in] length of vector
vector[in] vector to write in FITS extension

References DEBUG_ENTRY, get_data_minmax(), ioFITS_OUTPUT, punchFITSimg_ExtensionData_vector(), and punchFITSimg_ExtensionHeader().

Here is the call graph for this function:

◆ saveFITSimg() [2/2]

void saveFITSimg ( FILE * io,
const string & extName,
const string & units,
const long nPixels,
const multi_arr< double, 2, C_TYPE > & image )

Save rate matrix to a FITS file. Mainly a debugging aid.

Parameters
io[in] the file we will write to
extName[in] extension name
units[in] vector units
nPixels[in] dimension of (square) image
image[in] image to write in FITS extension

References DEBUG_ENTRY, get_data_minmax(), ioFITS_OUTPUT, punchFITSimg_ExtensionData_matrix(), punchFITSimg_ExtensionHeader(), and punchFITSimg_PrimaryHeader().

Referenced by save_img_matrix::addImagePop_FITS(), and save_img_matrix::createImage_FITS().

Here is the call graph for this function:

◆ SaveGrid()

void SaveGrid ( FILE * pnunit,
exit_type status )

SaveGrid implements the SAVE GRID command

Parameters
pnunit: file descriptor to write to
status: exit status of the grid point

References cpu, DEBUG_ENTRY, ES_SUCCESS, ES_WARNINGS, fprintf(), grid, GridPointPrefix(), NULL, open_data(), optimize, save, TorF(), and warnings.

Referenced by cdPrepareExit().

Here is the call graph for this function:

◆ SaveHeat()

void SaveHeat ( FILE * io)

SaveHeat save contributors to local heating, with save heat command, called by save_do

Parameters
iothe file we will write to

References ASSERT, TransitionProxy::associated(), chLineLbl(), CollisionProxy::col_str(), TransitionProxy::Coll(), conv, DEBUG_ENTRY, dense, dynamics, elementnames, TransitionProxy::Emis(), FndLineHt(), fprintf(), CollisionProxy::heat(), ioQQQ, LIMELM, EmissionProxy::Pesc(), phycon, EmissionProxy::pump(), radius, safe_div(), save, SMALLFLOAT, spsort(), EmissionProxy::TauIn(), thermal, and UNUSED.

Referenced by ConvBase(), and SaveDo().

Here is the call graph for this function:

◆ SaveLineData()

◆ SaveSpecial()

void SaveSpecial ( FILE * io,
const char * chTime )

SaveSpecial generate output for the save special command

Parameters
io
chTime

References DEBUG_ENTRY, dense, fprintf(), ipH1s, ipH2p, ipH2s, ipH_LIKE, ipHYDROGEN, iso_sp, opac, powi(), radius, rfield, and wind.

Referenced by SaveDo().

Here is the call graph for this function:

◆ SaveSpecies()

void SaveSpecies ( FILE * ioPUN,
long int ipPun )

SaveSpecies generate output for the save species command

Parameters
ioPUNio unit for save
ipPunarrayin save array

References ASSERT, cdEXIT, column(), DEBUG_ENTRY, density(), depart(), energy(), EXIT_FAILURE, fprintf(), ioQQQ, ipPun, levels(), molezone::levels, matchGeneric(), MAX2, mole, mole_global, NULL, null_molezone, save, SaveSpeciesHeader(), SaveSpeciesLines(), SaveSpeciesOne(), qList::size(), and TotalInsanity().

Referenced by SaveDo().

Here is the call graph for this function:

◆ SaveSpeciesBands()

void SaveSpeciesBands ( const long ipPun,
const string & speciesLabel,
const string & fileBands,
const bool lgEmergent )

SaveSpeciesBands - save species bands emission

Parameters
ipPun[in] save file index
speciesLabel[in] species emission to be stored
fileBands[in] file that holds the bands' definitions
lgEmergent[in] report emergent emission; intrinsic by default

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, findSpecBand(), fprintf(), ioQQQ, ipPun, LineSave, radius, save, and SpecBands.

Referenced by SaveDo().

Here is the call graph for this function:

◆ SaveSpeciesOptDep()

void SaveSpeciesOptDep ( const long int ipPun,
const string & speciesLabel )

SaveSpeciesOptDep – generate output for 'save species optical depth'

Parameters
ipPunarray index in save array
speciesLabellabel to acquire species

References DEBUG_ENTRY, fprintf(), getSpeciesGeneric(), ioQQQ, ipPun, iterations, NULL, and save.

Referenced by SaveDo().

Here is the call graph for this function:

◆ SaveSpeciesPseudoCont()

void SaveSpeciesPseudoCont ( const long ipPun,
const string & speciesLabel )

SaveSpeciesPseudoCont - save species pseudo-continuum

Parameters
ipPunsave file index
speciesLabelspecies emission to be stored

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), getIntenTypeStr(), getPseudoIndex(), INWARD, ioQQQ, ipPun, OUTWARD, PseudoCont, resolveSpecType(), save, TOTAL, and TotalInsanity().

Referenced by SaveDo().

Here is the call graph for this function:

Variable Documentation

◆ LIMPUN

const long LIMPUN = 100L
static

◆ save

◆ VERSION_TRNCON

const long VERSION_TRNCON = 20190210L
static

magic version number for the transmitted continuum output file

Referenced by ReadTable(), and SaveDo().