24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 1339  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 一志愿南昌大学324求调剂 +4 hanamiko 2026-03-27 4/200 2026-03-28 04:16 by fmesaito
[考研] 289求调剂 +8 新时代材料 2026-03-27 8/400 2026-03-28 04:09 by fmesaito
[考研] 285求调剂 +4 AZMK 2026-03-27 7/350 2026-03-27 20:59 by AZMK
[考研] 一志愿 西北大学 总分282 英语一62 求调剂 +7 18419759900 2026-03-25 8/400 2026-03-27 16:38 by 18419759900
[考研] 085600,材料与化工321分调剂 +4 大馋小子 2026-03-27 6/300 2026-03-27 14:11 by 松花缸1201
[考研] 材料学硕333求调剂 +8 北道巷 2026-03-24 8/400 2026-03-27 10:18 by 我是小康
[考研] 316求调剂 +5 江辞666 2026-03-26 5/250 2026-03-27 08:08 by hypershenger
[考研] 284求调剂 +11 junqihahaha 2026-03-26 12/600 2026-03-27 04:37 by wxiongid
[考研] 333求调剂 +6 wfh030413@ 2026-03-23 6/300 2026-03-26 22:45 by 学员8dgXkO
[考研] 327求调剂 +7 prayer13 2026-03-23 7/350 2026-03-26 20:48 by 不吃魚的貓
[考研] 生物学学硕,一志愿湖南大学,初试成绩338 +4 YYYYYNNNNN 2026-03-26 4/200 2026-03-26 19:00 by macy2011
[考研] 085602化学工程求调剂。 +4 平乐乐乐 2026-03-26 4/200 2026-03-26 17:57 by fmesaito
[考研] 一志愿南航 335分 | 0856材料化工 | GPA 4.07 | 有科研经历 +6 cccchenso 2026-03-23 6/300 2026-03-25 22:25 by 544594351
[考研] 求调剂 +3 QiMing7 2026-03-25 3/150 2026-03-25 21:13 by 给你你注意休息
[考研] 食品专硕 一志愿双一流 328 +3 xiaom99 2026-03-21 4/200 2026-03-24 21:20 by lailaisimei
[考研] 材料专硕331求调剂 +4 鲜当牛 2026-03-24 4/200 2026-03-24 15:58 by JourneyLucky
[考研] 269求调剂 +4 我想读研11 2026-03-23 4/200 2026-03-23 21:25 by pswait
[考研] 275求调剂 +6 shansx 2026-03-22 8/400 2026-03-22 15:27 by barlinike
[考研] 材料学硕301分求调剂 +7 Liyouyumairs 2026-03-21 7/350 2026-03-21 22:31 by peike
[考研] 336求调剂 +5 rmc8866 2026-03-21 5/250 2026-03-21 17:24 by 学员8dgXkO
信息提示
请填处理意见