摘要
提出了基于Fortran95新特性改写SIMPLE算法的主要方法与内容。其中主要包括Fortran95中MODULE模块封装数据的功能的运用;删除了所有功能强大但易破坏程序结构的GOTO语句;一些比较符合结构化编程的新的语句块的运用;Fortran95中增强了的数组功能在待求数组赋初值、设定边界条件等方面的运用等。并通过实例进行了新旧两种编程方法的对比。结果表明基于新语法的程序具有比原有程序更易维护、可读性好的特点。
The process of reprogramming SIMPLE program is described in detail based on new trait of Fortran95, which involves main program, user subroutine and other subroutines. The main contents of reprogramming include encapsulating data by using Module sentence of Fortran95, deleting all GOTO sentences which are powerful but destructive, exerting some new sentence blocks that accord well with structured programming, and using fortified array functions in boundary condition setting and other facets. By comparison between the new program and the old one through an example, it is found that the new source code is faster and more maintainable and readable.
出处
《山东建筑工程学院学报》
2006年第2期159-164,共6页
Journal of Shandong Institute of Architecture and Engineering