Fortran Coder

标题: fortran语言vs编译器时,数组或矩阵(GB)显示发生未指定的 [打印本页]

作者: LYCD    时间: 2023-11-14 09:56
标题: fortran语言vs编译器时,数组或矩阵(GB)显示发生未指定的
本帖最后由 LYCD 于 2023-11-14 10:02 编辑

[Fortran] 纯文本查看 复制代码
 DIMENSION GB1(2,2),GB2(2,2),JB(2,10),GB(2,2),
     $                GE1(10,2),GE2(10,2),JE(10,10),GE(2,2),XB(2)
        common /INV/GBx(70,70),GBy(70,70),GBai(70,70)
        common /MATRIX/A(100,100),B(100,100),AA(100,100)
         DOUBLE PRECISION GBX,GBY,GBAI,GB1,GB2,GB,GE1,GE2,GE,JE,A,B,AA
C
        CHARACTER  RI*12,R*1,ZZI*10,ZZO*10
        REAL L
C
        WRITE(*,'(1X,''Input the name of input file :'')')        
        READ(*,'(A)')ZZI
        OPEN(1,FILE=ZZI,STATUS='OLD')
        WRITE(*,'(1X,''Input the name of output file :'')')
        READ(*,'(A)')ZZO         
        OPEN(2,FILE=ZZO,STATUS='NEW')
C        * * * * * * * (ARES=mm**2,rp=Kg/dm**3,E=GPa(N/mm**2),L=mm) * * * * * * * *
        READ(1,*) ARES,RP,E,L
        READ(1,*) NN
        rp=rp*1.E+3
        ares=ares*1.E-6
        E=E*1.E+6
        L=L*1.E-3
c        
c        * * * * * * * * U2=1,U8=2,F2=3,F8=4 * * * * * * * * *
c         * * * * * * * K1 & K2 are the reserved variables * * * * * * * *
c
        read(1,*)k1,k2
C
        GB1(1,1)=-0.5
        GB1(1,2)=0.5
        GB1(2,1)=0.5
        GB1(2,2)=-0.5
C        
        GB2(1,1)=0.
        GB2(1,2)=-0.5*L/(ARES*E)
        GB2(2,1)=-0.5*L/(ARES*E)
        GB2(2,2)=0.
C
        DX=L/NN
        X=0
        DO 10 I=1,NN
          X=X+DX
          JB(1,I)=-RP*DX*0.5*X/E
          JB(2,I)=-RP*DX*0.5*(L-X)/E
          GE1(I,1)=0.5
          GE1(I,2)=0.5
          GE2(I,1)=0.5*X/(ARES*E)
          GE2(I,2)=-0.5*ABS(L-X)/(ARES*E)
          X2=X
          X1=0.
          DO 20 J=1,NN
            X1=X1+DX
            JE(I,J)=-0.5*ABS(X1-X2)*RP*DX/E         
20          CONTINUE
10        CONTINUE



作者: Transpose    时间: 2023-11-14 16:27
代码文件的后缀改成.f
第1行的从第7列开始
代码加上end


然后把错误截图
作者: LYCD    时间: 2023-11-15 08:13
Transpose 发表于 2023-11-14 16:27
代码文件的后缀改成.f
第1行的从第7列开始
代码加上end

[Fortran] 纯文本查看 复制代码
      DIMENSION GB1(2,2)
      DOUBLE PRECISION GB1   
      GB1(1,1)=-0.5
        GB1(1,2)=0.5
        GB1(2,1)=0.5
        GB1(2,2)=-0.5
      WRITE(*,*) GB1G:\NewDesk\AAA.png
      END

您好,感谢您的帮助,比如这个程序,我定义了个GB1(2x2的矩阵,但是在调试过程中,局部变量中值的地方会显示’发生未指定的错误‘)就是局部变量和监视中都显示不出来矩阵

AAA.png (13.64 KB, 下载次数: 150)

AAA.png

作者: Transpose    时间: 2023-11-15 08:37
安装oneapi base 里面的gdb了吗
作者: LYCD    时间: 2023-11-16 08:39
Transpose 发表于 2023-11-15 08:37
安装oneapi base 里面的gdb了吗

您好,我不太懂这个,刚开始接触,您可以帮忙查看下么,我的qq:1808257628,十分感谢您

作者: Transpose    时间: 2023-11-16 08:56
https://www.bilibili.com/video/B ... id_from=333.999.0.0  可以查看这个安装教程
作者: LYCD    时间: 2023-11-16 15:00
Transpose 发表于 2023-11-16 08:56
https://www.bilibili.com/video/BV1oh411o7AT/?spm_id_from=333.999.0.0  可以查看这个安装教程

好滴好滴 ,我先研究下 十分感谢您呢
作者: LYCD    时间: 2023-11-16 20:58
本帖最后由 LYCD 于 2023-11-16 21:02 编辑
Transpose 发表于 2023-11-16 08:56
https://www.bilibili.com/video/BV1oh411o7AT/?spm_id_from=333.999.0.0  可以查看这个安装教程

您好,我装base的时候,会提示‘There is no lDE installed, so the product cannot be integrated. lf you aim at better experienceplease install Microsoft Visual Studio 2019 or 2022.Otherwise ignore this message and continuethe installation.‘然后点击下一步,会出现’‘There is no IDE installed, so the product cannot be integrated. If you aim at better experienceplease install Microsoft Visual Studio 2019 or 2022.Otherwise ignore this message and continuethe installation.
’‘。这个影响么,如何处理呢,先谢谢您呢(已经装了vs2019)




欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2