fortran90常见错误
- 格式:docx
- 大小:44.42 KB
- 文档页数:29
. 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 PVIEWto 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 a temporary 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 a valid number. An ordinal number is an optional argument in either an /EXPORT option 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 aconversion 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 filename was 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 moduledefinitionstatements. 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. Relink with 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 the base 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 onlythat object. The object was not removed.Linker Tools Error LNK1161invalid export specificationEither the /EXPORT option or the EXPORTS module-definition statementincorrectly 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 addpads 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 overridesthis 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. Onepossible 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 thezero 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.invalid 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; usethe /debug:full and /pdbfile options. If filename is the PDB for the main output file 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 withold-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.program 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:NOThere 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.(注:可编辑下载,若有不当之处,请指正,谢谢!)。
gfortran 编译f90使用gfortran编译f90gfortran是GNU组织开发的一款免费的Fortran编译器。
Fortran 是一种高级编程语言,主要用于科学计算和数值计算。
gfortran编译器可以将Fortran源代码转换为可执行文件,使得程序可以在计算机上运行。
我们需要准备一个Fortran源代码文件,通常以.f90或.f95为扩展名。
在编写代码之前,我们可以使用任何文本编辑器来创建一个新的源代码文件。
在这个文件中,我们可以定义变量、编写数学公式、编写程序逻辑等。
在编写代码之前,我们需要了解一些基本的Fortran语法规则。
Fortran中的变量可以是整数、实数、逻辑值或字符类型。
变量可以通过使用等号来赋值。
Fortran还支持基本的数学运算,如加法、减法、乘法和除法。
此外,Fortran还支持条件语句(如if语句)和循环语句(如do循环)等控制结构。
在编写完Fortran源代码之后,我们可以使用gfortran编译器来将其转换为可执行文件。
在命令行中,我们可以使用以下命令来编译Fortran源代码:```gfortran -o output_file_name source_file_name.f90```其中,output_file_name是我们希望生成的可执行文件的名称,source_file_name.f90是我们准备的Fortran源代码文件的名称。
编译成功后,将生成一个与output_file_name相同的可执行文件。
编译过程中,gfortran编译器会检查源代码中的语法错误和逻辑错误,并生成相应的编译器错误信息。
如果存在错误,我们需要根据错误信息来修复代码。
通常,错误信息会指出错误发生的位置和错误的类型,我们可以根据错误信息逐个解决。
一旦编译成功,我们可以通过在命令行中输入可执行文件的名称来运行程序。
程序将按照我们在源代码中定义的逻辑进行计算,并输出结果。
除了编译和运行Fortran程序之外,gfortran编译器还提供了一些选项来控制编译过程。
⎰-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.。
Visual Fortran 常见运行错误信息41 Insufficient virtual memory 虚拟内存不足70 Integer overflow 整数溢出错误71 Integer divide by zero 整数除0错误72 Floating overflow 浮点数溢出错误73 Floating divide by zero 浮点数除0错误74 Floating underflow 浮点数下溢错误75 Floating point exception 浮点数异常错误77 Subscript out of range 数组定义超出边界95 Floating-point conversion failed 浮点数格式转换失败146 Null pointer error 空指针错误147 Stack overflow 堆栈溢出148 String length error 字符串长度超出允许范围149 Substring error 数组下标超出允许范围150 Range error 整数值超出允许范围151 Allocatable array is already allocated 数组重复定义161 Program Exception - array bounds exceeded 引用数组下标超出允许范围162 Program Exception - denormal floating-point operand 非法浮点数操作符163 Program Exception - floating stack check 浮点数堆栈检查164 Program Exception - integer divide by zero 整数除0错误165 Program Exception - integer overflow 整数溢出166 Program Exception - privileged instruction 非法执行特权指令168 Program Exception - illegal instruction 非法指令170 Program Exception - stack overflow 堆栈溢出540 Array or substring subscript expression out of range 数组下标低下数组定义下界或高于数组定义上界541 CHARACTER substring expression out of range 字符串非法表示542 Label not found in assigned GOTO list 不属于GOTO语句引用的标号543 INTEGER arithmetic overflow 整数运算结果出现溢出544 INTEGER overflow on input 输入的整数值超出允许范围545 Invalid INTEGER 非法整数值546 REAL indefinite (uninitialized or previous error) 产生非法实数547 Invalid REAL 非法实数548 REAL math overflow 实数值溢出549 No matching CASE found for SELECT CASE select case语句中缺少case项550 INTEGER assignment overflow 整数定义超出允许范围556 A edit descriptor expected for CHARACTER 字符型数据的格式化输入和输出需要A编辑符557 E, F, D, or G edit descriptor expected for REAL 实数型数据的格式化输入和输出需要E,F,D,G编辑符558 I edit descriptor expected for INTEGER 整数型数据的格式化输入和输出需要I编辑符559 L edit descriptor expected for LOGICAL 逻辑型数据的格式化输入和输出需要L编辑符568 Multiple radix specifiers 输入或输出语句重复说明582 Array already allocated 数组已分配583 Array size zero or negative 数组大小为0或负数585 Array not allocated 没有被分配的数组610 Invalid argument 非法参数616 Invalid number in input 输入非法数字617 Invalid string in input 输入非法字符串618 Comma missing in COMPLEX input 输入的多个表达式之间缺少逗号619 T or F expected in LOGICAL read 输入的逻辑值必须是T或F622 Illegal character in hexadecimal input 输入非法的十六进制数637 Integer expected in format 格式语句中要求的整数638 Initial left parenthesis expected in format 格式语句中多余的左括号639 Positive integer expected in format 格式语句中要求用正整数641 Integer expected preceding H, X, or P edit descriptor 在H、X、P编辑符前要求用整数644 '.' expected in format 在D、E、F、G编辑符中w和d域之间用'.'分隔645 Unexpected end of format 格式语句没有结束646 Unexpected character in format 格式语句中的非法字符647 M field exceeds W field in I edit descriptor 在I编辑符中M域的值大于W域的值648 Integer out of range in format 格式语句中的整数值超出允许范围650 Separator expected in format 格式语句中需要分隔符663 Out of range: substring starting position 'pos' is less than 1 子字符串的起始位置小于1664 Out of range: substring ending position 'pos' is greater than string length 'len' 子字符串的终止位置大于字符串长度672 Out of memory 内存不足718 Cannot allocate temporary array -- out of memory 由于内存不足不能分配临时数组727 Cannot ALLOCATE allocatable array -- out of memory 由于内存不足不能分配数组729 DEALLOCATE failure: ALLOCATABLE array is not ALLOCATED 释放没有被分配的数组。
实验2 Fortran语言基本语句及程序改错实验目的:1,学习把已有程序导入新的project中。
2,学习整形、实行和双精度变量的差异。
3,熟悉常见的语法错误,学习程序纠错。
实验内容:1,建立一个project, 输入ch2_110 PROGRAM ch2_120 USE dflib30 IMPLICIT none40 INTEGER:: i,n,p50 REAL x,y60 PARAMETER (n=10)70 OPEN(3,file="rec.dat")80 READ(*,*) x90 y=1.0100 DO i=1, 100105 IF(i.LE.n) THEN110 CALL pn(i,p)120 y=y+x**i/(p*1.0)121 ELSE125 END IF130 ENDDO140 WRITE(*,*) x, y, exp(x)150 WRITE(3,160) x, y, exp(x)160 FORMAT(3F12.6)165 CLOSE(3)170 END PROGRAM ch2_1180 SUBROUTINE pn(i,p)190 IMPLICIT none200 INTEGER i,j,p210 p=1220 DO j=1,i230 p=p*j240 ENDDO250 END SUBROUTINE pn2,编译运行。
取n为不同数值,观察计算结果与真值的关系。
查找大的n值出现误差的原因(写在实验报告上)。
弄清整形、实行和双精度变量的差异。
3,分别去掉10、30、70、100、130、160、170等语句,看编译出错信息(写在实验报告上)。
熟悉常见的语法错误导致的编译问题。
4,完成上述操作的同学可以把自己编写的求一元二次方程复根的程序输入,调试、计算。
实验报告:1,写出把现有程序导入一个新建的project的步骤。
2,说明大n出错的原因及纠错方法。
3,记下各种出错信息。
声明:1.欢迎使用本指导方案,本指导方案仅供参考,若因为本指导而导致的安装错误以及其他损失,本人概不负责。
2.FORTRAN90仅能支持32位电脑。
3,若有其他安装使用技术问题,请与本人联系。
编辑:张智超联系方式:373134347 安装顺序:1.打开FORTRAN编译器,点开SETUP.EXE2.选择三个选项的第一个。
3.之后会弹出一个框图,点击否。
这个是介绍本软件的。
4.然后点击next5.对于这个,名字随便你自己,序列号为33206,0500,0010743,00007,输完之后点击next6.点击yes7.继续点击next,切记按照如图所示,不要改动其他东西。
8.继续点击next9.等待几十秒后,点击允许本次操作。
10.点击是或者否都无所谓,这个是供你更新用的。
11.之后连续点击两个否,点击finish即可。
12.安装之后你回发现招不到文件夹所在,不要着急。
提供两个方法!第一,点击电脑左下角的这个,然后点击所有程序,找到这个文件夹:Compaq Visual Fortran 6,点开,找到Developer Studio,点开即可。
第二,按照这个去找你电脑里的原始启动程序。
之后找到这个,点击DFDEV,.com。
然后会有360等防火墙组织,点击允许此操作。
下面开始讲解操作过程:1点击file。
2 点击file里面的new。
3点击确定4 点击第一个FILES5 选择第四个,fortran fixed format source file6点击ok之后就可以开始编写程序了,其他应用技术就不多讲解了。
后记,祝同学们学习进步,编写愉快!。
第三章 FORTRAN 90 基础知识基本知识,如:字符集、名称、关键字、程序单元、书写格式、数据类型。
名称:①名称只能由英文字母、数字、下划线符“_”和美元符号“$”组成。
②名称第一个字符必须是英文字母。
③名称不能超过31个字符。
合法名称: Number,Max, PrOgRaM, FIND_IT, read, x, a3b7, china, total, x$y$z 。
非法名称:X-Y-Z, 8q, a.5, _wrong,U.S.A., DR.WANG,$abcd,r a t e 。
书写格式:自由格式,固定格式3个通用标志符:注释标志符“!”、语句分隔标志符“;”和续行标志符“&”。
数据类型第四章 内部数据类型与表控输入输出常量和变量:语法描述; 精度(kind 值)和取值范围整型。
实型。
复型。
字符型。
CH(1:5)是什么?逻辑型。
变量的申明(几种声明方式,谁优先)。
表达式 (会写正确的表达式,表达式计算结果)如:e算术表达式:算术运算符的优先级和结合规则;操作数的类型转换不同优先级运算符,“先高后低”结合先乘方、后乘除、再加减,括号最优先相同优先级运算符,“从左向右”结合,如9-4+12/3*2**3 = ?乘方算符,“从右向左”结合,如2**3**2 = ?尽量多地使用( ),以使意义明确,避免出现歧义和产生错误转换规则“由低级向高级转换”①数据类型和KIND相同的两个算术操作数,计算时不转换,运算结果的类型和KIND与原数据相同。
②数据类型相同但KIND值不同的两个算术操作数,计算时,将KIND值低的操作数转换为高KIND值,运算结果为高KIND值的原类型。
③数据类型不同的两个算术操作数,将低级别类型的操作数高级别类型,运算结果的类型及KIND值与高级别类型操作数相同。
字符表达式字符串连接操作符//“I” // ‘ ‘ // “Love” // ‘ ‘ // “Fortran 90” I Love Fortran 90逻辑变量逻辑与逻辑或逻辑非逻辑等于逻辑不等逻辑异或X Y X.AND.Y X.OR.Y.NOT.X X.EQV.Y X.NEQV.Y X.XOR.Y T T T T F T F FT F F T F F T TF T F T T F T TF F F F T T F F逻辑运算的优先级:.NOT. →.AND.→.OR.→.EQV.、.NEQV.、.XOR、相同优先级时,运算按从左到右的顺序进行(“左结合”)(3>5).and.(4>1))的计算结果是什么?赋值语句 (能写出正确的赋值语句)第五章数据的有格式输入输出I编辑符F编辑符E编辑符D编辑符A编辑符READ(*,*)a,bWRITE(*,*)a,bWRITE(1,"(1X,I5)")WRITE(1,100)100 FORMAT(1X,I5)Open(10, FILE=“FILE1.txt” ,STATUS=“new”)WRITE( * , '(1X, A, "=", I2)') '2+3', 2+3第六章选择结构程序设计逻辑IF语句块IF语句多支块IF语句会写多支块IF程序,块CASE语句第七章循环结构程序设计EXIT语句的功能是:在循环体执行过程中强制性终止整个循环语句的执行,转循环语句后的第一条语句执行。
Fortran常见错误41 Insufficient virtual memory 虚拟内存不足70 Integer overflow 整数溢出错误71 Integer divide by zero 整数除0错误72 Floating overflow 浮点数溢出错误73 Floating divide by zero 浮点数除0错误74 Floating underflow 浮点数下溢错误75 Floating point exception 浮点数异常错误77 Subscript out of range 数组定义超出边界95 Floating-point conversion failed 浮点数格式转换失败146 Null pointer error 空指针错误147 Stack overflow 堆栈溢出148 String length error 字符串长度超出允许范围149 Substring error 数组下标超出允许范围150 Range error 整数值超出允许范围151 Allocatable array is already allocated 数组重复定义161 Program Exception - array bounds exceeded 引用数组下标超出允许范围162 Program Exception - denormal floating-point operand 非法浮点数操作符163 Program Exception - floating stack check 浮点数堆栈检查164 Program Exception - integer divide by zero 整数除0错误165 Program Exception - integer overflow 整数溢出166 Program Exception - privileged instruction 非法执行特权指令168 Program Exception - illegal instruction 非法指令170 Program Exception - stack overflow 堆栈溢出540 Array or substring subscript expression out of range 数组下标低下数组定义下界或高于数组定义上界541 CHARACTER substring expression out of range 字符串非法表示542 Label not found in assigned GOTO list 不属于GOTO语句引用的标号543 INTEGER arithmetic overflow 整数运算结果出现溢出544 INTEGER overflow on input 输入的整数值超出允许范围545 Invalid INTEGER 非法整数值546 REAL indefinite (uninitialized or previous error) 产生非法实数547 Invalid REAL 非法实数548 REAL math overflow 实数值溢出549 No matching CASE found for SELECT CASE select case语句中缺少case项550 INTEGER assignment overflow 整数定义超出允许范围556 A edit descriptor expected for CHARACTER 字符型数据的格式化输入和输出需要A编辑符557 E, F, D, or G edit descriptor expected for REAL 实数型数据的格式化输入和输出需要E,F,D,G编辑符558 I edit descriptor expected for INTEGER 整数型数据的格式化输入和输出需要I编辑符559 L edit descriptor expected for LOGICAL 逻辑型数据的格式化输入和输出需要L编辑符568 Multiple radix specifiers 输入或输出语句重复说明582 Array already allocated 数组已分配583 Array size zero or negative 数组大小为0或负数585 Array not allocated 没有被分配的数组610 Invalid argument 非法参数616 Invalid number in input 输入非法数字617 Invalid string in input 输入非法字符串618 Comma missing in COMPLEX input 输入的多个表达式之间缺少逗号619 T or F expected in LOGICAL read 输入的逻辑值必须是T或F622 Illegal character in hexadecimal input 输入非法的十六进制数637 Integer expected in format 格式语句中要求的整数638 Initial left parenthesis expected in format 格式语句中多余的左括号639 Positive integer expected in format 格式语句中要求用正整数641 Integer expected preceding H, X, or P edit descriptor 在H、X、P编辑符前要求用整数644 '.' expected in format 在D、E、F、G编辑符中w和d域之间用'.'分隔645 Unexpected end of format 格式语句没有结束646 Unexpected character in format 格式语句中的非法字符647 M field exceeds W field in I edit descriptor 在I编辑符中M域的值大于W域的值648 Integer out of range in format 格式语句中的整数值超出允许范围650 Separator expected in format 格式语句中需要分隔符663 Out of range: substring starting position 'pos' is less than 1 子字符串的起始位置小于1 664 Out of range: substring ending position 'pos' is greater than string length 'len' 子字符串的终止位置大于字符串长度672 Out of memory 内存不足718 Cannot allocate temporary array -- out of memory 由于内存不足不能分配临时数组727 Cannot ALLOCA TE allocatable array -- out of memory 由于内存不足不能分配数组729 DEALLOCA TE failure: ALLOCA TABLE array is not ALLOCATED 释放没有被分配的数组。
fortran unclassifiable statement at (1)
在Fortran编程语言中,错误消息"fortran unclassifiable statement at (1)" 通常表示编译器遇到了它无法识别的语句。
这可能是由于多种原因造成的,以下是一些常见的原因:
1.语法错误:代码中可能存在拼写错误、错误的符号使用,或者缺少某些必需的关键字。
2.代码结构问题:在某些情况下,可能是由于程序的结构问题,例如,子程序或函数调用
中的错误。
3.不支持的特性:如果尝试使用Fortran标准中不支持的特性或功能,也可能会触发此错
误。
4.混合编程:在某些情况下,如果Fortran代码与其他编程语言(如C或C++)混合编写,
可能会因为不兼容的语法或结构而出现此错误。
5.版本不匹配:编译器的版本可能不兼容你的代码。
尝试更新或更改编译器可能会解决这
个问题。
6.使用了过时或不推荐使用的语法或函数:尽管这些功能在旧版本的Fortran中是有效的,
但现代版本的Fortran可能不再支持这些功能。
为了解决这个问题,你可以:
•检查代码中的语法错误,确保所有的语句都是正确的。
•确保所有的子程序和函数调用都是正确的。
•查阅Fortran文档,确保你正在使用的所有特性都是当前标准所支持的。
•如果与其他语言混合编程,请确保你遵循了正确的混合编程规范。
•更新或更改编译器,确保它与你的代码兼容。
•考虑使用现代的Fortran编程实践和标准。
FORTRAN90笔试试卷(二○一○年四月)一、选择题1、关于FORTRAN90中的标识符 (如变量名、过程名),以下说法中错误的是 (1) 。
DA、标识符只能由英文字母、数字、下划线组成B、标识符第一个字符必须是英文字母C、标识符长度不能超过31个字符D、标识符不能用FORTRAN90的关键字2、关于FORTRAN90中的程序单元,以下说法错误的是 (2) 。
DA、FORTRAN90 规定有 4 种程序单元B、一个 FORTYAN90 程序可由多个程序单元组成,其中至少包含一个主程序单元C、主程序单元是 FORTRAN90 程序运行的入口点D、一个程序的多个程序单元必须统一编译,生成可执行程序3、关于FORTRAN90中的主程序单元,以下说法正确的是 (3) 。
AA、一个主程序单元可以只含一个 END 语句B、一个主程序单元必须由 PROGRAM 语句开始C、PROGRAM 语句可以在主程序单元中多次出现D、主程序单元中可以包含其他外部子程序单元4、设有说明:CHARACTER(LEN=20)::string="This is a computer."BCHARACTER(LEN=15)::subs执行语句:subs=string(:4)//string(5:5)//string(11:)后,变量subs的值是 (4) 。
A、This isB、This computerC、is aD、a computer5、说明整型数组array并给其赋初值的正确语句是 (5) 。
CA、INTEGER array(3)=(/2, 4, 6/)B、DIMENSION::array(3)=(/2, 4, 6/)C、INTEGER,DIMENSION(3)::array=(/2, 4, 6/)D、INTEGER,DIMENSION(3)::array(3)=(/2, 4, 6/)6、关于FORTRAN90中的EXTERNAL语句,以下说法正确的是 (6) 。
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无意义的变量。
例如log10(0)M6203 functionname:OVERFLOW error函数的结果值或其中一个既时计算值太大以致不能表示,例如EXP(250000.0) M6204 functionname:UNDERFLOW error函数的结果值或其中一个既时计算值太小以致不能表示。
M6205 functionname:TLOSS error完全丢失精度,例如COS(1E30)M6206 functionname:PLOSS errorfortran debug模式设置和技巧CVF中有两种编译(连接、执行)模式:release模式和debug模式。
调试程序时,宜用debug 模式;调好后再用release模式,得到高效的执行程序。
设定debug模式:点击菜单Build/Set Active Project Configuration,选*- Win32 Debug,OK,即设定为debug模式。
以debug 模式执行:点击“Go (F5)”按钮,或直接按F5键,则执行程序,并在第一个出错语句处停止,在该语句前有一个小黄色箭头。
若程序没错,则一直执行完毕,自动关闭dos窗口。
此时,宜用“!”按钮或“Ctrl+F 5”键,执行完成后,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 expression out of range 数组下标低下数组定义下界或高于数组定义上界CHARACTER substring expression 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或FIllegal 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 子字符串的起始位置小于1Out 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 释放没有被分配的组fortran中forrtl:severe(24):end-of-file during read,unit 7,file D:\for\1\b-mu.txt image读数据时读到文件末尾了。