- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Using IVF 11.1, the code shown below does not compile. Does this restriction (no derived type components in a NAMELIST group) still apply for later versions of IVF?
Thanks,
Olivier
[/fortran]
コピーされたリンク
3 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Yes, it still applies. The Fortran standard allows only "variable-name" in the namelist object list. You can, however, put T in the namelist and reference T%I in namelist input (and it is shown on output).
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Thanks Steve for this clarification.Obviously this is nothing more than a convenience feature that can be easily worked around as you indicated, butis there any fundamental reason for this not being allowed?
Olivier
Olivier
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
It would be a major departure from the language to allow things that are not whole variables in such contexts as NAMELIST, COMMON, etc. But I also think it is due to the age of NAMELIST, which first appeared in IBM FORTRAN compilers in the 1970s, long before derived types. Having implemented NAMELIST for VAX Fortran, what you're asking for is sort of a degenerate case of what is already allowed. The only difference is that you want to restrict access to specific components in the type. You can't put A(3) in a NAMELIST either.
I have not seen any attempt by the standards committee to extend NAMELIST beyond the initial featureset, other than allowing namelist I/O in more contexts (such as internal files.) You can already reference T%I in input, and when you outuput the namelist, the values of all components are written.
I have not seen any attempt by the standards committee to extend NAMELIST beyond the initial featureset, other than allowing namelist I/O in more contexts (such as internal files.) You can already reference T%I in input, and when you outuput the namelist, the values of all components are written.
