cloudy  trunk
 All Data Structures Namespaces 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-2022 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 "thermal.h"
6 #include "input.h"
7 #include "optimize.h"
8 #include "phycon.h"
9 #include "dynamics.h"
10 #include "parser.h"
11 #include "atmdat.h"
12 
13 /*ParseCoronal parse parameters off coronal equilibrium command */
15 {
16  double a;
17 
18  DEBUG_ENTRY( "ParseCoronal()" );
19 
20  /* use coronal command to establish initial conditions in a cooling
21  * time-varying cloud */
22  if( p.nMatch( "INIT" ) && p.nMatch( "TIME" ) )
23  {
25  dynamics.lgRecom = true;
27  if( p.nMatch( "TRAC" ) )
28  dynamics.lgTracePrint = true;
29  }
30 
31  /* coronal equilibrium; set constant temperature to number on line */
34 
35  // kinetic temperatures for a given ion are higher for coronal equilibrium
36  // simulations - large Fe chianti/stout models are needed to get the full cooling
38  {
41  }
43  {
46  }
47 
48  a = p.FFmtRead();
49  if( p.lgEOL() )
50  {
51  fprintf( ioQQQ, " There should be a temperature on this line.\n" );
53  }
54 
55  /* numbers less than or equal to 10 are the log of the temperature */
56  if( (a <= 10. && !p.nMatch("LINE")) || p.nMatch(" LOG") )
57  {
59  }
60  else
61  {
63  }
64 
65  /* check temperature bounds */
67  {
69  fprintf( ioQQQ, " PROBLEM Te too low, reset to %g K.\n",
71  }
73  {
75  fprintf( ioQQQ, " PROBLEM Te too high, reset to %g K.\n",
77  }
78 
79  /* vary option */
80  if( optimize.lgVarOn )
81  {
82  /* no luminosity options on vary */
84  strcpy( optimize.chVarFmt[optimize.nparm], "COROnal equilibrium %f LOG" );
86  strcat( optimize.chVarFmt[optimize.nparm], " TIME INIT" );
87 
88  /* pointer to where to write */
90 
91  /* log of temp will be pointer */
93  optimize.vincr[optimize.nparm] = 0.1f;
96  ++optimize.nparm;
97  }
98  return;
99 }
bool lgStoutLevelsSet
Definition: atmdat.h:415
bool nMatch(const char *chKey) const
Definition: parser.h:150
t_atmdat atmdat
Definition: atmdat.cpp:6
t_thermal thermal
Definition: thermal.cpp:6
bool lgChiantiLevelsSet
Definition: atmdat.h:388
double FFmtRead(void)
Definition: parser.cpp:472
double exp10(double x)
Definition: cddefines.h:1368
const long nDefaultCollLevelsFe
Definition: atmdat.h:364
t_input input
Definition: input.cpp:12
long int nvfpnt[LIMPAR]
Definition: optimize.h:198
bool lgTimeDependentStatic
Definition: dynamics.h:102
bool lgTracePrint
Definition: dynamics.h:183
long nStoutMaxLevelsFe
Definition: atmdat.h:410
realnum varang[LIMPAR][2]
Definition: optimize.h:201
long int nRead
Definition: input.h:105
t_phycon phycon
Definition: phycon.cpp:6
bool lgTemperatureConstant
Definition: thermal.h:44
char chVarFmt[LIMPAR][FILENAME_PATH_LENGTH_2]
Definition: optimize.h:267
FILE * ioQQQ
Definition: cddefines.cpp:7
realnum vparm[LIMEXT][LIMPAR]
Definition: optimize.h:192
t_dynamics dynamics
Definition: dynamics.cpp:42
Definition: parser.h:43
bool lgVarOn
Definition: optimize.h:207
const double TEMP_LIMIT_LOW
Definition: phycon.h:121
long int nparm
Definition: optimize.h:204
const double TEMP_LIMIT_HIGH
Definition: phycon.h:123
long nStoutMaxLevels
Definition: atmdat.h:413
float realnum
Definition: cddefines.h:124
#define EXIT_FAILURE
Definition: cddefines.h:168
#define cdEXIT(FAIL)
Definition: cddefines.h:482
long nChiantiMaxLevels
Definition: atmdat.h:386
t_optimize optimize
Definition: optimize.cpp:6
realnum vincr[LIMPAR]
Definition: optimize.h:195
bool lgTemperatureConstantCommandParsed
Definition: thermal.h:50
realnum ConstTemp
Definition: thermal.h:56
const long nDefaultCollLevels
Definition: atmdat.h:366
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
bool lgEOL(void) const
Definition: parser.h:113
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
bool lgRecom
Definition: dynamics.h:108
long nChiantiMaxLevelsFe
Definition: atmdat.h:384
bool lg_coronal_time_init
Definition: dynamics.h:99
void ParseCoronal(Parser &p)
long int nvarxt[LIMPAR]
Definition: optimize.h:198