I’m trying to dump some real*4 binary arrays to disk and I
get garbage results, even though doing an ascii dump of a portion
of the array shows the data values themselves to be ok.
If I’m dumping an array (real4) of NSMP samples to disk, what
should I set the record length to be? I’m currently setting the
record length to NSMP4, but this produces garbage.
Thanks for any help,
Catherine
Here’s a code sample:
PROGRAM READ_QSCAT
IMPLICIT NONE
INTEGER, PARAMETER :: NLAT = 180
INTEGER, PARAMETER :: NLONG = 360
INTEGER, PARAMETER :: NPIX = 4
CHARACTER(LEN=120) :: FILENAME
REAL4, DIMENSION(NLONGNPIX,NLATNPIX) :: WINDSPD, WINDDIR, RADRAIN
INTEGER4, DIMENSION(NLONGNPIX,NLATNPIX) :: SCATFLAG
INTEGER :: ILINE,ISMP
INTEGER :: IERR
filename = ‘/data/L2TC/cmm/tasc/200001’
call get_scat_averaged_v03(filename, windspd, winddir, scatflag, radrain, ierr)
open(10,file=‘windspeed.bin’,form=‘unformatted’,access=‘direct’, &
recl=nlongnpix4,action=‘write’,status=‘replace’)
open(11,file=‘windangle.bin’,form=‘unformatted’,access=‘direct’, &
recl=nlongnpix4,action=‘write’,status=‘replace’)
do iline = 1,nlatnpix
write(10,rec=iline) (windspd(ismp,iline),ismp=1,nlongnpix)
write(11,rec=iline) (winddir(ismp,iline),ismp=1,nlong*npix)
end do
close(10)
close(11)
END PROGRAM READ_QSCAT