Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

problems with unformatted file

$
0
0

My module:

module m2

 contains
subroutine wrtrec(iter,n)
integer,intent(in) :: n
integer,intent(in) :: iter
real,dimension(:),allocatable :: x,y,z,t,t0,u,p
real :: x1,y1,z1,t01,u1,p1
integer,dimension(:),allocatable :: q
integer :: id1,id2
character(7)  :: dfile="fd  .tx"
character(6)  :: pfile="rec.  "

allocate(x(n))
allocate(y(n))
allocate(z(n))
allocate(t(n))
allocate(t0(n))
allocate(u(n))
allocate(p(n))
allocate(q(n))

t0=0

  id1=iter/10
  id2=iter-10*id1
  dfile(3:4)=CHAR(id1+48)//CHAR(id2+48)
  pfile(5:6)=CHAR(id1+48)//CHAR(id2+48)
open(32,file=dfile)
open(33,file=pfile)

  do i=1,n
      read (unit=32, fmt=88)x(i),y(i),z(i),t(i),u(i),q(i)
88 format(5f10.3,i3)
if(i.eq.1) then
p(1)=0
else
p=u
end if

      x1=x(i)
      y1=y(i)
      z1=z(i)
     t01=t0(i)
      p1=p(i)
      q1=q(i)

      write(unit=33, form='unformatted')x1,y1,z1,t01,p1,q1
  end do

deallocate(x)
deallocate(y)
deallocate(z)
deallocate(t)
deallocate(t0)
deallocate(u)
deallocate(p)
deallocate(q)

end subroutine

end module

I got :

milenko@milenkons:~/mgtalgarve$ ifort -c -fp-stack-check -g -traceback m2.f90
m2.f90(48): error #6254: This keyword is invalid for this I/O operation.   [FORM]
      write(unit=33, form='unformatted')x1,y1,z1,t01,p1,q1
---------------------^
m2.f90(48): error #7939: A scalar default-character variable is required in this context.   ['unformatted']
      write(unit=33, form='unformatted')x1,y1,z1,t01,p1,q1
--------------------------^
compilation aborted for m2.f90 (code 1)
Why?


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>