| 5 | 1/1 | 返回列表 |
| 查看: 3539 | 回復(fù): 11 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
賀儀鐵桿木蟲(chóng) (著名寫(xiě)手)
|
[求助]
fortran編譯 read出錯(cuò) 完畢
|
||
|
錯(cuò)誤提示 POSITION.F(31): error #6358: Constants and expressions are invalid in read-only I/O lists. [MSP] read(15,*) (msp(i),i=1,10) 前面msp有定義 character msp(10) read(15,*) (msp(i),i=1,10) 語(yǔ)法有問(wèn)題嗎? 一下是全部程序 program getpos ccccccccc 12 is SPPARKS OUTPUT cccccccc ccccccccc 15 is the molecure ccccccccc ccccccccc 13 is OUTPUT ccccccccccc integer mnum nsp real coord(2000,3) real species(10,3) integer nsp(10) real x y z character tile cellp cella cellb cellz msp(10) open(12,file='POSCAR',status='old') open(15,file='POSCAR',status='old') open(13,file='CONTCAR',status='new') ccccccccccccccccccc sys param a b c cccccccccccccc read(12,*) tile write(13,*) tile read(12,*) cellp write(13,*) cellp read(12,*) cella ; write(13,*) cella read(12,*) cellb ; write(13,*) cellb read(12,*) cellc ; write(13,*) cellc read(15,*); read(15,*); read(15,*); read(15,*); read(15,*); cccccccccccccccccccc atom char ccccccccccccccccccccccc read(15,*) (msp(i),i=1,10) write(13,*) (msp(i),i=1,10) read(12,*); cccccccccccccccccccc atom num cccccccccccccccccccccccc read(12,*) mnum read(15,*) (nsp(i),i=1,10) DO i=1, 10 N_anum=mnum*nsp(i) write(13,N_anum) END DO read(12,*) read(15,*) write(13,*) 'R' cccccccccccccccc read molecue coord cccccccccccc DO i=1, mnum read(12,*) (coord(i,j),j=1,13) ENDDO close(12) cc DO j=1, 10 !!! species cyc !!!!!! DO i=1, nsp(j) !!! the j atom cyc !!!!!! read(15,*) x y z !!!!!!!!!!!!!!!!!!!!!!!! molecure coord !!!!!!!!!!!!! DO k=1, mnum nx=x+coord(k,1) ny=y+coord(k,2) nz=z+coord(k,3) write(13,*) nx ,ny ,nz ENDDO ENDDO ENDDO close(15) close(13) END [ Last edited by 賀儀 on 2011-8-23 at 14:53 ] |

鐵桿木蟲(chóng) (著名寫(xiě)手)
|
是的 錯(cuò)誤很多 這是最開(kāi)始的 現(xiàn)在調(diào)好了,程序如下: program getpos ccccccccc 12 is SPPARKS OUTPUT cccccccc ccccccccc 15 is the molecure ccccccccc ccccccccc 13 is OUTPUT ccccccccccc integer mnum Nanum real::coord(2000,3) integer::nsp(4) real x y z character tile cellp character::msp(4) real::cella(3) real::cellb(3) real::cellc(3) open(12,file='POSCARS',status='old') open(15,file='POSCARV',status='old') open(13,file='CONTCAR',status='new') ccccccccccccccccccc sys param a b c cccccccccccccc read(12,*) tile write(13,"(2XA10)" tileread(12,*) cellp write(13,*) cellp read(12,*) (cella(i),i=1,3) write(13,"(3(2XF10.7))" (cella(i),i=1,3)read(12,*) (cellb(i),i=1,3) write(13,"(3(2XF10.7))" (cellb(i),i=1,3)read(12,*) (cellc(i),i=1,3) write(13,"(3(2XF10.7))" (cellc(i),i=1,3)read(15,*) read(15,*) read(15,*) read(15,*) read(15,*) cccccccccccccccccccc atom char ccccccccccccccccccccccc read(15,*) (msp(i),i=1,4) write(13,"(4(2XA2))" (msp(i),i=1,4)read(12,*) cccccccccccccccccccc atom num cccccccccccccccccccccccc read(12,*) mnum read(15,*) (nsp(i),i=1,4) DO i=1, 4 Nanum=mnum*nsp(i) write(13,10) Nanum END DO read(12,*) read(15,*) write(13,"(/,A1)" 'D'DO i=1, mnum read(12,*) (coord(i,j),j=1,3) END DO close(12) cc DO j=1, 4 !!! species cyc !!!!!! DO i=1, nsp(j) !!! the j species atom cyc !!!!!! read(15,*) x, y, z !!!!!!!!!!!!!!!!!!!!!!!! molecure coord !!!!!!!!!!!!! DO k=1, mnum write(13,100) x+coord(k,1), y+coord(k,2), z+coord(k,3) END DO END DO END DO close(15) close(13) 10 FORMAT(2XI5.0,\) 100 FORMAT(3(2XF10.6)) END |

至尊木蟲(chóng) (職業(yè)作家)
至尊木蟲(chóng) (職業(yè)作家)
鐵桿木蟲(chóng) (著名寫(xiě)手)

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 考研調(diào)劑 +6 | 小蠟新筆 2026-03-29 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 一志愿鄭州大學(xué),080500學(xué)碩,總分317分求調(diào)劑 +8 | 舉個(gè)栗子oi 2026-03-24 | 9/450 |
|
|
[考研] 318一志愿吉林大學(xué)生物與醫(yī)藥 求調(diào)劑 +4 | 篤行致遠(yuǎn). 2026-03-28 | 4/200 |
|
|
[考研] 332求調(diào)劑 +8 | 蕉蕉123 2026-03-28 | 8/400 |
|
|
[考研] 083000學(xué)碩274求調(diào)劑 +8 | Li李魚(yú) 2026-03-26 | 8/400 |
|
|
[考研] 一志愿北化085600材料專碩275|有文章專利|求調(diào)劑 +7 | Micky11223 2026-03-25 | 7/350 |
|
|
[考研] 283求調(diào)劑 +3 | A child 2026-03-28 | 3/150 |
|
|
[考研] 0703本科鄭州大學(xué)求調(diào)劑 +3 | nhj_ 2026-03-25 | 3/150 |
|
|
[考研] 材料與化工(0856)304求B區(qū)調(diào)劑 +8 | 邱gl 2026-03-27 | 8/400 |
|
|
[考研] 調(diào)劑 +3 | 好好讀書(shū)。 2026-03-28 | 3/150 |
|
|
[考研] 339求調(diào)劑,想調(diào)回江蘇 +6 | 烤麥芽 2026-03-27 | 8/400 |
|
|
[考研] 285求調(diào)劑 +4 | AZMK 2026-03-27 | 7/350 |
|
|
[考研] 求調(diào)劑 +4 | 零八# 2026-03-27 | 4/200 |
|
|
[考研] 283求調(diào)劑(080500) +4 | A child 2026-03-27 | 4/200 |
|
|
[考研] 305求調(diào)劑 +5 | 哇盧卡庫(kù) 2026-03-26 | 5/250 |
|
|
[考研] 考研調(diào)劑 +10 | 呼呼?~+123456 2026-03-24 | 10/500 |
|
|
[考研] 材料考研求調(diào)劑 +3 | Dendel 2026-03-23 | 6/300 |
|
|
[考研] 材料科學(xué)與工程 317求調(diào)劑 +4 | JKSOIID 2026-03-26 | 4/200 |
|
|
[考研] 一志愿吉大化學(xué)322求調(diào)劑 +4 | 17501029541 2026-03-23 | 6/300 |
|
|
[考研] 一志愿山東大學(xué)藥學(xué)學(xué)碩求調(diào)劑 +3 | 開(kāi)開(kāi)心心沒(méi)煩惱 2026-03-23 | 4/200 |
|