/*Zerologic set initial values for logical variables */ #ifdef _MSC_VER # pragma warning( disable : 4305 )/* disable const double to float warning in MS VS*/ #endif #include #include #include "cddefines.h" #include "colimt.h" #include "kshllenr.h" #include "prttau.h" #include "crsnut.h" #include "mappar.h" #include "optype.h" #include "escdst.h" #include "cludon.h" #include "iph2.h" #include "dmetal.h" #include "flxfnt.h" #include "otsmin.h" #include "didz.h" #include "con0.h" #include "assav.h" #include "extinc.h" #include "plot.h" #include "dump.h" #include "atomcwgt.h" /* */ /* following used to enter total predicted continuum into emission line array * actually entered into line array in lineset1 */ #include "predcont.h" /* energies where diffuse continuuum is to be entered into line array * variables are declared in predcont.h, where array dimensioned */ /* >>> chng99 mar 23, adjusted energies so that wavelength line list is * the same as it was in C90 - small changes were caused by going over * to proper rydberg constant */ float EnrPredCont[NPREDCONT] = { 7.345e-04 , 1.498e-03 , 2.211e-03 , 2.952e-03 , 3.677e-03 , 4.314e-03 , 5.162e-03 , 6.240e-03 , 7.320e-03 , 9.772432e-03 , 1.29253e-02f , 2.2152e-02 , 3.920443e-02 , 5.54593e-02f , 6.2107e-02 , 6.2457e-02 , 8.1460e-02 , 0.110859 , 0.11106 , 0.14675 , 0.18653 , 0.24971 , 0.250008 , 0.38096 , 0.43994 , 0.44394 , 0.50811 , 0.57489 , 0.62487 , 0.67155 , 0.70244 , 0.72163 , 0.74812 , 0.76172 , 0.77551 , 0.79681 , 0.81859 , 0.8260 , 0.84859 , 0.85618 , 0.87967 , 0.91086 , 0.99783 , 1.000 , 1.199 , 1.299 , 1.4984 , 1.58441 , 1.80433 , 1.809 , 2.283}; long int ipPredCont[NPREDCONT]; #include "betaver.h" #include "shell.h" #include "wkhtcl.h" #include "varypar.h" #include "phycon.h" #include "redis.h" #include "toler.h" #include "faint.h" #include "printit.h" #include "fudgec.h" #include "taumin.h" #include "forcte.h" #include "norm.h" #include "compton.h" #include "dampon.h" #include "itercnt.h" #include "ipdr.h" #include "filfac.h" #include "egray.h" #include "noexec.h" #include "abnslr.h" #include "trovrd.h" #include "moldrv.h" #include "autoit.h" #include "vary.h" #include "cnegtk.h" #include "only.h" #include "limfal.h" #include "timed.h" #include "pstart.h" #include "reason.h" #include "lyamas.h" #include "heclon.h" #include "drmnon.h" #include "strkon.h" #include "plast.h" #include "freeon.h" #include "colneg.h" #include "fston.h" #include "casbhs.h" #include "caseb.h" #include "rcota.h" #include "trace.h" #include "parray.h" #include "thigh.h" #include "sphere.h" #include "nomole.h" #include "pbn.h" #include "pshort.h" #include "tseton.h" #include "recoil.h" #include "cyclot.h" #include "sdrmin.h" #include "hextra.h" #include "turhet.h" #include "punconv.h" #include "zero.h" /* * long names of elements * ok here since never change */ /*#include "elementnames.h"*/ struct /*t_elementnames*/ { char chElementName[LIMELM][11] ; char chElementNameShort[LIMELM][5] ; /* symbols for elements, used in various printouts */ char chElementSym[LIMELM][3] ; /* ionization stages */ char chIonStage[LIMELM+1][3] ; } elementnames = { /*char chElementName[LIMELM][11] = */ { "Hydrogen " , "Helium " , "Lithium " , "Beryllium " , "Boron " , "Carbon " , "Nitrogen " , "Oxygen " , "Fluorine " , "Neon " , "Sodium " , "Magnesium " , "Aluminium " , "Silicon " , "Phosphorus" , "Sulphur " , "Chlorine " , "Argon " , "Potassium " , "Calcium " , "Scandium " , "Titanium " , "Vanadium " , "Chromium " , "Manganese " , "Iron " , "Cobalt " , "Nickel " , "Copper " , "Zinc " }, /*char chElementNameShort[LIMELM][5] = */ { "HYDR" , "HELI" , "LITH" , "BERY" , "BORO" , "CARB" , "NITR" , "OXYG" , "FLUO" , "NEON" , "SODI" , "MAGN" , "ALUM" , "SILI" , "PHOS" , "SULP" , "CHLO" , "ARGO" , "POTA" , "CALC" , "SCAN" , "TITA" , "VANA" , "CHRO" , "MANG" , "IRON" , "COBA" , "NICK" , "COPP" , "ZINC" }, /* symbols for elements, used in various printouts */ /*char chElementSym[LIMELM][3] = */ { "H " , "He" , "Li" , "Be" , "B " , "C " , "N " , "O " , "F " , "Ne" , "Na" , "Mg" , "Al" , "Si" , "P " , "S " , "Cl" , "Ar" , "K " , "Ca" , "Sc" , "Ti" , "V " , "Cr" , "Mn" , "Fe" , "Co" , "Ni" , "Cu" , "Zn" } , /* ionization stages */ /*char chIonStage[LIMELM+1][3] =*/ { " 1" , " 2" , " 3" , " 4" , " 5" , " 6" , " 7" , " 8" , " 9" , "10" , "11" , "12" , "13" , "14" , "15" , "16" , "17" , "18" , "19" , "20" , "21" , "22" , "23" , "24" , "25" , "26" , "27" , "28" , "29" , "30" , "31" } }; void Zerologic(void) { long int i; # ifdef DEBUG_FUN fputs( "<+>Zerologic()\n", debug_fp ); # endif /* drChange was reset to get orion flux in h-beta correct * drChange is really tau of current zone */ didz.drChange = 0.15; otsminCom.otsmin = 0.; flxfnt.FluxFaint = 1e-10; dmetal.ScaleMetals = 1.; cludon.GuessDiel = 1.; strcpy( optype.chOpcTyp, " " ); crsnut.CrsSecNeutron = 4e-26; /* parameters having to do with thermal map */ MapPar.RangeMap[0] = 10.; MapPar.RangeMap[1] = .99e10; MapPar.MapZone = 9999; MapPar.lgMapOK = TRUE; MapPar.lgMapDone = FALSE; MapPar.nMapStep = 20; /* will be reset to positive number when map actually done */ MapPar.nMapAlloc = 0; MapPar.nmap = 0; strcpy( escdst.chDstFun, " K2" ); strcpy( escdst.chEscFun, " K2" ); iph2.ipPunH2 = NULL; iph2.lgPunH2 = FALSE; /* upper limit to energies of inner shell opacities in ryd * this is 1 mev by default */ KshllEnr.EnergyKshell = 7.35e4; dump.nzdump = -100; extinc.excolm = 0.; extinc.exleak = 0.; extinc.exlow = 1.; colimt.COLimit = 0.80; con0.lgCoStarInterpolationCaution = FALSE; con0.lgCon0 = FALSE; /* list of shells, 1 to 7 */ strcpy( Shell.chShell[0], "1s" ); strcpy( Shell.chShell[1], "2s" ); strcpy( Shell.chShell[2], "2p" ); strcpy( Shell.chShell[3], "3s" ); strcpy( Shell.chShell[4], "3p" ); strcpy( Shell.chShell[5], "3d" ); strcpy( Shell.chShell[6], "4s" ); /* this is version of beta test, normally zero *c90 beta 3, May 23 1996 *c90 beta 4, June 9 1996 */ /*c94 beta 1, July 9 1999 */ /*c94 beta 2, Oct 1 1999 */ BetaVer.nBetaVer = 0; /* threshold for faintest heating cooling to punch with * punch heating or punch cooling commands, * can be reset with PUNCH WEAKHEATCOOL command */ WkHtCl.WeakHeatCool = 0.05; /* list of atomic weights, mass in amu, used for thermal line widths */ AtomcWgt.AtomicWeight[0] = 1.0080; AtomcWgt.AtomicWeight[1] = 4.0026; AtomcWgt.AtomicWeight[2] = 6.941; AtomcWgt.AtomicWeight[3] = 9.0122; AtomcWgt.AtomicWeight[4] = 10.811; AtomcWgt.AtomicWeight[5] = 12.011; AtomcWgt.AtomicWeight[6] = 14.0067; AtomcWgt.AtomicWeight[7] = 15.9994; AtomcWgt.AtomicWeight[8] = 18.9984; AtomcWgt.AtomicWeight[9] = 20.179; AtomcWgt.AtomicWeight[10] = 22.9898; AtomcWgt.AtomicWeight[11] = 24.305; AtomcWgt.AtomicWeight[12] = 26.9815; AtomcWgt.AtomicWeight[13] = 28.086; AtomcWgt.AtomicWeight[14] = 30.9738; AtomcWgt.AtomicWeight[15] = 32.06; AtomcWgt.AtomicWeight[16] = 35.453; AtomcWgt.AtomicWeight[17] = 39.948; AtomcWgt.AtomicWeight[18] = 39.102; AtomcWgt.AtomicWeight[19] = 40.08; AtomcWgt.AtomicWeight[20] = 44.956; AtomcWgt.AtomicWeight[21] = 47.90; AtomcWgt.AtomicWeight[22] = 50.9414; AtomcWgt.AtomicWeight[23] = 51.996; AtomcWgt.AtomicWeight[24] = 54.9380; AtomcWgt.AtomicWeight[25] = 55.847; AtomcWgt.AtomicWeight[26] = 58.9332; AtomcWgt.AtomicWeight[27] = 58.71; AtomcWgt.AtomicWeight[28] = 63.546; AtomcWgt.AtomicWeight[29] = 65.37; /* default no printing of optical depths, TooFaint is .1 */ PrtTau.lgPrtTau = FALSE; PrtTau.PrtTauFnt = 0.1; noexec.lgNoExec = FALSE; PunConv.lgPunConv = FALSE; ipdr.lgDROn = FALSE; ipdr.lgDRPLst = FALSE; ipdr.ipDRout = NULL; phycon.hden = -99.f; strcpy( redis.chRedis, "INCO" ); tolerCom.toler = 0.02; faint.TooFaint = 1e-3; faint.lgFaintOn = TRUE; /* print ages */ printit.lgPrnAges = FALSE; /* print hydrogenic level populations */ printit.lgPrintHLevPops = FALSE; printit.psort = 0.; fudgec.nfudge = 0; for( i=0; i < NFUDGC; i++ ) { fudgec.fudgea[i] = 0.; } tauminCom.taumin = 1e-20; tauminCom.tlamin = 1e-20; for( i=0; i < ITRDIM; i++ ) { IterCnt.IterPrnt[i] = 10000; } IterCnt.itermx = 0; IterCnt.iter = 0; turhet.TurbHeat = 0.; turhet.turrad = 1e30; hextra.cryden = 0.; hextra.crpowr = 0.; hextra.crtemp = 0.; sdrminCom.sdrmin = SMALLFLOAT; sdrminCom.sdrmax = 1e30; sdrminCom.lgSMinON = FALSE; cyclot.CycloCoolCoef = 0.; /* following are in norm.h */ /* pointer to the line in the line stack * default is Hbeta total - the second line in the stack */ norm.ipNormWavL = 1; /* the label for the normalization line */ strcpy( norm.chNormLab, " " ); /* the scale factor for the normalization line */ norm.ScaleNormLine = 1.; forcte.ForceTemp = 0.; dampon.DampOnFac = 1.; Compton.comtot = 0.; Compton.comoff = 1.; Compton.cmcool = 0.; Compton.cinrat = 0.; egray.EnerGammaRay = 7676.; filfac.fiscal = 1.; filfac.FillFac = 1.; filfac.filpow = 0.; strcpy( reason.chReason, "reason not specified." ); pstart.lgPrtStart = FALSE; pstart.nstart = 0; timed.itime = 0; timed.dt = 0.; timed.tmt1 = 0.; timed.tmpwr = 0.; limfal.LimFail = 20; limfal.lgNoMap = FALSE; /* following were block data logic */ strkon.lgStarkON = TRUE; cnegtk.lgCNegChk = TRUE; vary.lgVaryOn = FALSE; caseb.lgCaseb = FALSE; casbhs.lgCasBhs = FALSE; fston.lgFstOn = TRUE; recoil.lgCompRecoil = TRUE; colneg.lgColNeg = TRUE; freeon.lgFreeOn = TRUE; plast.lgPrtLastIt = FALSE; tseton.lgTSetOn = FALSE; trace.lgTraceInput = FALSE; trace.lgOpacBug = FALSE; trace.lgTrConvg = FALSE; trace.lgTr8446 = FALSE; trace.lgTrLevN = FALSE; trace.lgTrGant = FALSE; trace.lgOptcBug = FALSE; trace.lgTrace3Bod = FALSE; trace.lgOTSBug = FALSE; trace.lgTrMole = FALSE; trace.lgHeatBug = FALSE; trace.lgHeavyBug = FALSE; trace.lgBug2nu = FALSE; trace.lgDrBug = FALSE; trace.lgPtrace = FALSE; trace.lgDustBug = FALSE; trace.lgComBug = FALSE; trace.lgHeBug = FALSE; trace.lgCarBug = FALSE; trace.lgCalBug = FALSE; trace.lgConBug = FALSE; trace.lgNeBug = FALSE; trace.lgFeBug = FALSE; trace.lgHBug = FALSE; trace.lgTrLine = FALSE; trace.lgHe1Bug = FALSE; trace.lgHe2Bug = FALSE; trace.lgHe3Bug = FALSE; trace.nznbug = 10000; trace.npsbug = 10000; trace.lgHBugFull = FALSE; trace.lgTrace = FALSE; trace.lgPointBug = FALSE; trace.lgNeonBug = FALSE; trace.lgCoolTr = FALSE; trace.lgTrDiff = FALSE; pshort.lgPrtShort = FALSE; pbn.lgPrtBN = FALSE; /* default is open geometry, not sphere */ sphere.lgSphere = FALSE; /* the radiative transport covering factor */ sphere.covrt = 0.; /* the geometric covering factor */ sphere.covgeo = 1.; /* default is expanding when sphere set */ sphere.lgStatic = FALSE; /* option to tell code not to complain when sphere static done without iterating, * set with (OK) option on sphere command */ sphere.lgStaticNoIt = FALSE; /* option for slit projected on the nebula */ sphere.lgSlit = FALSE; /* this is exponent for emissivity contributing to observed luminosity, r^2. * set to 2 with sphere long slit, to 1 with sphere slit command */ sphere.iEmissPower = 3; /* flags that turn off molecular network */ nomole.lgNoH2Mole = FALSE; nomole.lgNoCOMole = FALSE; thigh.lgTeHigh = FALSE; parray.lgPrtArry = FALSE; /* parameters dealing with printer plots */ for( i=0; i < NDPLOT; i++ ) { plotCom.lgPltTrace[i] = FALSE; } /* this says what types of printer plots we will make */ for( i=0; i < NDPLOT; i++ ) { strcpy( plotCom.chPType[i], "NONE" ); } plotCom.lgPlotON = FALSE; drmnon.lgDrMnOn = TRUE; heclon.lgHeClON = TRUE; lyamas.lgHLyaMased = FALSE; rcota.lgNoCota = FALSE; for( i=0; i < LIMELM; i++ ) { rcota.CotaRate[i] = 0.; } trovrd.lgTrOvrd = TRUE; only.lgOnlyZone = FALSE; only.lgOnlyHead = FALSE; autoit.lgAutoIt = FALSE; autoit.autocv = 0.20; moldrv.lgDriveMole = FALSE; abnslr.lgAbnSolar = FALSE; /* used for hei */ AsSav.HeAsSav[0][1] = 6.265e8; AsSav.HeAsSav[0][2] = 5.575e7; AsSav.HeAsSav[0][3] = 1.278e7; AsSav.HeAsSav[0][4] = 4.125e6; AsSav.HeAsSav[0][5] = 1.644e6; AsSav.HeAsSav[0][6] = 7.568e5; AsSav.HeAsSav[0][7] = 3.86e5; AsSav.HeAsSav[0][8] = 2.14e5; AsSav.HeAsSav[1][2] = 4.41e7; AsSav.HeAsSav[1][3] = 8.42e6; AsSav.HeAsSav[1][4] = 2.53e6; AsSav.HeAsSav[1][5] = 9.73e5; AsSav.HeAsSav[1][6] = 4.39e5; AsSav.HeAsSav[1][7] = 2.219e5; AsSav.HeAsSav[1][8] = 1.22e5; AsSav.HeAsSav[2][3] = 8.99e6; AsSav.HeAsSav[2][4] = 2.201e6; AsSav.HeAsSav[2][5] = 7.78e5; AsSav.HeAsSav[2][6] = 3.36e5; AsSav.HeAsSav[2][7] = 1.65e5; AsSav.HeAsSav[2][8] = 8.91e4; AsSav.HeAsSav[3][4] = 2.70e6; AsSav.HeAsSav[3][5] = 7.71e5; AsSav.HeAsSav[3][6] = 3.041e5; AsSav.HeAsSav[3][7] = 1.42e5; AsSav.HeAsSav[3][8] = 7.46e4; AsSav.HeAsSav[4][5] = 1.025e6; AsSav.HeAsSav[4][6] = 3.253e5; AsSav.HeAsSav[4][7] = 1.39e5; AsSav.HeAsSav[4][8] = 6.91e4; AsSav.HeAsSav[5][6] = 4.561e5; AsSav.HeAsSav[5][7] = 1.56e5; AsSav.HeAsSav[5][8] = 7.07e4; AsSav.HeAsSav[6][7] = 2.27e5; AsSav.HeAsSav[6][8] = 8.24e4; AsSav.HeAsSav[7][8] = 1.23e5; # ifdef DEBUG_FUN fputs( " <->Zerologic()\n", debug_fp ); # endif return; }