Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cdinit.cpp File Reference
#include "cddefines.h"
#include "taulines.h"
#include "monitor_results.h"
#include "called.h"
#include "cddrive.h"
#include "grid.h"
#include "input.h"
#include "parse.h"
#include "save.h"
#include "init.h"
#include "ran.h"
#include "trace.h"
Include dependency graph for cdinit.cpp:

Functions

void cdInit (void)
 
void cdPrepareExit (exit_type exit_status)
 

Variables

FILE * ioMAP = NULL
 
const double ZeroNum = 0.
 
const void * ZeroPtr = NULL
 
long nWindLine = NWINDDIM
 
bool lgcdInitCalled =false
 
bool lgHydroAlloc = false
 
bool lgRfieldAllocated =false
 
bool lgOpacAllocated =false
 

Function Documentation

void cdInit ( )

cdInit This routine must be called before any of the others - it reinitializes many variables, and must be called before any of the other routines. In a large grid of calculations it must be repeatedly called before the start of the new calculation and after all results have been obtained from the previous model

References called, cdSetExecTime(), t_input::clear(), cpu, t_input::crd, DEBUG_ENTRY, fprintf(), grid, t_cpu::i(), t_ran::init(), t_cpu_i::initPath(), input, ioQQQ, lgBigBotch, lgcdInitCalled, t_grid::lgGrid, lgMonitorsOK, t_cpu_i::lgMPI_talk(), t_optimize::lgNoVary, t_optimize::lgOptimr, t_grid::lgOutputTypeOn, lgPrtSciNot, t_called::lgTalk, t_called::lgTalkForcedOff, t_called::lgTalkIsOK, t_optimize::lgVaryOn, t_grid::nGridCommands, t_input::nRead, NUM_OUTPUT_TYPES, optimize, ran, TotalInsanity(), and zero().

Referenced by cdMain().

Here is the call graph for this function:

void cdPrepareExit ( exit_type  )

prepare termination of the code, but do not terminate yet

References cdInput(), cdOutput(), CloseSaveFiles(), cpu, fprintf(), grid, t_cpu::i(), ioQQQ, t_save::ipSaveGrid, t_grid::lgGrid, t_trace::lgTrace, t_cpu_i::MPIMode(), MS_GRID, t_grid::pnunit, save, SaveGrid(), and trace.

Referenced by cdMain().

Here is the call graph for this function:

Variable Documentation

FILE* ioMAP = NULL
bool lgcdInitCalled =false

this is the value that will be set true when cdInit is called. Other routines will check that this is true when they are called, to verify that cdInit was called first. Definition is in cdInit.cpp

Referenced by cdDrive(), cdGetLineList(), cdInit(), and cdRead().

bool lgHydroAlloc = false

this will be set true once space is allocated for the HydroLines array. from then on any HYDROGENIC LEVELS command will be ignored, this is set to false in cddefines.c

Referenced by iso_create(), and ParseDatabaseISO().

bool lgOpacAllocated =false

set true when allocated, init to false

Referenced by OpacityCreateAll(), and tauff().

bool lgRfieldAllocated =false

set true when allocated, init to false

Referenced by rfield_opac_alloc(), rfield_opac_zero(), and tfidle().

const double ZeroNum = 0.

this is the number zero, used to trick clever compilers when dividing by it to crash program there is a routine called zero - this name cannot overlap definition is in cddefines.cpp

Referenced by ParseCrashDo(), RandomCrash(), and TotalInsanityAsStub().

const void* ZeroPtr = NULL

this is used to trick compilers into dereferencing a null pointer in order to crash the program

Referenced by ParseCrashDo(), and RandomCrash().