C.....Subroutine to write raw output files. subroutine wrtraw(nframe,istart,iend,ihop,jstart,jend,jhop, & base,field,ilead,xmax) implicit real (a-h,o-z) real field(ilead,*) character filnam*1024, base*(*), frmt*30 C..... C Local variables: C frmt = internal file used to construct output file name C ilen = number of non-blank characters in the base name C idum,jdum = dummy loop counters C ipnt = record pointer for output file C ndigit = number of digits in current frame number C Input variables: C field,ilead = two dimensional array with leading dimension ilead C base = base name of output files C nframe = frame number (assumed set by calling program) C istart,jstart = starting column and row for output C iend,jend = ending column and row for output C ihop,jhop = column and row strides C Output variable: C xmax = largest absolute value of output C..... C.....Determine the location of last character in the base name. ilen = index(base,' ') - 1 C.....Calculate the number of digits in the current frame number. ndigit = log10(real(nframe)+0.01) + 1 C.....Construct the proper format for the desired output file name. write(frmt,'(a2,i4,a5,i9,a1)')'(a',ilen,',a1,i',ndigit,')' C.....Put this together to obtain the proper output file name. write(filnam,frmt)base,'.',nframe C.....Open the output file and write header info. open(68,file=filnam,status='new',form='unformatted', & access='direct',recl=4,err=2000) write(68,rec=1)real((iend-istart)/ihop + 1) write(68,rec=2)real((jend-jstart)/jhop + 1) C..... C Loop through writing of data. The first entry is for the upper C left corner, the next is for the next column over, etc. C..... ipnt=2 do 20 jdum=jend,jstart,-jhop do 10 idum=istart,iend,ihop ipnt=ipnt + 1 if(abs(field(idum,jdum)).gt.xmax)xmax=abs(field(idum,jdum)) write(68,rec=ipnt)field(idum,jdum) 10 continue 20 continue close(68) return 2000 write(6,*)'Error opening output file in wrtraw.' stop end