/*PntForLine generate pointer for forbidden line */ #include #include "cddefines.h" #include "physconst.h" #include "linesave.h" #include "iplinsafe.h" #include "pntforline.h" /* * maximum number of forbidden lines - this is a good bet since * new lines do not go into this group, and lines are slowly * moving to level 1 */ #define MAXFORLIN 1000 void PntForLine(double wavelength, char *chLabel, long int *ipnt) { static long int ipForLin[MAXFORLIN]={0}, nForLin=0; # ifdef DEBUG_FUN fputs( "<+>PntForLine()\n", debug_fp ); # endif if( wavelength < 0. ) { fprintf( ioQQQ, " PntSetLin called with insane wavelength,=%10.2e\n", wavelength ); } else if( wavelength == 0. ) { /* zero is special flag to initialize */ nForLin = 0; } else { if( LineSave.ipass > 0 ) { /* not first pass, sum lines only */ *ipnt = ipForLin[nForLin]; } else if( LineSave.ipass == 0 ) { /* check if number of lines in arrays exceeded */ if( nForLin >= MAXFORLIN ) { fprintf( ioQQQ, "%5ld lines is too many for PntForLine.\n", nForLin ); fprintf( ioQQQ, " Increase the value of maxForLine everywhere in the code.\n" ); puts( "[Stop in pntforline]" ); exit(1); } /* ipLinSafe will only put in line label if nothing already there */ ipForLin[nForLin] = ipLinSafe(RYDLAM/wavelength,chLabel , 0); *ipnt = ipForLin[nForLin]; } else { /* this is case where we are only counting lines */ *ipnt = 0; } ++nForLin; } # ifdef DEBUG_FUN fputs( " <->PntForLine()\n", debug_fp ); # endif return; }