/*dgaunt drive gaunt factor routines by letting user query values */ #include "cddefines.h" #include "phycon.h" #include "logte.h" #include "gffsub.h" #include "ffmtread.h" #include "dgaunt.h" void dgaunt(void) { char chCard[130]; int lgEOL; long int i, ierror, if1; float ener[1], gfac[1]; # ifdef DEBUG_FUN fputs( "<+>dgaunt()\n", debug_fp ); # endif /* this routine is entered with the command DRIVE GAUNT, and * drives the gaunt factor routine to check range * */ fprintf( ioQQQ, " Enter the temperature (log if <=10) and energy (Ryd). Null line to stop.\n" ); /* >>chng 96 july 7, got rid of statement labels replacing with do while * */ ierror = 0; while( ierror == 0 ) { if( fgets( chCard , sizeof(chCard) , stdin ) == NULL ) { fprintf( ioQQQ, " dgaunt error getting magic number\n" ); puts( "[Stop in dgaunt]" ); exit(1); } i = 1; phycon.te = (float)FFmtRead(chCard,&i,76,&lgEOL); /* the line may be trash but ierror will pick it up */ if( lgEOL ) { fprintf( ioQQQ, " Gaunt driver exits, enter next line.\n" ); break; } /* numbers less than or equal to 10 are the log of the temperature */ if( phycon.te <= 10. ) { logte.alogte = phycon.te; } else { logte.alogte = (float)log10(phycon.te); } ener[0] = (float)FFmtRead(chCard,&i,76,&lgEOL); if( lgEOL || ener[0] == 0. ) { fprintf( ioQQQ, " Sorry, but there should be a second nonzero number, the energy.\n" ); } if( ener[0] > 0. ) { ener[0] = (float)log10(ener[0]); } gffsub(0.,ener,gfac,1,1,&if1); fprintf( ioQQQ, " Gaunt factor is" ); fprintf( ioQQQ, "%11.3e\n", gfac[0] ); /* if1=1 if GAMS is out of range; 2 if U is out of range. */ if( if1 != 0 ) { fprintf( ioQQQ, " Failure mode is%2ld\n", if1 ); } } # ifdef DEBUG_FUN fputs( " <->dgaunt()\n", debug_fp ); # endif return; }