24小时热门版块排行榜    

查看: 1335  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 总分293求调剂 +4 加一一九 2026-03-25 6/300 2026-03-25 22:34 by barlinike
[考研] 北科281学硕材料求调剂 +13 tcxiaoxx 2026-03-20 15/750 2026-03-25 20:17 by Alex alex
[考研] 一志愿河工大 081700 276求调剂 +3 地球绕着太阳转 2026-03-23 3/150 2026-03-25 19:10 by 雾散后相遇lc
[考研] 311求调剂 +4 勇敢的小吴 2026-03-20 4/200 2026-03-25 18:12 by xcjcqu
[考研] 材料277求调剂 +4 min3 2026-03-24 4/200 2026-03-25 15:29 by fch1983
[考研] 282求调剂 +3 wcq131415 2026-03-24 3/150 2026-03-25 12:16 by userper
[考研] 086003食品工程求调剂 +6 淼淼111 2026-03-24 6/300 2026-03-25 10:29 by 3Strings
[考研] 291求调剂 +3 HanBeiNingZC 2026-03-24 3/150 2026-03-24 16:34 by barlinike
[考研] 一志愿211 初试270分 求调剂 +5 谷雨上岸 2026-03-23 6/300 2026-03-24 16:32 by laoshidan
[考博] 26申博自荐 +3 whh869393 2026-03-24 3/150 2026-03-24 09:55 by 21018060
[基金申请] 请教下大家 2026年国家基金申请是双盲审吗? +3 lishucheng1 2026-03-22 5/250 2026-03-24 08:22 by gltch
[考研] 一志愿重庆大学085700资源与环境,总分308求调剂 +7 墨墨漠 2026-03-23 8/400 2026-03-23 20:36 by Creta
[考研] 生物学一志愿985,分数349求调剂 +6 zxts12 2026-03-21 9/450 2026-03-23 18:37 by macy2011
[考研] 293求调剂 +3 涛涛Wjt 2026-03-22 5/250 2026-03-22 22:21 by jiangpengfei
[考研] 306求调剂 +5 来好运来来来 2026-03-22 5/250 2026-03-22 16:17 by BruceLiu320
[考研] 324求调剂 +6 lucky呀呀呀鸭 2026-03-20 6/300 2026-03-22 16:01 by ColorlessPI
[考研] 260求调剂 +3 朱芷琳 2026-03-20 4/200 2026-03-22 15:12 by 朱芷琳
[考研] 332求调剂 +3 凤凰院丁真 2026-03-20 3/150 2026-03-21 10:27 by luoyongfeng
[考研] 南昌大学材料专硕311分求调剂 +6 77chaselx 2026-03-20 6/300 2026-03-21 07:24 by JourneyLucky
[考研] 一志愿南理工085701环境302求调剂院校 +3 葵梓卫队 2026-03-20 3/150 2026-03-20 19:28 by zhukairuo
信息提示
请填处理意见