Proper use of modules in Fortran

后端 未结 4 1216
旧巷少年郎
旧巷少年郎 2020-12-03 06:32

I work with FORTRAN a lot, but I never had formal instruction in the proper way to write source code. I currently use modules to store global variables, but I understand yo

4条回答
  •  无人及你
    2020-12-03 07:04

    Modules help the Fortran program by automatically providing the explicit interfaces, as already described in some of the other answers. This allows the compiler to check for consistency between arguments in procedure calls and the procedure declarations, which catches a lot of mistakes -- here are some Stackoverflow answer that show this benefit of modules: Computing the cross product of two vectors in Fortran 90, FORTRAN functions and Fortran segmentation fault in pointer array

提交回复
热议问题