cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_absmag.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 /*ParseAbsMag parse the absolute magnitude command */
4 #include "cddefines.h"
5 #include "rfield.h"
6 #include "called.h"
7 #include "parse.h"
8 
9 void ParseAbsMag(char *chCard,
10  long int *nqh)
11 {
12  bool lgEOL;
13  long int i;
14 
15  DEBUG_ENTRY( "ParseAbsMag()" );
16 
17  /* enter luminosity in absolute magnitudes */
18  i = 5;
19  strcpy( rfield.chRSpec[*nqh], "4 PI" );
20  rfield.totpow[*nqh] = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
21  if( lgEOL )
22  {
23  if( called.lgTalk )
24  {
25  fprintf( ioQQQ, " There should have been a number on this line. Sorry.\n" );
26  }
27  cdEXIT(EXIT_FAILURE);
28  }
29  if( nMatch("BOLO",chCard) )
30  {
31  strcpy( rfield.chSpNorm[*nqh], "LUMI" );
32  rfield.range[*nqh][0] = rfield.emm;
33  rfield.range[*nqh][1] = rfield.egamry;
34  /* page 197 allen 76 */
35  rfield.totpow[*nqh] = ((4.75 - rfield.totpow[*nqh])/
36  2.5 + 33.5827);
37  }
38  else if( nMatch("VISU",chCard) )
39  {
40  strcpy( rfield.chSpNorm[*nqh], "FLUX" );
41  /* this is 5550A, the center of the V filter */
42  rfield.range[*nqh][0] = 0.164f;
43  /* totpow(nqh) = (4.79 - totpow(nqh)) / 2.5 + 18.758
44  * page 197, allen 76, 3rd line from bottom */
45  rfield.totpow[*nqh] = (-rfield.totpow[*nqh]/2.5 +
46  20.65296);
47  }
48  else
49  {
50  if( called.lgTalk )
51  {
52  fprintf( ioQQQ, " Keyword BOLOmetric or VISUal must appear.\n" );
53  }
54  cdEXIT(EXIT_FAILURE);
55  }
56 
57  /* >>chng 06 mar 22, add time option to vary only some continua with time */
58  if( nMatch( "TIME" , chCard ) )
59  rfield.lgTimeVary[*nqh] = true;
60 
61  ++*nqh;
62  if( *nqh >= LIMSPC )
63  {
64  cdEXIT(EXIT_FAILURE);
65  }
66  return;
67 }

Generated for cloudy by doxygen 1.8.1.1