@@ -18,16 +18,22 @@ program donut
18
18
real (wp) :: sini,cosj,sinA,sinj,cosA,cosj2, mess, cosi,cosB,t,sinB
19
19
integer :: x,y,o,N,ii, u, Nloop
20
20
character (5 ) :: buf
21
+
21
22
character (:), allocatable :: dumpfn
23
+ logical :: dump
22
24
23
- Nloop = 100
25
+ Nloop = 300
26
+ dump = .false.
24
27
do ii = 1 , command_argument_count()
25
28
call get_command_argument(ii, buf)
26
29
27
30
select case (buf)
28
31
case (" -dump" )
29
32
call get_command_argument(ii+1 , buf, status= k)
30
- if (k== 0 ) dumpfn = trim (buf)
33
+ if (k== 0 ) then
34
+ dumpfn = trim (buf)
35
+ dump = .true.
36
+ endif
31
37
case (" -frames" )
32
38
call get_command_argument(ii+1 , buf, status= k)
33
39
if (k== 0 ) read (buf, ' (I5)' ) Nloop
@@ -41,7 +47,7 @@ program donut
41
47
42
48
allocate (z(0 :L-1 ), screen(0 :L-1 ))
43
49
44
- if (allocated (dumpfn) ) open (newunit= u, file= dumpfn, status= ' replace' , action= ' write' )
50
+ if (dump ) open (newunit= u, file= dumpfn, status= ' replace' , action= ' write' )
45
51
46
52
write (stdout," (a)" , advance= " no" ) ESC // " [2J" ! < move cursor to top left
47
53
@@ -79,16 +85,14 @@ program donut
79
85
write (stdout, " (a)" , advance= " no" ) ESC // " [d" ! < line feed
80
86
81
87
do k= 0 , rows-2
82
- print * , screen(k* cols:k* cols+ cols)
83
- if (allocated (dumpfn)) write (u, " (80a )" ) screen(k* cols:k* cols+ cols)
88
+ print ' (81a) ' , screen(k* cols:k* cols+ cols)
89
+ if (dump) write (u, " (81a )" ) screen(k* cols:k* cols+ cols)
84
90
enddo
85
91
86
- ! print *, size(screen), k*cols,k*cols+cols
87
-
88
92
a = a + 0.04
89
93
b = b + 0.02
90
94
enddo
91
95
92
- if (allocated (dumpfn) ) close (u)
96
+ if (dump ) close (u)
93
97
94
98
end program
0 commit comments