vasp 发表于 2018-4-2 10:56:47

module 的书写顺序问题

小弟新手,在编译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)       !
                              1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:36.30:

   real*8 kelvin       !
                              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) !
                                                1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:39.50:

   real*8 mass_acou(1:3) !
                                                1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:40.36:

   real*8 Q_Nose       !
                                    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*8gap_dipole_u(3)
                            1
Error: Unexpected data declaration statement at (1)
.\param_module.F90:47.53:

   real*8 a0          ! lattice constant
                                                   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
                                                               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 *

kyra 发表于 2018-4-2 11:39:53

需要提供 define.h 文件

vasp 发表于 2018-4-2 11:54:29

kyra 发表于 2018-4-2 11:39
需要提供 define.h 文件

大侠,提供了define.h文件

kyra 发表于 2018-4-2 14:30:35

您不能在 Program Main 下面立即写 Module Param_module
必须先结束 Program Main 然后才能写 module

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

pasuka 发表于 2018-4-2 14:42:45

lz既然用人家的现成开源代码,为啥不能贴全呢?好歹也贴个项目地址啊?
https://www.linkedin.com/in/takeshi-nishimatsu-9100bb80/
http://t-nissie.users.sourceforge.net/

vasp 发表于 2018-4-2 16:46:17

pasuka 发表于 2018-4-2 14:42
lz既然用人家的现成开源代码,为啥不能贴全呢?好歹也贴个项目地址啊?
https://www.linkedin.com/in/takes ...

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

vasp 发表于 2018-4-2 16:47:32

pasuka 发表于 2018-4-2 14:42
lz既然用人家的现成开源代码,为啥不能贴全呢?好歹也贴个项目地址啊?
https://www.linkedin.com/in/takes ...

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

vasp 发表于 2018-4-2 16:48:18

kyra 发表于 2018-4-2 14:30
您不能在 Program Main 下面立即写 Module Param_module
必须先结束 Program Main 然后才能写 module



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

pasuka 发表于 2018-4-3 09:23:23

vasp 发表于 2018-4-2 16:47
大侠,我qq:44711606,能否认识下?

可以加入本站的QQ群:2338021
http://v.fcode.cn/
此外,本站的教学视频务必看三遍!
页: [1]
查看完整版本: module 的书写顺序问题