cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_f_nu.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 /*ParseF_nu parse intensity command parameters */
4 #include "cddefines.h"
5 #include "physconst.h"
6 #include "rfield.h"
7 #include "radius.h"
8 #include "parse.h"
9 
10 void ParseF_nu(
11  char *chCard,
12  long int *nqh,
13  realnum *ar1,
14  const char *chType,
15  bool lgNU2)
16 {
17  bool lgEOL;
18  long int i;
19  double fr;
20 
21  DEBUG_ENTRY( "ParseF_nu()" );
22 
23  /* flux density of this continuum source, at optional frequency */
24  i = 5;
25 
26  strcpy( rfield.chRSpec[*nqh], chType );
27 
28  rfield.totpow[*nqh] = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
29 
30  /* large luminosity but per sq cm */
31  if( rfield.totpow[*nqh] > 37. &&
32  strcmp(rfield.chRSpec[*nqh],"SQCM") == 0 )
33  {
34  fprintf( ioQQQ, " This intensity is VERY large. Problems? Was luminosity intended??\n" );
35  }
36 
37  if( lgEOL )
38  {
39  NoNumb(chCard);
40  }
41 
42  strcpy( rfield.chSpNorm[*nqh], "FLUX" );
43 
44  /* this is optional frequency in Rydbergs */
45  rfield.range[*nqh][0] = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
46 
47  /* >>chng 96 dec 18, was 1 changed to H mass nuc ryd
48  * if( lgEOL ) range(nqh,1) = 1. */
49  if( lgEOL )
50  {
51  rfield.range[*nqh][0] = HIONPOT;
52  }
53 
54  if( rfield.range[*nqh][0] <= 0. )
55  {
56  rfield.range[*nqh][0] = pow(10.,rfield.range[*nqh][0]);
57  }
58 
59  if( lgNU2 )
60  {
61  /* range is now freq in ryd, totpow is log of product nu*f_nu */
62  fr = log10(rfield.range[*nqh][0]*FR1RYD);
63  rfield.totpow[*nqh] -= fr;
64  }
65 
66  /* set R to large value in case R not specified (per sq cm)
67  * and this is per unit area */
68  if( strcmp(chType,"SQCM") == 0 && radius.Radius == 0. )
69  {
70  /* RDFALT in BLOCK DATA SCALAR, is 25 */
71  *ar1 = (realnum)radius.rdfalt;
72  radius.Radius = pow(10.,radius.rdfalt);
73  }
74 
75  /* >>chng 06 mar 22, add time option to vary only some continua with time */
76  if( nMatch( "TIME" , chCard ) )
77  rfield.lgTimeVary[*nqh] = true;
78 
79  ++*nqh;
80  if( *nqh >= LIMSPC )
81  {
82  fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
83  cdEXIT(EXIT_FAILURE);
84  }
85  return;
86 }

Generated for cloudy by doxygen 1.8.4