执行程序时的Fortran77参数 [英] Fortran77 parameter when executing program

查看:165
本文介绍了执行程序时的Fortran77参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在执行Fortran77作业,所以请不要告诉我确切的编码,但是请给我一些提示:

I am currently doing a Fortran77 assignment, so please don't tell me the exact coding, but please give me a hint of what I want to do:

使用UNIX终端,我想通过执行来传递参数

Using UNIX terminal, I would like to get the parameter passed on by executing

./program.exe parameter

推荐答案

在标准Fortran77中,您不能这样做.故事结局.直到Fortran 2003才开始使用fortran程序访问命令行参数.

In standard Fortran77 you can't. End of story. Accessing command line arguments with fortran programs wasn't standardized until Fortran 2003.

如果您使用的是GNU fortran编译器,则可以使用 iargc() getarg(i, arg) 函数,它们返回参数的数量和特定参数的值.

If you're using the GNU fortran compiler, you can use the iargc() and getarg(i, arg) functions, which return the number of arguments and the value of a specific argument, resepectively.

这篇关于执行程序时的Fortran77参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆