24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 1338  |  回复: 2

damao4361556

铁虫 (正式写手)

[交流] PWSCF 算完能带 和 dos 后的数据 如何转换成origin 能打开的 格式? 已有1人参与

PWSCF 算完能带 和 dos 后的数据 如何转换成origin 能打开的 格式?
求分享 有关的小代码

自带的 plotband.x 等 感觉 不好用。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

司马星空

银虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
dos算完的结果是可以直接导入origin的,band算完的程序要用一个小程序转换下。下面这个程序是我从小木虫找到的。我改了下,有两个输入文件一个band.dat,还有一个ev写费米能级。
        program prog
        real, allocatable :: e(:,
        real, allocatable :: k(:, ,dk( ,x(
        real, dimension(3) ::k0,a
        real ev
        character(len=32):: xx, yy, zz,evv
        integer ::   nbands, i, j, n, nk
        open(10, file='band.dat', status='old')
        open(22, file='ev', status='old')
        read(10,*) xx, yy, nbands, zz, nk
        read(22,*) evv
        read(evv,*) ev
        write(*,*)"nk=",nk
        allocate(k(nk,3))
        allocate(e(nk,nbands))
        allocate(dk(0:nk))
        allocate(x(1:nk))
        open(11,file='phoband.dat')
      do i=1,nk
      read(10,*) (k(i,j),j=1,3)
      read(10,*) (e(i,n),n=1,nbands)
   
        enddo
         
                do n=1,nk
           dk(0)=0
            if (n.eq.1) then
        k0=k(n,
            endif
      a=k(n,-k0
      dk(n)=dk(n-1)+sqrt(dot_product(a,a))
      x(n)=dk(n)     
      k0=k(n,
      enddo
      do i=1,nk
        write(11, 8888) x(i), (e(i,j)-ev,j=1,nbands)
      enddo
8888 format (1x, f9.4, 2x ,1000(f12.6,2x))
      end program prog
2楼2015-05-01 20:58:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

damao4361556

铁虫 (正式写手)

引用回帖:
2楼: Originally posted by 司马星空 at 2015-05-01 20:58:08
dos算完的结果是可以直接导入origin的,band算完的程序要用一个小程序转换下。下面这个程序是我从小木虫找到的。我改了下,有两个输入文件一个band.dat,还有一个ev写费米能级。
        program prog
        real, allocatable ...

你好 非常感谢您的回复

请问 为什么我这个 编译总出错呢? 是直接 编译 gfortran ***.f 吗?

[wl_903@hpc-login3 band]$ gfortran Getband.f
Getband.f:1.2:

program prog                                                           
  1
Error: Non-numeric character in statement label at (1)
Getband.f:1.2:

program prog                                                           
  1
Error: Unclassifiable statement at (1)
Getband.f:2.31:

        real, allocatable :: e(:,                                       
                               1
Error: Missing ')' in statement at or before (1)
Getband.f:3.42:

        real, allocatable :: k(:, ,dk( ,x(                              
                                          1
Error: Missing ')' in statement at or before (1)
Getband.f:14.18:

        allocate(k(nk,3))                                               
                  1
Error: Syntax error in ALLOCATE statement at (1)
Getband.f:15.18:

        allocate(e(nk,nbands))                                          
                  1
Error: Syntax error in ALLOCATE statement at (1)
Getband.f:16.19:

        allocate(dk(0:nk))                                             
                   1
Error: Syntax error in ALLOCATE statement at (1)
Getband.f:17.18:

        allocate(x(1:nk))                                               
                  1
Error: Syntax error in ALLOCATE statement at (1)
Getband.f:20.16:

      read(10,*) (k(i,j),j=1,3)                                         
                1
Error: Expected variable in READ statement at (1)
Getband.f:21.16:

      read(10,*) (e(i,n),n=1,nbands)                                    
                1
Error: Expected variable in READ statement at (1)
Getband.f:26.11:

           dk(0)=0                                                      
           1
Error: Unclassifiable statement at (1)
Getband.f:28.72:

        k0=k(n,                                                         
                                                                        1
Error: Syntax error in argument list at (1)
Getband.f:30.72:

      a=k(n,-k0                                                         
                                                                        1
Error: Syntax error in argument list at (1)
Getband.f:31.12:

      dk(n)=dk(n-1)+sqrt(dot_product(a,a))                              
            1
Error: Statement function at (1) is recursive
Getband.f:32.72:

      x(n)=dk(n)                                                        
                                                                        1
Error: Unexpected STATEMENT FUNCTION statement at (1)
Getband.f:33.72:

      k0=k(n,                                                           
                                                                        1
Error: Syntax error in argument list at (1)
Getband.f:38.6:

8888 format (1x, f9.4, 2x ,1000(f12.6,2x))                              
      1
Error: Bad continuation line at (1)
Getband.f:38.6:

8888 format (1x, f9.4, 2x ,1000(f12.6,2x))                              
      1
Error: Unclassifiable statement at (1)
Getband.f:39.22:

      end program prog                                                  
                      1
Error: Syntax error in END PROGRAM statement at (1)
Error: Unexpected end of file in 'Getband.f'

需要当前目录存在两个文件是吗? 一个 是ev 里面的数据是费米能级  另外一个是 band.dat 里面的内容是 QE 算能带后得到的?
3楼2015-05-04 06:13:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 damao4361556 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 0856,材料与化工321分求调剂 +7 大馋小子 2026-03-27 8/400 2026-03-27 22:31 by 无际的草原
[考研] 070300化学求调剂 +4 起个名咋这么难 2026-03-27 4/200 2026-03-27 21:39 by 83503孙老师
[考研] 286求调剂 +8 PolarBear11 2026-03-26 8/400 2026-03-27 18:05 by yu221
[考研] 考研调剂 +4 Sanmu-124 2026-03-26 4/200 2026-03-27 17:49 by kiokin
[考研] 085600材料与化工306 +10 z1z2z3879 2026-03-21 11/550 2026-03-27 11:31 by wangjy2002
[考研] 333求调剂 +3 question挽风 2026-03-23 3/150 2026-03-27 11:29 by 不吃魚的貓
[论文投稿] Journal of Mechanical Science and Technology +3 Russ_ss 2026-03-25 5/250 2026-03-27 10:49 by 陆小果画大饼
[考研] 324求调剂 +8 hanamiko 2026-03-26 10/500 2026-03-27 08:06 by hypershenger
[考研] 327求调剂 +7 prayer13 2026-03-23 7/350 2026-03-26 20:48 by 不吃魚的貓
[考研] 生物学 296 求调剂 +4 朵朵- 2026-03-26 6/300 2026-03-26 19:01 by 不吃魚的貓
[考研] 打过很多竞赛,085406控制工程300分,求调剂 +3 askeladz 2026-03-26 3/150 2026-03-26 09:08 by 给你你注意休息
[考研] 290分调剂求助 +3 吉祥止止陈 2026-03-25 3/150 2026-03-25 19:58 by barlinike
[考研] 284求调剂 +15 Zhao anqi 2026-03-22 15/750 2026-03-25 12:51 by wht0531
[考研] 一志愿武理085500机械专业总分300求调剂 +3 an10101 2026-03-24 7/350 2026-03-25 00:00 by 山鬼0-
[考研] 求调剂 +6 研研,接电话 2026-03-24 7/350 2026-03-24 17:01 by barlinike
[考研] 277分求调剂,跨调材料 +3 考研调剂lxh 2026-03-24 3/150 2026-03-24 13:52 by JourneyLucky
[考研] 求调剂 +7 十三加油 2026-03-21 7/350 2026-03-23 23:48 by 热情沙漠
[考研] 269求调剂 +4 我想读研11 2026-03-23 4/200 2026-03-23 21:25 by pswait
[考研] 一志愿东华大学化学070300,求调剂 +7 2117205181 2026-03-21 8/400 2026-03-22 22:55 by chixmc
[考研] 求调剂 +5 Zhangbod 2026-03-21 7/350 2026-03-22 13:13 by Zhangbod
信息提示
请填处理意见