/*ipLinSafe generate unique pointer to line energy within energy mesh * line energy in Rydbergs */ #include #include "cddefines.h" #include "linelabl.h" #include "ipoint.h" #include "iplinsafe.h" long ipLinSafe(double energy, /* 4 char label for line, like those returned by chLineLbl */ char *chLabel , /* will make sure energy is < this pointer */ long ipIonEnergy ) { long int ipLinSafe_v; # ifdef DEBUG_FUN fputs( "<+>ipLinSafe()\n", debug_fp ); # endif ipLinSafe_v = ipoint(energy); /* make sure pointer is below next higher continuum if positive */ if( ipIonEnergy > 0 ) { ipLinSafe_v = MIN2( ipLinSafe_v , ipIonEnergy-1 ); } /* stuff in a label if none there */ if( strcmp(LineLabl.chLineLabel[ipLinSafe_v-1]," ")==0 ) { strcpy( LineLabl.chLineLabel[ipLinSafe_v-1], chLabel ); } # ifdef DEBUG_FUN fputs( " <->ipLinSafe()\n", debug_fp ); # endif return( ipLinSafe_v ); }