[問題] 新手請教~"~

看板Fortran作者 (坦克)時間16年前 (2008/10/31 00:16), 編輯推噓0(005)
留言5則, 3人參與, 最新討論串1/1
首先 我先寫了一個副程式 SUBROUTINE IDMAT(NFIX,IDND,NDN,NNOD,NEQ) . . . DO I=1,NNOD DO J=1,NDN . . . IDND(J,I)=xxx . . . END DO END DO WRITE(*,*) IDND ^^^^這個IDND矩陣的值有跑出來,沒問題 接下來我要再寫一個副程式 SUBROUTINE MEMDOF(IDBC,NDN,NDE,NBC,NNOD,IDND,LM) IMPLICIT REAL*8 (A-H,O-Z) IMPLICIT INTEGER*4 (I-N) INTEGER*4 IDBC(5,NBC),IDND(NDN,NNOD),LM(NDE,NBC),NDN,NNOD,NDE,NBC WRITE(*,*) IDND ^^^^我想去測試有沒有辦法讀到上面副程式所寫的IDND 但結果顯示讀不出東西,請問為什麼呢??? --------------------------------------------------------------- Sorry 附上部份主程式... PROGRAM IMPLICIT REAL*8 (A-H,O-Z) IMPLICIT INTEGER*4 (I-N) REAL*8 A(200000) INTEGER*4 MAXMEM,IEND,IRI INTEGER*4 NNOD,NBC,NMAT,NSEC,ITP,NNE,IFORCE INTEGER*4 ICOOR,IVECTY,INFIX,IEXLD,IPROP,ISECT,IIDBC,IIDND,IFEF INTEGER*4 ILM,IGLOAD,IGLK,IDISP,IELFOR . . . C C Compute pointers for the input arrays C ICOOR = 1 INFIX = ICOOR + NCO*NNOD IEXLD = INFIX +(NDN*NNOD+IRI-1)/IRI IIDBC = IEXLD +NDN*NNOD IVECTY = IIDBC+(5*NBC+IRI-1)/IRI IF (ITP .EQ. 6) THEN IFEF = IVECTY+ 3*NBC ELSE IFEF = IVECTY ENDIF IF (IFORCE .EQ. 1) IPROP=IFEF IF (IFORCE .EQ. 2) IPROP=IFEF+NDE*NBC ISECT =IPROP+5*NMAT IEND =ISECT+5*NSEC C C Memory check C PLACE='INPUT' CALL MEMCHECK(IEND,MAXMEM,PLACE) C C Read the remaining data C CALL INPUT(A(ICOOR),A(INFIX),A(IEXLD),A(IIDBC),A(IVECTY),A(IFEF), 1 A(IPROP),A(ISECT),NNOD,NBC,NMAT,NSEC,ITP,NCO,NDN,NDE, 2 IFORCE) CLOSE(UNIT=1) C***** UP TO HERE --- PROG 1 ***** IIDND = IEND IEND = IIDND +(NDN*NNOD+IRI-1)/IRI C PLACE='IDMAT' CALL MEMCHECK(IEND,MAXMEM,PLACE) CALL IDMAT(A(INFIX),A(IIDND),NDN,NNOD,NEQ) C Compute LM(NDE,NBC) ILM = IEND IEND = ILM+(NDE*NBC+IRI-1)/IRI C PLACE='MEMDOF' CALL MEMCHECK(IEND,MAXMEM,PLACE) C CALL MEMDOF(A(IIDBC),A(IIDND),A(ILM),NBC,NDE,NDN,NNOD) . . . end -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.217.19

10/31 06:17, , 1F
沒主程式嬤 @_@? 線索只有這樣~誰解的出來 ...... =_=
10/31 06:17, 1F
※ 編輯: RuinGgg 來自: 125.233.1.90 (11/01 01:40)

11/02 22:13, , 2F
錯誤訊息是?
11/02 22:13, 2F

11/03 01:10, , 3F
我的猜測...IDND宣告問題乎?!?!
11/03 01:10, 3F

11/03 01:10, , 4F
檢查看看主程式跟sub對IDND的宣告是否一致
11/03 01:10, 4F

11/03 16:18, , 5F
嗯嗯~謝謝^^ 我跑出來了 我發現我回傳順序和宣告都有點誤
11/03 16:18, 5F
文章代碼(AID): #192TtHqw (Fortran)
文章代碼(AID): #192TtHqw (Fortran)