首页 > 最新文献

ACM SIGPLAN Fortran Forum最新文献

英文 中文
A reference counting implementation in Fortran 95/2003 引用计数在Fortran 95/2003中的实现
Pub Date : 2010-04-01 DOI: 10.1145/1753166.1753168
David Car
This paper outlines a reference counting programming pattern for derived types in Fortran 95/2003. Modern object oriented languages like Java [1, 3] and Python [2, 6] use reference counting to free the programmer from the concern of object allocation and deallocation, thus making possible memory leaks almost obsolete. The reference counting pattern outlined here is being used with the PyF95++ pre-processor [5] and the accompanying Standard Template Library. All the containers in that project are reference counted containers and employ this pattern. The result of this pattern is something akin to an auto ptr template class in C++ [4].
本文概述了Fortran 95/2003中派生类型的引用计数编程模式。现代面向对象语言,如Java[1,3]和Python[2,6]使用引用计数将程序员从对象分配和释放的担忧中解放出来,从而使可能的内存泄漏几乎过时。这里概述的引用计数模式正在与pyf95++预处理器[5]和随附的标准模板库一起使用。该项目中的所有容器都是引用计数容器,并采用此模式。这种模式的结果类似于c++[4]中的auto ptr模板类。
{"title":"A reference counting implementation in Fortran 95/2003","authors":"David Car","doi":"10.1145/1753166.1753168","DOIUrl":"https://doi.org/10.1145/1753166.1753168","url":null,"abstract":"This paper outlines a reference counting programming pattern for derived types in Fortran 95/2003. Modern object oriented languages like Java [1, 3] and Python [2, 6] use reference counting to free the programmer from the concern of object allocation and deallocation, thus making possible memory leaks almost obsolete. The reference counting pattern outlined here is being used with the PyF95++ pre-processor [5] and the accompanying Standard Template Library. All the containers in that project are reference counted containers and employ this pattern. The result of this pattern is something akin to an auto ptr template class in C++ [4].","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"37 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2010-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126890044","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 5
PyF95++: a templating capability for the Fortran 95/2003 language pyf95++: Fortran 95/2003语言的模板功能
Pub Date : 2010-04-01 DOI: 10.1145/1753166.1753167
David Car, Michael List
This article outlines a framework that was used to create a templating capability in the Fortran 95/2003 language (hereafter simply referenced as Fortran) as well as additional useful features which provide a native feel for integration into the language. Recent comparisons of Fortran with C++ have cited the lack of templating in Fortran as a major deficiency in the language [1]. Templating is a very powerful capability which allows the programmer to easily create and maintain more complex code than would be desirable to do manually. There are some very good C++ resources on templating for those not familiar with the subject [4] and are worth reading to gain a more thorough appreciation for the concept than what will be discussed here.
本文概述了一个框架,该框架用于在Fortran 95/2003语言(以下简称Fortran)中创建模板功能,以及其他有用的特性,这些特性为集成到该语言中提供了原生感觉。最近将Fortran与c++进行比较,发现Fortran缺乏模板是该语言的主要缺陷[1]。模板是一种非常强大的功能,它允许程序员轻松地创建和维护比手动更复杂的代码。对于那些不熟悉这个主题的人[4],有一些关于模板的非常好的c++资源,值得一读,以获得比这里讨论的内容更全面的概念理解。
{"title":"PyF95++: a templating capability for the Fortran 95/2003 language","authors":"David Car, Michael List","doi":"10.1145/1753166.1753167","DOIUrl":"https://doi.org/10.1145/1753166.1753167","url":null,"abstract":"This article outlines a framework that was used to create a templating capability in the Fortran 95/2003 language (hereafter simply referenced as Fortran) as well as additional useful features which provide a native feel for integration into the language. Recent comparisons of Fortran with C++ have cited the lack of templating in Fortran as a major deficiency in the language [1]. Templating is a very powerful capability which allows the programmer to easily create and maintain more complex code than would be desirable to do manually. There are some very good C++ resources on templating for those not familiar with the subject [4] and are worth reading to gain a more thorough appreciation for the concept than what will be discussed here.","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"129 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2010-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126272059","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 3
Standardized mixed language programming for Fortran and C 标准的Fortran和C混合语言编程
Pub Date : 2009-12-04 DOI: 10.1145/1667140.1667142
B. Einarsson, R. Hanson, T. Hopkins
Programmers have long practiced the matter of mixed language procedure calls. This is particularly true for the programming languages C and Fortran. The use of the alternate language often results in efficient running time or the effective use of human or other resources. Prior to the Fortran 2003 standard there was silence about how the two languages interoperated. Before this release there existed a set of differing ad hoc methods for making the inter-language calls. These typically depended on the Fortran and C compilers. The newer Fortran standard provides an intrinsic module, iso_c_binding, that permits the languages to interoperate. There remain restrictions regarding interoperable data types. This paper illustrates several programs that contain core exercises likely to be encountered by programmers. The source code is available from the first author's web site. Included is an illustration of a "trap" based on use of the ad hoc methods: A call from a C to a Fortran 2003 routine that passes a character in C to a character variable in Fortran results in a run-time error.
程序员长期以来一直在实践混合语言过程调用的问题。对于编程语言C和Fortran来说尤其如此。使用替代语言通常会导致高效的运行时间或有效地利用人力或其他资源。在Fortran 2003标准之前,对于这两种语言如何互操作一直保持沉默。在此版本之前,存在一组不同的用于进行语言间调用的特殊方法。这些通常依赖于Fortran和C编译器。较新的Fortran标准提供了一个内部模块iso_c_binding,它允许两种语言进行互操作。关于可互操作的数据类型仍然存在限制。本文举例说明了几个包含程序员可能遇到的核心练习的程序。源代码可从第一作者的网站获得。下面是一个基于特殊方法使用的“陷阱”的示例:从C调用Fortran 2003例程,将C中的字符传递给Fortran中的字符变量,将导致运行时错误。
{"title":"Standardized mixed language programming for Fortran and C","authors":"B. Einarsson, R. Hanson, T. Hopkins","doi":"10.1145/1667140.1667142","DOIUrl":"https://doi.org/10.1145/1667140.1667142","url":null,"abstract":"Programmers have long practiced the matter of mixed language procedure calls. This is particularly true for the programming languages C and Fortran. The use of the alternate language often results in efficient running time or the effective use of human or other resources.\u0000 Prior to the Fortran 2003 standard there was silence about how the two languages interoperated. Before this release there existed a set of differing ad hoc methods for making the inter-language calls. These typically depended on the Fortran and C compilers. The newer Fortran standard provides an intrinsic module, iso_c_binding, that permits the languages to interoperate. There remain restrictions regarding interoperable data types.\u0000 This paper illustrates several programs that contain core exercises likely to be encountered by programmers. The source code is available from the first author's web site. Included is an illustration of a \"trap\" based on use of the ad hoc methods: A call from a C to a Fortran 2003 routine that passes a character in C to a character variable in Fortran results in a run-time error.","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"17 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-12-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126572401","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 2
Joint J3/WG5 meetings November 2008, May 2009: a reply to David Muxworthy J3/WG5联合会议2008年11月,2009年5月:对David Muxworthy的答复
Pub Date : 2009-12-04 DOI: 10.1145/1667140.1667143
D. Nagle
While most of the minor items on the Fortran 2008 work list were completed (only the INTENT( SCRATCH) item was dropped), there were two major items that were dropped. These were the Generic Programming item (that had morphed into the Intelligent Macros item) and the new intrinsic BITS type. This was a substantial reduction of the scope of the work for Fortran 2008. Later, additionally, large parts of the coarrays item were removed to a TR. This was a second substantial reduction of the scope of the work for Fortran 2008. No one has said how delaying Fortran 2008 will make Fortran 2003 any easier to implement, or change the compiler vendors' estimates of their customers' priorities. Nor is there any indication that Fortran 2008 needs any general experience with Fortran 2003, since it is almost entirely a revision of Fortran 95 plus the TRs published between Fortran 95 and Fortran 2003; the TRs are now widely implemented.
虽然Fortran 2008工作列表中的大多数次要项目都完成了(只有INTENT(SCRATCH)项目被删除了),但是有两个主要项目被删除了。它们是泛型编程项(已经演变成智能宏项)和新的内在BITS类型。这大大减少了Fortran 2008的工作范围。后来,另外,coarrays项目的大部分被移到了TR中。这是Fortran 2008的第二次实质性的工作范围缩减。没有人说推迟Fortran 2008将如何使Fortran 2003更容易实现,或者改变编译器供应商对客户优先级的估计。也没有任何迹象表明Fortran 2008需要任何Fortran 2003的一般经验,因为它几乎完全是Fortran 95加上Fortran 95和Fortran 2003之间发布的tr的修订;TRs现已得到广泛实施。
{"title":"Joint J3/WG5 meetings November 2008, May 2009: a reply to David Muxworthy","authors":"D. Nagle","doi":"10.1145/1667140.1667143","DOIUrl":"https://doi.org/10.1145/1667140.1667143","url":null,"abstract":"While most of the minor items on the Fortran 2008 work list were completed (only the INTENT( SCRATCH) item was dropped), there were two major items that were dropped. These were the Generic Programming item (that had morphed into the Intelligent Macros item) and the new intrinsic BITS type. This was a substantial reduction of the scope of the work for Fortran 2008. Later, additionally, large parts of the coarrays item were removed to a TR. This was a second substantial reduction of the scope of the work for Fortran 2008. No one has said how delaying Fortran 2008 will make Fortran 2003 any easier to implement, or change the compiler vendors' estimates of their customers' priorities. Nor is there any indication that Fortran 2008 needs any general experience with Fortran 2003, since it is almost entirely a revision of Fortran 95 plus the TRs published between Fortran 95 and Fortran 2003; the TRs are now widely implemented.","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"86 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-12-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126774089","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
A generic linked list implementation in Fortran 95 一个泛型链表在Fortran 95中的实现
Pub Date : 2009-12-04 DOI: 10.1145/1667140.1667141
Jason R. Blevins
This paper develops a standard conforming generic linked list in Fortran 95 which is capable of storing data of any type. The list is implemented using the transfer intrinsic function, and although the interface is generic, it remains relatively simple and minimizes the potential for error. Although linked lists are the focus of this paper, the generic programming techniques used are very general and broadly-applicable to other data structures and procedures implemented in Fortran 95 that need to be used with data of an unknown type.
本文在Fortran 95语言中开发了一个标准的通用链表,该链表能够存储任何类型的数据。该列表是使用transfer内禀函数实现的,尽管接口是通用的,但它仍然相对简单,并将错误的可能性降至最低。虽然链表是本文的重点,但所使用的泛型编程技术是非常通用的,并且广泛适用于需要使用未知类型数据的Fortran 95中实现的其他数据结构和过程。
{"title":"A generic linked list implementation in Fortran 95","authors":"Jason R. Blevins","doi":"10.1145/1667140.1667141","DOIUrl":"https://doi.org/10.1145/1667140.1667141","url":null,"abstract":"This paper develops a standard conforming generic linked list in Fortran 95 which is capable of storing data of any type. The list is implemented using the transfer intrinsic function, and although the interface is generic, it remains relatively simple and minimizes the potential for error. Although linked lists are the focus of this paper, the generic programming techniques used are very general and broadly-applicable to other data structures and procedures implemented in Fortran 95 that need to be used with data of an unknown type.","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"26 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-12-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131755266","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 4
Fortran 2003 & 2008 poll Fortran 2003年和2008年的投票
Pub Date : 2009-07-17 DOI: 10.1145/1570522.1570526
T. Burnus
1 Parameterized derived types 1 27 22 2 9 18 6 2 13 2 Procedure pointers 1 31 18 8 14 8 3 2 15 3 Finalization 1 20 29 5 9 8 6 1 21 4 Procedures bound by name to a type 4 22 24 13 4 10 3 1 19 5 The PASS attribute 3 14 33 3 5 6 7 2 27 6 Procedures bound to a type as operators 4 21 25 7 7 11 6 2 17 7 Type extension 6 23 21 19 7 6 3 1 14 8 Overriding a type-bound procedure 2 15 33 3 9 7 6 2 23 9 Enumerations 7 11 32 4 6 12 6 5 17 10 ASSOCIATE construct 4 13 33 3 3 11 6 2 25 11 Polymorphic entities 4 24 22 17 7 5 4 1 16 12 SELECT TYPE construct 5 20 25 11 9 4 5 1 20 13 Deferred bindings and abstract types 4 17 29 12 4 5 7 1 21 Miscellaneous U P WN V I U R N DK
参数化派生类型1 27 22 2 9 18 6 2 13 2程序指针1 31 18 8 14 8 3 2 15 3终结1 20 29 5 9 8 6 1 21 4程序的名字绑定到类型4 22 24 13 4 10 3 1 19 5通过属性3 14 33 3 5 6 7 2 27 6程序绑定到类型作为运营商4 21 25 7 7 11 6 2 17日7类型扩展6 23日21日19日7 6 3 1 14 8覆盖类型范围过程2 15 33 3 9 7 6 2 23 9枚举7 11 32 4 6 12 6 5 17 10副构建4 13 33 3 3 11 6 4 2 25 11多态实体1 . SELECT TYPE construct 5 .延迟绑定和抽象类型4 .其他类型P P V I I R N DK
{"title":"Fortran 2003 & 2008 poll","authors":"T. Burnus","doi":"10.1145/1570522.1570526","DOIUrl":"https://doi.org/10.1145/1570522.1570526","url":null,"abstract":"1 Parameterized derived types 1 27 22 2 9 18 6 2 13 2 Procedure pointers 1 31 18 8 14 8 3 2 15 3 Finalization 1 20 29 5 9 8 6 1 21 4 Procedures bound by name to a type 4 22 24 13 4 10 3 1 19 5 The PASS attribute 3 14 33 3 5 6 7 2 27 6 Procedures bound to a type as operators 4 21 25 7 7 11 6 2 17 7 Type extension 6 23 21 19 7 6 3 1 14 8 Overriding a type-bound procedure 2 15 33 3 9 7 6 2 23 9 Enumerations 7 11 32 4 6 12 6 5 17 10 ASSOCIATE construct 4 13 33 3 3 11 6 2 25 11 Polymorphic entities 4 24 22 17 7 5 4 1 16 12 SELECT TYPE construct 5 20 25 11 9 4 5 1 20 13 Deferred bindings and abstract types 4 17 29 12 4 5 7 1 21 Miscellaneous U P WN V I U R N DK","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"127 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127405474","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
WG5 meetings: November 2008 and May 2009: a personal view WG5会议:2008年11月和2009年5月:个人观点
Pub Date : 2009-07-17 DOI: 10.1145/1570522.1570523
D. Muxworthy
The SC22 ballot on the Committee Draft of the revision of Fortran 2003 took place during the summer of 2008. This was the first opportunity for the member body organizations of ISO, as distinct from the individuals working in WG5, to express an opinion on the proposals so far. Fifteen countries voted and three member countries failed to vote. The counts were: Approval: 8 (only one of which had played an active part in WG5) Approval with comments: 3 (all active in WG5) Abstention: 3 (one active in WG5) Disapproval: 1 (UK)
SC22对Fortran 2003修订委员会草案的投票于2008年夏天进行。这是ISO成员机构组织的第一次机会,不同于在WG5中工作的个人,对迄今为止的提案发表意见。15个国家投票,3个成员国没有投票。计数为:赞成:8(其中只有一个在WG5中发挥了积极作用)赞成并评论:3(所有在WG5中活跃)弃权:3(一个在WG5中活跃)反对:1(英国)
{"title":"WG5 meetings: November 2008 and May 2009: a personal view","authors":"D. Muxworthy","doi":"10.1145/1570522.1570523","DOIUrl":"https://doi.org/10.1145/1570522.1570523","url":null,"abstract":"The SC22 ballot on the Committee Draft of the revision of Fortran 2003 took place during the summer of 2008. This was the first opportunity for the member body organizations of ISO, as distinct from the individuals working in WG5, to express an opinion on the proposals so far. Fifteen countries voted and three member countries failed to vote. The counts were: Approval: 8 (only one of which had played an active part in WG5) Approval with comments: 3 (all active in WG5) Abstention: 3 (one active in WG5) Disapproval: 1 (UK)","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"2 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125117467","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
Compiler support for the Fortran 2003 and 2008 standards 编译器支持Fortran 2003和2008标准
Pub Date : 2009-07-17 DOI: 10.1145/1570522.1570525
I. Chivers, J. Sleightholme
Introduction This is a repeating article in Fortran Forum. The first version appeared in Fortran Forum in April 2007. The basis for the entries in the list of features was a report by John Reid. An electronic version can be found at: ftp://ftp.nag.co.uk/sc22wg5/N1601-N1650/N1648.pdf If you are a compiler vendor and would like to be included in future versions of this table please email one of us with details and they will be added to the table and published in Fortran Forum.
这是Fortran论坛上的一篇重复文章。第一个版本出现在2007年4月的Fortran论坛上。特征列表条目的基础是约翰·里德的一份报告。如果您是编译器供应商,并希望包含在此表的未来版本中,请通过电子邮件将详细信息发送给我们中的一位,它们将被添加到表中并发布在Fortran论坛上。
{"title":"Compiler support for the Fortran 2003 and 2008 standards","authors":"I. Chivers, J. Sleightholme","doi":"10.1145/1570522.1570525","DOIUrl":"https://doi.org/10.1145/1570522.1570525","url":null,"abstract":"Introduction This is a repeating article in Fortran Forum. The first version appeared in Fortran Forum in April 2007. The basis for the entries in the list of features was a report by John Reid. An electronic version can be found at: ftp://ftp.nag.co.uk/sc22wg5/N1601-N1650/N1648.pdf If you are a compiler vendor and would like to be included in future versions of this table please email one of us with details and they will be added to the table and published in Fortran Forum.","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"63 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124887960","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 3
An introduction to Sun studio 介绍Sun studio
Pub Date : 2009-03-27 DOI: 10.1145/1520752.1520754
I. Chivers, J. Sleightholme
{"title":"An introduction to Sun studio","authors":"I. Chivers, J. Sleightholme","doi":"10.1145/1520752.1520754","DOIUrl":"https://doi.org/10.1145/1520752.1520754","url":null,"abstract":"","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"85 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-03-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132740698","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 2
Note on creating an array of procedure pointers 注意创建过程指针数组
Pub Date : 2009-03-27 DOI: 10.1145/1520752.1520753
N. Clerman
Introduction Fortran programmers know that it is not possible to directly form an array of pointers. To the uninitiated, the notation may be somewhat confusing. The following line of code is a declaration of an array of intrinsic type real. real , dimension (20) :: samples But the following line of code is a declaration of a pointer to an array of real values, not an array of pointers. real , dimension (:) , pointer :: ptr_samples And in the following code, a pointer assignment points ptr_samples at the samples array. ptr_samples => samples To create an array of pointers, you can define a data type whose sole component is a pointer, and you can then use an array of this new type as a pointer array. type Real_Ptr_Type real , dimension (:) , pointer :: real_ptr_comp end type Real_Ptr_Type
Fortran程序员知道直接形成指针数组是不可能的。对于没有经验的人来说,这个符号可能有些令人困惑。下面一行代码声明了一个内部类型为real的数组。但是下面这行代码是一个指针的声明,它指向一个实值数组,而不是一个指针数组。在下面的代码中,一个指针赋值指向samples数组中的ptr_samples。为了创建指针数组,你可以定义一个数据类型,它的唯一组成部分是指针,然后你可以使用这个新类型的数组作为指针数组。type Real_Ptr_Type real, dimension (:), pointer:: real_ptr_comp end type: Real_Ptr_Type
{"title":"Note on creating an array of procedure pointers","authors":"N. Clerman","doi":"10.1145/1520752.1520753","DOIUrl":"https://doi.org/10.1145/1520752.1520753","url":null,"abstract":"Introduction Fortran programmers know that it is not possible to directly form an array of pointers. To the uninitiated, the notation may be somewhat confusing. The following line of code is a declaration of an array of intrinsic type real. real , dimension (20) :: samples But the following line of code is a declaration of a pointer to an array of real values, not an array of pointers. real , dimension (:) , pointer :: ptr_samples And in the following code, a pointer assignment points ptr_samples at the samples array. ptr_samples => samples To create an array of pointers, you can define a data type whose sole component is a pointer, and you can then use an array of this new type as a pointer array. type Real_Ptr_Type real , dimension (:) , pointer :: real_ptr_comp end type Real_Ptr_Type","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"31 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-03-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115936819","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
期刊
ACM SIGPLAN Fortran Forum
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1