Fortran 板


LINE

各位前辈好 我想请问一下 我的程式 出现以下三个错误 但是 都是针对同一个式子 那是一个计算式 Error: An arithmetic or LOGICAL type is required in this context Error: This binary operation is invalid for this data type. Error: The assignment operation or the binary expression operation is invalid for the data types of the two operands. 错误:算术或逻辑类型,需要在这方面 错误:这个二进制操作这个数据类型是无效的。 错误:赋值操作或二进制表达式的操作是无效的两个操作数的数据类型。 这是我用GOOGLE翻译的中文 如果我把它宣告为 倍精度 後面再加上一个逗号 就会变成 Error: Syntax error, found END-OF-STATEMENT when expecting one of: %FILL <IDENTIFIER> !!!有大大提醒 所以小的赶快付上 程式码 open (unit=20,file='time.txt') read(20,*) td read(20,*) tr read(20,*) ts read(20,*) tb read(20,*) vm read(20,*) epsilon read(20,*) b read(20,*) c read(20,*) ar do 6500 k=1,ntt space=ts/ntt relt=k*space if (time .le. tb) then weigt(k)=(2*Vm/td)*(relt)*(1-(relt/2.*td)) else if ((relt .ge. tb) .and. (relt .le. tr)) then weigt(k)=b/sqrt(relt-epsilon) else if ((relt .le. ts) .and. (relt .gt. tr)) then weigt(k)=c-ar*(relt-tr) end if 主要问题 出现在 最後一行的 weigt(k)=c-ar*(relt-tr) !!!! 请问大大们 我该怎麽做 才能把错误消掉阿 查不到啊!! 可以烦请帮我看看吗.. 或是有遇过相同问题 最後解决的 -- j&= y+ y* jv+ yy-v v & wE!" j17$T 7MPC NU$E- Ej&v- O*K^ yHH:Ovm+ UMMK BMNTO: H1="7' jO&OH: "OH7"E~ U0H1 BB71` jCf'U: vM1H1 jB-j1 wHhHh*-/$B]B- BKJUK ^HI'OH j""^N1 "OHOK~ H$H"Da jP'N ^ 这次,是我的真心话... --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.115.62.44 ※ 编辑: sunnywei 来自: 140.115.62.44 (02/03 18:55)
1F:推 terryys:ar是什麽? 02/03 19:06
2F:→ sunnywei:就只是一个 参数而已 用INPUT的方式 读的一个参数 02/03 19:20
3F:推 terryys:那c呢?可以把变数宣告都写出来吗? 02/03 20:00
其实我也做甚麽宣告 就只有读值而已 5.305165024714408E-002 td 0.250000000000000 tr 0.375000000000000 ts 9.961165024710450E-002 tb 0.371960221459961 vm 9.613954976412804E-002 epsilon 4.115322526508360E-002 b 0.104915674725249 c 0.839325397801995 ar 以上在附上我的INPUT档 ※ 编辑: sunnywei 来自: 140.115.62.44 (02/03 20:17)
4F:推 terryys:我的意思是real :: td之类的 02/03 21:21
5F:→ sunnywei:我都没做宣告.... 02/03 21:26
6F:→ sunnywei:因为我是拿别人的程式 可是他连 program XX 都没有 02/03 21:26
7F:推 terryys:那你试试把用到的变数都宣告一下看看 02/03 23:14







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:e-shopping站内搜寻

TOP