cloudy  trunk
 All Data Structures 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-2008 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 "extinc.h"
7 
8 /*ParseExtinguish parse the extinguish command */
9 void ParseExtinguish( char *chCard )
10 {
11  long int i;
12  bool lgEOL;
13  /* extinguish ionizing continuum by absorbing column AFTER
14  * setting luminosity or Q(H). First number is the column
15  * density (log), second number is leakage (def=0%)
16  * last number is lowest energy (ryd), last two may be omitted
17  * from right to left
18  *
19  * extinction is actually done in extin, which is called by ContSetIntensity */
20 
21  DEBUG_ENTRY( "ParseExtinguish()" );
22 
23  i = 5;
24  extinc.excolm = (realnum)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
25  if( lgEOL )
26  NoNumb(chCard);
27 
28  /* >>chng 01 dec 19, add linear option */
29  /* default is for the number to be the log of the column.
30  * there is a linear option for the column or optical depth,
31  * if linear does not occur then log, and convert to linear */
32  if( !nMatch("LINE" , chCard ) )
33  {
34  /* >>chng 03 jan 02, make comment if first value seems too large */
35  if( extinc.excolm>35. )
36  {
37  fprintf(ioQQQ,
38  " The first parameter on this command line is the log of either the column density or optical depth.\n");
39  fprintf(ioQQQ,
40  " The value seems pretty big to me - please check it.\n");
41  /* flush it since we will probably crash */
42  fflush(ioQQQ);
43  }
44  extinc.excolm = (realnum)pow((realnum)10.f,extinc.excolm);
45  }
46 
47  /* option to set leakage - default is 0. */
48  extinc.exleak = (realnum)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
49  /* optional leakage is zero */
50  if( lgEOL )
51  extinc.exleak = 0.;
52 
53  /* negative leaks are logs */
54  if( extinc.exleak < 0. )
55  extinc.exleak = (realnum)pow((realnum)10.f,extinc.exleak);
56 
57  if( extinc.exleak > 1. )
58  {
59  /* but leaks greater than 1 are not allowed */
60  fprintf( ioQQQ, " A leakage of%9.0f%% was entered - this must be less than 100%%\n",
61  extinc.exleak*100. );
62  cdEXIT(EXIT_FAILURE);
63  }
64  /* user input check that H-ionizing radiation is blocked if
65  * table Draine used */
66  rfield.lgBlockHIon = true;
67 
68  /* option to set lowest energy for absorber */
69  extinc.exlow = (realnum)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
70  if( lgEOL )
71  {
72  extinc.exlow = 0.99946f;
73  }
74 
75  else
76  {
77  if( extinc.exlow <= 0. )
78  extinc.exlow = (realnum)pow((realnum)10.f,extinc.exlow);
79  if( extinc.exlow < 0.99946 )
80  {
81  fprintf( ioQQQ, " Energy less than 1 Ryd!!\n" );
82  }
83  }
84 
85  /* >>chng 01 dec 19, add optical depth at 1 Ryd rather than column density */
86  if( nMatch("OPTI" , chCard ) )
87  {
88  /* convert the optical depth into the proper column density */
91  }
92  return;
93 }

Generated for cloudy by doxygen 1.8.1.2