Good day. wrote the program, launched. the program itself does not give any errors, it seems to work. creates a file but does not write anything to the file . already two programs behave the same way. here is one
program ioposneg implicit none integer::i,a,x do i=1,10 open(10,file='posneg') read(10,*) a if (a>0) then open(15,file='pos') x=a write(15,*) x else open(20,file='neg') x=a write(20,*) x end if end do print*,'finished' end program ioposneg and here is the second
program ioformat implicit none real::x=0,ex integer::i character(len=5)::c='x',ec='ex' open(10,file='xex') write(10,2) c,ec 2 format(2a10) do i=1,11 ex=x**2 open(10,file='xex') write(10,5)x,ex 5 format(2f10.5) x=x+0.1 end do print*,'finished' end program ioformat The read file of the first program looks like this:
2 3 -9 15 -25 -47 85 68 -10 -5