/home66/gary/public_html/cloudy/c08_branch/source/parse_f_nu.cpp

Go to the documentation of this file.
00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
00002  * others.  For conditions of distribution and use see copyright notice in license.txt */
00003 /*ParseF_nu parse intensity command parameters */
00004 #include "cddefines.h"
00005 #include "physconst.h"
00006 #include "rfield.h"
00007 #include "radius.h"
00008 #include "parse.h"
00009 
00010 void ParseF_nu(
00011   char *chCard, 
00012   long int *nqh, 
00013   realnum *ar1, 
00014   const char *chType, 
00015   bool lgNU2)
00016 {
00017         bool lgEOL;
00018         long int i;
00019         double fr;
00020 
00021         DEBUG_ENTRY( "ParseF_nu()" );
00022 
00023         /* flux density of this continuum source, at optional frequency */
00024         i = 5;
00025 
00026         strcpy( rfield.chRSpec[*nqh], chType );
00027 
00028         rfield.totpow[*nqh] = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00029 
00030         /* large luminosity but per sq cm */
00031         if( rfield.totpow[*nqh] > 37. && 
00032                 strcmp(rfield.chRSpec[*nqh],"SQCM") == 0 )
00033         {
00034                 fprintf( ioQQQ, " This intensity is VERY large.  Problems?  Was luminosity intended??\n" );
00035         }
00036 
00037         if( lgEOL )
00038         {
00039                 NoNumb(chCard);
00040         }
00041 
00042         strcpy( rfield.chSpNorm[*nqh], "FLUX" );
00043 
00044         /* this is optional frequency in Rydbergs */
00045         rfield.range[*nqh][0] = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00046 
00047         /* >>chng 96 dec 18, was 1 changed to H mass nuc ryd
00048          * if( lgEOL ) range(nqh,1) = 1. */
00049         if( lgEOL )
00050         {
00051                 rfield.range[*nqh][0] = HIONPOT;
00052         }
00053 
00054         if( rfield.range[*nqh][0] <= 0. )
00055         {
00056                 rfield.range[*nqh][0] = pow(10.,rfield.range[*nqh][0]);
00057         }
00058 
00059         if( lgNU2 )
00060         {
00061                 /* range is now freq in ryd, totpow is log of product nu*f_nu */
00062                 fr = log10(rfield.range[*nqh][0]*FR1RYD);
00063                 rfield.totpow[*nqh] -= fr;
00064         }
00065 
00066         /* set R to large value in case R not specified (per sq cm)
00067          * and this is per unit area */
00068         if( strcmp(chType,"SQCM") == 0 && radius.Radius == 0. )
00069         {
00070                 /* RDFALT in BLOCK DATA SCALAR, is 25 */
00071                 *ar1 = (realnum)radius.rdfalt;
00072                 radius.Radius = pow(10.,radius.rdfalt);
00073         }
00074 
00075         /* >>chng 06 mar 22, add time option to vary only some continua with time */
00076         if( nMatch( "TIME" , chCard ) )
00077                 rfield.lgTimeVary[*nqh] = true;
00078 
00079         ++*nqh;
00080         if( *nqh >= LIMSPC )
00081         {
00082                 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
00083                 cdEXIT(EXIT_FAILURE);
00084         }
00085         return;
00086 }

Generated on Mon Feb 16 12:01:25 2009 for cloudy by  doxygen 1.4.7