fortran end-of-file during read的解决方法

合集下载

FORTRAN运行错误消息列表中英对照

FORTRAN运行错误消息列表中英对照

F O R T R A N运行错误消息列表中英对照集团文件版本号:(M928-T898-M248-WU2669-I2896-DQ586-M1988)Fortran的运行时错误消息列表本节列出了英特尔Fortran运行时库(RTL)处理的错误。

对于每一个错误,该表提供了错误号,严重性代码,错误信息文本,条件符号名称,而错误的详细说明。

在程序中定义条件符号值(参数表),包括以下文件:for_iosdef.for如表中所述,消息的严重程度决定了发生下列情况:与信息和警告,程序继续执行与错误,结果可能会不正确与严重的,程序执行停止(除非指定了恢复方法)在最后一种情况下,为防止程序终止,您必须包含一个合适的I / O错误处理说明符并重新编译,或者对于某些错误,改变信号的缺省操作您再次运行该程序之前。

在下面的表中,第一列列出的错误号返回检测到I / O错误时iostat的变量。

第二列的第一行提供的消息,因为它会显示(以下forrtl:?),包括严重级别,消息号,消息文本。

第二列下面的行包含状态条件符号(如$ IOS_INCRECTYP)和消息的解释。

1?1严重(1):不是??Fortran特定的错误美元IOS_NOTFORSPE。

在用户程序中或在RTL的错误不是英特尔Fortran的特定错误和通过任何其他英特尔Fortran运行时的消息重度(10):不能覆盖已经存在的文件美元IOS_CANOVEEXI。

当指定的OPEN语句指定的文件XXX已存在状态='新'使用I / O单元×(创建新的文件)。

确保正确的文件名,目录路径,单元等等在源程序中指定。

决定是否:重命名或重新运行该程序前删除现有文件。

修改源文件来指定不同的文件规格,I / O单元,或OPEN语句状态。

重度(19):无效的引用变量在NAMELIST输入美元IOS_INVREFVAR。

其中下列条件发生:该变量是不是名单??组的成员。

fortran常见问题解决

fortran常见问题解决

fortran常见问题解决为了减少重复回答问题,特编此帖,并不定期添加和更新内容。

错误难免,欢迎讨论,仅供参考。

很多人问哪里可以找到Fortran编译器,有不少热心学友提供网址,特汇集在这里。

虽然俺检验过这些链接,但是它们不一定总有效。

Fortran 编译器下载:CVFFTN95 (License: Free for personal use)以下操作,如无特别说明,都是以为例。

1. 如何加大Stack size?选Project => Settings => Link => Category: Output =>Stack allocationsReserve: 这里填新值(默认为1M,若需要10M,则填)2. 如何用Fortran批量生成文件?设要生成4000个文件,文件名为AA1-AA4000,如何写循环生成文件,而不用写4000次write 命令呢?用内部文件:character(len=80) :: filename,forminteger :: ido i=1,4000select case (i)case (1:9)write(form,'(i1)') icase (10:99)write(form,'(i2)') icase (100:999)write(form,'(i3)') icase (1000:9999)write(form,'(i4)') iend selectwrite(filename,*) "AA",trim(form),".TXT"open(10,file=filename)write(10,*) iclose(10)end dostopend3. 如何用Fortran动态生成输出格式?设有一个数组data(100),输出时,希望每行输出num个数,而num由用户输入,如何实现?用内部文件:character(len=80) :: formreal :: data(100)integer :: i,numdata = (/ (i,i=1,100) /)/read(*,*) numwrite(form,*) "(",num,""write(*,form) datastopend4. MS 是不是很垃圾?是垃圾,其中Bug太多,多到不可用的地步!在这个主题里,换了CVF后问题就没了的人已有相当的数目。

Fortran运行中给出的系统错误及解决方法

Fortran运行中给出的系统错误及解决方法

⎰-102e xdxSevere_MessagesMust be corrected. The program's execution is terminated when the error is encountered, unless for I/O statements the program uses the END or ERR I/O statement specifiers to transfer control,perhaps to a routine that uses the IOSTAT specifier (see your DEC Fortran user manual).The severe messages follow (in alphabetical order):o MESSAGE: Adjustable array dimension errorNUMBER: 93EXPLANATION: Upon entry to a subprogram, one of the followingerrors was detected during the evaluation of dimensioninginformation:- An upper-dimension bound was less than alower-dimension bound.- The dimensions implied an array that was largerthan addressable memory.o MESSAGE: Attempt to access non-existent recordNUMBER: 36EXPLANATION: A direct-access READ or FIND statement attemptedto access beyond the end of a relative file (or a sequentialfile on disk with fixed-length records) or access a record that was previously deleted in a relative file.o Array index out of bounds (SIGTRAP)NUMBER: 138EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created.The cause is an array subscript that is outside the dimensionedboundaries of that array. Try recompiling using the -checkbounds option (perhaps with the f77_dump_flag environmentvariable set) or examine the core dump file to determine thesource code in error.o MESSAGE: Array index out of bounds for index n (SIGTRAP) NUMBER: 139EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created.The cause is an array subscript that is outside the dimensionedboundaries of the array index n. Try recompiling using the-check bounds option (perhaps with the f77_dump_flagenvironment variable set) or examine the core dump file todetermine the source code in error.o MESSAGE: BACKSPACE errorNUMBER: 23EXPLANATION: An error condition was detected during executionof a BACKSPACE statement.o MESSAGE: Cannot overwrite existing fileNUMBER: 10EXPLANATION: Specified file xxx already exists when OPENstatement specified STATUS='NEW' (create new file) using I/Ounit x. Make sure correct file name, directory path, unit, and so forth were specified in the source program. Decide whether to:- Rename or remove the existing file before rerunningthe program.- Modify the source file to specify different filespecification, I/O unit, or OPEN statement STATUS='UNKNOWN'. o MESSAGE: Cannot stat fileNUMBER: 108EXPLANATION: Attempted stat operation on the indicated filefailed. Make sure correct file and unit were specified.o MESSAGE: CLOSE errorNUMBER: 28EXPLANATION: An error condition was detected by the DECFortran RTL I/O system during execution of a CLOSE statement. o MESSAGE: DELETE errorNUMBER: 55EXPLANATION: An error condition was detected by the DECFortran RTL I/O system during execution of a DELETE statement. o MESSAGE: Divide by zero check (SIGTRAP)NUMBER: 137EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created.Examine core dump file for possible cause.o MESSAGE: Duplicate file specificationsNUMBER: 21EXPLANATION: Multiple attempts were made to specify fileattributes without an intervening close operation. A DEFINEFILE statement was followed by another DEFINE FILE statement or an OPEN statement.o MESSAGE: ENDFILE errorNUMBER: 33EXPLANATION: One of the following conditions occurred:- The file was not a sequential organization file withvariable-length records.- The file was not opened for sequential or append access.- An unformatted file did not contain segmented records.- The DEC Fortran RTL I/O system detected an error duringexecution of an ENDFILE statement.o MESSAGE: End-of-file during readNUMBER: 24EXPLANATION: One of the following conditions occurred:- A DEC Fortran RTL I/O system end-of-file conditionwas encountered during execution of a READ statementthat did not contain an END, ERR, or IOSTAT specification. - An end-of-file record written by the ENDFILE statementwas encountered during execution of a READ statementthat did not contain an END, ERR, or IOSTAT specification. - An attempt was made to read past the end of an internalfile character string or array during execution of a READ statement that did not contain an END, ERR, or IOSTATspecification.o MESSAGE: Error during readNUMBER: 39EXPLANATION: The DEC Fortran RTL I/O system detected an errorcondition during execution of a READ statement.o MESSAGE: Error during writeNUMBER: 38EXPLANATION: The DEC Fortran RTL I/O system detected an error condition during execution of a WRITE statement.o MESSAGE: File name specification errorNUMBER: 43EXPLANATION: The file name was specified erroneously.o MESSAGE: File not foundNUMBER: 29EXPLANATION: A file with the specified name could not be found during an open operation.o MESSAGE: FIND errorNUMBER: 57EXPLANATION: The DEC Fortran RTL I/O system detected an error condition during execution of a FIND statement.o MESSAGE: Floating overflow in math libraryNUMBER: 88EXPLANATION: A floating-point overflow condition was detected during execution of a math library procedure.o MESSAGE: Floating underflow in math libraryNUMBER: 89EXPLANATION: A floating-point underflow condition was detected during execution of a math library procedure. The resultreturned was zero.o MESSAGE: Format/variable-type mismatchNUMBER: 61EXPLANATION: An attempt was made either to read or write areal variable with an integer field descriptor (I or L), or to read or write an integer or logical variable with a real field descriptor (D, E, F, or G).o MESSAGE: Formatted I/O to unit open for unformatted transfers NUMBER: 257EXPLANATION: Attempted formatted I/O (such as list-directed ornamelist I/O) to a unit where the OPEN statement indicated the file was unformatted (FORM keyword). Check that the correct unit (file) was specified.If the FORM keyword was not specified in the OPEN statement andthe file should contain formatted data, specifyFORM='FORMATTED' in the OPEN statement. Otherwise, ifappropriate, use unformatted I/O.o MESSAGE: Inconsistent file organizationNUMBER: 51EXPLANATION: The file organization specified in an OPENstatement did not match the organization of the existing file. o MESSAGE: Inconsistent OPEN/CLOSE parametersNUMBER: 46EXPLANATION: Specifications in an OPEN or CLOSE statement wereinconsistent. Some invalid combinations follow:- READONLY with STATUS='NEW' or STATUS='SCRATCH'- ACCESS='APPEND' with READONLY, STATUS='NEW' orSTATUS='SCRATCH'- DISPOSE='SAVE', 'PRINT', or 'SUBMIT' withSTATUS='SCRATCH'- DISPOSE='DELETE' with READONLYo MESSAGE: Inconsistent record lengthNUMBER: 37EXPLANATION: An attempt was made to open a direct access filewithout specifying a record length.o MESSAGE: Inconsistent record typeEXPLANATION: The RECORDTYPE value in an OPEN statement did notmatch the record type attribute of the existing file that was opened.o MESSAGE: Infinite format loopNUMBER: 60EXPLANATION: The format associated with an I/O statement thatincluded an I/O list had no field descriptors to use intransferring those values.o MESSAGE: Input conversion errorNUMBER: 64EXPLANATION: During a formatted input operation, an invalidcharacter was detected in an input field, or the input valueoverflowed the range representable in the input variable. The value of the variable was set to zero.o MESSAGE: Input record too longNUMBER: 22EXPLANATION: A record was read that exceeded the explicit ordefault record length specified when the file was opened. To read the file, use an OPEN statement with a RECL= value (record length) of the appropriate size.o MESSAGE: Input statement requires too much dataEXPLANATION: An unformatted READ statement attempted to readmore data than existed in the record being read.o MESSAGE: Insufficient virtual memoryNUMBER: 41EXPLANATION: The DEC Fortran RTL was unable to acquireadditional virtual memory from the operating system. Users of the C and Korn shells may be able to overcome this problem by increasing the per-process data limit using the limit (C shell) or ulimit (Korn shell) commands. For more information, see the csh(1) and ksh(1) reference pages.If the maximum per-process data size is already allocated,increase the value of the maxdsiz parameter in the system'sconfiguration file. Note that edits to the configuration file do not take effect until the operating system kernel has been rebuilt, and the system has been rebooted. For moreinformation, see the doconfig(1) reference page and youroperating system guide to system configuration.o MESSAGE: Integer overflowNUMBER: 70EXPLANATION: During an arithmetic operation, an integer valueexceeded byte, word, or longword range. The result of theoperation was the correct low-order part. See your DEC Fortran user manual for ranges of the various integer data types.o MESSAGE: Integer zero divideNUMBER: 71EXPLANATION: During an integer arithmetic operation, anattempt was made to divide by zero. The result of theoperation was set to the dividend, which is equivalent todivision by 1.o MESSAGE: Internal consistency check failureNUMBER: 8EXPLANATION: Internal severe error. Please check that theprogram is correct. Recompile if an error exists in theprogram.If this error persists, submit an SPR.o MESSAGE: Invalid argument to Fortran Run-Time Library NUMBER: 48EXPLANATION: The compiler passed an invalid or improperlycoded argument to the DEC Fortran RTL. This can occur if the compiler is newer than the RTL in use.o MESSAGE: Invalid argument to math libraryNUMBER: 81EXPLANATION: One of the mathematical procedures detected aninvalid argument value.o MESSAGE: Invalid logical unit numberNUMBER: 32EXPLANATION: A logical unit number greater than or less than zero was used in an I/O statement.o MESSAGE: Invalid reference to variable in NAMELIST input NUMBER: 19EXPLANATION: One of the following conditions occurred:- The variable was not a member of the namelist group.- An attempt was made to subscript the scalar variable.- A subscript of the array variable was out-of-bounds.- An array variable was specified with too many or toofew subscripts for the variable.- An attempt was made to specify a substring of a non-character variable or array name.- A substring specifier of the character variable wasout-of-bounds.- A subscript or substring specifier of the variable wasnot an integer constant.- An attempt was made to specify a substring using anunsubscripted array variable.o MESSAGE: Kernel breakpoint (SIGTRAP)NUMBER: 131EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created.Examine core dump for possible cause.o MESSAGE: Keyword value error in OPEN statementNUMBER: 45EXPLANATION: An improper value was specified for an OPEN orCLOSE statement keyword requiring a value.o MESSAGE: List-directed I/O syntax errorNUMBER: 59EXPLANATION: The data in a list-directed input record had aninvalid format, or the type of the constant was incompatiblewith the corresponding variable. The value of the variable was unchanged.o MESSAGE: Logarithm of zero or negative valueNUMBER: 83EXPLANATION: An attempt was made to take the logarithm of zeroor a negative number. The result returned was the reservedoperand, -0.o MESSAGE: Mixed file access modesNUMBER: 31EXPLANATION: An attempt was made to use any of the followingcombinations:- Formatted and unformatted operations on the same unit.- An invalid combination of access modes on a unit,such as direct and sequential.- A DEC Fortran RTL I/O statement on a logical unit thatwas opened by a program coded in another language. o MESSAGE: No such deviceNUMBER: 42EXPLANATION: A pathname included an invalid or unknown device name when an OPEN operation was attempted.o MESSAGE: Not a Fortran-specific errorNUMBER: 1EXPLANATION: An error occurred in the user program or in the RTL that was not a DEC Fortran-specific error.o MESSAGE: Not taken branch delay emulation (SIGTRAP) NUMBER: 134EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created. Examine core dump for possible cause.o MESSAGE: OPEN or DEFINE FILE requiredNUMBER: 26EXPLANATION: A direct access READ, WRITE, or FIND, statementwas attempted for a file when no DEFINE FILE or OPEN statement with ACCESS='DIRECT' was performed for that file.o MESSAGE: Open failureNUMBER: 30EXPLANATION: An error was detected by the DEC Fortran RTL I/Osystem while attempting to open a file in an OPEN, INQUIRE, or other I/O statement. This message is issued when the errorcondition is not one of the more common conditions for which specific error messages are provided. It can occur if an OPEN operation is attempted for one of the following files:- A segmented file that was not on a disk or a rawmagnetic tape.- A standard I/O file that had been closed.o MESSAGE: Operation requires seek abilityNUMBER: 120EXPLANATION: Attempted an operation on a file that requiresthe ability to perform seeks on that file. Make sure thecorrect unit, directory path, and file were specified.o MESSAGE: Output statement overflows recordNUMBER: 66EXPLANATION: An output statement attempted to transfer moredata than would fit in the maximum record size.o MESSAGE: Overflow check (SIGTRAP)NUMBER: 136EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created.The cause is an integer overflow. Try recompiling using the-check overflow option (perhaps with the f77_dump_flagenvironment variable set) or examine the core dump file todetermine the source code in error.o MESSAGE: Pathname errorNUMBER: 43EXPLANATION: A pathname (or file name) given to an OPEN orINQUIRE statement was not acceptable to the DEC Fortran RTL I/O system.o MESSAGE: Permission to access file denied, unit x, file xxx NUMBER: 9EXPLANATION: Check the mode (protection) of the specifiedfile. Make sure the correct file was being accessed. Change the protection, specified file, or process used beforererunning program.o MESSAGE: Record number outside rangeNUMBER: 25EXPLANATION: A direct access READ, WRITE, or FIND statementspecified a record number outside the range specified when the file was opened.o MESSAGE: Recursive I/O operationNUMBER: 40EXPLANATION: While processing an I/O statement for a logicalunit, another I/O operation on the same logical unit wasattempted, such as a function subprogram that performs I/O to the same logical unit was referenced in an expression in an I/O list or variable format expression.o MESSAGE: REWIND errorNUMBER: 20EXPLANATION: One of the following conditions occurred:- The file was not a sequential file.- The file was not opened for sequential or append access.- The DEC Fortran RTL I/O system detected an error conditionduring execution of a REWIND statement.o MESSAGE: Segmented record format errorNUMBER: 35EXPLANATION: An invalid segmented record control data word wasdetected in an unformatted sequential file. The file wasprobably either created with RECORDTYPE='FIXED' or 'VARIABLE' in effect, or was created by a program written in a languageother than Fortran.o MESSAGE: Significance lost in math libraryNUMBER: 87EXPLANATION: The magnitude of an argument or the magnitude ofthe ratio of the arguments to a math library function was solarge that all significance in the result was lost. The result returned was the reserved operand, -0.o MESSAGE: Square root of negative valueNUMBER: 84EXPLANATION: An argument required the evaluation of the squareroot of a negative value. The result returned was the reserved operand, -0.o MESSAGE: Subscript out of rangeNUMBER: 77EXPLANATION: An array reference was detected outside thedeclared array bounds.o MESSAGE: Syntax error in formatNUMBER: 62EXPLANATION: A syntax error was encountered while the RTL wasprocessing a format stored in an array or character variable. o MESSAGE: Syntax error in NAMELIST inputNUMBER: 17EXPLANATION: The syntax of input to a namelist READ statement was incorrect.o MESSAGE: Taken branch delay emulation (SIGTRAP) NUMBER: 133EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created. Examine core dump for possible cause.o MESSAGE: Too many records in I/O statementNUMBER: 27EXPLANATION: An attempt was made to do one of the following: - Read or write more than one record with an ENCODEor DECODE statement.- Write more records than existed.o MESSAGE: Too many values for NAMELIST variableNUMBER: 18EXPLANATION: An attempt was made to assign too many values to a variable during a namelist READ statement.o MESSAGE: Undefined exponentiationNUMBER: 82EXPLANATION: An exponentiation that is mathematicallyundefined was attempted, for example, 0.**0. The result returned for floating-point operations was the reservedoperand, -0, and for integer operations, zero.o MESSAGE: Unformatted I/O to unit open for formatted transfers NUMBER: 256EXPLANATION: Attempted unformatted I/O to a unit where theOPEN statement indicated the file was formatted (FORM keyword). Check that the correct unit (file) was specified.If the FORM keyword was not specified in the OPEN statement andthe file should contain unformatted data, specifyFORM='UNFORMATTED' in the OPEN statement. Otherwise, ifappropriate, use formatted I/O (such as list-directed ornamelist I/O).o MESSAGE: Unit already openNUMBER: 34EXPLANATION: A DEFINE FILE statement specified a logical unitthat was already opened.o MESSAGE: Unit not connectedNUMBER: 11EXPLANATION: The specified unit was not open at the time ofthe attempted I/O operation. Check if correct unit number was specified. If appropriate, use an OPEN statement to explicitly open the file (associates the file with the unit number).o MESSAGE: User breakpoint (SIGTRAP)EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created.Examine core dump for possible cause.o MESSAGE: User single step (SIGTRAP)NUMBER: 135EXPLANATION: Break exception generated a SIGTRAP signal(described in signal(3)). Core dump file created.Examine core dump for possible cause.o MESSAGE: Variable format expression value errorNUMBER: 68EXPLANATION: The value of a variable format expression was notwithin the range acceptable for its intended use; for example, a field width was less than or equal to zero. A value of 1 was assumed, except for a P edit descriptor, for which a value of zero was assumed.o MESSAGE: Write to READONLY fileNUMBER: 47EXPLANATION: A write operation was attempted to a file thatwas declared READONLY in the OPEN statement that is currently in effect.o MESSAGE: Wrong number of argumentsEXPLANATION: An improper number of arguments was used to calla math library procedure.Error_MessagesShould be corrected. The program may continue execution, but the output from this execution may be incorrect.The error messages follow (in alphabetical order):o MESSAGE: Floating divide by zeroNUMBER: 73EXPLANATION: During a floating-point arithmetic operation, anattempt was made to divide by zero.o MESSAGE: Floating invalidNUMBER: 65EXPLANATION: During an arithmetic operation, thefloating-point value generated resulted in an invalid format (not representable for that data type).o MESSAGE: Floating overflowNUMBER: 72EXPLANATION: During an arithmetic operation, a floating-pointvalue exceeded the largest representable value for that data type. See your DEC Fortran user manual for ranges of thevarious data types.o MESSAGE: Floating point exceptionNUMBER: 75EXPLANATION: A floating-point exception occurred. Core dumpfile created. Possible causes include divide by zero,overflow, or an invalid operation, such as subtraction ofinfinite values, multiplication of zero by infinity (withoutsigns), division of zero by zero or infinity by infinity, and conversion of floating-point to fixed-point format when anoverflow prevents conversion.o MESSAGE: Floating underflowNUMBER: 74EXPLANATION: During an arithmetic operation, a floating-pointvalue became less than the smallest representable value forthat data type. On RISC systems (depending on the values ofthe f77 command -fpe option), the underflowed result was either set to zero or allowed to gradually underflow. On AXP systems, the underflowed result is set to zero. See your DEC Fortranuser manual for ranges of the various data types.o MESSAGE: Fortran abort routine calledNUMBER: 266EXPLANATION: The program called abort to terminate theprogram.o MESSAGE: IOT trap signalNUMBER: 76EXPLANATION: Core dump file created. Examine core dump forpossible cause of this IOT signal.o MESSAGE: Output conversion errorNUMBER: 63EXPLANATION: During a formatted output operation, the value ofa particular number could not be output in the specified field length without loss of significant digits. When this situation is encountered, the field is filled with asterisks.o MESSAGE: Process interrupted (SIGINT)NUMBER: 69EXPLANATION: The process received the signal SIGINT.Determine source of this interrupt signal (described insignal(3)).o MESSAGE: Process killed (SIGTERM)NUMBER: 78EXPLANATION: The process received the signal SIGTERM.Determine source of this software termination signal (described in signal(3)).o MESSAGE: Process quit (SIGQUIT)NUMBER: 79EXPLANATION: The process received the signal SIGQUIT. Coredump file created. Determine source of this quit signal(described in signal(3)).Warning_MessagesShould be investigated. The program continues execution, but the output from this execution may be incorrect.The warning messages follow (in alphabetical order):o MESSAGE: Could not open message catalog: formsg.cat NUMBER: noneEXPLANATION: The DEC Fortran message file was not found onthis system. See your DEC Fortran user manual for moreinformation.Informational_MessagesFor informational purposes only. Unless it accompanies anothermessage, the program continues.The informational messages follow (in alphabetical order):o MESSAGE: Check environment variable NLSPATH and protection of path-name/for_msg.datNUMBER: noneEXPLANATION: The DEC Fortran message file was not found onthis system. For more information, see your DEC Fortran user manual or your DEC Fortran installation guide.o MESSAGE: Check location/protection of NLS and/usr/lib/formsg.datNUMBER: noneEXPLANATION: The DEC Fortran message file was not found onthis system. See your DEC Fortran user manual for moreinformation.o MESSAGE: nn floating divide-by-zero trapsNUMBER: 299EXPLANATION: The total number of floating-point divide-by-zero traps encountered during program execution was nn. This summary message appears at program completion.o MESSAGE: nn floating invalid trapsNUMBER: 297EXPLANATION: The total number of floating-point invalid data traps encountered during program execution was nn. This summary message appears at program completion.o MESSAGE: nn floating overflow trapsNUMBER: 298EXPLANATION: The total number of floating-point overflow traps encountered during program execution was nn. This summary message appears at program completion.o MESSAGE: Floating-point conversion failedNUMBER: 95EXPLANATION: The attempted unformatted read or write ofnon-native floating-point data failed. A non-nativefloating-point value either exceeded the allowable maximumvalue for the equivalent native format and was set equal toinvalid, or the value was infinity (plus or minus), not anumber (NaN), or otherwise invalid and was set to invalid.Very small numbers are set to zero (0). This could be caused by the specified non-native floating-point format not matching the floating-point format found in the specified file.Make sure the correct file was specified. Make sure the recordlayout matches the format DEC Fortran is expecting. Check that the correct non-native floating-point data format wasspecified, as described in your DEC Fortran user manual.o MESSAGE: nn floating underflow trapsNUMBER: 300EXPLANATION: The total number of floating-point underflowtraps encountered during program execution was nn. Thissummary message appears at program completion.o MESSAGE: Format syntax error at or near xxNUMBER: 58EXPLANATION: Check the statement containing xx, a charactersubstring from the format string, for a format syntax error.For information about FORMAT statements, refer to the "DECFortran Language Reference Manual".o MESSAGE: Fortran error message number is nnnNUMBER: noneEXPLANATION: The DEC Fortran message file was not found onthis system. For information about the message file location and the error text that corresponds to the listed error number, nnn, see your DEC Fortran user manual.。

fortran常见错误

fortran常见错误

FAQ之常见错误2014-02-02 13:45:35 来源:Fcode研讨团队评论:2点击:4419本文从编译错误,链接错误,运行时错误,计算结果错误等四个方面介绍了常见的错误及解决思路。

适合初学者阅读。

首先应该明确:错误有哪几种?我们当前遇到的是何种错误?阐述这些问题前,我们先讨论一下常规的应用程序开发的过程:1>>编写代码,使用一个或多个源代码文件。

2>>对第一步的每一个源代码文件执行编译操作。

得到一个或若干个目标代码。

3>>将目标代码,运行时库(Run-time Library)和其他使用到的函数库链接起来。

得到一个可执行文件(EXE 或其他)4>>编写程序的说明书,必要的(输入)数据文件5>>将上述得到的结果发布给用户。

(发布的方式可以是刻录成光盘,销售,放在网站上供别人下载,或者其他)6>>用户得到程序后,运行,输入数据,得到计算结果。

对于很多 Fortran 程序员来说,可能用户就是自己,也可能仅仅是自己教研室的同事同学。

所以第4,5,6步骤很多时候不明显。

而如果使用集成开发环境(IDE)进行开发,第1,2,3步骤又可以一键完成。

因此,很多初学者就认为,写程序就是:输入代码,运行,得到结果。

这样的理解太狭义。

不管我们面对什么使用者来写代码,程序开发应该是上述的过程。

我们的编译器,编译环境,也是为这个过程而设计的。

于是,我们将错误分为四种:一. 编译错误(发生在第2步)编译错误,一般是源代码书写格式不正确,不符合语法要求。

二. 链接错误(发生在第3步)链接错误,一般是源代码结构不完整,运行时库或函数库使用不合理。

三. 运行时错误(发生在第6步)运行时错误,一般是执行代码时,遇到了事先未料及的错误。

比如内存不足了,磁盘空间不够了,输入文件格式不对了,输出文件写入失败了等等。

四. 计算结果不符合预期(程序代码不规范,或不符合你的设想)计算结果不符合预期,可能性就很多了。

end of file reached before reading fully

end of file reached before reading fully

end of file reached before reading fully 最近,我在读取一个重要的文件时,遭遇了一个错误,错误信息显示“end of file reached before reading fully”(在完全读取
之前已达到文件的结尾)。

这个错误非常令人沮丧,因为它意味着我
无法完全获取我需要的信息。

在处理这个问题之前,我深入研究了这个错误的原因以及如何解决它。

首先,我了解了这个错误的原因。

这个错误通常发生在文件读取过程中,当读取器在遇到文件结尾之前就停止读取时会出现这个错误。

这通常发生在以下情况下:文件格式不正确,文件已经损坏,读取器没有正确地配置,或者文件太大以至于读取器无法完全读取它。

接下来,我寻找解决这个问题的方法。

我首先检查了文件的格式和状态,发现文件没有损坏,所以问题不是出在文件本身。

然后,我检查了读取器的配置,发现它需要一些调整才能完全读取文件。

最后,我将文件分成几个部分进行读取,确保不会读取太多的数据以至于读取器无法处理。

通过这些步骤,我成功地解决了这个问题,并成功地获取了我需要的信息。

这个经历让我更加了解了文件读取的过程和常见的错误,并教给我如何解决这些错误的方法。

总的来说,“end of file reached before reading fully”这
个错误是一个常见的问题,但是它可以通过仔细检查文件格式和状态,调整读取器配置,以及分开读取文件的方法来解决。

这个经历让我更好地了解了文件读取的过程,并让我更加有信心地处理类似的问题。

fortran安装调试运行过程中的可能错误及其原因

fortran安装调试运行过程中的可能错误及其原因

fortran安装、调试、运行过程中的【可能错误及其原因】-中英对照楼主鲍炜炜2011-04-18 14:37(欢迎加入气象QQ讨论群:149280902,点击即可加入)安装1.关于Fortran编译器的安装和配置?在安装FEPG之前一般要先安装好Powerstation Fortran 4.0编译器,并设置好Fortran编译器的path、lib 和include路径。

如果你的Powerstation Fortran 4.0编译器安装在目录C:\MSDEV下,设置如下:·在WIN 2000/XP下的设置:a.鼠标移到我的电脑图标,单击右键,然后点击属性;b.点击高级属性;c.点击环境变量,进行系统变量设置;系统变量如下图:d. 如果图上的include、lib、path几个变量没有,请点击新建;如有,点击编辑;按下面变量值进行修改:变量:path值:c:\MSDEV\bin; %path%变量:lib 值:c:\MSDEV\lib;%lib%变量:include值:c:\MSDEV\include;%include%注意:如果path、lib和include变量中有相应新增加的内容,可不增加。

如果编译器装在其它目录,则把C:\MSDEV换为该目录名。

实际上,在安装Powerstation Fortran 4.0时,会出现一个对话框,询问是否增加环境变量,如果选是,这些变量就已经配置好了。

安装fepg,需要用户有管理员权限。

2.运行FEPG命令生成Fortran源程序时,出现fl32不是内部命令也不是外部命令的错误(或fl32 is not internal command)?没配置好Fortran编译器的path路径。

按照上面第1个问题中的解答配置好path路径。

3. 运行FEPG命令生成Fortran源程序时,有些fortran源程序没连接成可执行程序,出现不能发现fepg.lib 库文件的错误?安装FEPG之前,没安装和配置好Fortran编译器所致。

nc文件的读取与处理

nc文件的读取与处理

.nc 文件的查看和处理2013-08-04 12:45阅读:2,168最近在学习冰后回弹模型(http://www.atmosp.physics.utoronto.ca/~peltier/data.php),里面给出的数据为nc(netcdf)格式的,读取是个问题,在言深深的帮助下,成功读取,在这里将其总结出来,以备后用也希望可以方便有用之人。

有两种方式可以进行读取:1、Excel的一个插件,NetCDF4Excel可以完成相关的查看工作,需要的可以进行下载(/c0lngehgha),/share/link? ... 416233&third=15(华为网盘太不靠谱,不知道百度靠谱到合适)安装之后,我们可以得到,一个快捷方式,如图:打开之后,我们可以看到下面的情形:然后打开nc文件,我们就可以进行查看操作:2、通过Grads进行相关的读取,主要是在言深深同学的帮助下完成,深深的感谢!第一步,安装相关的grads软件,这个这里不做介绍,相关可以论坛网站;第二步,打开grads软件,如图,回车之后的那个窗口千万不能关,那个窗口是图像显示的,关闭之后输入命令之后直接就退出了,刚开始我老犯这个低级错误(对菜鸟而言)。

第三步,可以通过两个命令简单的看到数据的头文件包含信息:①sdfopen d:\1.nc②q ctlinfo然后编写gs文件,如下:'reinit''sdfopen D:\1.nc''set gxout fwrite''se t fwrite D:\1.dat''set x 1 360''set y 1 179''set z 1''set t 1 1''d dsea_250''disable fwrite'ps1:路径自己可以按需更改,不要有空格。

fortran runtime end of file

fortran runtime end of file

fortran runtime end of file在Fortran编程中,"End of File"是一个常见的错误,通常发生在尝试从一个文件读取数据,但是已经到达文件的末尾时。

当程序尝试读取超出文件末尾的数据时,就会触发这个错误。

为了避免这个错误,你可以在读取文件之前检查是否已经到达文件的末尾。

在Fortran中,你可以使用EOF函数来检查是否到达文件末尾。

EOF函数返回一个逻辑值,如果已经到达文件末尾,那么它返回.TRUE.,否则返回.FALSE.。

下面是一个简单的例子,演示了如何在读取文件时使用EOF函数:fortran复制代码PROGRAM ReadFileIMPLICIT NONEINTEGER :: iosCHARACTER(LEN=100) :: lineOPEN('myfile.txt', STATUS='OLD', IOSTAT=ios)IF (ios /= 0) THENPRINT *, 'Error opening file'STOPEND IFDO WHILE (.NOT. EOF(1))READ(1, *, IOSTAT=ios) lineIF (ios /= 0) EXITPRINT *, lineEND DOCLOSE(1)END PROGRAM ReadFile在这个例子中,程序打开一个名为'myfile.txt'的文件,并在一个循环中逐行读取文件的内容。

每次读取一行之前,它都会检查是否已经到达文件的末尾。

如果已经到达文件的末尾,那么EOF(1)将返回.TRUE.,循环将结束,程序将关闭文件并退出。

如果在读取过程中发生任何错误,程序也会退出。

nc文件的读取与处理

nc文件的读取与处理

.nc 文件的查看和处理2013-08-04 12:45阅读:2,168最近在学习冰后回弹模型(http://www.atmosp.physics.utoronto.ca/~peltier/data.php),里面给出的数据为nc(netcdf)格式的,读取是个问题,在言深深的帮助下,成功读取,在这里将其总结出来,以备后用也希望可以方便有用之人。

有两种方式可以进行读取:1、Excel的一个插件,NetCDF4Excel可以完成相关的查看工作,需要的可以进行下载(/c0lngehgha),/share/link? ... 416233&third=15(华为网盘太不靠谱,不知道百度靠谱到合适)安装之后,我们可以得到,一个快捷方式,如图:打开之后,我们可以看到下面的情形:然后打开nc文件,我们就可以进行查看操作:2、通过Grads进行相关的读取,主要是在言深深同学的帮助下完成,深深的感谢!第一步,安装相关的grads软件,这个这里不做介绍,相关可以论坛网站;第二步,打开grads软件,如图,回车之后的那个窗口千万不能关,那个窗口是图像显示的,关闭之后输入命令之后直接就退出了,刚开始我老犯这个低级错误(对菜鸟而言)。

第三步,可以通过两个命令简单的看到数据的头文件包含信息:①sdfopen d:\1.nc②q ctlinfo然后编写gs文件,如下:'reinit''sdfopen D:\1.nc''set gxout fwrite''se t fwrite D:\1.dat''set x 1 360''set y 1 179''set z 1''set t 1 1''d dsea_250''disable fwrite'ps1:路径自己可以按需更改,不要有空格。

Fortran运行中给出的系统错误及解决方法

Fortran运行中给出的系统错误及解决方法

. Fortran 运行中给出的系统错误及解决方法以下均为linker tools errors and warningsLinker Tools Error LNK1000unknown error; consult documentation for technical support options Note the circumstances of the error, try to isolate the problem and create a reproducible test case, then contact technical support.Linker Tools Error LNK1101incorrect MSPDBxx.DLL version; recheck installation of this product The version of MSPDBxx.DLL available on your system does not match the version required by this tool.Linker Tools Error LNK1102out of memoryThere was not enough memory for the tool to run. Probably the paging file exceeded available disk space. If a shortage of disk space is not the cause, note the circumstances of the error, try to isolate the problem and create a reproducible test case, then request technical support.Linker Tools Error LNK1103debugging information corrupt; recompile moduleProbably the compilation was terminated before a valid object file was created.Recompile the given object file. If recompiling does not correct the problem,note the circumstances of the error, try to isolate the problem and create a reproducible test case, then consult technical support.Linker Tools Error LNK1104cannot open file "filename"The tool could not open the given file. One of the following may be a cause:l There was not enough disk space.l The file does not exist.l The filename or its path was incorrectly specified.l The specified drive is invalid.l The file does not have the appropriate permissions.l The path for filename expands to more than 260 characters.l If the given file is named LNKn, which is a filename generated by the linker for a temporary file, then the directory specified in the TMP environment variable may not exist, or more than one directory is specified for the TMP environment variable. (Only one directory path should be specified for the TMP environment variable.)l If the error occurs on the executable filename, an earlier version of the executable may still be running. You will need to terminate the executable before linking it. In Windows NT (including Windows 2000) or Windows 95,you can use the utility PVIEW to look for and kill instances of the application.l If the error message occurs for a library name, and you recently ported the .MAK file from a previous Microsoft Visual C++ developmentLinker Tools Messages Page 3 of 37environment, the library may no longer be valid. Ensure that the library still exists in this circumstance.l If the error message occurs for a library name such as CONSOLE.LIB, and you included object modules from an older Fortran developmentenvironment such as Microsoft Fortran PowerStation, recompile all source files with Visual Fortran to create new object files and libraries.Linker Tools Error LNK1105cannot close file "filename"The tool could not close the given file. Possibly there was insufficient disk space available.Linker Tools Error LNK1106invalid file or disk full: cannot seek to locationThe tool could not read or write to location in a memory-mapped file:l Your disk may be too full to complete the link. Free up some space and try the link again.l The error may be a result of trying to link over a network. Some networks do not fully support the memory-mapped files used by the linker. Try linking on your local disk to see if that fixes the problem.l There may be a bad block on your disk. Although the operating system and disk hardware should have detected such an error, you may want to run a disk checking program.Linker Tools Error LNK1107invalid or corrupt file: cannot read at locationThe tool could not read the file. Recreate the file.Linker Tools Error LNK1108cannot write file at locationThe tool could not write to the file. One of the following may be a cause:l There was not enough disk space to create the file.l The drive being written to was not available, possibly due to a network problem.Linker Tools Error LNK1109cannot remove file "filename"LIB could not delete the given file. Before LIB writes the new version of a library, it removes the existing library file. One of the following may be a cause:l The given file does not have the appropriate permissions.l The drive containing the file was not available, possibly due to a network problem.Linker Tools Error LNK1110Linker Tools Messages Page 4 of 37cannot rename file "filename"LIB could not rename the given file. When LIB builds a new version of a library, it creates atemporary file, then renames the file. One of the following may be a cause:l The given file does not have the appropriate permissions.l The drive containing the file was not available, possibly due to a network problem.Linker Tools Error LNK1111invalid /BASE argument "argument"The /BASE option was incorrectly specified. Either no argument was specified or argument is not a number.Linker Tools Error LNK1112module machine type "type1" conflicts with target machine type "type2"The object files specified as input were compiled for different machine types.Linker Tools Error LNK1113invalid machine typeThe machine type specified in the object header is not valid. Probably the file is corrupt. Rebuild the object. See Corrupt Object File for more information.Linker Tools Error LNK1115/MACHINE option requiredLINK or LIB cannot determine the machine type for objects that are provided entirely from libraries. Either specify the /MACHINE option with the appropriate machine type or specify at least one object file in the input.Linker Tools Error LNK1117syntax error in option "option"The given option was not correctly specified.Linker Tools Error LNK1118syntax error in keyword statementThe given module-definition statement was not correctly specified.Linker Tools Error LNK1119invalid ordinal number "argument"The argument following the at sign (@) in an ordinal specification was not avalid number. An ordinal number is an optional argument in either an /EXPORToption in a LINK or LIB command or an EXPORTS statement in a moduledefinitionfile. It is an index into the exports table. The number must be aninteger in the range 1-65535.Linker Tools Error LNK1120number unresolved externalsLinker Tools Messages Page 5 of 37Error LNK1120 gives you a count (number) of unresolved externals for this link.The conditions that cause unresolved externals are described with errorLNK2001 (see Linker Errors LNK2001 to LNK2014), which precedes this error message (once for each unresolved external).Linker Tools Error LNK1121duplicate ordinal number "number"The given ordinal number was specified more than once in either an /EXPORT option in a LINK or LIB command or an EXPORTS statement in a moduledefinition file. Ordinal numbers must be unique integers in the range 1-65535.Linker Tools Error LNK1123failure during conversion to COFF: file invalid or corruptThe object or resource could not be converted to COFF. This tool requires the format of all input files to be COFF. If an input file is not COFF, the tool runs a conversion tool, either CVTOMF (to convert 32-bit OMF objects) or CVTRES (to convert resource files). This error is preceded by errors or warnings from the conversion tool. One of the following may be a cause:l The file is corrupt.l The file is not a valid file type. An example of an invalid type is a 16-bit OMF object.Linker Tools Error LNK1127library is corruptThe library file is corrupt. Rebuild the library.Linker Tools Error LNK1129cannot find resolution for weak extern symbolThe given weak external symbol does not have a default resolution. Probablythe symbol table is corrupt. Rebuild the object file. See Corrupt Object File for more information.Linker Tools Error LNK1130Linker miscalc (base relocations off by number)There was not enough space in the image to write base relocations.Linker Tools Error LNK1131no library file specifiedThe LIB /EXTRACT command required a library as input, but a library filenamewas not specified.Linker Tools Error LNK1132invalid format for MS-DOS stub file "filename"The filename specified with the /STUB option was not a valid real-mode MS-DOS executable (.EXE) file.Linker Tools Messages Page 6 of 37Linker Tools Error LNK1136invalid or corrupt fileThe input file either has a corrupt header or is zero size or abnormally small.See Corrupt Object File for more information.Linker Tools Error LNK1137invalid argument specified with /SECTIONEither the name or the attributes argument to the /SECTION option is specified incorrectly.Linker Tools Error LNK1140too many modules for program database; relink with /PDB:NONEThe project contains more than 4096 modules. One of the following is asolution:l Relink using /PDB:NONE.l Compile some modules without debugging information.l Reduce the number of modules.Linker Tools Error LNK1141failure during build of exports fileLINK could not build the exports (.EXP) file. Causes of this error include system problems such as insufficient memory and syntax errors in options or moduledefinition statements. This error is preceded by another error that givesadditional information.Linker Tools Error LNK1143invalid or corrupt file: no symbol for COMDAT section numberThe object file is corrupt. Rebuild the file. See Corrupt Object File for more information.Linker Tools Error LNK1144error with LINK_REPRO var; cannot open "filename"The linker could not create filename. One of the following may be a cause:l Check that you've set your LINK_REPRO environment variable to anexisting directory and not the current directory.l Make sure there are no read-only files in the directory.l Make sure none of the files in the LINK_REPRO directory are open byanother process, because the linker needs to write to them.Linker Tools Error LNK1145/MERGE created circular link for section "section"You attempted to merge a section into itself. Check the /MERGE options.Linker Tools Error LNK1146Linker Tools Messages Page 7 of 37no argument specified with option "option"The given option requires an argument.Linker Tools Error LNK1147invalid number specified with option "option"The argument to the given option was specified incorrectly.Linker Tools Error LNK1148failure during conversion to COFF: cannot copy temp file filenameEDITBIN could not convert the input file to COFF. When EDITBIN converts a file,it creates a temporary file, then copies the file. One of the following may be a cause: l The given file does not have the appropriate permissions.l There was not enough disk space to create the file.l The drive being written to was not available, possibly due to a network problem.Linker Tools Error LNK1149output filename matches input filename "filename"The output filename specified with the /OUT or /IMPLIB option was the same asan input file.Return to Main Linker Error PageLinker Errors LNK1152 to LNK1189Linker Tools Error LNK1152cannot resolve one or more undecorated symbolsThis error is preceded by one warning LNK4022 for each undecorated symbolthat could not be resolved and by at least two warnings LNK4006 for theduplicate symbols found for the undecorated symbol.Linker Tools Error LNK1153/VXD command-line option requiredYou attempted to build a virtual device driver without the /VXD option. Relinkwith the /VXD option.Linker Tools Error LNK1154specified import library filename matches exports file "filename"The filename specified with LINK /IMPORT or with LIB /DEF /OUT conflicted with the filename given by LINK or LIB to the exports file, which is formed from thebase name of the main output file and the extension .EXP.Linker Tools Error LNK1155special symbol "symbol" already definedLinker Tools Messages Page 8 of 37The given symbol is reserved for use by LINK.Linker Tools Error LNK1156.sbss section not supportedAn object file contained an .sbss section.Linker Tools Error LNK1157fixup overflow; offset of target symbol "symbol" greater than +-8MBThe VXD is too large, or the sections are not arranged properly.Linker Tools Error LNK1158cannot run "filename"The given executable file called by LINK is not in the directory that contains LINK and is not in a directory specified in the PATH environment variable. Linker Tools Error LNK1159no output file specifiedNo name was specified for the main output file (executable file or DLL). LINK derives the default name of the output file from the base name of the first object file. If no object files are specified, and if the /OUT option is not used, this error occurs.Linker Tools Error LNK1160library with zero objects not allowedAn attempt was made to remove an object from a library that contained only that object. The object was not removed.Linker Tools Error LNK1161invalid export specificationEither the /EXPORT option or the EXPORTS module-definition statement incorrectly specified an export. A possible cause is a typing error.Linker Tools Error LNK1162expected aux symbol for comdat section numberThe linker expected to find an auxiliary symbol table for the indicated COMDAT but could not. The object file is probably corrupt. See Corrupt Object File for more information.Linker Tools Error LNK1163invalid selection for comdat section numberThe byte in the object file indicating the type of COMDAT section is invalid. The object file is probably corrupt. See Corrupt Object File for more information. Linker Tools Error LNK1164section section alignment (number) greater than /ALIGN valueThe alignment size for the given section in the object file exceeds the value specified with the /ALIGN option. The /ALIGN value must be a power of 2 and Linker Tools Messages Page 9 of 37must equal or exceed the section alignment given in the object file. Either recompile with a smaller section alignment or increase the /ALIGN value. Linker Tools Error LNK1165link failed because of fixup errorsThe build failed due to fixup errors. The /FORCE or /FORCE:UNRESOLVED option overrides this error.Linker Tools Error LNK1166cannot adjust code at offset=offset, va=valueLINK was unable to pad the code as required. Certain instructions are not allowed to cross page boundaries on some processors. LINK attempts to add pads to correct this situation. In this case, LINK could not work around the problem.Linker Tools Error LNK1167file contains relocs but header has no machine typeA converted COFF object did not have a machine type specified in its header. One cause of this error is omitting a machine type when converting a .RES file in a separate step before linking.Linker Tools Error LNK1168cannot open filename for writingThe given file does not have write permission.Linker Tools Error LNK1169one or more multiply defined symbols foundThe build failed due to multiple definitions of one or more symbols. This error is preceded by error LNK2005. The /FORCE or /FORCE:MULTIPLE option overrides this error.Linker Tools Error LNK1170line in command file contains limit or more charactersThe length of a line in a command file must be less than the given limit.Linker Tools Error LNK1171unable to load filenameThe given DLL was unavailable. The possible locations for the DLL are the current directory, the system directory, the Windows directory, and the directories specified in the PATH environment variable.Linker Tools Error LNK1172more than one object with the name "object" found; rename object(s) orrelink /PDB:NONEA library contained two or more objects with the same name. Do one of the following:Linker Tools Messages Page 10 of 37l Rename the objects using unique names and rebuild the library.l Link using the /PDB:NONE option.Linker Tools Error LNK1173unable to find entrypoint function in filenameThe given function does not exist in the given DLL.Linker Tools Error LNK1174unable to /REBASE filename; not a valid Win32 imageThe format of the given file was invalid.Linker Tools Error LNK1175failed to /REBASE filenameThe rebase operation failed on the given file.Linker Tools Error LNK1177TOC size limit exceededThe linker was unable to create a TOC (Table of Contents) in your image file. The limit is 2048 entries in the TOC.Linker Tools Error LNK1178missing MODEND record; file is invalid or corruptThe linker tool tried to convert an OMF object module to COFF format but could not find an expected MODEND (module end) record in the OMF object. The OMF object module is corrupt and needs to be recreated or recopied. See Corrupt Object File for more information.Linker Tools Error LNK1179invalid or corrupt file: duplicate comdat comdatAn object module contained two or more COMDATs with the same name. One possible cause is if you use the Visual C++ /H option with the Visual C++ /Gy option. The /H option limits the length of external names, and the /Gy option packages functions in COMDATs.Linker Tools Error LNK1180insufficient disk space to complete linkThe linker tool was unable to complete a file operation since the operating system reported that the disk is full. Free up space on your local and network drives (if you are writing files there).Linker Tools Error LNK1181cannot open input file "filename"The linker tool could not find "filename" because it does not exist or the path was not found.Linker Tools Error LNK1182Linker Tools Messages Page 11 of 37cannot have more than 64K exportsYou have reached the linker's limit of 65,536 exports.Linker Tools Error LNK1183invalid or corrupt file: extended relocation count number less than 65535The COFF object file is corrupt since it contains an extended relocation count that is less than 0xFFFF. See Corrupt Object File for more information.Linker Tools Error LNK1184invalid section name "section" specified in option or directive "option"You gave the linker an invalid section name in option. Invalid section names contain "$" or blanks.Linker Tools Error LNK1185invalid section name "section" specifiedYou gave the linker an invalid section name in a .DEF file. Invalid section names contain "$" or blanks.Linker Tools Error LNK1186invalid or corrupt COFF object; reloc to undefined static symbol "symbol"Your COFF object module is corrupt since it contains a relocation entry for an undefined static symbol. See Corrupt Object File for more information.Linker Tools Error LNK1187Corrupt object - unmatched name relocation; ignoredYour object file contains bad relocation information. Recopy or recreate the object file. See Corrupt Object File for more information.Linker Tools Error LNK1188BADFIXUPSECTION:: invalid fixup target "symbol"; possible zero length section This message is issued only for VxD links when the target of a relocation does not have a section. With LINK386 (an older version), an OMF GROUP record (generated by a MASM GROUP directive) may have been used to combine the zero length section with another non-zero length section. COFF format does not support the GROUP directive and zero-length sections. When LINK automatically converts this type of OMF objects to COFF, this error may occur.Linker Tools Error LNK1189LIBTOOMANYMEMBERS:: library limit of number objects exceededThe limit of 65535 objects or members in a library has been exceeded.Return to Main Linker Error PageLinker Errors LNK1190 to LNK1581Linker Tools Error LNK1190Linker Tools Messages Page 12 of 37invalid fixup found, type typeThe object file has become corrupted. Recompile.Linker Tools Error LNK1194cannot delay-load dll name due to import of data symbol symbol name; relink without /DELAYLOAD:dll nameYou cannot delay load a DLL if data is imported from it.Linker Tools Error LNK1195target machine "machine" requires "option"Add the required option.Linker Tools Error LNK1196invalid or corrupt import object: unknown versionThe import library has become corrupted. Rebuild the library.Linker Tools Error LNK1197invalid or corrupt import object: unknown typeThe import library has become corrupted. Rebuild the library.Linker Tools Error LNK1198invalid or corrupt import object: unknown name typeThe import library has become corrupted. Rebuild the library.Linker Tools Error LNK1199invalid or corrupt import object: non-zero reserved fieldsThe import library has become corrupted. Rebuild the library.Linker Tools Error LNK1200error reading program database "filename"The given program database (PDB) could not be read, probably because it is corrupted. If filename is the PDB for an object file, recompile the object file; use the /debug:full and /pdbfile options. If filename is the PDB for the main outputfile and this error occurred during an incremental link, delete the PDB and relink.Linker Tools Error LNK1201error writing to program database "filename"; check for insufficient disk space LINK could not write to the program database (PDB) for the output file. One of the following may be a cause:l The file is corrupted. Delete filename and relink.l There was not enough disk space to write to the file.l The drive being written to was not available, possibly due to a network problem.Linker Tools Error LNK1202Linker Tools Messages Page 13 of 37"filename" missing debugging information for referencing moduleThe given program database (PDB) for an object file was invalid. Recompile the object file; use CL's /Zi option.Linker Tools Error LNK1203"filename" missing current debugging information for referencing moduleThe given program database (PDB) for an object file was invalid. Recompile the object file; use CL's /Zi option.Linker Tools Error LNK1204"filename" compiled /Yc /Yu /Z7; cannot create PDB; recompile with /Zi Multilayered program databases (PDBs) are not supported in combination with old-style debugging information. Recompile using CL's /Zi option.Linker Tools Error LNK1206cannot overwrite Visual C++ 1.0 PDB "filename"; delete and rebuildThis version of LINK cannot write to an existing program database (PDB) created using older versions of the visual development environment. Delete filename and rebuild.Linker Tools Error LNK1207incompatible PDB format in "filename"; delete and rebuildThis version of LINK cannot write to the existing program database (PDB). Delete filename and rebuild.Linker Tools Error LNK1209program database "filename" differs from previous link; relink or rebuildThe given program database (PDB) is invalid and possibly corrupt. Relink. If filename is also the PDB for an object file, recompile to recreate the PDB. Linker Tools Error LNK1210insufficient memory for incremental link; relink with /INCREMENTAL:NO There was not enough virtual memory available for LINK to create the incremental status (.ILK) file.Linker Tools Error LNK1211precompiled type information not found; "filename" not linked or overwritten The given object file, compiled with /Yc, either was not specified in the LINK command or was overwritten.Linker Tools Error LNK1212error opening program database; file is in useThe PDB is already in use by another application.Linker Tools Error LNK1213unexpected import object encounteredThe import library has become corrupted. Rebuild the library.Linker Tools Messages Page 14 of 37Linker Tools Error LNK1221a subsystem can't be inferred and must be definedThe linker does not have enough information to infer which subsystem you will target your application. To fix this error, use the /SUBSYSTEM option.Linker Tools Error LNK1561entry point must be definedThe symbol specified by the /ENTRY option is not defined.Linker Tools Error LNK1581corrupted object or old compiler (bad Pcode entry point)Your object file contained a bad entry point. The object file is probably corrupt.。

fortran read error 处理

fortran read error 处理

fortran read error 处理Fortran Read Error Handling: A Step-by-Step GuideIn Fortran, read statements are used to input data from a specified source, such as a file or the standard input. However, there are cases where errors can occur during the execution of a read statement, which can lead to program failures or incorrect results. Therefore, it is essential to understand how to effectively handle read errors in Fortran. In this article, we will take a step-by-step approach to guide you through the process of handling Fortran read errors.Step 1: Enable Error HandlingTo begin, you need to enable error handling in your Fortran program. This can be achieved by including the `ERR` parameter in your read statement. The `ERR` parameter allows you to specify an error handling routine that will be executed if an error occurs during the execution of the read statement. For example:READ(UNIT, *, ERR = errorHandler) variableIn this example, `UNIT` is the unit number associated with the input source, `variable` is the variable to store the input data, and`errorHandler` is the name of the error handling routine.Step 2: Define the Error Handling RoutineNext, you need to define the error handling routine that will be executed when an error occurs during the read statement. This routine should handle the error appropriately, such as displaying an error message or taking corrective actions. For example:SUBROUTINE errorHandler()IMPLICIT NONEINTEGER :: errorCodeerrorCode = IOSTAT ! Get the error code from IOSTATSELECT CASE (errorCode)CASE (-1)WRITE(*, *) "End-of-file reached."CASE (-i)WRITE(*, *) "Input error occurred (code = ", ABS(i), ")."CASE (i)WRITE(*, *) "Output error occurred (code = ", i, ")."CASE DEFAULTWRITE(*, *) "Unknown error occurred."END SELECT! Take appropriate actions based on the error...END SUBROUTINE errorHandlerIn this example, we use the `SELECT CASE` construct to handle different error codes. The `IOSTAT` function returns the error code, which can be negative for input errors and positive for output errors. You can customize the error handling routine to suit your specific needs, such as logging errors or terminating the program.Step 3: Implement Error Detection and RecoveryAfter defining the error handling routine, you can now implement error detection and recovery mechanisms in your program. One common approach is to use a loop to continuously read input until a valid data isobtained or an error occurs. For example:INTEGER :: i, errorCodeDOREAD(UNIT, *, ERR = errorHandler, IOSTAT = errorCode) iIF (errorCode == 0) THEN! Valid input obtained, exit the loopEXITELSE! Error occurred, display error message and continue readingCALL errorHandler()END IFEND DOIn this example, the loop continues until a valid input is obtained(`errorCode == 0`), at which point the program exits the loop. If an error occurs, the `errorHandler` routine is called to handle the error and the loop continues.Step 4: Test and DebugFinally, it is crucial to thoroughly test your Fortran program with different input scenarios to ensure the error handling mechanism is functioning correctly. Test for common read errors, such as invalid input types, reaching end-of-file prematurely, or unexpected input format. Use test cases that cover a wide range of possible inputs to verify the effectiveness of your error handling implementation.In conclusion, handling Fortran read errors involves enabling error handling, defining an error handling routine, implementing error detection and recovery mechanisms, and testing and debugging the program. By following this step-by-step guide, you can ensure that your Fortran programs handle read errors effectively, improving the stability and reliability of your code.。

nc数据读取及编程常见问题解答(阿木)

nc数据读取及编程常见问题解答(阿木)

论坛里常常有人对nc这种内置ctl的文件数据处理提出问题,这里总结下常见的一些问题及对策。

nc数据是一类内置ctl的文件,也就说没有独立的ctl文件,那么打开命令也不是常见的open,而是sdfopen命令,那么要处理这类数据就得知道变量名、变量层次分布等信息,用q ctlinfo命令就可以查看全部的ctl了。

为什么提查看ctl 呢,很多人在处理这类数据的时候会想当然的认定一个变量名,缺省值、甚至精度都会不注意,那么无论怎么提取,出来的图都不会对的。

下面总结下容易出的问题:1、从nc文件提取出二进制数据(fwrite)设定需要注意经纬度,层次,时间是否是你需要的部分,尤其是用循环提取数据的朋友,尤其要注意。

有的时候设定经纬度(set lat 0 359.8)出了问题,可是尝试定义x y格点(set x 1 180)的方法试试,实在不行,可以用循环来输出不同的经纬度的数值。

2、注意提取数据的grads命令'set gxout fwrite''set fwrite c:\ss00.grd'....'disable fwrite'最后一行的这个命令,如果忘了加就容易数据不正常,还有的朋友,一个gs文件提取了两个数据文件,两组这类命令中间那个disable fwrite丢掉了,数据就彻底乱套了。

3、提取的数据,写ctl,需要注意与nc的ctl对应,包括缺测值,精度,这个问题只要照着nc的ctl写,层次格点什么的写成你数据对应的就好了。

4、数据提取了,ctl写好了,画画图看是不是与nc的一致,设定的时间、层次,图是不是不一样,因为用循环出数据的朋友容易犯写了好几个时间点,数据是一样的错误。

5、还有的朋友需要进一步提取这个grd或者dat文件,这就涉及到二进制数据的读取与操作问题了。

二进制数据是无格式的数据,读取与写入都不需要格式说明,里面的数据无法直接看到,其内部无非是0和1,而且数据之间没有间隔,读取写入只要read(文件号)write(文件号)就好读取种要注意,grads写入的数据循环从内到外依次为x 、y、z、变量、t,如果你需要确定某个数据的位置,那么,x是从西到东,y是从南到北,z 是从地面到高空,t是从前到后的顺序。

fortran90常见错误

fortran90常见错误

1、运行fortran时出现forrt1:severe<59>:list-directed I/O syntax error,unit 1,file G:\1\1\meat.dat怎么办这是通道1 ,链接到文件meat.dat 的读写出错了。

这问题你得认真检查类似read( 1 , * ) 或write( 1 , * ) 这样的语句,错误原因挺多的。

比如二进制文件用了文本方式读取,比如变量列表与文件不匹配。

问:另外forrt1:severe<161>:program exception -array bounds exceeded是怎么回事?回答:数组越界,也是很常见的错误。

比如real a(100)如果你使用了a(101) 就会越界,因为a 数组只有100 个元素。

2、fortran运行提示error M6201:math-**,现将代码贴出,求高手帮忙看看,急求解答!我不能确定你的错误是怎么引起的。

可能咱们的编译器不同。

你的代码在我这里的问题是:虚参和实参精度不同。

在程序中,你定义了部分real*8,但是对应的虚参和返回值却定义为real。

比如主程序里的z1(双精度),传入函数g里面的x却定义为单精度。

主程序Do 死循环了。

z2_jiashe和z2_suan每一次循环都没有发生改变,于是永远跳不出循环。

我给你的建议是:同一个程序,统一使用real*8 或real*4,尽量不要混用,除非你很自信能理清他们的关系。

检查Do 循环,尤其是z2_jiashe 和z2_suan,是否应该每次循环不同?fortran_排除错误(2012-04-20 23:22:44)安装好VISUAL FORTRAN后1、运行Developer studio即可开始编译FORTRAN程序2、选择File菜单中的New选项3、在弹出的对话框选择projects标签,其他标签不用管,projects格式选用Fortran console application;在project name里命名(最好英文名),点击“ok ”4、接下来画面中,选择“an empty project”,点击“finish”5、接下来画面点击“ok”6、再选择一次File菜单中的new7、对话框选用files标签,选择Fortran free format source file ,并在file里命名8、点击“ok”数Source Files 放源文件(.c、.cpp)程序的实现代码全放在这里Header Files 放头文件(.h)声明放在这里Resource Files 资源文件(.rc)放图标、图片、菜单、文字之类的,主要用来做界面的东东一般都放这里External Dependencies 除上三种以外的,程序编译时用到的文件全放这里fortran内部函数出错信息解释内部函数出错信息解释[sourcefile(line)]run-time error M62××MATH错误号函数级数学错误信息M6201 functionnames:DOMAIN error函数的自变量超出了约定的取值域,例如sqrt(-1)M6202 functionname:SING error无意义的变量。

(完整版)fortran文件操作

(完整版)fortran文件操作

fortran文件操作From: 《Fortran 95 程序设计》彭国伦1.文件读取的概念:读取:“顺序读取”和“直接读取”。

保存:“文本文件”和“二进制文件”。

二进制文件:读取快,因为保存格式和数据在内存中的保存方法一样,同时也节省空间。

----------------------------------2. 文件的操作:----------------------------------open的使用:使用open命令打开文件之后,就可以对文件来做输入输出。

example:program ex0901impicit noneopen(unit=10, file='hello.txt') ! 打开hello.txt文件, unit指定文件代码,file 指定文件名称。

write(10, *) "hello" !在代码为10的文件中写入hellostopend program ex0901open中有很多参数可以使用,详细如下:OPEN(UNIT=number, FILE='filename', FORM='...', STATUS='...', ACCESS='...', RECL=length, ERR=label, IOSTAT=iostat, BLANK='...', POSITION='...', ACTION=action, PAD='...', DELIM='...')UNIT='number': number必须是一个正整数,它可以使用变量或是常量来赋值。

number最好避开1,2,5,6。

因为2,6是默认的输出位置,也就是屏幕。

1,5则是默认的输入位置,键盘。

FILE='filename':指定要打开的文件名称,文件名要符合系统规定。

fortran90常见错误

fortran90常见错误

fortran90常见错误1、运行fortran时出现forrt1:severe<59>:list-directed I/O syntax error,unit 1,file G:\1\1\meat.dat怎么办这是通道1 ,链接到文件meat.dat 的读写出错了。

这问题你得认真检查类似read( 1 , * ) 或write( 1 , * ) 这样的语句,错误原因挺多的。

比如二进制文件用了文本方式读取,比如变量列表与文件不匹配。

问:另外forrt1:severe<161>:program exception -array bounds exceeded是怎么回事?回答:数组越界,也是很常见的错误。

比如real a(100)如果你使用了a(101) 就会越界,因为a 数组只有100 个元素。

2、fortran运行提示error M6201:math-**,现将代码贴出,求高手帮忙看看,急求解答!我不能确定你的错误是怎么引起的。

可能咱们的编译器不同。

你的代码在我这里的问题是:虚参和实参精度不同。

在程序中,你定义了部分real*8,但是对应的虚参和返回值却定义为real。

比如主程序里的z1(双精度),传入函数g里面的x却定义为单精度。

主程序Do 死循环了。

z2_jiashe 和 z2_suan 每一次循环都没有发生改变,于是永远跳不出循环。

我给你的建议是:同一个程序,统一使用real*8 或real*4,尽量不要混用,除非你很自信能理清他们的关系。

检查Do 循环,尤其是z2_jiashe 和z2_suan,是否应该每次循环不同?fortran_排除错误(2012-04-20 23:22:44)安装好VISUAL FORTRAN后1、运行Developer studio即可开始编译FORTRAN程序2、选择File菜单中的New选项3、在弹出的对话框选择projects标签,其他标签不用管,projects格式选用Fortran console application;在project name 里命名(最好英文名),点击“ok ”4、接下来画面中,选择“an empty project”,点击“finish”5、接下来画面点击“ok”6、再选择一次File菜单中的new7、对话框选用files标签,选择Fortran free format source file ,并在file里命名8、点击“ok”数Source Files 放源文件(.c、.cpp)程序的实现代码全放在这里Header Files 放头文件(.h)声明放在这里Resource Files 资源文件(.rc)放图标、图片、菜单、文字之类的,主要用来做界面的东东一般都放这里External Dependencies 除上三种以外的,程序编译时用到的文件全放这里fortran内部函数出错信息解释内部函数出错信息解释[sourcefile(line)]run-time error M62××MATH错误号函数级数学错误信息M6201 functionnames:DOMAIN error函数的自变量超出了约定的取值域,例如sqrt(-1)M6202 functionname:SING error无意义的变量。

Fortran编译器常见错误提示及原因

Fortran编译器常见错误提示及原因

Fortran编译器常见错误提⽰及原因附录:常见错误提⽰及原因安装1.关于Fortran编译器的安装和配置?在安装FEPG之前⼀般要先安装好Powerstation Fortran 4.0编译器,并设置好Fortran编译器的path、lib和include路径。

如果你的Powerstation Fortran 4.0编译器安装在⽬录C:\MSDEV下,设置如下:·在WIN 2000/XP下的设置:a.⿏标移到我的电脑图标,单击右键,然后点击属性;b.点击⾼级属性;c.点击环境变量,进⾏系统变量设置;系统变量如下图:d. 如果图上的include、lib、path⼏个变量没有,请点击新建;如有,点击编辑;按下⾯变量值进⾏修改:变量:path值:c:\MSDEV\bin; %path%变量:lib 值:c:\MSDEV\lib;%lib%变量:include值:c:\MSDEV\include;%include%注意:如果path、lib和include变量中有相应新增加的内容,可不增加。

如果编译器装在其它⽬录,则把C:\MSDEV换为该⽬录名。

实际上,在安装Powerstation Fortran 4.0时,会出现⼀个对话框,询问是否增加环境变量,如果选是,这些变量就已经配置好了。

安装fepg,需要⽤户有管理员权限。

2.运⾏FEPG命令⽣成Fortran源程序时,出现fl32不是内部命令也不是外部命令的错误(或fl32 is not internal command)?没配置好Fortran编译器的path路径。

按照上⾯第1个问题中的解答配置好path路径。

3. 运⾏FEPG命令⽣成Fortran源程序时,有些fortran源程序没连接成可执⾏程序,出现不能发现fepg.lib库⽂件的错误?安装FEPG之前,没安装和配置好Fortran编译器所致。

在安装FEPG之后出现此情况,可先按照上⾯第1个问题中的解答配置好Fortran编译器,然后在dos窗⼝下,运⾏FEPG所在⽬录下nfe.r8⽬录下的gfepglib.bat程序,即可⽣成fepg.lib库⽂件。

fortran常见错误代码

fortran常见错误代码
8
severe (8): Internal consistency check failure
FOR$IOS_BUG_CHECK. Internal error. Please check that the program is correct. Recompile if an error existed in the program. If this error persists, submit an SPR.
20
severe (20): REWIND error
FOR$IOS_REWERR. One of the following conditions occurred:
The file was not a sequential file.
The file was not opened for sequential or append access.
22
severe (22): Input record too long
FOR$IOS_INPRECTOO. A record was read that exceeded the explicit or default record length specified when the file was opened. To read the file, use an OPEN statement with a RECL= value (record length) of the appropriate size.
23
severe (23): BACKSPACE error
FOR$IOS_BACERR. The DIGITAL Fortran 90 RTL I/O system detected an error condition during execution of a BACKSPACE statement.

end-of-file during read的解决方法

end-of-file during read的解决方法

解决“end-of-file during read”错误的方法
在处理文件时,我们可能会遇到“end-of-file during read”的错误。

这种错误通常意味着在读取文件的过程中,程序意外地到达了文件的末尾。

为了解决这个问题,我们可以采取以下措施:
首先,要确保文件路径和文件名正确无误。

有时候,一个小小的拼写错误或路径错误就可能导致读取失败。

检查文件是否存在,以及是否位于预期的位置。

其次,确认文件没有被其他程序锁定或占用。

如果文件正在被另一个程序使用,可能会导致读取时发生冲突或锁定。

在这种情况下,尝试关闭占用该文件的其他程序,或者等待一段时间再尝试读取。

另外,审查代码中的读取逻辑也很重要。

有时候,程序中的逻辑错误会导致不断地尝试读取数据,而实际上文件中的数据量少于预期。

这种情况下,需要检查代码逻辑,确保读取数据的操作符合预期的逻辑流程。

如果是批量处理文件,还需特别注意文件格式的统一性。

确保所有处理中的文件格式一致,避免因格式不匹配导致的数据读取错误。

同时,检查每个文件的内容是否符合预期的结构和规范。

总结来说,解决“end-of-file during read”错误需要综合考虑多个方面。

从确认文件路径和名称、检查文件占用情况、审查代码逻辑到统一文件格式,每一步都至关重要。

通过细致的检查和调整,我们通常能够找到问题的根源并采取相应的措施来解决这个错误。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

fortran end-of-file during read的解决方法
在Fortran中,"end-of-file during read" 错误通常表示在尝试读取文件时已经到达了文件的末尾。

这可能是由于文件结尾符号不正确、文件被意外删除或其他一些问题引起的。

以下是一些可能的解决方法:
1. 检查文件路径和文件是否存在:
-确保你正在尝试读取的文件路径是正确的。

-确保文件确实存在于指定的路径中。

2. 检查文件格式:
-确保你的Fortran程序中的文件格式与文件本身的格式匹配。

例如,如果文件是以ASCII 格式存储的,你的程序应该使用`READ(*,*)`而不是二进制读取。

3. 检查文件是否为空:
-如果文件是空的,你可能会遇到此错误。

在尝试读取文件之前,你可以添加一些逻辑来检查文件是否为空。

```fortran
INTEGER :: file_unit
OPEN (UNIT=file_unit, FILE='your_file.txt', STATUS='OLD', ACTION='READ', IOSTAT=iostat) IF (iostat /= 0) THEN
! 文件不存在或无法打开
PRINT *, 'Error opening file'
ELSE
! 文件已成功打开
READ (file_unit, *, IOSTAT=iostat)
IF (iostat /= 0) THEN
! 在尝试读取文件时出现错误
PRINT *, 'Error reading file'
ELSE
! 文件成功读取
PRINT *, 'File read successfully'
END IF
END IF
CLOSE (file_unit)
```
4. 检查文件访问权限:
-确保你的程序有足够的权限读取指定的文件。

在某些操作系统上,文件权限可能是一个问题。

5. 使用文件存在性检查:
-在尝试打开或读取文件之前,你可以使用`INQUIRE`函数检查文件是否存在。

```fortran
INTEGER :: file_unit, iostat
INQUIRE(FILE='your_file.txt', EXIST=iostat)
IF (iostat /= 0) THEN
! 文件不存在
PRINT *, 'Error: File does not exist'
ELSE
! 文件存在,进行打开和读取操作
OPEN(UNIT=file_unit, FILE='your_file.txt', STATUS='OLD', ACTION='READ', IOSTAT=iostat) IF (iostat /= 0) THEN
! 文件打开时出现错误
PRINT *, 'Error opening file'
ELSE
! 文件成功打开,进行读取操作
READ(file_unit, *) your_variable
CLOSE(file_unit)
END IF
END IF
```
根据你的具体情况,上述方法中的一种或多种可能会帮助你解决"end-of-file during read" 错误。

相关文档
最新文档