Fortran 90 Presence Of Optional Arguments

前端 未结 2 561
轮回少年
轮回少年 2021-01-12 01:48

I do not understand the behavior of the present() intrinsic function with pgf90 7.2. I wrote a 20 line sample program to test this, but the results still make no sense to m

2条回答
  •  萌比男神i
    2021-01-12 02:39

    In Modern Fortran optional arguments must be declared as optional in the calling function (either through a module or an explicit interface). In Fortran 77 it was possible to simply leave out the last argument, if it was a scalar number, so optional arguments could be passed without extra declaration in the calling routine. This might not have been part of the Fortran standard, but it was a helpful feature provided by wise compiler implementations. Unfortunately, Modern Fortran killed this awesome feature.

提交回复
热议问题