Author Topic: run fortran code  (Read 8170 times)

Offline gio

  • Single posting newcomer
  • *
  • Posts: 3
run fortran code
« 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?

 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: run fortran code
« Reply #1 on: November 14, 2013, 07:09:42 pm »
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!]

Offline gio

  • Single posting newcomer
  • *
  • Posts: 3
Re: run fortran code
« Reply #2 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)
« Last Edit: November 28, 2013, 06:06:37 pm by gio »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: run fortran code
« Reply #3 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.
(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!]

Offline gio

  • Single posting newcomer
  • *
  • Posts: 3
Re: run fortran code
« Reply #4 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