/*ParseSphere parse parameters on sphere command */ #include "cddefines.h" #include "sphere.h" #include "opac.h" #include "taumin.h" #include "ffmtread.h" #include "lgmatch.h" #include "parse.h" void ParseSphere(char *chCard ) { int lgEOL; long int i; double fac; # ifdef DEBUG_FUN fputs( "<+>ParseSphere()\n", debug_fp ); # endif /* compute a spherical model, diffuse field from other side included */ sphere.lgSphere = TRUE; /* turn off electron scattering opacity */ opac.lgScatON = FALSE; /* if "STATIC" is specified then set to case B for H lines */ if( lgMatch("STAT",chCard) ) { sphere.lgStatic = TRUE; tauminCom.tlamin = 1e5; /* this is option to not check on iterations, used for debugging H atom */ if( lgMatch("(OK)",chCard) ) { sphere.lgStaticNoIt = TRUE; } } /* check for optional covering factor */ i = 5; fac = FFmtRead(chCard,&i,76,&lgEOL); if( lgEOL ) { sphere.covgeo = 1.; } else { sphere.covgeo = (float)fac; /* it is a log if negative */ if( sphere.covgeo <= 0. ) { sphere.covgeo = (float)pow(10.,sphere.covgeo); } } sphere.covrt = sphere.covgeo; /* check that covering factors not greater than unity */ if( sphere.covgeo>1. ) { fprintf(ioQQQ," A covering factor greater than 1 does not make sense to me.\n"); fprintf(ioQQQ," The entered covering factor was %g\n", sphere.covgeo); puts( "[Stop in ParseSphere]" ); exit(1); } /* if the "BEAM" or "SLIT" option is specified then only part * of the sphere is observed, and intensities * should not be increased by r^2. There are two limiting cases, SLIT in which * the slit is longer than the diameter of the nebula and the contibution to the * detected luminosity goes as r^1, and BEAM when the contribution is r^0, * or same as plane parallel */ if( lgMatch("SLIT",chCard) ) { sphere.lgSlit = TRUE; /* long slit is case where slit is longer than diameter, so emissivity contributes * r^1 to the observed luminosity */ sphere.iEmissPower = 2; } else if( lgMatch("BEAM",chCard) ) { sphere.lgSlit = TRUE; /* long slit is case where slit is longer than diameter, so emissivity contributes * r^1 to the observed luminosity */ /* this is the default or SHORT case, where r^0 is dependence */ sphere.iEmissPower = 1; } # ifdef DEBUG_FUN fputs( " <->ParseSphere()\n", debug_fp ); # endif return; }