24小时热门版块排行榜    

查看: 8338  |  回复: 14

hakuna

木虫 (知名作家)


gzqdyouxia(金币+1): 谢谢交流 2011-06-03 13:03:42
引用回帖:
Originally posted by first_yg at 2011-06-03 08:58:38:
能把你的程序发给我一个吗,我最不会写程序

碰到个懒MM,不写也就罢了,搜也不搜,
CODE:
     

      implicit real*8 (a-h,o-z)
      dimension dump(20),num(2),x(100),y(100),z(100),chg(100,100,800)
      dimension chgt(1000),a(3,3)

      write(*,*) 'Choose input file (LOCPOT=1, CHGCAR=2):'
      read(*,*) input
      if (input.eq.1) then
      open(15,file='LOCPOT')
      write(6,*) ' Enter fermi energy: '
      read(*,*) ef
      elseif (input.eq.2) then
      open(15,file='CHGCAR')
      ef=0.0
      elseif ((input.ne.1).and.(input.ne.2)) then
      write(*,*) ' INPUT ERROR, input must equal to 1 or 2 '
      stop
      endif


      write(*,*) 'Spin polarized calculation? (no=1, yes=2):'
      read (*,*) ispin
      if (ispin.eq.1) then
       if (input.eq.1) open(16,file='workfn.dat')
       if (input.eq.2) open(16,file='chgave.dat')
      elseif (ispin.eq.2) then
       if (input.eq.1) then
       open(16,file='workfn-up.dat')
       open(26,file='workfn-dn.dat')
       elseif (input.eq.2) then
       open(16,file='chgave-up.dat')
       open(26,file='chgave-dn.dat')
       endif
      elseif ((ispin.ne.1).and.(ispin.ne.2)) then
      write(*,*) ' INPUT ERROR, ispin must equal to 1 or 2 '
      stop
      endif


      open(19,file='atom.dat')


      read(15,1) dump
      read(15,*) scale
      do i=1,3
      read(15,*) (a(i,j),j=1,3)
      enddo
1    format(20a4)
      aa=sqrt(a(3,1)**2+a(3,2)**2+a(3,3)**2)
      read(15,2) num(1),num(2)
c     write(6,2) num(1),num(2)
2    format(2i4)
      ity=1
      if (num(2) .gt. 0) ity=2
      natm=0
      do i=1,ity
      natm=natm+num(i)
      enddo
      read(15,1) dump
c     write(6,1) dump
      zero=0.0
      do i=1,natm
      read(15,*) x(i),y(i),z(i)
      enddo
      do i=1,natm
      x(i)=z(i)
      do j=i,natm
      if (z(j) .lt. x(i))  then
      x(i)=z(j)
      z(j)=z(i)
      z(i)=x(i)
      endif
      enddo
c     if (a(3,3) .eq. 0) a(3,3)=a(3,2)
      write(19,30) z(i)*aa*scale,zero
30   format(2f10.5)
      enddo
      nat=natm/2+1
      do i=1,nat
c     write(6,4) i,z(i)
   4  format(i5,f10.5)
      enddo
      read(15,1) dump

      do 600 is = 1,ispin
      read(15,*) nx,ny,nz
c     write(6,*) nx,ny,nz
      nn=nx*ny
      read(15,*) (((chg(j,k,iz),j=1,nx),k=1,ny),iz=1,nz)
c     write(6,5) (((chg(j,k,iz),j=1,nx),k=1,ny),iz=1,nz)
   5  format(5(e18.11,1x))
      do i=1,nz
      chgt(i)=0.0
      do j=1,nx
      do k=1,ny
      chgt(i)=chgt(i)+chg(j,k,i)
      enddo
      enddo
      x1=float(i-1)/float(nz)
      chgt(i)=chgt(i)/float(nn)-ef
      write(6+10*is,10) x1*aa*scale,chgt(i)               
10   format(2f12.5)
       enddo

      if (input.eq.1)then
      emax=-9999.0
      do i=1,nz
      if (chgt(i) .gt. emax) emax=chgt(i)
      enddo
      workfn=emax
c     write(6,201) ef
      write(6,301) workfn
      endif
c201  format(' fermi energy =',f10.5)
301  format(' workfunction =',f10.5)

      if ((is.eq.1).and.(ispin.eq.2))then
       if (input.eq.1) then
       read(15,*) (ttt,i=1,natm)

       elseif (input.eq.2) then
       do nn=1,natm
       read(15,'(24x,2i4)') nn1,nn2
       read(15,*) (ttt,i=1,nn2)
       enddo
       read(15,*) (ttt,i=1,natm)
       endif
      endif
600  continue
      stop  
      end

11楼2011-06-03 11:47:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
12楼2012-10-28 11:16:19
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

微醉的晨光

新虫 (初入文坛)

引用回帖:
4楼: Originally posted by cavediger at 2011-06-01 22:43:06
没有用过MEDIAa,一般是通过LOCALPOT,找出正空能级再减掉费米能级就是功函数了.........

请问楼主怎样在LOCALPOT中找到真空能级啊,我是刚入门的菜鸟,望大侠帮忙
好雨知时节
13楼2014-06-23 17:14:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

新月妃

新虫 (小有名气)

引用回帖:
10楼: Originally posted by 胡同学 at 2011-06-03 11:10:18
我是在Al2O3(0001)表面吸附氢原子,想得到体系功函数的变化,真空层设定为1nm,但得出左右两个功函数,且是负数,那它的负数是相对什么得出来的?本应该是正数啊?哪个功函数才是真正的功函数呢?...

你的问题解决了吗?我计算的功函数也出现left和right都是负值的情况,求解释
14楼2017-03-01 16:42:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

quezhui17

新虫 (初入文坛)

引用回帖:
13楼: Originally posted by 微醉的晨光 at 2014-06-23 17:14:04
请问楼主怎样在LOCALPOT中找到真空能级啊,我是刚入门的菜鸟,望大侠帮忙...

我是MedeA提交得参数,通过参数得形式生成得INCAR等文件提交得作业,但是作业算好之后没有生成LOCALPOT文件是什么原因啊,希望大神可以指导一下
15楼2020-12-23 15:36:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 胡同学 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 265分求调剂不调专业和学校有行学上就 +5 礼堂丁真258 2026-02-28 7/350 2026-03-01 19:12 by Js512888
[考研] 298求调剂 +6 axyz3 2026-02-28 6/300 2026-03-01 19:00 by 18137688336
[考研] 一志愿中南大学理学化学 +4 15779376950 2026-03-01 5/250 2026-03-01 19:00 by Fff-1
[考研] 272求调剂 +6 材紫有化 2026-02-28 6/300 2026-03-01 18:58 by 18137688336
[考研] 材料学调剂 +9 提神豆沙包 2026-02-28 11/550 2026-03-01 18:15 by ms629
[考研] 材料类求调剂 +10 wana_kiko 2026-02-28 11/550 2026-03-01 18:11 by 海嵙Y
[考研] 高分子化学与物理调剂 +6 好好好1233 2026-02-28 11/550 2026-03-01 17:47 by 好好好1233
[考研] 285求调剂 +8 满头大汗的学生 2026-02-28 8/400 2026-03-01 16:47 by caszguilin
[考研] 313求调剂 +3 水流年lc 2026-02-28 3/150 2026-03-01 16:01 by 新能源达人
[考研] 303求调剂 +4 今夏不夏 2026-03-01 4/200 2026-03-01 14:46 by 嘟嘟小浣熊
[考研] 求调剂 +6 repeatt?t 2026-02-28 6/300 2026-03-01 14:37 by Sakura绘
[考研] 298求调剂 +9 人间唯你是清欢 2026-02-28 12/600 2026-03-01 14:23 by Ducount.Y
[考研] 材料284求调剂,一志愿郑州大学英一数二专硕 +10 想上岸的土拨鼠 2026-02-28 10/500 2026-03-01 14:12 by yc258
[考研] 302材料工程求调剂 +4 Doleres 2026-03-01 5/250 2026-03-01 11:52 by liqiongjy
[考研] 317一志愿华南理工电气工程求调剂 +6 Soliloquy_Q 2026-02-28 11/550 2026-03-01 11:14 by 歌liekkas
[硕博家园] 2025届双非化工硕士毕业,申博 +3 更多的是 2026-02-27 4/200 2026-03-01 10:04 by ztg729
[考研] 304求调剂 +3 52hz~~ 2026-02-28 5/250 2026-03-01 00:00 by 52hz~~
[考研] 085600材料工程一志愿中科大总分312求调剂 +8 吃宵夜1 2026-02-28 10/500 2026-02-28 20:27 by L135790
[考研] 276求调剂 +3 路lyh123 2026-02-28 4/200 2026-02-28 19:45 by 路lyh123
[高分子] 求环氧树脂研发1名 +3 孙xc 2026-02-25 11/550 2026-02-28 16:57 by ichall
信息提示
请填处理意见