Fortran Coder

查看: 10377|回复: 8
打印 上一主题 下一主题

[Module] module 的书写顺序问题

[复制链接]

5

帖子

1

主题

0

精华

新人

F 币
22 元
贡献
12 点
跳转到指定楼层
楼主
发表于 2018-4-2 10:56:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
小弟新手,在编译Fortran 文件时候遇到以下问题,请求高手解决,如何编译?
==============================================================================
Generating Makefile... Okay
==============================================================================
Compiling .\param_module.F90
.\param_module.F90:7.19:

module Param_module
                   1
Error: Unexpected MODULE statement at (1)
.\param_module.F90:8.15:

  implicit none
               1
Error: Unexpected IMPLICIT NONE statement at (1)
.\param_module.F90:9.17:

  type Param_type
                 1
Error: Unexpected derived type declaration statement at (1)
.\param_module.F90:33.21:

     logical continue
                     1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:34.113:

     character(len=30) :: method ! 'md' Nose-Poincare, 'vs' velocity-scaling, 'lf' leapfrog, 'hl' hysteresis loop
                                                                                                                 1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:35.32:

     real*8 GPa(3)       ! [GPa]
                                1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:36.30:

     real*8 kelvin       ! [K]
                              1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:37.33:

     real*8 target_kinetic_energy
                                 1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:38.50:

     real*8 mass_dipo(1:3) ! [eV Angstrom^-2 ps^2]
                                                  1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:39.50:

     real*8 mass_acou(1:3) ! [eV Angstrom^-2 ps^2]
                                                  1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:40.36:

     real*8 Q_Nose       ! [eV ps^2]
                                    1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:42.37:

     character(len=4) :: bulk_or_film
                                     1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:43.33:

     integer Lx, Ly, Lz ! Integer
                                 1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:44.33:

     integer gap_id     ! 0, 1, 2
                                 1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:45.22:

     integer padding_y
                      1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:46.28:

     real*8  gap_dipole_u(3)
                            1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:47.53:

     real*8 a0          ! lattice constant [Angstrom]
                                                     1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:48.22:

     real*8 epi_strain
                      1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:50.63:

     real*8 dt          ! Time step width delta t [pico second]
                                                               1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:51.25:

     integer n_thermalize
                         1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:52.22:

     integer n_average
                      1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:53.28:

     integer n_E_wave_period
                            1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:54.70:

     integer n_coord_freq  ! frequency for writing out the coordinates
                                                                      1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:55.62:

     integer n_hl_freq     ! frequency for writing to .hl file
                                                              1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:56.39:

     integer n_hysteresis_loop_continue
                                       1
Error: Unexpected data declaration statement at (1)
Fatal Error: Error count reached limit of 25.
Error(E42): Last command making (build\param_module.o) returned a bad status
Error(E02): Make execution terminated

* Failed *

msg_module.F90

1.27 KB, 下载次数: 3

param_module.F90

21.43 KB, 下载次数: 5

分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

235

帖子

0

主题

0

精华

版主

World Analyser

F 币
630 元
贡献
464 点

新人勋章美女勋章元老勋章热心勋章规矩勋章管理勋章

QQ
沙发
发表于 2018-4-2 11:39:53 | 只看该作者
需要提供 define.h 文件

5

帖子

1

主题

0

精华

新人

F 币
22 元
贡献
12 点
板凳
 楼主| 发表于 2018-4-2 11:54:29 | 只看该作者
kyra 发表于 2018-4-2 11:39
需要提供 define.h 文件

大侠,提供了define.h文件

define.h.txt

1.31 KB, 下载次数: 2

235

帖子

0

主题

0

精华

版主

World Analyser

F 币
630 元
贡献
464 点

新人勋章美女勋章元老勋章热心勋章规矩勋章管理勋章

QQ
地板
发表于 2018-4-2 14:30:35 | 只看该作者
您不能在 Program Main 下面立即写 Module Param_module
必须先结束 Program Main 然后才能写 module

看起来你的程序似乎没有主程序,你需要自己完成主程序。但不能让 module Param_module 包含在主程序里。应该在后面写,或者单独弄一个源代码文件写。

490

帖子

4

主题

0

精华

大宗师

F 币
3298 元
贡献
1948 点

水王勋章元老勋章热心勋章

5#
发表于 2018-4-2 14:42:45 | 只看该作者
lz既然用人家的现成开源代码,为啥不能贴全呢?好歹也贴个项目地址啊?
https://www.linkedin.com/in/takeshi-nishimatsu-9100bb80/
http://t-nissie.users.sourceforge.net/

5

帖子

1

主题

0

精华

新人

F 币
22 元
贡献
12 点
6#
 楼主| 发表于 2018-4-2 16:46:17 | 只看该作者
pasuka 发表于 2018-4-2 14:42
lz既然用人家的现成开源代码,为啥不能贴全呢?好歹也贴个项目地址啊?
https://www.linkedin.com/in/takes ...

谢谢这位大侠提醒,我只是对这个开源代码部分比较感兴趣

5

帖子

1

主题

0

精华

新人

F 币
22 元
贡献
12 点
7#
 楼主| 发表于 2018-4-2 16:47:32 | 只看该作者
pasuka 发表于 2018-4-2 14:42
lz既然用人家的现成开源代码,为啥不能贴全呢?好歹也贴个项目地址啊?
https://www.linkedin.com/in/takes ...

大侠,我qq:44711606,能否认识下?

5

帖子

1

主题

0

精华

新人

F 币
22 元
贡献
12 点
8#
 楼主| 发表于 2018-4-2 16:48:18 | 只看该作者
kyra 发表于 2018-4-2 14:30
您不能在 Program Main 下面立即写 Module Param_module
必须先结束 Program Main 然后才能写 module

谢谢,这位大侠解答,我明白了

490

帖子

4

主题

0

精华

大宗师

F 币
3298 元
贡献
1948 点

水王勋章元老勋章热心勋章

9#
发表于 2018-4-3 09:23:23 | 只看该作者
vasp 发表于 2018-4-2 16:47
大侠,我qq:44711606,能否认识下?

可以加入本站的QQ群:2338021
http://v.fcode.cn/
此外,本站的教学视频务必看三遍!
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-4-24 15:25

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表