计算化学公社

标题: 推荐一个Windows10下的Fortran开发环境CodeBlocks [打印本页]

作者
Author:
gsbear    时间: 2020-2-27 14:16
标题: 推荐一个Windows10下的Fortran开发环境CodeBlocks
CodeBlocks 17.12内带GNU Fortran编译器的版本,也就是集成gfortran了,比Windows下那些古董级别的Fortran编译器兼容性好多了,也方便使用。本身体积也小,比起装个Cygwin再用gfortran小多了,而且是开源的。下载地址:
https://www.fosshub.com/Code-Blo ... w_fortran-setup.exe

http://sourceforge.net/projects/ ... w_fortran-setup.exe

(, 下载次数 Times of downloads: 134) (, 下载次数 Times of downloads: 135)



作者
Author:
zjxitcc    时间: 2020-2-27 14:43
本帖最后由 zjxitcc 于 2020-2-28 11:32 编辑

请问这个支持fortran2008语法么?比如
  1. module test_null
  2. implicit none
  3. type :: deftype
  4.   integer :: i
  5.   logical :: alive
  6.   real(kind=8), allocatable :: a(:)
  7. end type
  8. end

  9. program test_f2008
  10. use test_null
  11. implicit none
  12. type(deftype) :: deftype0
  13. deftype0 = deftype(1, .true., null())
  14. stop
  15. end
复制代码



Fortran2008之前要求没赋值的地方用null()填;2008之后则可以直接不写null()。
作者
Author:
gsbear    时间: 2020-2-27 23:49
zjxitcc 发表于 2020-2-27 14:43
请问这个支持fortran2008语法么?比如
module test_null
implicit none

没测试过最新的Fortran语法,F95是可以,至于新语法特性,你可以自己下载一个测试下
作者
Author:
St_Maxwell    时间: 2020-2-28 10:53
VS Code+gfortran不香么?
高版本的gfortran对新标准的支持比较完善,我在Windows下用的是gfortran 9.2。
(, 下载次数 Times of downloads: 137)


作者
Author:
zjxitcc    时间: 2020-2-28 10:58
St_Maxwell 发表于 2020-2-28 10:53
VS Code+gfortran不香么?
高版本的gfortran对新标准的支持比较完善,我在Windows下用的是gfortran 9.2。
...

你把null()删了也行么
作者
Author:
St_Maxwell    时间: 2020-2-28 11:25
zjxitcc 发表于 2020-2-28 10:58
你把null()删了也行么
  1. deftype0 = deftype(1, .true.)
  2. write(*,*) deftype0%i, deftype0%alive
复制代码

编译运行后打印" 1 T "
作者
Author:
xp47    时间: 2020-2-28 13:15
vscode +1
作者
Author:
gsbear    时间: 2020-2-29 13:31
xp47 发表于 2020-2-28 13:15
vscode +1

VSCode只是提供一个IDE编辑器,拿什么编译呢?
作者
Author:
xp47    时间: 2020-2-29 15:54
gsbear 发表于 2020-2-29 13:31
VSCode只是提供一个IDE编辑器,拿什么编译呢?

vscode 找扩展 有mingw之类(别的也行,mingw的简单些) 还有fortran代码分析和自动补全。自己动手配置下。
作者
Author:
xp47    时间: 2020-2-29 15:55
举个栗子https://www.jianshu.com/p/98e16631c852
作者
Author:
gsbear    时间: 2020-3-1 15:25
xp47 发表于 2020-2-29 15:54
vscode 找扩展 有mingw之类(别的也行,mingw的简单些) 还有fortran代码分析和自动补全。自己动手配置下 ...

可以用minGW那也不错,VSCODE界面功能确实要更丰富!




欢迎光临 计算化学公社 (http://ccc.keinsci.com/) Powered by Discuz! X3.3