C---------------------------------------------------------------------- subroutine ftpr4b(ounit,nvals,incre,r4vals,status) C Write an array of Real*4 bytes to the output FITS file. C Does any required translation from internal machine format to FITS. integer nvals,incre,ounit,status,offset real r4vals(nvals) C ounit i fortran unit number C nvals i number of pixels in the r4vals array C incre i byte increment between values C r4vals r array of input real*4 values C status i output error status integer compid common/ftcpid/compid integer i,neven,ierr,cray2ieg 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 from VAX format to IEEE do 5 i=1,nvals r4vals(i)=r4vals(i)*0.25 5 continue call ftswby(r4vals,nvals*2) else C must be a CRAY C there is a bug in cray2ieg if the number of values to convert C is not a multiple of 8 bytes. neven=nvals/2*2 ierr= cray2ieg(2,neven,r4vals,0,r4vals,1,' ') if (neven .ne. nvals)then C have to do the remaining odd word separately ierr= cray2ieg(2,1,r4vals(nvals/2+1),0,r4vals(nvals),1,' ') end if end if if (incre .le. 4)then call ftpbyt(ounit,nvals*4,r4vals,status) else C offset is the number of bytes to move between each value offset=incre-4 call ftpbyo(ounit,4,nvals,offset,r4vals,status) end if end