/*ParseCompile compile werner or kurucz model atmospheres into cloudy format, by K Volk */ #include "cddefines.h" #include "opac.h" #include "lgmatch.h" #include "opacity.h" #include "createpoint.h" #include "createdata.h" #include "atlas.h" #include "werner.h" #include "costar.h" #include "rauch.h" #include "parse.h" void ParseCompile(char *chCard ) { # ifdef DEBUG_FUN fputs( "<+>ParseCompile()\n", debug_fp ); # endif /* this option to compile opacities into file for later use */ if( lgMatch("OPAC",chCard) ) { /* read in some external data files, but only if this is first call */ CreateData(); /* first generate the frequency array */ CreatePoint(); /* say that we want to compile the opacities */ opac.lgCompileOpac = TRUE; /* generate inital set of opacities ut only if this is the first call * in this coreload */ OpacityCreate(); fprintf(ioQQQ, "Success!! Created file opacity.opc\nMake sure this is on the path.\n" ); puts( "[Stop in ParseCompile]" ); exit(0); } else if( lgMatch("STAR",chCard) ) { /* this subroutine is intended to convert a sequential version of the klaus * werner or kurucz model values (assumed to come with the program) into a * direct access version for faster access. the original file is assumed to * be named in *.ASC, and the new direct access file is assumed to be named * in *.MOD. if either cannot be openned the subroutine exits. */ /* possible we only want to copy over the Rauch atmospheres */ if( lgMatch("RAUC",chCard) && lgMatch("INIT",chCard) ) { ConcatRauch(); puts( "[Stop in ParseCompile]" ); exit(0); } /* read in some external data files, but only if this is first call */ CreateData(); /* first generate the frequency array */ CreatePoint(); /* check for "only" keyword, which means only do one of the group */ if( lgMatch("ONLY",chCard) ) { /* only do one of the stars, which one?*/ if( lgMatch("WERN",chCard) ) { /* do Werner hot stars */ GetWerner(); fprintf( ioQQQ, "\n The compilation was successful!\n" ); fprintf( ioQQQ, " The portable file werner.ascii is no longer needed and may be deleted to save space.\n" ); fprintf( ioQQQ, " Do not forget to set the path when running in other directories.\n" ); fprintf( ioQQQ, "\n Good Luck!!\n\n\n" ); } else if( lgMatch("RAUC",chCard) ) { /* do the Rauch hot stars */ GetRauch(); fprintf( ioQQQ, "\n The compilation was successful!\n" ); fprintf( ioQQQ, " The portable files rauch_solar.ascii and rauch_halo.ascii are no longer needed and may be deleted to save space.\n" ); fprintf( ioQQQ, " Do not forget to set the path when running in other directories.\n" ); fprintf( ioQQQ, "\n Good Luck!!\n\n\n" ); } else if( lgMatch("COST",chCard) ) { /* do the costar OB stars */ CompileCoStar(); fprintf( ioQQQ, "\n The compilation was successful!\n" ); fprintf( ioQQQ, " The portable file costar.ascii is no longer needed and may be deleted to save space.\n" ); fprintf( ioQQQ, " Do not forget to set the path when running in other directories.\n" ); fprintf( ioQQQ, "\n Good Luck!!\n\n\n" ); } else if( lgMatch("ATLA",chCard) ) { /* do all work with Atlas */ GetAtlas(); fprintf( ioQQQ, "\n The compilation was successful!\n" ); fprintf( ioQQQ, " The portable files kurucz.ascii and kurucz.list are no longer needed and may be deleted to save space.\n" ); fprintf( ioQQQ, " Do not forget to set the path when running in other directories.\n" ); fprintf( ioQQQ, "\n Good Luck!!\n\n\n" ); } } else { /* no only, so do all three at one time*/ /* do the costar OB stars - do first since fast */ CompileCoStar(); /* do werner hot stars */ GetWerner(); /* do the rauch hot stars */ GetRauch(); /* do all work with atlas */ GetAtlas(); fprintf( ioQQQ, " \n The compilation was successful!\n" ); fprintf( ioQQQ, " The portable files kurucz.ascii, kurucz.list, rauch.ascii, and werner.ascii are no longer needed and may be deleted to save space.\n" ); fprintf( ioQQQ, " Do not forget to set the path when running in other directories.\n" ); fprintf( ioQQQ, "\n Good Luck!!\n\n\n" ); } puts( "[Stop in ParseCompile]" ); exit(0); } else { fprintf( ioQQQ, " One of the keywords, Opacity or Stars,must appear.\n" ); fprintf( ioQQQ, " Sorry.\n" ); puts( "[Stop in ParseCompile]" ); exit(1); } /* all of the above exited - can't fall to here */ }