cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_coronal.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*ParseCoronal parse parameters off coronal equilibrium command */
4 #include "cddefines.h"
5 #include "rfield.h"
6 #include "thermal.h"
7 #include "input.h"
8 #include "optimize.h"
9 #include "phycon.h"
10 #include "radius.h"
11 #include "dynamics.h"
12 #include "parse.h"
13 
14 /*ParseCoronal parse parameters off coronal equilibrium command */
15 void ParseCoronal(char *chCard,
16  long int *nqh,
17  realnum *ar1)
18 {
19  bool lgEOL;
20  long int i;
21  double a;
22 
23  DEBUG_ENTRY( "ParseCoronal()" );
24 
25  if( nMatch( "INIT" , chCard ) && nMatch( "TIME" , chCard ) )
26  {
28  }
29 
30  /* coronal equilibrium; set constant temperature to number on line */
33  i = 5;
34  a = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
35  if( lgEOL )
36  {
37  fprintf( ioQQQ, " There should be a temperature on this line.\n" );
38  cdEXIT(EXIT_FAILURE);
39  }
40 
41  /* numbers less than or equal to 10 are the log of the temperature */
42  if( a <= 10. && !nMatch("LINE",chCard) )
43  {
44  thermal.ConstTemp = (realnum)pow(10.,a);
45  }
46  else
47  {
49  }
50 
51  /* insure not below lowest allowed temperature for the code */
53  {
54  fprintf( ioQQQ, " temperature on coronal command cannot be below %.3f, reset to 3K.\n",
56  thermal.ConstTemp = 3.;
57  }
59  {
60  fprintf( ioQQQ, " temperature on coronal command cannot be above %.3f, reset to 3e9K.\n",
62  thermal.ConstTemp = 3e9;
63  }
64 
65  /* now simulate a BREMS line */
66  strcpy( rfield.chSpType[rfield.nspec], "BREMS" );
67  rfield.slope[rfield.nspec] = 1e8;
68  rfield.cutoff[rfield.nspec][0] = 0.;
69  rfield.cutoff[rfield.nspec][1] = 0.;
70 
71  /* simulate an ionization parameter line */
72  strcpy( rfield.chRSpec[*nqh], "SQCM" );
73  strcpy( rfield.chSpNorm[*nqh], "IONI" );
74 
75  /* >>chng 96 jun 17, to stop mole network from crashing */
76  /* >>chng 05 aug 15, this sets ionization parameter, in test case ism_hot_brems the
77  * value of 1e-10 was enough to dominate the ionization of he-like N - it's ionization
78  * then jumped due to large optical depth in the continuum - change U from -10 to -15 */
79  /* >>chng 05 aug 16, this very strongly affected the coll_t4 sim - apparently there
80  * was a significant photoionization contribution from the -10 continuum,
81  * this was close to a 'no photoionization' case, but lower further to insure
82  * no photo contribution
83  * chang from -15 to -20 */
84  rfield.totpow[*nqh] = -20.f;
85 
86  /* set R to large value if U specified but R is not */
87  /* set radius to very large value if not already set */
88  /* >>chng 01 jul 24, from Radius == 0 to this, as per PvH comments */
89  if( !radius.lgRadiusKnown )
90  {
91  *ar1 = (realnum)radius.rdfalt;
92  radius.Radius = pow(10.,radius.rdfalt);
93  }
94 
95  ++rfield.nspec;
96  if( rfield.nspec >= LIMSPC )
97  {
98  /* too many continua were entered */
99  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
100  cdEXIT(EXIT_FAILURE);
101  }
102  ++*nqh;
103  if( *nqh >= LIMSPC )
104  {
105  /* too many continua were entered */
106  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
107  cdEXIT(EXIT_FAILURE);
108  }
109 
110  /* vary option */
111  if( optimize.lgVarOn )
112  {
113  /* no luminosity options on vary */
115  strcpy( optimize.chVarFmt[optimize.nparm], "COROnal equilibrium %f" );
116 
117  /* pointer to where to write */
119 
120  /* log of temp will be pointer */
121  optimize.vparm[0][optimize.nparm] = (realnum)log10(phycon.te);
122  optimize.vincr[optimize.nparm] = 0.1f;
123  ++optimize.nparm;
124  }
125  return;
126 }

Generated for cloudy by doxygen 1.8.3.1