使用 SUM 内部函数时出错
使用 g95 编译器时,我收到一条错误消息:
ERROR: Procedure attribute conflicts with INTENT attribute in 'quantityarray'
我试图查找数组的总和。以下是出现此错误的子例程:
SUBROUTINE findTotals(pricearray,quantityarray,totalprice, totalquantity)
INTEGER, INTENT(IN)::quantityarray
REAL, INTENT(IN):: pricearray
INTEGER, INTENT(OUT)::totalquantity
REAL, INTENT(OUT)::totalprice
totalquantity = SUM(quantityarray)
totalprice = SUM(pricearray)
END SUBROUTINE
非常感谢您的宝贵时间。
using the g95 compiler, I get an error that says:
ERROR: Procedure attribute conflicts with INTENT attribute in 'quantityarray'
I was trying to take find the total sum of the array. Here is the subroutine in which this error appears:
SUBROUTINE findTotals(pricearray,quantityarray,totalprice, totalquantity)
INTEGER, INTENT(IN)::quantityarray
REAL, INTENT(IN):: pricearray
INTEGER, INTENT(OUT)::totalquantity
REAL, INTENT(OUT)::totalprice
totalquantity = SUM(quantityarray)
totalprice = SUM(pricearray)
END SUBROUTINE
Thanks so much for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这也许是您希望实现的目标吗?
Is this perhaps what you wished to achieve?