- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you tried just using * instead ofform='unformatted'? You could also format it. Example:
WRITE(UNIT=33,'(5E17.8,1I10)) x1,y1,z1,t01,p1,q1
Regards.
Felipe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have solved this with:
open(33,file=pfile,form='unformatted')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for posting here, but I do not know because I can not create a new topic (I've tried several times but does not appear). How could I do to post?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There should be a "New Topic" button on the main forum page beneath the "Announcements" box and to the left. Do you not see this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, but when I tried to publish, the post was not published. But now, all is ok, Thanks for your answering Steve.
Regard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many posts get held for moderation - you should see a message about that when you post. If that happens, the post will appear soon. We are working to improve the moderation issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the clarification. My fault, I did not notice the moderation message.
Regard.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page