C---------------------------------------------------------------------- subroutine ftgr8b(iunit,nvals,incre,r8vals,status) C Read an array of Real*8 bytes from the input FITS file. C Does any required translation from FITS to internal machine format. integer nvals,iunit,incre,status,offset double precision r8vals(nvals) C iunit i fortran unit number C nvals i number of pixels to read C incre i byte increment between values C r8vals d output array of real*8 values C status i output error status integer compid common/ftcpid/compid integer ierr,ieg2cray,nloop,fpixel,ntodo,i if (incre .le. 8)then call ftgbyt(iunit,nvals*8,r8vals,status) else C offset is the number of bytes to move between each value offset=incre-8 call ftgbyo(iunit,8,nvals,offset,r8vals,status) end if if (compid .eq. 0 .or. compid .eq. -1)then C big endian machine (e.g., SUN) doesn't need byte swapping else if (compid .eq. 1)then C little endian machine (e.g. DEC or PC) must be byte swapped call ftswi8(r8vals,nvals) else if (compid .eq. 2)then C convert the values from IEEE format to VAX double (D) format call ieevud(r8vals,r8vals,nvals) else if (compid .eq. 3)then C convert the values from IEEE format to VMS double (G) format C first, swap the bytes call ftswby(r8vals,nvals*4) C then test for IEEE special values and multiply value by 4.0 call ftr8vx(r8vals,r8vals,r8vals,nvals) else C must be a CRAY C convert from IEEE R*8 to cray R*16 C have to work backwards, so as to not overwrite the input data nloop=(nvals+1)/2 fpixel = (nloop*2)-1 ntodo=nvals-(nloop-1)*2 do 10 i=nloop,1,-1 ierr=ieg2cray(3,ntodo,r8vals(i),0,r8vals(fpixel),1,' ') fpixel=fpixel-2 ntodo=2 10 continue end if end