Code::Blocks Forums

User forums => Help => Topic started by: gio on November 14, 2013, 06:35:02 pm

Title: run fortran code
Post by: gio on November 14, 2013, 06:35:02 pm
hi,
When build and run  fortran code using CodeBloks the output files (such as dati.dat) of program  are saved
on home directory.
if i run the code using terminal, the output file are saved on folder where i run the code.
How can i do the same it using CodeBlocks?

 
Title: Re: run fortran code
Post by: oBFusCATed on November 14, 2013, 07:09:42 pm
Use a project?
Title: Re: run fortran code
Post by: gio on November 28, 2013, 06:04:27 pm
No i'm using an empty file and save it as name_file.f90.
Open CodeBlocks, File --->New--->Empty File
I'm using CodeBlocks on Mac osx. (Sorry i forgot  this information)
Title: Re: run fortran code
Post by: oBFusCATed on November 28, 2013, 06:16:05 pm
Start using a project.
The single file mode is intended for testing purposes, only.
If you have more specific needs you'll have to use a project.
Title: Re: run fortran code
Post by: gio on December 03, 2013, 09:20:24 pm
i also used project mode but the output files are saved on home directory.
For example the program is:
program test
implicit none
open(unit=10,file='name.dat', status='replace', action='write')
write(10,*) 24
stop
end program test

The file name.dat is saved in home directory if use code blocks.
If lunch the program using the terminal with command  ./test  the file is saved in folder where  there is the  executable file