cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
init_coreload_postparse.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*InitCoreloadPostparse initialization at start, called from cloudy
4 * after parser one time per core load */
5 #include "cddefines.h"
6 #include "init.h"
7 #include "dense.h"
8 #include "iso.h"
9 #include "species.h"
10 
11 /*InitCoreloadPostparse initialization at start, called from cloudy
12 * after parser, one time per core load */
14 {
15 
16  static int nCalled = 0;
17 
18  DEBUG_ENTRY( "InitCoreloadPostparse()" );
19 
20  /* only do this once per coreload */
21  if( nCalled > 0 )
22  {
23  return;
24  }
25 
26  /* this is first call, increment the nCalled counter so we never do this again */
27  ++nCalled;
28 
29  for( long ipISO=ipH_LIKE; ipISO<NISO; ++ipISO )
30  {
31  for( long nelem=ipISO; nelem<LIMELM; ++nelem)
32  {
33  /* only grab core for elements that are turned on */
34  if( nelem < 2 || dense.lgElmtOn[nelem] )
35  {
36  iso_update_num_levels( ipISO, nelem );
37  ASSERT( iso_sp[ipISO][nelem].numLevels_max > 0 );
38  iso_ctrl.nLyman_malloc[ipISO] = iso_ctrl.nLyman[ipISO];
39  iso_ctrl.nLyman_max[ipISO] = iso_ctrl.nLyman[ipISO];
40  // resolved and collapsed levels
41  long numLevels = iso_sp[ipISO][nelem].numLevels_max;
42  // "extra" Lyman lines
43  numLevels += iso_ctrl.nLyman_malloc[ipISO] - 2;
44  // satellite lines (one for doubly-excited continuum)
45  if( iso_ctrl.lgDielRecom[ipISO] )
46  numLevels += 1;
47  iso_sp[ipISO][nelem].st.init( makeChemical( nelem, nelem-ipISO ).c_str(), numLevels );
48  }
49  }
50  }
51 
52  return;
53 }
qList st
Definition: iso.h:482
t_isoCTRL iso_ctrl
Definition: iso.cpp:9
const int NISO
Definition: cddefines.h:311
t_dense dense
Definition: global.cpp:15
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:11
void iso_update_num_levels(long ipISO, long nelem)
long int nLyman_max[NISO]
Definition: iso.h:352
long int nLyman[NISO]
Definition: iso.h:352
bool lgDielRecom[NISO]
Definition: iso.h:385
bool lgElmtOn[LIMELM]
Definition: dense.h:160
string makeChemical(long nelem, long ion)
Definition: species.cpp:929
#define ASSERT(exp)
Definition: cddefines.h:613
const int ipH_LIKE
Definition: iso.h:64
const int LIMELM
Definition: cddefines.h:308
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
long int numLevels_max
Definition: iso.h:524
void InitCoreloadPostparse(void)
long int nLyman_malloc[NISO]
Definition: iso.h:352
void init(const char *label, size_t i)
Definition: quantumstate.h:108