program curves c Create the empirical and theoretical data files for the plots. implicit none c t, x, and y values real t(0:100),x(0:150),y(0:75) c pi real pi c intermediate value in vorticity computation real temp c indices integer i,j,n c maximum value of indices integer imax,jmax,nmax c format for comment lines 10 format('# ',a) c the g format below can handle very large and very small plot values 20 format(g11.4,g12.4) c however, the f format is much more compact and saves disk space c you do need to check that no numbers are printed as ****.. 30 format(f6.3,f7.3,f8.4) c velocity plot file open(1,file='veloc.plt') write(1,10) & 'Theoretical velocity plots, listing t and v_p on each line.' write(1,20) write(1,10) & 'First curve for white miata; data below equal', & 'v_p = 100% (1 - exp(-t/10)) with 0 < t < 30 seconds' nmax=100 do 110 n=0,nmax t(n)=n*30./nmax write(1,20)t(n),100.*(1.-exp(-t(n)/10.)) 110 continue c note that a blank line is needed to separate the two curves write(1,20) write(1,10) & 'Second curve for red miata; data below equal', & 'v_p = 50% (1 - exp(-t/10)) with 0 < t < 30 seconds' nmax=100 do 120 n=0,nmax t(n)=n*30./nmax write(1,20)t(n),50.*(1.-exp(-t(n)/10.)) 120 continue close(1) c acceleration plot file open(1,file='accel.plt') write(1,10) & 'Relative acceleration, listing a_p/a_p(0) versus t.', & 'a_p(t)/a_p(0) = exp(-t/10) with 0 < t < 30 seconds' nmax=100 do 210 n=0,nmax t(n)=n*30./nmax write(1,20)t(n),exp(-t(n)/10.) 210 continue close(1) c measured velocity plot file open(1,file='meas.plt') write(1,10) & 'Measured white Miata velocity as reported in literature.', & 'See citation Self12 for details.' nmax=10 do 310 n=0,nmax t(n)=n*30./nmax write(1,20)t(n),100.*(1.-exp(-t(n)/10.)) 310 continue write(1,20) write(1,10) & 'Measured red Miata velocity as reported in literature.', & 'See citation Self12 for details.' nmax=10 do 320 n=0,nmax t(n)=n*30./nmax write(1,20)t(n),50.*(1.-exp(-t(n)/10.)) 320 continue close(1) c set pi pi=4.*atan(1.) c streamwise vorticity of Goertler vortices. open(1,file='goertler.plt') write(1,10) & 'Gortler vorticity f, listing x, y, and f on each line.', & 'For reasons too complex to go into here, the vorticity in', & 'Goertler vortices always takes the form', & 'f = sin(pi x) sin(2 pi y)/(2 - sin(pi x) sin(2 pi y))', & 'However, feel free to check a random point below.' imax=150 jmax=75 do 500 i=0,imax write(1,30) x(i)=i*2./imax do 490 j=0,jmax y(j)=j*1./jmax temp=sin(pi*x(i))*sin(2.*pi*y(j)) write(1,30)x(i),y(j),temp/(2.-temp) 490 continue 500 continue close(1) end