24小时热门版块排行榜    

Znn3bq.jpeg
查看: 1350  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 297,工科调剂? +9 河南农业大学-能 2026-04-14 9/450 2026-04-15 20:08 by 学员JpLReM
[考研] 297,工科调剂?河南农业大学本科 +11 河南农业大学-能 2026-04-14 11/550 2026-04-15 15:03 by 学员JpLReM
[考研] 289 分105500药学专硕求调剂(找B区学校) +3 白云123456789 2026-04-13 3/150 2026-04-15 12:42 by 西北望—风沙
[考研] 367求调剂 +11 hffQAQ 2026-04-09 11/550 2026-04-14 17:48 by lhj2009
[考研] 一志愿沪9,326求生物学调剂 +10 刘墨墨 2026-04-13 10/500 2026-04-14 15:16 by zs92450
[考研] 085404 298分求调剂 +11 呼啦呼啦呼呼呼 2026-04-10 12/600 2026-04-14 08:38 by wfj257
[考研] 一志愿西交机械专硕求调剂 +9 求上岸的小王 2026-04-10 9/450 2026-04-13 16:08 by jiangguiquan11
[考研] 考研二轮调剂 +10 故人?? 2026-04-09 10/500 2026-04-13 09:55 by szhize
[硕博家园] 新一代电子信息294求调剂 不挑学校 +7 Ytyt11 2026-04-09 8/400 2026-04-12 16:57 by ajpv风雷
[考研] 296求调剂 +14 汪!?! 2026-04-10 16/800 2026-04-12 10:48 by zhouyuwinner
[考研] 307求调剂 +10 tzq94092 2026-04-10 10/500 2026-04-12 08:18 by wise999
[考研] 化工调剂求导师收留!一志愿失利,踏实肯干,有植物提取科研经历 +20 yzyzx 2026-04-09 21/1050 2026-04-12 00:12 by 小小小小啦啦啦
[考研] 一志愿厦大0856,306求调剂 +15 Bblinging 2026-04-11 15/750 2026-04-11 22:53 by 314126402
[考研] 本人女孩 +7 吼吼, 2026-04-10 9/450 2026-04-11 14:45 by ACS Nano——
[考研] 296求调剂 +6 汪!?! 2026-04-09 6/300 2026-04-11 11:25 by zhq0425
[考研] 281求调剂 +11 觉得好的吧 2026-04-10 11/550 2026-04-11 09:35 by 逆水乘风
[考研] 298求调剂 +13 钉叮咚冬瓜 2026-04-09 13/650 2026-04-10 15:49 by jiajinhpu
[考研] 求调剂 材料与工程 324分 专硕 +19 翩翩一书生 2026-04-10 21/1050 2026-04-10 11:41 by wp06
[考研] 292求调剂 +9 笑笑袁 2026-04-09 9/450 2026-04-10 10:05 by LHGeng
[考研] 283电子信息求调剂 +4 三石WL 2026-04-08 4/200 2026-04-09 10:21 by wp06
信息提示
请填处理意见