设为首页收藏本站|繁體中文 快速切换版块

 找回密码
 立即加入
搜索
查看: 476|回复: 3

error#8093 ,error#6511,编写代码遇到这两个错误请问怎么解决

[复制链接]
  • TA的每日心情
    郁闷
    2019-12-23 14:39
  • 签到天数: 281 天

    连续签到: 1 天

    [LV.8]以坛为家I

    累计签到:281 天
    连续签到:1 天
    发表于 2018-11-10 12:23:29 | 显示全部楼层 |阅读模式

    马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!

    您需要 登录 才可以下载或查看,没有账号?立即加入

    ×
    本帖最后由 菜鸟萌新 于 2018-11-10 14:49 编辑
    / n* j& [; A+ `
    ' x* l. l- D- V: l T1UH@~P4~Z~JXL70H8BLB37.png ' O; |; l/ a7 G7 c& o
    描述错误#8093:DO主体内的do变量不应出现在变量定义上下文中。 [I], W4 L5 \6 e* E# n! O! A2 o
    描述错误#6511:此DO变量已在同一嵌套结构中用作外部DO变量。 [I]
      y2 Y7 }$ v9 q- C7 b2 C! z5 x# r+ n; p" @7 V

    7 H( E& [5 C4 _' N以上描述是用谷歌翻译,如有错误请指正。
    * i' t' z& t' I截图中代码是用来冒泡排序。
    $ R" I9 ~2 s2 R& O9 W, V; ^. x+ s( R( q2 {% M( x7 T* m: n
    个人理解是双循环中的变量I用了两次,出现在下一个do循环中,但就fortran语法来说这是允许的,不知道如何解决。也有可能是我对错误的描述理解出现偏差/ M" F0 [& f" X+ E" Q7 t  I) `) X& S& T
    . d- V+ S5 x) F% y( q

    7 t! y6 g3 |' u0 b/ B# R: {" z  d
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    [发帖际遇]: 菜鸟萌新特爱帮助研友,研友一致同意奖励他 学分1 点,帅呆了. 幸运榜 / 衰神榜
    楼主热帖
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
  • TA的每日心情
    郁闷
    2019-12-23 14:39
  • 签到天数: 281 天

    连续签到: 1 天

    [LV.8]以坛为家I

    累计签到:281 天
    连续签到:1 天
     楼主| 发表于 2018-11-10 15:42:12 | 显示全部楼层
    本帖最后由 菜鸟萌新 于 2018-11-10 17:11 编辑 * N1 {" M5 Y+ c4 ?

    ( i2 V4 T5 ]! ^) c' hhttps://software.intel.com/en-us ... c-os-x/topic/559950; o! w8 m% t# A& {7 P
    # _- \6 W7 C7 V2 K" G) v* G
    The interesting (to me, anyway) part of this question is that the do-variable in an io-implied-do does NOT have "statement scope" the way a DATA implied-do or array constructor implied-do variable do.  With statement scope, the implied-do variable is a new, different variable that inherits only the type of any outer-scope variable (but that type must be integer.)The "i" in the I/O implied DO is the same variable as the line 1 DO control variable and ifort is absolutely correct in complaining about this., pgf90 could support this as an extension, but would need to have the ability to diagnose it (perhaps through a standards checking switch), or else risk being a nonconforming implementation.
    ' u4 Q% v9 l7 d+ {- ?1 a  h7 S9 W
    The other interesting part is that we do, sort-of, allow changing DO variables, as an extension, but you have to do it by passing the variable to a procedure which then changes it. ifort recognizes the possibility and generates an explicit test rather than a loop count if it sees this.1 H! Y/ k- G0 s7 _& t

    7 ^0 b" ^0 K, O* O1 S  l这个问题的有趣(对我来说,无论如何)部分是io声明的do中的do的变量没有DATA声明的方式或者数组构造函数声明-do变量的方式。 对于语句范围,声明do变量是一个新的,不同的变量,它只继承任何外部作用域变量的类型(但该类型必须是整数。)I / O暗示DO中的“i”是相同的变量 作为第1行DO控制变量和ifort在抱怨这一点时绝对正确。,pgf90可以支持这作为扩展,但是需要能够诊断它(可能通过标准检查开关),否则冒险成为 不合格的实施。& `* o/ A; X  v# M7 L( j1 ]1 p

    ; G" i% f1 L; o4 _" z$ M另一个有趣的部分是我们这样做,排序,允许更改DO变量,作为扩展,但你必须通过将变量传递给一个程序然后更改它来完成它。 如果它看到这个,ifort会识别出这种可能性并生成一个显式测试而不是一个循环计数。5 D/ p& m, o  q+ T- O
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
    回复 推荐 踩下

    使用道具 举报

  • TA的每日心情
    郁闷
    2019-12-23 14:39
  • 签到天数: 281 天

    连续签到: 1 天

    [LV.8]以坛为家I

    累计签到:281 天
    连续签到:1 天
     楼主| 发表于 2018-11-10 15:43:18 | 显示全部楼层
    https://software.intel.com/en-us ... c-os-x/topic/5599508 d1 f" G7 Z' x' I8 t7 F
    6 k) ~7 ~9 l% N) |1 K! y
    The interesting (to me, anyway) part of this question is that the do-variable in an io-implied-do does NOT have "statement scope" the way a DATA implied-do or array constructor implied-do variable do.  With statement scope, the implied-do variable is a new, different variable that inherits only the type of any outer-scope variable (but that type must be integer.)The "i" in the I/O implied DO is the same variable as the line 1 DO control variable and ifort is absolutely correct in complaining about this., pgf90 could support this as an extension, but would need to have the ability to diagnose it (perhaps through a standards checking switch), or else risk being a nonconforming implementation.
    8 b3 g5 G; n; c* T: m: `# o5 G9 }) T# J* D: y& K% L
    The other interesting part is that we do, sort-of, allow changing DO variables, as an extension, but you have to do it by passing the variable to a procedure which then changes it. ifort recognizes the possibility and generates an explicit test rather than a loop count if it sees this.0 X0 [" f$ f- Q6 l+ r3 j

    * _0 E# @4 Q" E& S
    ( [% E: j3 M  Z4 ~# b% r# ]- V' h这个问题的有趣(对我来说,无论如何)部分是io-implied-do中的do-variable没有DATA隐含的方式或者数组构造函数暗示-do变量的方式。 对于语句范围,implied-do变量是一个新的,不同的变量,它只继承任何外部作用域变量的类型(但该类型必须是整数。)I / O暗示DO中的“i”是相同的变量 作为第1行DO控制变量和ifort在抱怨这一点时绝对正确。,pgf90可以支持这作为扩展,但是需要能够诊断它(可能通过标准检查开关),否则冒险成为 不合格的实施。
    * [" M$ N! J8 D. e4 B6 @% L' g6 G) E. R# X
    另一个有趣的部分是我们这样做,排序,允许更改DO变量,作为扩展,但你必须通过将变量传递给一个程序然后更改它来完成它。 如果它看到这个,ifort会识别出这种可能性并生成一个显式测试而不是一个循环计数。
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
    回复 推荐 踩下

    使用道具 举报

  • TA的每日心情
    郁闷
    2019-12-23 14:39
  • 签到天数: 281 天

    连续签到: 1 天

    [LV.8]以坛为家I

    累计签到:281 天
    连续签到:1 天
     楼主| 发表于 2018-11-10 21:37:05 | 显示全部楼层
    本帖最后由 菜鸟萌新 于 2018-11-11 10:18 编辑 4 t% a1 f+ E0 A" p1 U

      I3 ^6 l$ Y. L- r$ t' x' e已找到问题, 是另外一个模块do循环没有加终结语结束循环,i 的值被篡改,因为我的循环语句用的是i 作为变量,对所有的循环语句都造成了干扰
    ! r$ O( K1 m5 G2 V! @) c' \
    "真诚赞赏,手留余香"
    还没有人打赏,支持一下
    帖文化:【文明发帖 和谐互动】 社区精神:【创新、交流、互助、共享】
    回复 推荐 踩下

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即加入

    本版积分规则

    招聘斑竹

    小黑屋|手机版|APP下载(beta)|Archiver|电力研学网 ( 赣ICP备12000811号-1|赣公网安备36040302000210号 )|网站地图

    GMT+8, 2024-3-29 19:15

    Powered by Discuz! X3.5 Licensed

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表