News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

run fortran code

Started by gio, November 14, 2013, 06:35:02 PM

Previous topic - Next topic

gio

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?


oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

gio

#2
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)

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

gio

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