C---------------------------------------------------------------------- subroutine ftgr4b(iunit,nvals,incre,r4vals,status) C Read an array of Real*4 bytes from the input FITS file. C Does any required translation from FITS to internal machine format. integer nvals,iunit,incre,status,offset real r4vals(nvals) C iunit i fortran unit number C nvals i number of pixels to read C incre i byte increment between values C r4vals r output array of real*4 values C status i output error status integer ierr,ieg2cray,nloop,fpixel,ntodo,i integer compid common/ftcpid/compid if (incre .le. 4)then call ftgbyt(iunit,nvals*4,r4vals,status) else C offset is the number of bytes to move between each value offset=incre-4 call ftgbyo(iunit,4,nvals,offset,r4vals,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 ftswi4(r4vals,nvals) else if (compid .ge. 2)then C convert the values from IEEE format to VAX floating point format C first, swap the bytes call ftswby(r4vals,nvals*2) C then test for IEEE special values and multiply value by 4.0 call ftr4vx(r4vals,r4vals,nvals) else C must be a CRAY C convert from IEEE R*4 to cray R*8 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(2,ntodo,r4vals(i),0,r4vals(fpixel),1,' ') fpixel=fpixel-2 ntodo=2 10 continue end if end