fortran内部函数出错信息解释和常见运行错误

2014-08-28 00:47 阅读(?)评论(0)

fortran内部函数出错信息解释和常见运行错误

 (2009-05-22 21:55:51)
http://www.sohu.com转载

http://blog.sina.com.cn/s/blog_600423c00100de1m.html

fortran内部函数出错信息解释

 
内部函数出错信息解释
[sourcefile(line)]run-time error M62××MATH
错误号          函数级数学错误信息
M6201           functionnames:DOMAIN error
              函数的自变量超出了约定的取值域,例如sqrt(-1)
M6202         functionname:SING error
              无意义的变量。例如log10(0)
M6203        functionname:OVERFLOW error
             函数的结果值或其中一个既时计算值太大以致不能表示,例如EXP(250000.0)
M6204       functionname:UNDERFLOW error
            函数的结果值或其中一个既时计算值太小以致不能表示。
M6205       functionname:TLOSS error
            完全丢失精度,例如COS(1E30)
M6206       functionname:PLOSS error

fortran debug模式设置和技巧
CVF中有两种编译(连接、执行)模式:release模式和debug模式。调试程序时,宜用debug模式;调好后再用release模式,得到高效的执行程序。设定debug模式:点击菜单Build/Set Active Project Configuration,选 *- Win32 Debug,OK,即设定为debug模式。以debug模式执行:点击“Go (F5)”按钮,或直接按F5键,则执行程序,并在第一个出错语句处停止,在该语句前有一个小黄色箭头。若程序没错,则一直执行完毕,自动关闭dos窗口。此时,宜用“!”按钮或“Ctrl+F5”键,执行完成后,dos窗口等待用户关闭。设置断点:若希望执行时在某一语句处暂停,可将光标置于该语句,点击“手”形状的按钮,或按F9键,则程序执行到该语句时停在该语句处。单步执行:F10(不进入子过程程序段)或者F11(遇到子过程进入子过程程序段继续单步执行)。在工具栏上都有相应的按钮。查看变量值:小黄箭头停在某语句时,按下Variable按钮,显示当前程序段的变量值;对于简单变量,将光标放在该变量上,则即时显示该变量值。先简单说这么多。
如何用Debug模式获得更多的提示信息
依次选择/打开:Project => Settings => Fortran => Compilation Diagnostics
建议选中以下各项:
Argument Mismatch       (类型不一致)
Data Alignment          (数据排列错位)
Uncalled Routines       (从无调用的子过程)
Undeclared Symbols      (未声明变量、过程等)
Uninitialized Variables (未赋初始值的变量)
Unused Variables        (从未用到的变量)
Usage                   (用法)
用了这些选项,可以对很多潜在的问题给予警告,使代码更为规范安全。注意:Uninitialized Variables只对简单变量有效,对数组无效。如果简单变量a未给初值,而用于 b=3.0*a,则编译时将报错,但是如果a是个数组变量,则不报错。(不知后来的Intel VF版本有没有改进?)
另外也建议以下设置:Fortran Standard Checking: Fortran 90/95这样,非标准的、厂家扩充的语法功能就会给出警告。

 

Visual Fortran常见运行错误

 

Insufficient virtual memory 虚拟内存不足
Integer overflow 整数溢出错误
Integer divide by zero 整数除0错误
Floating overflow 浮点数溢出错误
Floating divide by zero 浮点数除0错误
Floating underflow 浮点数下溢错误
Floating point exception 浮点数异常错误
Subscript out of range 数组定义超出边界
Floating-point conversion failed 浮点数格式转换失败
Null pointer error 空指针错误
Stack overflow 堆栈溢出
String length error 字符串长度超出允许范围
Substring error 数组下标超出允许范围
Range error 整数值超出允许范围
Allocatable array is already allocated 数组重复定义
Program Exception - array bounds exceeded 引用数组下标超出允许范围
Program Exception - denormal floating-point operand 非法浮点数操作符
Program Exception - floating stack check 浮点数堆栈检查
Program Exception - integer divide by zero 整数除0错误
Program Exception - integer overflow 整数溢出
Program Exception - privileged instruction 非法执行特权指令
Program Exception - illegal instruction 非法指令
Program Exception - stack overflow 堆栈溢出
Array or substring subscript ex pression out of range 数组下标低下数组定义下界或高于数组定义上界 
CHARACTER substring ex pression out of range 字符串非法表示
Label not found in assigned GOTO list 不属于GOTO语句引用的标号
INTEGER arithmetic overflow 整数运算结果出现溢出
INTEGER overflow on input 输入的整数值超出允许范围
Invalid INTEGER 非法整数值
REAL indefinite (uninitialized or previous error) 产生非法实数
Invalid REAL 非法实数
REAL math overflow 实数值溢出
No matching CASE found for SELECT CASE select case语句中缺少case项
INTEGER assignment overflow 整数定义超出允许范围
A edit descriptor expected for CHARACTER 字符型数据的格式化输入和输出需要A编辑符
E, F, D, or G edit descriptor expected for REAL 实数型数据的格式化输入和输出需要E,F,D,G编辑符
I edit descriptor expected for INTEGER 整数型数据的格式化输入和输出需要I编辑符
L edit descriptor expected for LOGICAL 逻辑型数据的格式化输入和输出需要L编辑符
Multiple radix specifiers 输入或输出语句重复说明
Array already allocated 数组已分配
Array size zero or negative 数组大小为0或负数
Array not allocated 没有被分配的数组
Invalid argument 非法参数
Invalid number in input 输入非法数字
Invalid string in input 输入非法字符串
Comma missing in COMPLEX input 输入的多个表达式之间缺少逗号
T or F expected in LOGICAL read 输入的逻辑值必须是T或F
Illegal character in hexadecimal input 输入非法的十六进制数
Integer expected in format 格式语句中要求的整数
Initial left parenthesis expected in format 格式语句中多余的左括号
Positive integer expected in format 格式语句中要求用正整数
Integer expected preceding H, X, or P edit descriptor 在H、X、P编辑符前要求用整数
'.' expected in format 在D、E、F、G编辑符中w和d域之间用'.'分隔
Unexpected end of format 格式语句没有结束
Unexpected character in format 格式语句中的非法字符
M field exceeds W field in I edit descriptor 在I编辑符中M域的值大于W域的值
Integer out of range in format 格式语句中的整数值超出允许范围
Separator expected in format 格式语句中需要分隔符
Out of range: substring starting position 'pos' is less than 1 子字符串的起始位置小于1
Out of range: substring ending position 'pos' is greater than string length 'len' 子字符串的终止位置大于字符串长度
Out of memory 内存不足
Cannot allocate temporary array -- out of memory 由于内存不足不能分配临时数组
Cannot ALLOCATE allocatable array -- out of memory 由于内存不足不能分配数组
DEALLOCATE failure: ALLOCATABLE array is not ALLOCATED 释放没有被分配的数组

分享: http://www.sohu.com http://www.sohu.com http://www.sohu.com 
http://www.sohu.comhttp://www.sohu.comhttp://www.sohu.comhttp://www.sohu.comhttp://www.sohu.comhttp://www.sohu.com
 
表  情:
加载中...
 

请各位遵纪守法并注意语言文明