00001
00002
00003
00004
00005
00006
00007 #include "cddefines.h"
00008 #include "optimize.h"
00009 #include "parse.h"
00010 #include "struc.h"
00011 #include "input.h"
00012 #include "dense.h"
00013 #include "hcmap.h"
00014 #include "h2.h"
00015 #include "version.h"
00016 #include "hextra.h"
00017 #include "mole.h"
00018 #include "heavy.h"
00019 #include "grid.h"
00020 #include "ionbal.h"
00021 #include "iso.h"
00022 #include "taulines.h"
00023 #include "cosmology.h"
00024 #include "physconst.h"
00025 #include "broke.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 void InitCoreload( void )
00042 {
00043 static int nCalled=0;
00044 long int nelem;
00045
00046 DEBUG_ENTRY( "InitCoreload()" );
00047
00048
00049 if( nCalled )
00050 return;
00051
00052 ++nCalled;
00053
00054 hcmap.lgMapOK = true;
00055 hcmap.lgMapDone = false;
00056
00057
00058 # ifdef _WIN32
00059 strcpy( input.chDelimiter, "\\" );
00060 # else
00061 strcpy( input.chDelimiter, "/" );
00062 # endif
00063
00064
00065 hcmap.nMapAlloc = 0;
00066 hcmap.nmap = 0;
00067 hcmap.lgMapBeingDone = false;
00068
00069
00070 strncpy( chOptimFileName , "optimal.in" , sizeof( chOptimFileName ) );
00071
00072
00073 long int nCom[LIMELM] =
00074 {
00075 1 , 2 ,
00076 1 , 2 ,
00077 1 , 2 , 3 , 4 , 5 , 6 ,
00078 1 , 2 ,
00079 1 , 2 , 3 , 4 , 5 , 6 ,
00080 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ,
00081 1 , 2 ,
00082 1 , 2
00083 };
00084
00085 for( nelem=ipHYDROGEN; nelem<LIMELM; ++nelem )
00086 {
00087 ionbal.nCompRecoilElec[nelem] = nCom[nelem];
00088 }
00089
00090
00091 strcpy( Heavy.chShell[0], "1s" );
00092 strcpy( Heavy.chShell[1], "2s" );
00093 strcpy( Heavy.chShell[2], "2p" );
00094 strcpy( Heavy.chShell[3], "3s" );
00095 strcpy( Heavy.chShell[4], "3p" );
00096 strcpy( Heavy.chShell[5], "3d" );
00097 strcpy( Heavy.chShell[6], "4s" );
00098
00099
00100
00101 for( nelem=ipHYDROGEN; nelem < LIMELM; ++nelem )
00102 {
00103 iso.n_HighestResolved_max[ipH_LIKE][nelem] = 5;
00104 iso.nCollapsed_max[ipH_LIKE][nelem] = 2;
00105 }
00106
00107 iso.n_HighestResolved_max[ipH_LIKE][ipHYDROGEN] = 10;
00108 iso.n_HighestResolved_max[ipH_LIKE][ipHELIUM] = 10;
00109
00110 iso.nCollapsed_max[ipH_LIKE][ipHYDROGEN] = 15;
00111 iso.nCollapsed_max[ipH_LIKE][ipHELIUM] = 15;
00112
00113
00114
00115 iso.n_HighestResolved_max[ipHE_LIKE][ipHYDROGEN] = -LONG_MAX;
00116 iso.numLevels_max[ipHE_LIKE][ipHYDROGEN] = -LONG_MAX;
00117 iso.nCollapsed_max[ipHE_LIKE][ipHYDROGEN] = -LONG_MAX;
00118
00119 for( nelem=ipHELIUM; nelem < LIMELM; ++nelem )
00120 {
00121
00122 iso.n_HighestResolved_max[ipHE_LIKE][nelem] = 3;
00123 iso.nCollapsed_max[ipHE_LIKE][nelem] = 1;
00124 }
00125
00126 iso.n_HighestResolved_max[ipHE_LIKE][ipHELIUM] = 6;
00127 iso.nCollapsed_max[ipHE_LIKE][ipHELIUM] = 20;
00128
00129
00130 iso.n_HighestResolved_max[ipHE_LIKE][ipCARBON] = 5;
00131 iso.n_HighestResolved_max[ipHE_LIKE][ipNITROGEN] = 5;
00132 iso.n_HighestResolved_max[ipHE_LIKE][ipOXYGEN] = 5;
00133 iso.n_HighestResolved_max[ipHE_LIKE][ipNEON] = 5;
00134 iso.n_HighestResolved_max[ipHE_LIKE][ipSILICON] = 5;
00135 iso.n_HighestResolved_max[ipHE_LIKE][ipMAGNESIUM] = 5;
00136 iso.n_HighestResolved_max[ipHE_LIKE][ipSULPHUR] = 5;
00137 iso.n_HighestResolved_max[ipHE_LIKE][ipIRON] = 5;
00138
00139 iso.n_HighestResolved_max[ipHE_LIKE][LIMELM-1] = 5;
00140
00141 iso.chISO[ipH_LIKE] = "H-like ";
00142 iso.chISO[ipHE_LIKE] = "He-like";
00143
00144 max_num_levels = 0;
00145 for( long ipISO = ipH_LIKE; ipISO < NISO; ipISO++ )
00146 {
00147 for( nelem=ipISO; nelem < LIMELM; nelem++ )
00148 {
00149
00150
00151 iso.numLevels_malloc[ipISO][nelem] = LONG_MAX;
00152 iso_update_num_levels( ipISO, nelem );
00153 }
00154 }
00155
00156 statesAdded = 0;
00157 lgStatesAdded = false;
00158 linesAdded = 0;
00159 lgLinesAdded = false;
00160
00162
00163
00164 mole.nH2_trace_final = 1;
00165
00166 mole.nH2_trace_iterations = 2;
00167
00168 mole.nH2_trace_full = 3;
00169
00170 mole.nH2_trace_matrix = 4;
00171
00172
00173
00174 for( nelem=0; nelem < LIMELM; nelem++ )
00175 {
00176
00177 dense.lgElmtOn[nelem] = true;
00178
00179
00180
00181 dense.lgSetIoniz[nelem] = false;
00182
00183
00184 for( int ion=0; ion<=nelem+1; ++ion )
00185 dense.lgIonChiantiOn[nelem][ion] = false;
00186 }
00187
00188
00189 dense.density_low_limit = SMALLFLOAT * 1e3;
00190 dense.density_low_limit = MAX2( dense.density_low_limit, 1e-50 );
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213 hextra.background_density = 2.15e-9f;
00214 hextra.background_rate = 2.5e-17f;
00215
00216
00217
00218
00219 grid.lgGridDone = false;
00220 grid.lgStrictRepeat = false;
00221
00222
00223 grid.LoEnergy_keV = 0.;
00224 grid.HiEnergy_keV = 0.;
00225 grid.ipLoEnergy = 0;
00226 grid.ipHiEnergy = 0;
00227
00228 for( long i=0; i < LIMPAR; ++i )
00229 optimize.lgOptimizeAsLinear[i] = false;
00230
00231
00232 struc.dr_ionfrac_limit = 1e-3f;
00233
00234 SaveFilesInit();
00235
00236 H2_init_coreload();
00237
00238
00239 cosmology.redshift_current = 0.f;
00240 cosmology.redshift_start = 0.f;
00241 cosmology.redshift_step = 0.f;
00242 cosmology.omega_baryon = 0.04592f;
00243 cosmology.omega_rad = 8.23e-5f;
00244 cosmology.omega_lambda = 0.7299177f;
00245 cosmology.omega_matter = 0.27f;
00246 cosmology.omega_k = 0.f;
00247
00248 cosmology.h = 0.71f;
00249
00250 cosmology.H_0 = 100.f*cosmology.h;
00251 cosmology.lgDo = false;
00252
00253
00254
00255 broke.lgBroke = false;
00256 broke.lgFixit = false;
00257 broke.lgCheckit = false;
00258
00259 return;
00260 }