- #1
sketos
- 56
- 0
I am using the following subroutine:
But if i want to save the gnuplot code in a different file(e.g the file Graphs) i can
but the how can i change directory from fortran to this file complile the gnuplot code, then remove it and go back to my old directory?
This apparently doesn't work:
Code:
subroutine plot_2pCF_2D(A_0,index_0,Point_color,Title)
implicit none
integer ret
real A_0,index_0
character(len=*) :: Point_color,Title
OPEN(10,ACCESS='SEQUENTIAL',FILE='gp.txt')
write(10,*)'set terminal postscript eps color enhanced size 5,7'
write(10,*)'set output "LCDM_Na_est.eps";'
write(10,*)'set logscale x'
write(10,*)'set logscale y'
write(10,*)'set zeroaxis'
write(10,*)'set yrange [0.001:]'
write(10,*)'set xlabel "{/Symbol q} (degrees)" font "Times-Roman, 20;'
write(10,*)'set ylabel "w({/Symbol q})" font "Times-Roman, 20;'
write(10,*)'set title "'//TRIM(Title)//'" font "Times-Roman, 30;'
write(10,*)'A1=',A_0
write(10,*)'g1=',index_0
write(10,*)'f(x)=10**(log10(A1)+(1-g1)*log10(x))'
write(10,*)'plot "Na_est_LCDM.txt" with errorbars lc rgb"'//TRIM(Point_color)//'" notitle,f(x) lc rgb"black" notitle'
CLOSE(10,STATUS='KEEP')
ret=SYSTEM('gnuplot gp.txt')
ret=SYSTEM('rm gp.txt')
end subroutine
But if i want to save the gnuplot code in a different file(e.g the file Graphs) i can
Code:
OPEN(10,ACCESS='SEQUENTIAL',FILE='Graphs/gp.txt')
but the how can i change directory from fortran to this file complile the gnuplot code, then remove it and go back to my old directory?
This apparently doesn't work:
Code:
ret=SYSTEM('cd Graphs')
ret=SYSTEM('gnuplot gp.txt')
ret=SYSTEM('rm gp.txt')
ret=SYSTEM('cd ..')