cloudy trunk
|
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 /*ParseAbsMag parse the absolute magnitude command */ 00004 #include "cddefines.h" 00005 #include "rfield.h" 00006 #include "called.h" 00007 #include "parse.h" 00008 00009 void ParseAbsMag(char *chCard, 00010 long int *nqh) 00011 { 00012 bool lgEOL; 00013 long int i; 00014 00015 DEBUG_ENTRY( "ParseAbsMag()" ); 00016 00017 /* enter luminosity in absolute magnitudes */ 00018 i = 5; 00019 strcpy( rfield.chRSpec[*nqh], "4 PI" ); 00020 rfield.totpow[*nqh] = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL); 00021 if( lgEOL ) 00022 { 00023 if( called.lgTalk ) 00024 { 00025 fprintf( ioQQQ, " There should have been a number on this line. Sorry.\n" ); 00026 } 00027 cdEXIT(EXIT_FAILURE); 00028 } 00029 if( nMatch("BOLO",chCard) ) 00030 { 00031 strcpy( rfield.chSpNorm[*nqh], "LUMI" ); 00032 rfield.range[*nqh][0] = rfield.emm; 00033 rfield.range[*nqh][1] = rfield.egamry; 00034 /* page 197 allen 76 */ 00035 rfield.totpow[*nqh] = ((4.75 - rfield.totpow[*nqh])/ 00036 2.5 + 33.5827); 00037 } 00038 else if( nMatch("VISU",chCard) ) 00039 { 00040 strcpy( rfield.chSpNorm[*nqh], "FLUX" ); 00041 /* this is 5550A, the center of the V filter */ 00042 rfield.range[*nqh][0] = 0.164f; 00043 /* totpow(nqh) = (4.79 - totpow(nqh)) / 2.5 + 18.758 00044 * page 197, allen 76, 3rd line from bottom */ 00045 rfield.totpow[*nqh] = (-rfield.totpow[*nqh]/2.5 + 00046 20.65296); 00047 } 00048 else 00049 { 00050 if( called.lgTalk ) 00051 { 00052 fprintf( ioQQQ, " Keyword BOLOmetric or VISUal must appear.\n" ); 00053 } 00054 cdEXIT(EXIT_FAILURE); 00055 } 00056 00057 /* >>chng 06 mar 22, add time option to vary only some continua with time */ 00058 if( nMatch( "TIME" , chCard ) ) 00059 rfield.lgTimeVary[*nqh] = true; 00060 00061 ++*nqh; 00062 if( *nqh >= LIMSPC ) 00063 { 00064 cdEXIT(EXIT_FAILURE); 00065 } 00066 return; 00067 }