cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_extinguish.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 /*ParseExtinguish parse the extinguish command */
4 #include "cddefines.h"
5 #include "rfield.h"
6 #include "parser.h"
7 
8 /*ParseExtinguish parse the extinguish command */
10 {
11  // extinguish ionizing continuum by absorbing column AFTER
12  // setting luminosity or intensity. First number is the column
13  // density (log), second number is leakage (def=0%)
14  // last number is lowest energy (ryd), last two may be omitted
15  // from right to left
16  //
17  // extinction is actually done in extin, which is called by ContSetIntensity
18 
19  DEBUG_ENTRY( "ParseExtinguish()" );
20 
22  if( p.lgEOL() )
23  p.NoNumb("extinguishing column");
24 
25  // default is for the number to be the log of the column.
26  // there is a linear option for the column or optical depth,
27  // if linear does not occur then log, and convert to linear */
28  if( !p.nMatch("LINE" ) )
29  {
31  {
32  fprintf(ioQQQ,
33  " The first parameter on this command line is the log of either the column density or optical depth.\n");
34  fprintf(ioQQQ,
35  " The value seems pretty big to me - please check it.\n");
36  /* flush it since we will probably crash */
37  fflush(ioQQQ);
38  }
40  }
41 
42  /* option to set leakage - default is 0. */
44  if( p.lgEOL() )
46 
47  /* negative leaks are logs */
48  if( rfield.ExtinguishLeakage < 0. )
50 
51  if( rfield.ExtinguishLeakage > 1. )
52  {
53  /* but leaks greater than 1 are not allowed */
54  fprintf( ioQQQ, " A leakage of%9.0f%% was entered - this must be less than 100%%\n",
57  }
58  // user input check that H-ionizing radiation is blocked if
59  // table Draine used */
60  rfield.lgBlockHIon = true;
61 
62  /* option to set lowest energy for absorber */
64  if( p.lgEOL() )
66  else
67  {
70  if( rfield.ExtinguishLowEnergyLimit < 0.99946 )
71  fprintf( ioQQQ, " Energy less than 1 Ryd!!\n" );
72  }
73 
74  /* specify optical depth at 1 Ryd rather than column density */
75  if( p.nMatch("OPTI" ) )
76  {
77  /* convert the optical depth into the proper column density */
80  }
81 
82  return;
83 }
bool nMatch(const char *chKey) const
Definition: parser.h:150
double FFmtRead(void)
Definition: parser.cpp:472
double exp10(double x)
Definition: cddefines.h:1368
void ParseExtinguish(Parser &p)
FILE * ioQQQ
Definition: cddefines.cpp:7
Definition: parser.h:43
realnum ExtinguishEnergyPowerLow
Definition: rfield.h:81
realnum ExtinguishConvertColDen2OptDepth
Definition: rfield.h:81
realnum ExtinguishLeakage
Definition: rfield.h:81
t_rfield rfield
Definition: rfield.cpp:9
float realnum
Definition: cddefines.h:124
#define EXIT_FAILURE
Definition: cddefines.h:168
#define cdEXIT(FAIL)
Definition: cddefines.h:482
NORETURN void NoNumb(const char *chDesc) const
Definition: parser.cpp:345
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
realnum ExtinguishColumnDensity
Definition: rfield.h:81
bool lgEOL(void) const
Definition: parser.h:113
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
bool lgBlockHIon
Definition: rfield.h:96
realnum ExtinguishLowEnergyLimit
Definition: rfield.h:81