/*readck check for sanity after commands all read in */ #include "cddefines.h" #include "incidspec.h" #include "radius.h" #include "input.h" #include "phycon.h" #include "called.h" #include "readck.h" void readck(long int nqh) { int lgPstop, lgStop; double ck; # ifdef DEBUG_FUN fputs( "<+>readck()\n", debug_fp ); # endif /* lgPstop says that not enough info for model, so stop */ lgStop = FALSE; /* NSAVE is number of lines saved, =0 if no commands entered */ if( input.nSave < 0 ) { fprintf( ioQQQ, " No commands were entered - whats up?\n" ); puts( "[Stop in readck]" ); exit(1); } lgPstop = FALSE; /* check hden within range. */ if( phycon.hden == -99. ) { fprintf( ioQQQ, " Hydrogen density MUST be specified.\n" ); lgPstop = TRUE; lgStop = TRUE; } else { if( called.lgTalk && (phycon.hden < -4. || phycon.hden > 15.) ) { fprintf( ioQQQ, "\n Is this value of the H-density reasonable?\n" ); } } /* is the model going to crash? */ if( called.lgTalk && !lgStop ) { ck = 1e-37; ck /= 1e30; if( ck == 0. && ((phycon.hden < -5.3) || (phycon.hden > 19.2)) ) { fprintf( ioQQQ, " Simulation may crash because of extreme density. " "Do not use a 32-bit machine, or make everything double precision.\n\n" ); } } if( called.lgTalk && phycon.hden > 24. ) { fprintf( ioQQQ, " You must be kidding about this density. Use ATLAS instead.\n" ); } if( IncidSpec.nspec == 0 ) { fprintf( ioQQQ, " Type of continuum MUST be specified.\n" ); lgStop = TRUE; lgPstop = TRUE; } if( nqh == 0 ) { fprintf( ioQQQ, " Luminosity of continuum MUST be specified.\n" ); lgStop = TRUE; lgPstop = TRUE; } if( radius.Radius == 0. ) { fprintf( ioQQQ, " Starting radius MUST be specified.\n" ); lgStop = TRUE; lgPstop = TRUE; } if( IncidSpec.nspec != nqh ) { fprintf( ioQQQ, " There were not the same number of continuum shapes and luminosities entered.\n" ); lgStop = TRUE; } if( lgPstop ) { fprintf( ioQQQ, " Insufficient information for model, STOP.\n" ); puts( "[Stop in readck]" ); exit(1); } if( lgStop ) { puts( "[Stop in readck]" ); exit(1); } else { # ifdef DEBUG_FUN fputs( " <->readck()\n", debug_fp ); # endif return; } }