/*spect order the emission line list according to increasing wavelength * l (index vector) is obtained using m01alf from the nag library */ #include "cddefines.h" #include "linesave.h" #include "called.h" #include "spect.h" void spect(void) { long int i, *ia, ifail, n, nline, nw; # ifdef DEBUG_FUN fputs( "<+>spect()\n", debug_fp ); # endif /*order the emission line list according to increasing wavelength * l (index vector) is obtained using m01alf from the nag library */ if( (ia = (long *)malloc( LineSave.ndsum*sizeof( long int ) ) ) == NULL ) { fprintf( ioQQQ," spect could not malloc space for ia\n"); puts( "[Stop in spect]" ); exit(1); } ifail = 0; n = LineSave.npxdd; nw = n; for( i=0; i < n; i++ ) { ia[i] = LineSv[i].lin; } /* CALL M01ALF(IA,IW,L,INDW,N,NW,IFAIL) * l not defined below as result of above not existing */ ifail = 1; if( ifail != 0 ) { fprintf( ioQQQ, " ADDLN1 fails.\n" ); puts( "[Stop in spect]" ); exit(1); } if( !called.lgTalk ) { free(ia); # ifdef DEBUG_FUN fputs( " <->spect()\n", debug_fp ); # endif return; } /* now write reordered and merged ouput */ fprintf( ioQQQ, "1\n" ); nline = (LineSave.npxdd + 3)/4; /* following are to stop lint from detecting that this is all bogus */ ia[0] = nw + nline; nline = ia[0]; free(ia); # ifdef DEBUG_FUN fputs( " <->spect()\n", debug_fp ); # endif return; }